/* ============================================================
   КЛУБ ПОДАРКОВ · ЖУРНАЛ — страница подписки на первый выпуск
   Дизайн-прототип. Все значения — из design_tokens.md
   ============================================================ */

@import url('assets/fonts/fonts.css');

:root {
  /* Цвета — светлая лаймовая гамма Клуба Подарков */
  --bg:          #FDFEF8;
  --lime:        #A5E028;   /* яркий акцент: кнопки, бейдж */
  --lime-2:      #C9EE55;
  --lime-soft:   #E7F5C6;   /* подложки */
  --lime-deep:   #5E8F0E;   /* читаемый зелёный текст */
  --ink:         #171B0E;
  --ink-soft:    #59614A;
  --ink-faint:   #98A088;
  --red:         #C6402F;
  --red-tint:    #FCE9E6;
  --white:       #FFFFFF;
  --line:        rgba(23, 27, 14, .14);
  --line-strong: rgba(23, 27, 14, .38);

  /* Типографика: 3 шрифта */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-ui:      'Jost', 'Segoe UI', Arial, sans-serif;
  --font-hand:    'Caveat', 'Segoe Script', cursive;

  /* Радиусы, тени */
  --r-field: 8px;
  --r-card:  14px;
  --shadow-card:  0 24px 60px -24px rgba(23, 27, 14, .22);
  --shadow-cover: 0 40px 80px -32px rgba(23, 27, 14, .5);
  --shadow-pop:   5px 5px 0 var(--ink);
  --ring-focus:   3px 3px 0 var(--lime);

  /* Ритм */
  --pad-x: clamp(20px, 4.5vw, 64px);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: linear-gradient(155deg, #EFF8DC 0%, var(--bg) 34%, #FBF6DC 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--lime-2); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ---------- Шапка ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px var(--pad-x);
  border-bottom: 2px solid var(--ink);
  background: rgba(253, 254, 248, .85);
}
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.brand__icon { height: 44px; width: auto; }
.brand__lockup { display: flex; flex-direction: column; line-height: 1; }
.brand__over {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 12px; letter-spacing: .42em; text-transform: uppercase;
  color: var(--lime-deep);
  margin-bottom: 6px;
}
.brand__name {
  font-family: var(--font-display); font-weight: 900;
  font-size: 26px; letter-spacing: .01em;
  color: var(--ink); white-space: nowrap;
}
.brand--foot .brand__icon { height: 36px; }
.brand--foot .brand__name { font-size: 21px; }
.brand--foot .brand__over { font-size: 10px; }
.header-meta {
  display: flex; align-items: center; gap: 22px;
  font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink);
}

/* угловатые кнопки-«плашки» — фирменный приём страницы */
.btn-anchor {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  background: var(--lime);
  border: 2px solid var(--ink); border-radius: 6px;
  box-shadow: var(--shadow-pop);
  font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s, background .2s;
  white-space: nowrap;
}
.btn-anchor:hover { background: var(--lime-2); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn-anchor:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-anchor .arr { transition: transform .25s; }
.btn-anchor:hover .arr { transform: translateY(3px); }
.btn-anchor .t-short { display: none; }

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: center;
  padding: clamp(14px, 2.4vh, 28px) var(--pad-x) clamp(18px, 3vh, 32px);
  min-height: calc(100vh - 78px);
  overflow: hidden;
  /* на широких экранах контент центрируется, форма не прилипает влево */
  max-width: 1560px;
  margin-inline: auto;
}
/* вертикальная подпись — редакционный приём */
.hero__side-note {
  position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 15px; letter-spacing: .12em;
  color: var(--ink-faint);
  pointer-events: none;
}

.hero__copy { max-width: 620px; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 4.8vw, 64px);
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: 0 0 20px;
}
.hero__title em {
  font-style: italic; font-weight: 600;
  color: var(--lime-deep);
}
.hero__lead {
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 400;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 6px;
}
.hero__lead strong { color: var(--ink); font-weight: 600; }

