/* =========================================================
   «30 к 30» — стили
   Мудборд над рабочим столом: поляроиды на скотче, бирка,
   стикер, листок в клетку, штампы. Mobile-first.
   ========================================================= */

/* ---------- 1. Токены ---------- */
:root {
  --bg: #EFF2E8;          /* фисташково-молочный фон */
  --paper: #FFFFFF;       /* карточки */
  --paper-dim: #F5F6F1;   /* «проседающая» занятая карточка */
  --ink: #1C1E18;         /* текст */
  --muted: #5E6356;       /* второстепенный текст: 5,46:1 на фоне */
  --berry: #C22E5F;       /* акцент: белый текст на нём 5,45:1 */
  --berry-press: #A3244F;
  --lemon: #E6F06A;       /* маркер и стикер — только под тёмный текст */
  --tape: rgba(230, 240, 106, 0.72);
  --graphite: #3A3D36;    /* штамп «занято» */
  --olive: #6B7A3C;       /* штамп «подарено» */
  --line: #CDD3C2;        /* декоративные рамки */
  --field-line: #8A8F80;  /* рамки полей: 3,3:1 на белом */
  --grid-line: #D6DEE8;   /* клетка тетради */
  --track: #E1E6D6;       /* пустая часть полосы прогресса */

  --font-sans: "Jost", "Futura", "Century Gothic", "Segoe UI", system-ui, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --font-mono: "Fira Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r-btn: 12px;
  --r-card: 4px;
  --r-pol: 2px;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-pol: 0 1px 1px rgba(28, 30, 24, 0.08), 0 14px 28px -12px rgba(28, 30, 24, 0.35);
}

/* ---------- 2. База ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background-color: var(--bg);
  /* лёгкое бумажное зерно: встроенная SVG, отдельной картинки нет */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.12 0 0 0 0 0.08 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.125rem;      /* 18 px: крупнее обычного ради гостей 50+ */
  line-height: 1.55;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--berry); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.1; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px; top: -80px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-btn);
  text-decoration: none;
}
.skip:focus { top: 12px; color: var(--paper); }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0; }

/* Рукописный шрифт — только пометки, стикеры и записка */
.hand {
  font-family: var(--font-hand);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}

/* Появление пометок «на глазах»: текст открывается слева направо */
.motion .hand.js-write {
  clip-path: inset(-20% 100% -20% 0);
  transition: clip-path 0.9s steps(18, end);
}
.motion .hand.js-write.is-in { clip-path: inset(-20% -4% -20% 0); }

/* На первом экране подписи пишутся сразу при загрузке, без наблюдателя
   прокрутки: так они видны и в превью ссылки, и на скриншоте */
.motion .polaroid__note { animation: hand-write 0.9s steps(18, end) 0.7s backwards; }
.motion .polaroid:nth-child(2) .polaroid__note { animation-delay: 0.9s; }
.motion .polaroid:nth-child(3) .polaroid__note { animation-delay: 1.1s; }
.motion .polaroid:nth-child(4) .polaroid__note { animation-delay: 1.3s; }
.motion .polaroid:nth-child(5) .polaroid__note { animation-delay: 1.5s; }
@keyframes hand-write {
  from { clip-path: inset(-20% 100% -20% 0); }
  to { clip-path: inset(-20% -4% -20% 0); }
}

/* ---------- 3. Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0.7em 1.25em;
  border: 2px solid transparent;
  border-radius: var(--r-btn);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.btn:active:not([disabled]) { transform: translateY(1px); }

.btn--primary { background: var(--berry); border-color: var(--berry); color: #fff; }
.btn--primary:hover { background: var(--berry-press); border-color: var(--berry-press); color: #fff; }

.btn--ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }

.btn--quiet { background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.btn--quiet:hover { border-color: var(--ink); color: var(--ink); }

.btn[disabled] {
  cursor: not-allowed;
  background: #E6E9DF;
  border-color: #E6E9DF;
  color: var(--muted);
}

.btn--lg { min-height: 56px; padding-inline: 1.6em; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn--sm { padding-inline: 1em; font-size: 0.95rem; }

.btn--icon {
  width: 48px;
  padding: 0;
  font-size: 1.4rem;
  letter-spacing: 0;
}

/* ---------- 4. Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(239, 242, 232, 0.94);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background: rgba(239, 242, 232, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.logo__k {
  font-family: var(--font-hand);
  font-size: 1.6em;
  font-weight: 700;
  color: var(--berry);
  line-height: 0.6;
  transform: translateY(0.06em) rotate(-6deg);
  display: inline-block;
}

.nav {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: none;
}
.nav.is-open { display: block; }
.nav__list { list-style: none; padding: 8px var(--gutter) 20px; }
.nav__list a {
  display: flex;
  align-items: center;
  min-height: 52px;
  font-size: 1.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.countdown {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3em 0.75em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: nowrap;
}
.countdown__pre { display: none; }
.countdown__num {
  display: inline-flex;
  font-weight: 500;
  color: var(--berry);
}

/* цифры-барабаны */
.roll {
  display: inline-block;
  height: 1.2em;
  line-height: 1.2em;
  overflow: hidden;
  vertical-align: bottom;
}
.roll__track {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--d, 0) * -1.2em));
}
.motion .roll__track { transition: transform 0.9s var(--ease); }
.roll__track span { height: 1.2em; }

