/* ===========================================================================
   Полустанок — независимый книжный магазин.
   Дизайн-система: бумага + чернильно-чёрный + ультрамарин. Литературный сериф.
   Только локальные ресурсы, без внешних запросов.
   =========================================================================== */

:root {
  /* цвет */
  --paper:     #f4efe6;   /* тёплая бумага */
  --paper-2:   #ebe4d6;   /* бумага на тон темнее — чередующиеся секции */
  --card:      #fbf8f1;   /* почти белая карточка */
  --ink:       #181513;   /* чернильно-чёрный — основной текст и тёмные блоки */
  --ink-2:     #211d19;
  --ink-soft:  #4a443c;   /* мягкий чёрный — абзацы */
  --muted:     #877d6e;   /* приглушённый — подписи */
  --line:      #d8cdba;   /* линейки */
  --ultra:     #1f3fd8;   /* ультрамарин — единственный яркий акцент */
  --ultra-2:   #15309f;   /* тёмный ультрамарин — hover */
  --ultra-ink: #6e84ec;   /* ультрамарин на тёмном фоне */

  /* типографика */
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Georgia", "Times New Roman", serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* шкала отступов */
  --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 36px;
  --s-5: 52px; --s-6: 72px; --s-7: 104px; --s-8: 140px;

  --maxw: 1200px;
  --col:  720px;          /* узкая читательская колонка */
  --radius: 2px;
  --radius-lg: 6px;
  --shadow:    0 1px 2px rgba(24,21,19,.06), 0 10px 30px rgba(24,21,19,.08);
  --shadow-lg: 0 22px 60px rgba(24,21,19,.18);
  --ease: cubic-bezier(.2,.7,.3,1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; }
p { margin: 0 0 var(--s-2); }
em { font-style: italic; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s-4); }
.visually-hidden, .skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 12px; left: 12px; width: auto; height: auto; clip: auto;
  background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 999;
}
:focus-visible { outline: 2px solid var(--ultra); outline-offset: 3px; }

/* ---------- общие секции ---------- */
.section { padding-block: var(--s-7); }
.shelves { background: var(--paper); }
.picks   { background: var(--paper-2); }
.events  { background: var(--paper); }
.voices  { background: var(--paper-2); }
.visit   { background: var(--paper); }

.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ultra);
  margin: 0 0 var(--s-2);
}
.kicker--light { color: var(--ultra-ink); }

.head { max-width: var(--col); margin: 0 0 var(--s-6); }
.head--wide { max-width: 820px; }
.head--left { max-width: 420px; margin-bottom: 0; }
.head h2 { font-size: clamp(30px, 4.4vw, 50px); margin-bottom: var(--s-2); letter-spacing: -.01em; }
.head__lead { color: var(--ink-soft); font-size: 18px; margin: 0; max-width: 56ch; }

/* ---------- ссылка-кнопка ---------- */
.link-cta {
  display: inline-flex; align-items: center;
  font-weight: 600; font-size: 15px; letter-spacing: .01em;
  color: var(--ink); padding-bottom: 2px;
  border-bottom: 2px solid var(--ink);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.link-cta:hover { color: var(--ultra); border-color: var(--ultra); }
.link-cta--solid {
  background: var(--ultra); color: #fff; border: 1px solid var(--ultra);
  padding: 13px 26px; border-radius: var(--radius);
  transition: background .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}
.link-cta--solid:hover { background: var(--ultra-2); border-color: var(--ultra-2); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.link-cta--solid:active { transform: translateY(0); }
.link-cta--quiet { border-color: transparent; color: var(--ink-soft); }
.link-cta--quiet:hover { color: var(--ultra); border-color: transparent; }

/* ---------- masthead (хедер) ---------- */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244,239,230,.86);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.masthead.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 2px 18px rgba(24,21,19,.06);
  background: rgba(244,239,230,.95);
}
.masthead__inner { display: flex; align-items: center; gap: var(--s-3); height: 72px; }

.logo { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.logo__glyph {
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  color: #fff; background: var(--ink);
  border-radius: 3px; line-height: 1;
}
.logo__word { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: .01em; }

.nav { display: flex; gap: var(--s-4); margin-left: auto; }
.nav a { font-size: 15px; font-weight: 500; color: var(--ink-soft); position: relative; padding: 4px 0; transition: color .2s var(--ease); }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: var(--ultra);
  transition: width .25s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }
.nav-cta { flex: none; }

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; margin-left: auto; }
.burger span { width: 24px; height: 2px; background: var(--ink); transition: transform .3s var(--ease), opacity .2s var(--ease); }