/* ---------- Форма ---------- */
.order-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: clamp(14px, 1.4vw, 22px);
  margin-top: 14px;
  position: relative;
}
.order-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 5px;
  border-radius: var(--r-card) var(--r-card) 0 0;
  background: linear-gradient(90deg, var(--lime-deep), var(--lime), var(--lime-2));
}
.order-card__title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 23px;
  margin: 0 0 3px;
}
.order-card__hint { font-size: 13px; color: var(--ink-faint); margin: 0 0 14px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field { position: relative; }
.field--full { grid-column: 1 / -1; }

.field input {
  width: 100%;
  font: inherit; font-weight: 500;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-field);
  padding: 22px 16px 7px;
  height: 50px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:hover { border-color: var(--line-strong); }
.field input:focus {
  border-color: var(--ink);
  box-shadow: var(--ring-focus);
}
.field label {
  position: absolute; left: 17px; top: 50%;
  transform: translateY(-50%);
  font-size: 15px; color: var(--ink-faint); font-weight: 400;
  pointer-events: none;
  transition: all .18s ease;
}
.field label .req { color: var(--red); }
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 9px; transform: none;
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft);
}

/* ошибки */
.field .field__error {
  display: none;
  font-size: 12.5px; font-weight: 500; color: var(--red);
  margin: 6px 2px 0;
}
.field.is-error input {
  border-color: var(--red);
  background: var(--red-tint);
}
.field.is-error input:focus { box-shadow: 3px 3px 0 var(--red); }
.field.is-error .field__error { display: block; }
.field.is-error label { color: var(--red); }

/* чекбоксы */
.checks { grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 2px; }
.check {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 13.5px; line-height: 1.45; color: var(--ink-soft);
  cursor: pointer; user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  flex: 0 0 auto;
  width: 22px; height: 22px; margin-top: 1px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--white);
  display: grid; place-items: center;
  transition: background .18s, box-shadow .18s;
}
.check .box svg { width: 13px; height: 13px; opacity: 0; transform: scale(.5); transition: all .18s; }
.check input:checked + .box { background: var(--lime); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: var(--ring-focus); }
.check a { color: var(--lime-deep); font-weight: 600; }
.check.is-error .box { border-color: var(--red); background: var(--red-tint); }
.check .check__error { display: none; color: var(--red); font-weight: 500; }
.check.is-error .check__error { display: inline; }

/* кнопка отправки — инверсия: чёрная плашка, лаймовая тень */
.btn-submit {
  grid-column: 1 / -1;
  height: 58px;
  background: var(--ink);
  color: var(--lime);
  border: 2px solid var(--ink); border-radius: 6px;
  box-shadow: 5px 5px 0 var(--lime);
  font-family: var(--font-ui);
  font-size: 15px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  transition: transform .15s, box-shadow .15s, background .2s;
}
.btn-submit:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--lime); }
.btn-submit:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--lime); }
.btn-submit .arr { font-size: 18px; transition: transform .25s; }
.btn-submit:hover .arr { transform: translateX(5px); }
.form-note {
  grid-column: 1 / -1;
  font-family: var(--font-hand);
  font-size: 19px; font-weight: 500; color: var(--ink-soft);
  text-align: center; margin: 2px 0 0;
  transform: rotate(-.6deg);
}