.btn--header { display: none; }

.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px; height: 48px;
  padding: 0 12px;
  background: none;
  border: 0;
  border-radius: var(--r-btn);
}
.burger span { display: block; height: 2px; background: var(--ink); transition: transform 0.2s, opacity 0.2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 480px) {
  .countdown__pre { display: inline; }
}

@media (min-width: 900px) {
  .nav {
    position: static;
    display: block;
    background: none;
    border: 0;
    margin-left: 12px;
  }
  .nav__list { display: flex; gap: 4px; padding: 0; }
  .nav__list a {
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
  }
  .nav__list a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--berry); }
  .burger { display: none; }
  .btn--header { display: inline-flex; }
}

/* ---------- 5. Общие секции ---------- */
.section { padding-block: clamp(56px, 8vw, 104px); }

.section__head { margin-bottom: clamp(28px, 4vw, 44px); max-width: 780px; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker__num {
  padding: 0.15em 0.45em;
  background: var(--ink);
  color: var(--bg);
  letter-spacing: 0.06em;
}

.section__title {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.section__lead {
  margin-top: 16px;
  color: var(--muted);
  max-width: 62ch;
}

.stars { color: var(--berry); letter-spacing: 0.05em; }

/* ---------- 6. Первый экран ---------- */
.hero { padding-block: 28px 56px; overflow: hidden; }

/* minmax(0, …): иначе лента поляроидов распирает колонку до ширины всех фото */
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.hero__text,
.hero__visual { min-width: 0; }

.hero__title {
  font-size: clamp(2.5rem, 9vw, 5.4rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.mark {
  background-image: linear-gradient(transparent 60%, var(--lemon) 60%, var(--lemon) 94%, transparent 94%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-inline: 0.04em;
}

.hero__lead {
  margin-top: 22px;
  max-width: 34em;
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  color: var(--muted);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero__cta .btn { flex: 1 1 220px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 0 clamp(18px, 4vw, 44px);
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}
.stats__item { display: flex; flex-direction: column-reverse; gap: 2px; }
.stats dt {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.25;
  max-width: 13ch;
}
.stats dd {
  font-family: var(--font-mono);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 500;
  line-height: 1.1;
}
.stats__item:nth-child(3) dd { color: var(--berry); }

/* Веер поляроидов. На телефоне — горизонтальная лента */
.hero__visual { position: relative; }
.hero__bignum { display: none; }

.fan {
  list-style: none;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-inline: calc(var(--gutter) * -1);
  padding: 30px var(--gutter) 26px;
  scrollbar-width: none;
}
.fan::-webkit-scrollbar { display: none; }

.polaroid {
  position: relative;
  flex: 0 0 min(62%, 250px);
  scroll-snap-align: center;
  padding: 10px 10px 0;
  background: var(--paper);
  border-radius: var(--r-pol);
  box-shadow: var(--shadow-pol);
  transform: rotate(var(--r-m, -2deg));
}
.polaroid:nth-child(even) { --r-m: 2.2deg; }
.polaroid:nth-child(3n) { --r-m: -1deg; }

.polaroid img {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  background: var(--bg);
}

.polaroid__note {
  display: block;
  padding: 8px 4px 12px;
  text-align: center;
  font-size: 1.55rem;
  line-height: 1.05;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* поляроид — ссылка на карточку в каталоге */
.polaroid__link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: var(--r-pol);
}
.polaroid__link:hover { color: inherit; }
.polaroid__link:focus-visible { outline: 3px solid var(--ink); outline-offset: 12px; }

/* полупрозрачный скотч */
.polaroid::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 92px;
  height: 26px;
  background: var(--tape);
  transform: translateX(-50%) rotate(-4deg);
  clip-path: polygon(3% 0, 97% 4%, 100% 30%, 96% 62%, 100% 100%, 2% 96%, 0 68%, 4% 36%);
  z-index: 2;
}
.polaroid:nth-child(even)::before { transform: translateX(-50%) rotate(5deg); }

@media (min-width: 960px) {
  .hero { padding-block: 40px 72px; }
  .hero__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    min-height: min(calc(100vh - var(--header-h) - 40px), 760px);
  }

  .hero__visual { min-height: 620px; }

  .hero__bignum {
    display: block;
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -54%);
    font-size: 25rem;
    font-weight: 700;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px var(--line);
    user-select: none;
    pointer-events: none;
  }

  .fan {
    display: block;
    position: absolute;
    inset: 0;
    overflow: visible;
    margin: 0;
    padding: 0;
    --spread: 1;
  }

  .polaroid {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40%;
    max-width: 232px;
    --lift: 0px;
    --s: 1;
    transform:
      translate(-50%, -50%)
      translate(calc(var(--x) * var(--spread)), calc(var(--y) * var(--spread) + var(--lift)))
      rotate(var(--r))
      scale(var(--s));
    transition: transform 0.35s var(--ease), box-shadow 0.35s;
  }
  /* три сверху, два снизу — подписи не перекрываются */
  .polaroid:nth-child(1) { --x: -94%; --y: -50%; --r: -8deg; z-index: 1; }
  .polaroid:nth-child(2) { --x: -48%; --y: 55%;  --r: -3deg; z-index: 4; }
  .polaroid:nth-child(3) { --x: 0%;   --y: -58%; --r: 3deg;  z-index: 3; }
  .polaroid:nth-child(4) { --x: 50%;  --y: 52%;  --r: 6deg;  z-index: 5; }
  .polaroid:nth-child(5) { --x: 94%;  --y: -46%; --r: 9deg;  z-index: 2; }

  .polaroid:hover,
  .polaroid:focus-within {
    --lift: -16px;
    --r: 0deg;
    --s: 1.04;
    z-index: 10;
    box-shadow: 0 2px 2px rgba(28, 30, 24, 0.08), 0 26px 40px -16px rgba(28, 30, 24, 0.45);
  }

  /* Раскладка веером при загрузке — чистый CSS, без JS */
  .motion .polaroid { animation: fan-in 1s var(--ease) backwards; }
  .motion .polaroid:nth-child(2) { animation-delay: 0.08s; }
  .motion .polaroid:nth-child(3) { animation-delay: 0.16s; }
  .motion .polaroid:nth-child(4) { animation-delay: 0.24s; }
  .motion .polaroid:nth-child(5) { animation-delay: 0.32s; }
}

@keyframes fan-in {
  from { transform: translate(-50%, -46%) rotate(0deg) scale(0.94); opacity: 0.4; }
}

/* ---------- 7. Как это работает ---------- */
.steps {
  list-style: none;
  display: grid;
  gap: 16px;
  counter-reset: none;
}
.step {
  position: relative;
  padding: 24px 22px 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.step__num {
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1;
  color: var(--berry);
}
.step__title {
  margin-bottom: 8px;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.step p { color: var(--muted); }
.step--accent { background: var(--lemon); border-color: var(--lemon); }
.step--accent p { color: var(--ink); }
.step--accent .step__num { color: var(--ink); }

@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .step:nth-child(odd) { transform: rotate(-0.8deg); }
  .step:nth-child(even) { transform: rotate(0.8deg) translateY(10px); }
}

/* ---------- 8. Бюджет ---------- */
.budget { padding-top: 0; }

.budget__grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.budget-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 150px;
  padding: 18px 16px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  transition: transform 0.2s var(--ease), border-color 0.2s, background-color 0.2s;
}
.budget__grid li:nth-child(odd) .budget-tile { rotate: -1deg; }
.budget__grid li:nth-child(even) .budget-tile { rotate: 0.8deg; }
.budget-tile:hover { border-color: var(--ink); transform: translateY(-3px); rotate: 0deg; }
.budget-tile[aria-pressed="true"] { background: var(--lemon); border-color: var(--ink); border-width: 2px; }

.budget-tile__label {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 500;
  line-height: 1.2;
}
.budget-tile__count {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--berry);
}
.budget-tile[aria-pressed="true"] .budget-tile__count { color: var(--ink); }
.budget-tile__hint { font-size: 0.95rem; color: var(--muted); line-height: 1.35; }
.budget-tile[aria-pressed="true"] .budget-tile__hint { color: var(--ink); }

@media (min-width: 900px) {
  .budget__grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .budget-tile { min-height: 180px; padding: 22px 20px; }
}

/* ---------- 9. Каталог ---------- */
.catalog { padding-top: 0; }
.catalog:focus { outline: none; }

.catalog__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.catalog__main,
.sizes { min-width: 0; }

@media (min-width: 1024px) {
  .catalog__layout {
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 36px;
    align-items: start;
  }
}

/* --- Шпаргалка-бирка --- */
.sizes { position: relative; }

.sizes__toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r-card);
}
.sizes__toggle-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sizes__peek { grid-column: 1; font-size: 0.95rem; color: var(--berry); }
.sizes__chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 12px; height: 12px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform 0.2s;
}
.sizes.is-open .sizes__chevron { transform: rotate(-135deg); }