/* ---------- HERO / манифест (типографика-вперёд) ---------- */
.hero { position: relative; padding-block: clamp(var(--s-6), 9vw, var(--s-8)) var(--s-7); overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--s-6); align-items: end;
}
.hero__col { max-width: 16ch; } /* очень узкая колонка под крупный заголовок */
.hero__title {
  font-size: clamp(48px, 11vw, 120px);
  line-height: .96;
  letter-spacing: -.025em;
  margin-bottom: var(--s-4);
}
.hero__title em { color: var(--ultra); font-style: italic; }
.hero__manifesto {
  font-family: var(--sans); font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-soft); max-width: 42ch; margin-bottom: var(--s-4); line-height: 1.66;
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }

.hero__aside { align-self: end; border-top: 2px solid var(--ink); padding-top: var(--s-2); }
.hero__aside-line {
  font-size: 14.5px; color: var(--ink-soft); margin: 0; padding: var(--s-2) 0;
  border-bottom: 1px solid var(--line); line-height: 1.4;
}
.hero__aside-line:last-child { border-bottom: 0; }
.hero__num { display: block; font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1; margin-bottom: 4px; }

.hero__rule { height: 1px; background: var(--line); margin-top: var(--s-6); max-width: var(--maxw); margin-inline: auto; }

/* ---------- разделы магазина (нумерованный список-полок) ---------- */
.shelf-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.shelf {
  display: grid; grid-template-columns: 64px 1fr 200px; gap: var(--s-4); align-items: baseline;
  padding: var(--s-4) 0; border-bottom: 1px solid var(--line);
  transition: background .25s var(--ease);
}
.shelf:hover { background: var(--card); }
.shelf__no { font-family: var(--serif); font-size: 22px; color: var(--ultra); font-weight: 600; }
.shelf__body h3 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 6px; }
.shelf__body p { color: var(--ink-soft); font-size: 16px; margin: 0; max-width: 60ch; }
.shelf__count {
  font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); text-align: right; align-self: center;
}

/* ---------- выбор продавцов (карточки книг) ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-4); }
.pick {
  display: grid; grid-template-columns: 132px 1fr; gap: var(--s-4); align-items: start;
}
.pick__media {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 3/4; background: var(--card);
}
.pick__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.pick:hover .pick__media img { transform: scale(1.05); }
.pick__meta { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--ultra); margin: 0 0 6px; font-weight: 700; }
.pick__body h3 { font-size: 23px; margin-bottom: 10px; line-height: 1.15; }
.pick__note { color: var(--ink-soft); font-size: 15.5px; margin: 0 0 12px; }
.pick__price { font-family: var(--serif); font-size: 15px; color: var(--ink); margin: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.picks__note { color: var(--ink-soft); max-width: 56ch; margin: var(--s-6) 0 0; font-size: 16px; }

/* ---------- цитатная полоса ---------- */
.band { position: relative; padding-block: var(--s-8); overflow: hidden; }
.band__media { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: -2; }
.band__veil { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(24,21,19,.9) 0%, rgba(24,21,19,.66) 100%); z-index: -1; }
.band__quote { margin: 0; max-width: 880px; color: var(--paper); }
.band__quote p { font-family: var(--serif); font-size: clamp(24px, 4vw, 44px); line-height: 1.24; font-style: italic; margin: 0 0 var(--s-3); }
.band__quote cite { font-style: normal; font-size: 15px; letter-spacing: .08em; color: var(--ultra-ink); }