/* ---------- Обложка (визуал первого экрана) ---------- */
.hero__visual { position: relative; justify-self: center; }
.hero__visual::before {
  content: '';
  position: absolute; inset: -8% -14% -6% 6%;
  background:
    radial-gradient(closest-side, rgba(165, 224, 40, .32), transparent 72%);
  z-index: 0;
}
.cover-stack { position: relative; width: min(23vw, 300px); }
.cover-stack .cover-back {
  position: absolute; inset: 0;
  transform: rotate(6deg) translate(4%, 2%);
  border-radius: 4px;
  filter: brightness(.94);
  box-shadow: 0 24px 48px -24px rgba(23, 27, 14, .4);
}
.cover-stack .cover-front {
  position: relative; z-index: 1;
  transform: rotate(-2.5deg);
  border-radius: 4px;
  box-shadow: var(--shadow-cover);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.hero__visual:hover .cover-front { transform: rotate(-1deg) translateY(-6px); }
.cover-badge {
  position: absolute; z-index: 2;
  top: -28px; right: -28px;
  width: 102px; height: 102px;
  border-radius: 50%;
  background: var(--lime);
  border: 2.5px solid var(--ink);
  color: var(--ink);
  display: grid; place-items: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900; font-size: 24px; line-height: 1.05;
  transform: rotate(8deg);
  box-shadow: 4px 4px 0 var(--ink);
}
.cover-badge small {
  display: block;
  font-family: var(--font-ui); font-weight: 700;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  margin-bottom: 2px;
}

/* ---------- Бегущая строка ---------- */
.ticker {
  background: var(--ink);
  color: var(--lime);
  overflow: hidden;
  padding: 13px 0;
}
.ticker__track {
  display: flex; gap: 48px;
  width: max-content;
  animation: ticker 30s linear infinite;
  font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  white-space: nowrap;
}
.ticker__track span { display: inline-flex; align-items: center; gap: 48px; }
.ticker__track i { font-style: normal; color: #E9F7C8; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Список компаний ---------- */
.companies {
  padding: clamp(48px, 8vh, 96px) var(--pad-x);
  background: linear-gradient(135deg, #E9F6C9 0%, #F7FCE7 45%, #FBF3CF 100%);
  border-top: 2px solid var(--ink);
}
.companies__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 32px;
  margin-bottom: 28px;
}
.companies__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 3.6vw, 56px);
  line-height: 1.05;
  margin: 0;
}
.companies__count {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
  color: var(--ink);
}
.companies__count small {
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint);
}
.companies__tools { margin-left: auto; }
.companies__search { position: relative; }
.companies__search input {
  width: min(320px, 72vw);
  height: 52px;
  font: inherit; font-weight: 500;
  padding: 0 18px 0 44px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 6px;
  outline: none;
  transition: box-shadow .2s;
}
.companies__search input:focus { box-shadow: var(--ring-focus); }
.companies__search input::placeholder { color: var(--ink-faint); }
.companies__search svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--ink);
}