.tag {
  display: none;
  position: relative;
  margin-top: 10px;
  padding: 40px 22px 24px;
  background: var(--paper);
  clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%, 0 22px);
  outline: 1px dashed var(--field-line);
  outline-offset: -9px;
}
.sizes.is-open .tag { display: block; }

/* дырочка бирки */
.tag::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  width: 14px; height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 2px var(--line);
}

.tag__kicker { margin-bottom: 8px; }
.tag__title {
  font-size: 1.2rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.tag__row {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.tag__row dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.tag__row dd { font-size: 1rem; line-height: 1.45; }
.tag__row .mono { color: var(--berry); font-weight: 500; }

.swatches {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 4px;
}
.swatches li { display: inline-flex; align-items: center; gap: 6px; }
.swatch {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(28, 30, 24, 0.25);
}
.swatch--milk { background: #F3EBDD; }
.swatch--olive { background: #6B7A3C; }
.swatch--choc { background: #5A3A2A; }
.swatch--cherry { background: #8E1F35; }

@media (min-width: 1024px) {
  .sizes {
    position: sticky;
    top: calc(var(--header-h) + 20px);
    padding-top: 26px;
  }
  /* верёвочка к бирке */
  .sizes::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 48px;
    background: var(--berry);
    transform: rotate(8deg);
    transform-origin: top;
    z-index: 2;
  }
  .sizes__toggle { display: none; }
  .tag { display: block; margin-top: 0; transform: rotate(-1.5deg); }
}

/* --- Панель фильтров --- */
.toolbar { margin-bottom: 26px; }

.toolbar__row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.search input,
.select select,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1.5px solid var(--field-line);
  border-radius: var(--r-btn);
  font-size: 1.05rem;
  transition: border-color 0.15s;
}
.search input:focus,
.select select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}
.search input::placeholder,
.field input::placeholder { color: var(--muted); opacity: 1; }

.search input {
  -webkit-appearance: none;
  appearance: none;
  padding-left: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E6356' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px 50%;
  background-size: 20px;
}

.select { display: flex; align-items: center; gap: 10px; }
.select label {
  flex: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.search input::-webkit-search-decoration { -webkit-appearance: none; }

.select select,
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1E18' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

/* переключатель «только свободные» */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative;
  flex: none;
  width: 52px; height: 30px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--field-line);
  transition: background-color 0.2s, border-color 0.2s;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s var(--ease), background-color 0.2s;
}
.switch input:checked + .switch__track { background: var(--berry); border-color: var(--berry); }
.switch input:checked + .switch__track::after { transform: translateX(22px); background: #fff; }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--ink); outline-offset: 3px; }

@media (min-width: 720px) {
  .toolbar__row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; }
}

.chips {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
@media (min-width: 720px) {
  .chips { flex-wrap: wrap; overflow: visible; }
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip small { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] small { color: var(--bg); }

.toolbar__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 12px;
  min-height: 36px;
  font-size: 0.95rem;
  color: var(--muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  background: var(--lemon);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
}
.pill::after { content: "×"; font-size: 1.2rem; line-height: 1; }

/* --- Сетка карточек --- */
.grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 22px; }
}
@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card { position: relative; }

.card__tilt {
  height: 100%;
  perspective: 1600px;
  rotate: var(--tilt, 0deg);
  transition: rotate 0.3s var(--ease);
}
.card:hover .card__tilt,
.card:focus-within .card__tilt { rotate: 0deg; }

.card__flip {
  position: relative;
  display: grid;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s var(--ease);
}
.card.is-flipped .card__flip { transform: rotateY(180deg); }

/* Невидимая сторона карточки получает visibility: hidden — она пропадает из
   порядка Tab даже там, где нет inert (Safari до 15.5, Firefox до 112).
   Уходящая сторона прячется на середине поворота, приходящая видна сразу. */
.card__front { transition: visibility 0s; }
.card.is-flipped .card__front { visibility: hidden; transition: visibility 0s 0.32s; }
.card__back { visibility: hidden; transition: visibility 0s 0.32s; }
.card.is-flipped .card__back { visibility: visible; transition: visibility 0s; }

.card__face {
  grid-area: 1 / 1;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.card__front {
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  overflow: hidden;
}
@media (min-width: 600px) {
  .card__front { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
}

/* оборот не должен растягивать карточку: высоту задаёт лицевая сторона,
   а длинный текст на обороте прокручивается внутри */
.card__back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px 20px;
  overflow: auto;
}

.card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg);
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.35s, opacity 0.35s;
}
@media (max-width: 599px) {
  /* в горизонтальной карточке фото тянется на всю её высоту */
  .card__media { aspect-ratio: auto; min-height: 190px; }
  .card__media img { position: absolute; inset: 0; }
  .card__hand { font-size: 1.25rem; }
}

.prio {
  position: absolute;
  top: 8px; left: 8px;
  padding: 3px 8px;
  background: var(--paper);
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--berry);
  letter-spacing: 0.04em;
}