/* ---------- события / timeline ---------- */
.events__grid { display: grid; grid-template-columns: 360px 1fr; gap: var(--s-6); align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl { display: grid; grid-template-columns: 56px 1fr; gap: var(--s-4); padding-bottom: var(--s-5); position: relative; }
.tl:last-child { padding-bottom: 0; }
.tl__date {
  position: relative; z-index: 1; width: 56px; height: 56px; flex: none;
  display: grid; place-items: center; background: var(--ink); color: #fff;
  border-radius: 50%; line-height: 1;
}
.tl__date b { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.tl__date span { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ultra-ink); }
.tl__body h3 { font-size: 21px; margin-bottom: 6px; }
.tl__body p { color: var(--ink-soft); font-size: 15.5px; margin: 0; max-width: 56ch; }

/* ---------- подписка (тёмная секция) ---------- */
.newsletter { background: var(--ink); color: var(--paper); }
.newsletter__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s-6); align-items: center; }
.newsletter__text h2 { font-size: clamp(28px, 3.6vw, 42px); color: var(--paper); margin-bottom: var(--s-2); }
.newsletter__text > p { color: #c7bdac; }
.newsletter__perks { list-style: none; padding: 0; margin: var(--s-3) 0 0; }
.newsletter__perks li { position: relative; padding-left: 26px; color: #cfc6b5; font-size: 15px; margin-bottom: 10px; }
.newsletter__perks li::before { content: "→"; position: absolute; left: 0; color: var(--ultra-ink); font-weight: 700; }

.subscribe { background: var(--ink-2); border: 1px solid #34302a; border-radius: var(--radius-lg); padding: var(--s-4); }
.subscribe__field { display: flex; gap: 10px; }
.subscribe input {
  flex: 1; min-width: 0; padding: 15px 18px; border-radius: var(--radius);
  border: 1px solid #443f38; background: #0f0d0b; color: #f3ece0; font-size: 16px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.subscribe input::placeholder { color: #837a6c; }
.subscribe input:focus { outline: none; border-color: var(--ultra-ink); box-shadow: 0 0 0 3px rgba(110,132,236,.25); }
.subscribe input.invalid { border-color: #e0664c; box-shadow: 0 0 0 3px rgba(224,102,76,.25); }
.subscribe .link-cta--solid { flex: none; }
.subscribe__hint { font-size: 13px; color: #968c7c; margin: 14px 0 0; }
.subscribe__error { font-size: 14px; color: #f0a08c; margin: 12px 0 0; }
.subscribe__ok { font-size: 15px; color: #93d6a2; margin: 12px 0 0; }

/* ---------- голоса читателей ---------- */
.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.voice { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s-4); }
.voice blockquote {
  margin: 0 0 var(--s-3); font-family: var(--serif); font-size: 19px; line-height: 1.4; color: var(--ink);
  position: relative; padding-top: 28px;
}
.voice blockquote::before {
  content: "\201C"; position: absolute; top: -6px; left: -4px;
  font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--ultra); opacity: .35;
}
.voice figcaption { font-size: 14px; color: var(--muted); letter-spacing: .02em; }

/* ---------- как нас найти ---------- */
.visit__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s-6); align-items: center; }
.visit__media { margin: 0; }
.visit__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); aspect-ratio: 3/2; object-fit: cover; }
.visit__media figcaption { font-size: 13px; color: var(--muted); margin-top: 12px; font-style: italic; }
.visit__text h2 { font-size: clamp(28px, 3.6vw, 44px); margin-bottom: var(--s-3); }
.visit__text > p { color: var(--ink-soft); max-width: 52ch; }
.visit__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin: var(--s-4) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--line); }
.visit__facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--ultra); font-weight: 700; margin-bottom: 8px; }
.visit__facts dd { margin: 0; font-size: 15px; color: var(--ink-soft); line-height: 1.5; }
.visit__facts a:hover { color: var(--ultra); }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: #c7bdac; padding-top: var(--s-7); }
.footer__grid { display: grid; grid-template-columns: 1.7fr 1fr 1.2fr 1fr; gap: var(--s-5); padding-bottom: var(--s-6); }
.logo--light .logo__word { color: var(--paper); }
.logo--light .logo__glyph { background: var(--paper); color: var(--ink); }
.footer__brand p { margin-top: var(--s-2); font-size: 15px; max-width: 32ch; color: #a89e8d; }
.footer__col h4 { font-family: var(--sans); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: #897f6f; margin: 0 0 var(--s-2); }
.footer__col a, .footer__col p { display: block; font-size: 15px; color: #c7bdac; margin: 0 0 9px; transition: color .2s var(--ease); }
.footer__col a:hover { color: var(--ultra-ink); }
.footer__social a { display: inline; }
.footer__bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s-2);
  border-top: 1px solid #34302a; padding-block: var(--s-3) var(--s-4); font-size: 14px; color: #897f6f;
}
.footer__bottom a:hover { color: var(--ultra-ink); }

/* ---------- reveal-анимация ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- адаптив ---------- */
@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--s-5); align-items: start; }
  .hero__col { max-width: none; }
  .hero__aside { max-width: 420px; }
  .events__grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .pick-grid { gap: var(--s-5) var(--s-4); }
  .newsletter__inner, .visit__grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .voice-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--s-4); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .section { padding-block: var(--s-6); }
  .wrap { padding-inline: var(--s-3); }
  .nav-cta { display: none; }
  .burger { display: flex; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: var(--s-2) var(--s-3) var(--s-3); transform: translateY(-130%);
    transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); margin: 0;
  }
  .masthead.menu-open .nav { transform: translateY(0); }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
  .masthead.menu-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .masthead.menu-open .burger span:nth-child(2) { opacity: 0; }
  .masthead.menu-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero__title { font-size: clamp(44px, 16vw, 76px); }
  .shelf { grid-template-columns: 40px 1fr; gap: var(--s-2) var(--s-3); }
  .shelf__count { grid-column: 2; text-align: left; margin-top: 6px; }
  .pick-grid { grid-template-columns: 1fr; }
  .pick { grid-template-columns: 110px 1fr; }
  .visit__facts { grid-template-columns: 1fr; gap: var(--s-3); }
  .subscribe__field { flex-direction: column; }
  .subscribe .link-cta--solid { width: 100%; justify-content: center; }
  .footer__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