.companies__list {
  list-style: none; margin: 0; padding: 0;
  columns: 3; column-gap: 24px;
  counter-reset: company;
}
.companies__list li {
  counter-increment: company;
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .72);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  break-inside: avoid;
  font-weight: 600; font-size: 16px;
  transition: border-color .2s, background .2s;
}
.companies__list li:hover { border-color: var(--ink); background: var(--white); }
.companies__list li::before {
  content: counter(company, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px;
  color: var(--lime-deep);
  min-width: 26px;
}
.companies__list li .city {
  font-weight: 400; font-size: 13.5px;
  color: var(--ink-faint);
  margin-left: auto;
  padding-left: 10px;
  white-space: nowrap;
}
.companies__list li.is-new { animation: flashNew 2.2s ease-out; }
@keyframes flashNew {
  0% { background: var(--lime-2); border-color: var(--ink); }
  100% { background: rgba(255, 255, 255, .72); border-color: var(--line); }
}
.companies__nothing {
  display: none;
  padding: 24px; text-align: center;
  color: var(--ink-faint); font-weight: 500;
}

/* пустое состояние */
.companies__empty {
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-card);
  padding: clamp(32px, 5vw, 56px);
  text-align: center;
  background: rgba(255, 255, 255, .55);
}
.companies__empty p {
  font-family: var(--font-display);
  font-style: italic; font-weight: 600;
  font-size: clamp(20px, 2.2vw, 28px);
  margin: 0 0 8px;
}
.companies__empty small {
  display: block;
  font-family: var(--font-hand);
  font-size: 20px; color: var(--ink-soft);
  margin-bottom: 22px;
}
.btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px;
  background: var(--lime);
  border: 2px solid var(--ink); border-radius: 6px;
  box-shadow: var(--shadow-pop);
  color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase;
  transition: transform .15s, box-shadow .15s, background .2s;
}
.btn-ghost:hover { background: var(--lime-2); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn-ghost:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

/* ---------- Подтверждение (success) ---------- */
.form-success { text-align: center; padding: clamp(12px, 2vw, 24px) 4px; }
.form-success__icon {
  width: 74px; height: 74px; margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--lime);
  border: 2.5px solid var(--ink);
  display: grid; place-items: center;
  box-shadow: 4px 4px 0 var(--ink);
  animation: pop .5s cubic-bezier(.2, .9, .3, 1.4);
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.form-success__icon svg { width: 34px; height: 34px; }
.form-success h2 {
  font-family: var(--font-display);
  font-weight: 900; font-size: clamp(28px, 2.6vw, 38px);
  margin: 0 0 12px;
}
.form-success p { color: var(--ink-soft); margin: 0 auto 8px; max-width: 44ch; }
.form-success .sum {
  margin: 18px auto 22px;
  text-align: left;
  max-width: 430px;
  background: var(--lime-soft);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 14px;
}
.form-success .sum b { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 10px; }
.form-success .sum b:first-child { margin-top: 0; }

/* ---------- Подвал ---------- */
.site-footer {
  background: var(--white);
  border-top: 2px solid var(--ink);
  color: var(--ink-soft);
  padding: clamp(36px, 6vh, 64px) var(--pad-x) 30px;
}
.site-footer .foot-grid {
  display: flex; flex-wrap: wrap; gap: 24px 48px;
  align-items: center; justify-content: space-between;
}

.foot-contacts { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 15px; }
.foot-contacts a { color: var(--ink); text-decoration: none; font-weight: 600; }
.foot-contacts a:hover { color: var(--lime-deep); }
.foot-note {
  margin-top: 30px; padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 32px;
  font-size: 12.5px; color: var(--ink-faint);
}

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 28px; }
  .hero__visual { order: -1; margin-bottom: 6px; }
  .cover-stack { width: min(52vw, 300px); }
  .hero__side-note { display: none; }
  .companies__list { columns: 2; }
}

@media (max-width: 720px) {
  .site-header { padding: 12px 16px; gap: 10px; }
  .brand { gap: 9px; }
  .brand__icon { height: 34px; }
  .brand__name { font-size: 19px; }
  .brand__over { font-size: 9px; letter-spacing: .34em; margin-bottom: 4px; }
  .header-meta { gap: 12px; }
  .header-meta .meta-text { display: none; }
  .btn-anchor { padding: 11px 16px; font-size: 12px; letter-spacing: .06em; box-shadow: 4px 4px 0 var(--ink); }
  .btn-anchor .t-full { display: none; }
  .btn-anchor .t-short { display: inline; }

  .hero { padding: 18px 16px 30px; gap: 18px; }
  .hero__copy { max-width: none; }
  .hero__lead { margin-bottom: 4px; }

  /* компактная обложка над заголовком: журнал виден сразу, форма — на первом экране */
  .hero__visual { display: flex; align-items: flex-end; gap: 16px; justify-self: start; }
  .cover-stack { width: 118px; }
  .cover-badge {
    width: 66px; height: 66px; top: -16px; right: -14px;
    font-size: 15px; border-width: 2px; box-shadow: 3px 3px 0 var(--ink);
  }
  .cover-badge small { font-size: 7.5px; }

  .order-card { padding: 20px 16px; margin-top: 18px; }
  .order-card__title { font-size: 21px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .field input { height: 54px; }
  .btn-submit { height: 58px; }
  .form-note { font-size: 17px; }

  .companies { padding: 44px 16px 60px; }
  .companies__head { flex-direction: column; align-items: stretch; gap: 14px; }
  .companies__tools { margin-left: 0; }
  .companies__search input { width: 100%; }
  .companies__list { columns: 1; }
  .companies__list li .city { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  html { scroll-behavior: auto; }
}