.card__hand {
  position: absolute;
  left: 8px;
  bottom: 10px;
  max-width: calc(100% - 16px);
  padding: 2px 10px 4px;
  background: var(--tape);
  font-size: 1.4rem;
  color: var(--ink);
  transform: rotate(-2.5deg);
  transform-origin: left center;
}

/* Карточка переворачивается кликом по ней целиком; фото — кнопка для клавиатуры */
.card__front,
.card__back { cursor: pointer; }

.card__turn {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
/* своя рамка фокуса в цвет кнопки «Дарю это» вместо голубой системной */
.card__turn:focus,
.card__turn:focus-visible { outline: 3px solid var(--berry-press); outline-offset: -4px; }
.card__turn:focus:not(:focus-visible) { outline: none; }
.card__turn,
.card__front,
.card__back { -webkit-tap-highlight-color: transparent; }

.card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 14px 16px;
}
@media (min-width: 600px) {
  .card__body { padding: 16px 18px 18px; }
}

.card__brand {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.card__title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.card__detail { font-size: 0.95rem; color: var(--muted); line-height: 1.35; }

.card__foot { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 12px; }

.card__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
}
.price { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 500; white-space: nowrap; }
.price__approx { color: var(--muted); }
.card__shop { font-size: 0.9rem; color: var(--muted); }

.card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card__actions .btn { flex: 1 1 auto; }

/* мини-полоска складчины в карточке */
.mini-pool { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mini-pool__text { font-size: 0.9rem; color: var(--muted); }
.mini-pool__text b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }

/* оборот */
.back__title { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.back__list { display: grid; gap: 10px; }
.back__list dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.back__list dd { font-size: 1rem; line-height: 1.4; }
.back__why {
  padding: 12px 14px;
  background: var(--bg);
  border-left: 3px solid var(--berry);
  font-size: 1rem;
  line-height: 1.45;
}
.card__back .btn { margin-top: auto; }
.back__credit { font-size: 0.85rem; color: var(--muted); }
.back__credit a { color: var(--muted); }
.back__credit a:hover { color: var(--berry); }

/* --- Подсветка карточки, к которой перешли из веера --- */
.card.is-spotlight .card__front {
  outline: 3px solid var(--berry);
  outline-offset: 5px;
}
.motion .card.is-spotlight .card__tilt { animation: spotlight 0.9s var(--ease); }
@keyframes spotlight {
  0% { transform: scale(1); }
  35% { transform: scale(1.035); }
  65% { transform: scale(0.99); }
  100% { transform: none; }
}

/* --- Статусы --- */
.card.is-booked .card__front,
.card.is-received .card__front,
.card.is-collected .card__front { background: var(--paper-dim); }

.card.is-booked .card__media img,
.card.is-received .card__media img,
.card.is-collected .card__media img { filter: grayscale(1); opacity: 0.7; }

.card.is-booked .card__tilt,
.card.is-received .card__tilt { translate: 0 3px; }

.stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  padding: 0.25em 0.6em 0.2em;
  background: rgba(255, 255, 255, 0.88);
  border: 3px solid currentColor;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), inset 0 0 0 4px currentColor;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3.4vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-8deg);
  pointer-events: none;
}
.stamp--booked { color: var(--graphite); }
.stamp--received { color: var(--olive); }
.stamp--collected { color: var(--berry); }

.motion .is-stamping .stamp { animation: stamp-drop 0.35s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.motion .is-stamping .card__front { animation: card-sink 0.35s ease-out; }

@keyframes stamp-drop {
  0% { transform: translate(-50%, -50%) rotate(-8deg) scale(1.6); opacity: 0; }
  55% { transform: translate(-50%, -50%) rotate(-8deg) scale(0.95); opacity: 1; box-shadow: inset 0 0 0 2px rgba(255,255,255,.9), inset 0 0 0 4px currentColor, 0 0 0 10px rgba(58, 61, 54, 0.18); }
  100% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
}
@keyframes card-sink {
  40% { transform: translateY(5px) scale(0.99); }
}

/* --- Полоса прогресса --- */
.bar {
  position: relative;
  height: 12px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}
.bar__fill,
.bar__add {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  border-radius: inherit;
}
.bar__fill { background: var(--berry); }
.bar__add {
  background: repeating-linear-gradient(-45deg, var(--ink) 0 4px, var(--lemon) 4px 8px);
  transform: translateX(calc(var(--from, 0) * 100%)) scaleX(var(--p, 0));
}
.motion .bar__fill { transition: transform 1.1s var(--ease); }
.motion .bar.js-grow:not(.is-in) .bar__fill { transform: scaleX(0); }
.motion .bar--preview .bar__fill,
.motion .bar--preview .bar__add { transition: transform 0.3s var(--ease); }

/* --- Пусто --- */
.empty {
  padding: 40px 24px;
  text-align: center;
  background: var(--paper);
  border: 1px dashed var(--field-line);
  border-radius: var(--r-card);
}
.empty__title { font-size: 1.3rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.empty p { margin-bottom: 16px; color: var(--muted); }
.noscript { padding: 20px; background: var(--lemon); }

/* ---------- 10. Складчина ---------- */
.pool { background: var(--paper); border-block: 1px solid var(--line); }
.pool .kicker__num { background: var(--berry); color: #fff; }

.pools { list-style: none; display: grid; gap: 22px; }

.pool-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.pool-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--r-pol);
  background: var(--paper);
}
.pool-card__media img { width: 100%; height: 100%; object-fit: cover; }

.pool-card__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pool-card__title { font-size: clamp(1.2rem, 2.4vw, 1.55rem); text-transform: uppercase; letter-spacing: 0.03em; }
.pool-card__detail { color: var(--muted); font-size: 1rem; }
.pool-card__nums { font-family: var(--font-mono); font-size: 0.95rem; }
.pool-card__nums b { font-weight: 500; font-size: 1.2rem; }
@media (min-width: 720px) {
  .pool-card__nums { font-size: 1.05rem; }
  .pool-card__nums b { font-size: 1.3rem; }
}
.pool-card__meta { font-size: 0.98rem; color: var(--muted); }
.pool-card__meta strong { color: var(--ink); font-weight: 600; }

.pool-card__shares {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.pool-card__shares .btn { width: 100%; }
.pool-card__shares .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* суммы: «zł» не должно становиться «ZŁ» */
.btn--amount {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.05rem;
}
.pool-card__mine {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.98rem;
}
.pool-card__mine b { font-family: var(--font-mono); font-weight: 500; }
.linkbtn {
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  font-weight: 600;
  color: var(--berry);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--berry-press); }

.pool-card .stamp { font-size: clamp(1.3rem, 4vw, 2.2rem); }
.pool-card.is-collected .pool-card__media img { filter: grayscale(1); opacity: 0.7; }

@media (min-width: 720px) {
  .pool-card {
    grid-template-columns: 150px minmax(0, 1fr) minmax(0, 300px);
    align-items: center;
    gap: 24px;
    padding: 22px;
  }
  .pool-card__shares { grid-column: 3; }
  .pool-card__mine { grid-column: 2 / -1; }
}

/* ---------- 11. Не дарите ---------- */
.anti { overflow: hidden; }

.sticky-note {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  padding: 44px clamp(22px, 5vw, 56px) 40px;
  background: var(--lemon);
  transform: rotate(-1.2deg);
}
.sticky-note::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 120px;
  height: 30px;
  background: rgba(255, 255, 255, 0.6);
  transform: translateX(-50%) rotate(3deg);
  clip-path: polygon(3% 0, 97% 4%, 100% 30%, 96% 62%, 100% 100%, 2% 96%, 0 68%, 4% 36%);
}
/* загнутый уголок */
.sticky-note::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #D2DB55 0 50%, var(--bg) 50%);
}
.sticky-note .kicker { color: var(--ink); }
.sticky-note__lead { margin-top: 12px; font-size: 1.2rem; }

.anti__list { list-style: none; margin-top: 26px; display: grid; gap: 12px; }
.error-actions { margin-top: 28px; }
.anti__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 500;
}
.anti__list s {
  text-decoration-line: line-through;
  text-decoration-color: var(--berry);
  text-decoration-thickness: 3px;
}
.anti__list .hand { display: inline-block; font-size: 1.5rem; color: var(--muted); }

/* ---------- 12. Записка ---------- */
.letter {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 36px clamp(24px, 5vw, 56px) 32px clamp(40px, 7vw, 84px);
  background-color: #FBFCFD;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  transform: rotate(0.8deg);
}
/* поля тетради */
.letter::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: clamp(26px, 4.5vw, 56px);
  width: 2px;
  background: #E7A3B5;
}
.letter::after {
  content: "";
  position: absolute;
  top: -12px;
  right: 28px;
  width: 90px;
  height: 26px;
  background: var(--tape);
  transform: rotate(8deg);
  clip-path: polygon(3% 0, 97% 4%, 100% 30%, 96% 62%, 100% 100%, 2% 96%, 0 68%, 4% 36%);
}
.letter .kicker { color: var(--muted); }
.letter__text {
  margin: 8px 0 0;
  font-family: var(--font-hand);
  font-size: clamp(1.55rem, 3.4vw, 1.9rem);
  font-weight: 500;
  line-height: 1.38;
}
.letter__text p + p { margin-top: 0.5em; }
.letter__ps { color: var(--muted); }
.letter__sign { display: flex; justify-content: flex-end; margin-top: 8px; }
.blot { transform: rotate(-8deg); fill: var(--ink); }
.blot text { font-family: var(--font-hand); font-size: 58px; font-weight: 700; fill: var(--bg); }

/* ---------- 13. Вопросы ---------- */
.faq__wrap { max-width: 900px; }
.faq__list { border-top: 1px solid var(--ink); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 14px 52px 14px 0;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 36px; height: 36px;
  margin-top: -18px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 400;
  transition: transform 0.25s var(--ease), background-color 0.2s;
}
.qa[open] summary::after { transform: rotate(45deg); background: var(--lemon); }
.qa summary:hover { color: var(--berry); }
.qa p { padding: 0 52px 22px 0; color: var(--muted); max-width: 64ch; }
.qa a { color: var(--berry); }

/* ---------- 14. Форма ---------- */
.request { background: var(--paper); border-top: 1px solid var(--line); }
.request__grid { display: grid; gap: 32px; }
.request__intro > p:not(.kicker) { margin-top: 16px; color: var(--muted); max-width: 44ch; }
.privacy {
  padding: 14px 16px;
  background: var(--bg);
  border-left: 3px solid var(--olive);
  font-size: 0.98rem;
}
.request__intro .privacy { color: var(--ink); }
.privacy--small { font-size: 0.92rem; color: var(--muted); margin-bottom: 16px; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 1rem; }
.field__opt { font-weight: 400; color: var(--muted); }
.field textarea { min-height: 110px; resize: vertical; }
.field__error { font-size: 0.95rem; color: var(--berry); font-weight: 500; }
.field__error:empty,
.field__hint:empty { display: none; }
.field__hint { font-size: 0.98rem; color: var(--ink); padding: 8px 12px; background: var(--lemon); font-family: var(--font-sans); }
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea { border-color: var(--berry); border-width: 2px; }

.form__status { min-height: 1.5em; font-weight: 600; }
.form .btn { justify-self: start; }

/* ловушка для спам-ботов: скрыта от людей и скринридеров */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 900px) {
  .request__grid { grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: start; }
  .form { grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .form .field:nth-of-type(3),
  .form .field:nth-of-type(4),
  .form .btn,
  .form__status { grid-column: 1 / -1; }
}

/* ---------- 15. Подвал ---------- */
.footer { padding-block: 48px 28px; background: var(--ink); color: var(--bg); }
.footer a { color: var(--bg); }
.footer a:hover { color: var(--lemon); }
.footer__grid { display: grid; gap: 24px; }
.logo--footer { font-size: 1.6rem; margin-bottom: 6px; }
.logo--footer .logo__k { color: var(--lemon); }
.footer__prices { color: #C9CEBF; max-width: 36ch; }
.footer__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.footer .btn--ghost { border-color: var(--bg); color: var(--bg); }
.footer .btn--ghost:hover { background: var(--bg); color: var(--ink); }
.footer .btn--quiet { background: transparent; border-color: #5E6356; color: var(--bg); }
.footer .btn--quiet:hover { border-color: var(--lemon); color: var(--lemon); }
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid #3A3D36;
  font-size: 0.9rem;
  color: #C9CEBF;
}
@media (min-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr auto; align-items: center; }
}

/* ---------- 16. Модальные окна ---------- */
/* vh — запасное значение для браузеров без dvh (Safari до 15.4) */
.modal {
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
/* если браузер не знает <dialog>: закрытое окно скрыто, открытое — поверх страницы */
dialog.modal:not([open]) { display: none; }
dialog.modal[open] {
  position: fixed;
  inset: 0;
  margin: auto;
  height: -webkit-fit-content;
  height: fit-content;
  z-index: 80;
}
.modal::backdrop { background: rgba(28, 30, 24, 0.6); }
.modal__box {
  position: relative;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 28px clamp(20px, 5vw, 32px);
  background: var(--paper);
  border-radius: 8px;
}
.motion .modal[open] .modal__box { animation: modal-in 0.28s var(--ease); }
@keyframes modal-in { from { transform: translateY(18px); opacity: 0; } }

@media (max-width: 599px) {
  .modal {
    width: 100vw;
    margin: auto 0 0;
    max-height: 94vh;
    max-height: 94dvh;
  }
  dialog.modal[open] { margin: auto 0 0; }
  .modal__box {
    max-height: 94vh;
    max-height: 94dvh;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

.modal__close {
  position: absolute;
  top: 10px; right: 10px;
  width: 48px; height: 48px;
  background: none;
  border: 0;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}
.modal__close:hover { background: var(--bg); }

.modal__gift { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; padding-right: 40px; }
.modal__gift img {
  flex: none;
  width: 80px; height: 100px;
  object-fit: cover;
  border-radius: var(--r-pol);
  background: var(--bg);
}
.modal__gift .kicker { margin-bottom: 6px; }
.modal__title { font-size: 1.35rem; line-height: 1.2; padding-right: 40px; }
.modal__gift .modal__title { padding-right: 0; }
.modal__price { margin-top: 4px; color: var(--muted); }
.modal__size {
  margin-bottom: 18px;
  padding: 10px 14px;
  background: var(--lemon);
  font-size: 1rem;
}
.modal__size:empty { display: none; }
#bookForm, #poolForm { display: grid; gap: 14px; }

.shares { margin: 12px 0 0; padding: 0; border: 0; }
.shares legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.shares__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.share { position: relative; display: block; }
.share input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.share span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 6px 10px;
  border: 1.5px solid var(--field-line);
  border-radius: var(--r-btn);
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  transition: background-color 0.15s, border-color 0.15s;
}
.share input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.share input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.share input:disabled + span { opacity: 0.45; text-decoration: line-through; cursor: not-allowed; }
.share--wide { grid-column: 1 / -1; }

.preview { display: grid; gap: 8px; padding: 14px; background: var(--bg); border-radius: var(--r-card); }
.preview__text { font-size: 1rem; }
.preview__text b { font-family: var(--font-mono); font-weight: 500; color: var(--berry); }

.joke { text-align: center; padding-block: 40px 32px; background: var(--lemon); }
.joke__title { font-size: clamp(1.8rem, 5vw, 2.4rem); text-transform: uppercase; letter-spacing: 0.03em; }
.joke__text { margin: 12px 0 24px; font-family: var(--font-hand); font-size: 2rem; font-weight: 600; }

/* ---------- 17. Тост и конфетти ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 60;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 20px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-btn);
  font-size: 1rem;
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: transform 0.25s var(--ease), opacity 0.25s;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

.confetti {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

/* ---------- 18. Меньше движения ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 19. Печать ---------- */
@media print {
  .site-header, .toolbar, .card__actions, .footer__actions, .request, .hero__visual { display: none !important; }
  body { background: #fff; }
  .card__tilt, .sticky-note, .letter { rotate: none; transform: none; }
}
