/* ─────────────────────────────────────────────────────────────
   Design system: ui-ux-pro-max (MOFT), verified picks
     pattern     portfolio-grid   landing.csv
     style       Minimalism & Swiss Style   styles.csv
     colors      Luxury/Premium Brand   colors.csv
     type        Classic Elegant, Playfair Display + Inter   typography.csv
     motion      Stagger List (Standard), back.out(1.4), 300-450ms
     dials       variance 3, motion 4, density 3 (spacious 24-96px)
   Deviations are marked DEVIATION where they occur
   ───────────────────────────────────────────────────────────── */

:root {
  /* Гамма снята с voicy.uz, значения не на глаз, а из computed styles живой страницы
     Тёмная тема это оригинал, светлая выведена в том же семействе
     Карточка берёт #1B2935, а не #131C26: второй отличается от фона на 1.08:1,
     то есть поверхности нет, на самом voicy её вытягивает граница */
  --bg:          #0C141D;
  --card:        #1B2935;
  --card-quiet:  #131C26;
  --fg:          #E8EEF4;
  --fg-muted:    #8FA3B5;
  --fg-dim:      #5D7285;  /* 3.72:1, только декоративное, не для текста по делу */
  --border:      #223547;
  --border-soft: #182633;

  --accent:      #6ECF97;  /* мята: «это твоё», 9.03:1 на карточке */
  --on-accent:   #0C141D;
  --accent-2:    #4F93CF;  /* синий: ссылки и надзаголовки, 5.24:1 на карточке */
  --accent-wash: rgba(110, 207, 151, .12);

  --ink:         #345E8A;  /* основная кнопка, как на оригинале */
  --on-ink:      #E8EEF4;

  --band:        #1B3048;  /* второй регистр, одинаков в обеих темах */
  --on-band:     #E8EEF4;
  --band-muted:  #8FA3B5;
  --band-border: rgba(232, 238, 244, .16);
  --band-accent: #6ECF97;

  --shadow:      0 1px 2px rgba(0, 0, 0, .5);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 36px -20px rgba(0, 0, 0, .95);
  --plate-filter: brightness(.94) saturate(.96);

  --display: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --s1: 8px;  --s2: 12px; --s3: 16px; --s4: 24px;
  --s5: 32px; --s6: 48px; --s7: 64px; --s8: 96px;

  --r: 4px;
  --r-btn: 6px;
  --pad: clamp(var(--s4), 4vw, var(--s7));
  --max: 1320px;

  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.2, .8, .3, 1);
  --t-hover: 220ms;
  --t-reveal: 400ms;
}

/* Светлая тема выведена из той же гаммы: холодная бумага, те же мята и синий,
   притемнённые до контраста, шкала светлот заполнена */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    /* Дневная тема в точности как на снимке, который прислал Антон:
       пергамент, глубокий бутылочный текст, латунь. Ночная остаётся в гамме voicy */
    --bg:          #EDE7DC;
    --card:        #F8F4EC;
    --card-quiet:  #E7E0D4;
    --fg:          #17261F;
    --fg-muted:    #55625A;
    --fg-dim:      #77857C;
    --border:      #D6CDBE;
    --border-soft: #E3DBCD;
    --accent:      #8A5A12;
    --on-accent:   #F8F4EC;
    --accent-2:    #8A5A12;
    --accent-wash: rgba(138, 90, 18, .09);
    --ink:         #1C3A2E;
    --on-ink:      #F8F4EC;
    --band:        #17261F;
    --on-band:     #EDE7DC;
    --band-muted:  #A3B0A6;
    --band-border: rgba(237, 231, 220, .22);
    --band-accent: #D9A94E;
    --shadow:      0 1px 2px rgba(23, 38, 31, .06);
    --shadow-lift: 0 1px 2px rgba(23, 38, 31, .06), 0 14px 28px -16px rgba(23, 38, 31, .26);
    --plate-filter: none;
  }
}

:root[data-theme="light"] {
  /* Дневная тема в точности как на снимке, который прислал Антон:
     пергамент, глубокий бутылочный текст, латунь. Ночная остаётся в гамме voicy */
  --bg:        #EDE7DC;
  --card:      #F8F4EC;
  --card-quiet:  #E7E0D4;
  --fg:        #17261F;
  --fg-muted:    #55625A;
  --fg-dim:      #77857C;
  --border:      #D6CDBE;
  --border-soft: #E3DBCD;
  --accent:      #8A5A12;
  --on-accent:   #F8F4EC;
  --accent-2:    #8A5A12;
  --accent-wash: rgba(138, 90, 18, .09);
  --ink:       #1C3A2E;
  --on-ink:      #F8F4EC;
  --band:      #17261F;
  --on-band:     #EDE7DC;
  --band-muted:  #A3B0A6;
  --band-border: rgba(237, 231, 220, .22);
  --band-accent: #D9A94E;
  --shadow:      0 1px 2px rgba(23, 38, 31, .06);
  --shadow-lift: 0 1px 2px rgba(23, 38, 31, .06), 0 14px 28px -16px rgba(23, 38, 31, .26);
  --plate-filter: none;
}

/* ── base ──────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* a print-weight grain, the flat screen look is what made this read cheap */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9;
  pointer-events: none;
  opacity: .07;
  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='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) body::after { opacity: .045; } }
:root[data-theme="light"] body::after { opacity: .045; }

h1, h2, h3, h4, p, ul, figure, dl { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a, button, summary, [role="button"] { touch-action: manipulation; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; top: var(--s2); left: var(--s2); z-index: 60;
  transform: translateY(-200%);
  background: var(--ink); color: var(--on-ink);
  padding: var(--s2) var(--s3); border-radius: var(--r-btn);
  font: 500 13px/1 var(--ui); text-decoration: none;
  transition: transform var(--t-hover) var(--ease-out);
}
.skip:focus { transform: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ── top rail ──────────────────────────────────────────────── */

.rail {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border-soft);
}

.rail__mark {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
}

.rail__actions { display: flex; align-items: center; gap: var(--s1); }

.rail__btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  padding: 8px 14px;
  min-height: 36px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: border-color var(--t-hover), background-color var(--t-hover), color var(--t-hover);
}
.rail__btn:hover { border-color: var(--ink); background: var(--card); }
.rail__btn:active { background: var(--border-soft); }
.rail__btn--icon { padding: 8px; width: 36px; justify-content: center; }

.rail__pip { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* dark is the base now, so the moon shows by default and the sun marks light */
.icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: inline; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-moon { display: none; }
  :root:not([data-theme="dark"]) .icon-sun { display: inline; }
}

/* ── hero: type as hero, Swiss grid ────────────────────────── */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(var(--s6), 11vh, var(--s8)) var(--pad) clamp(var(--s7), 12vh, var(--s8));
}

.hero__date { margin: var(--s4) 0 0; font-weight: 400; }

/* Day and month share one baseline instead of stacking
   Stacked, the day needed sub-1 line-height to look right, its glyphs then
   overflowed their own line box and collided with the month's box below */
.hero__lockup {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: clamp(var(--s2), 1.8vw, var(--s5));
}

.hero__day {
  font-family: var(--display);
  font-weight: 400;
  font-weight: 400;
  font-size: clamp(5.5rem, 19vw, 15rem);
  line-height: 1;
  letter-spacing: -.035em;
  font-feature-settings: 'lnum' 1;
  animation: date-wipe 900ms var(--ease-out) both;
}

.hero__month {
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.9rem, 6vw, 4.25rem);
  line-height: 1;
  letter-spacing: -.005em;
  color: var(--fg-muted);
  animation: month-slide 800ms 180ms var(--ease-out) both;
}

/* the load sequence: number wipes up, month slides out from under it,
   then the rule draws and the rest settles */
@keyframes date-wipe {
  from { opacity: 0; clip-path: inset(100% -12% -20% -6%); transform: translateY(10px); }
  to   { opacity: 1; clip-path: inset(-25% -12% -20% -6%); transform: none; }
}
@keyframes month-slide {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}

.hero__lead {
  margin-top: var(--s5);
  max-width: 42ch;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.hero__meta {
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  max-width: 42ch;
  position: relative;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--fg-muted);
  display: flex; flex-wrap: wrap; gap: var(--s2);
}
.hero__sep { opacity: .45; }

/* the rule under the lead draws left to right on load */
.hero__meta::before {
  content: '';
  position: absolute; top: -1px; left: 0; right: 0;
  border-top: 1px solid var(--fg);
  transform-origin: left;
  animation: rule-draw 700ms 420ms var(--ease-out) both;
}
@keyframes rule-draw { from { transform: scaleX(0); opacity: .9; } to { transform: scaleX(1); opacity: 0; } }

/* a ticking clock must not jitter */
.tick { font-variant-numeric: tabular-nums; }
.tick b { font-weight: 500; color: var(--fg); }

/* how much of the list is still free, as a picture rather than a number */
.gauge {
  margin-top: var(--s3);
  max-width: 42ch;
  height: 2px;
  background: var(--border);
  overflow: hidden;
}
.gauge span {
  display: block; height: 100%;
  width: var(--p, 0%);
  background: var(--accent);
  transition: width 700ms var(--ease-out);
}

/* ── ticker: the categories drift past between hero and list ──── */

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: var(--s3) 0;
  margin-bottom: var(--s7);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.ticker__row {
  display: flex;
  width: max-content;
  gap: var(--s6);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
  animation: drift 46s linear infinite;
}
.ticker__row span { display: inline-flex; align-items: center; gap: var(--s6); }
.ticker__row i { font-style: normal; color: var(--accent); }
@keyframes drift { to { transform: translateX(-50%); } }
.ticker:hover .ticker__row { animation-play-state: paused; }

/* ── about: the pattern's own third slot, and the concept in three lines ── */

/* the dark chord of the page: a full-bleed band so the value scale has a bottom
   The band keeps its own tokens in both themes, everything inside just reads them */
.about {
  background: var(--band);
  color: var(--on-band);
  padding: var(--s8) 0 var(--s7);
  margin-top: var(--s4);
  --fg: var(--on-band);
  --fg-muted: var(--band-muted);
  --border: var(--band-border);
  --accent: var(--band-accent);
}

.about__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.about__title {
  color: var(--on-band);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  letter-spacing: -.015em;
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s5);
}

.about__steps {
  list-style: none;
  display: grid;
  gap: var(--s5);
  grid-template-columns: 1fr;
  counter-reset: step;
}

.about__steps li { display: grid; gap: 6px; }

.about__num {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .16em;
  color: var(--accent);
  margin-bottom: var(--s1);
}

.about__steps b {
  color: var(--on-band);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.3;
}

.about__steps li > span:last-child {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
  max-width: 34ch;
}

@media (min-width: 768px) {
  .about__steps { grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
}

.hero__cue {
  display: inline-flex; align-items: center; gap: var(--s2);
  margin-top: var(--s6);
  font-family: var(--mono);
  font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--t-hover);
}
.hero__cue:hover { border-bottom-color: var(--ink); }
.hero__cue svg { transition: transform var(--t-hover) var(--ease-out); }
.hero__cue:hover svg { transform: translateY(3px); }

/* ── list header ───────────────────────────────────────────── */

.list {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) var(--s8);
  scroll-margin-top: var(--s7);
}

.list__head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s3);
  padding-bottom: var(--s3);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--border);
}

.list__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  letter-spacing: -.015em;
}

/* portfolio-grid pattern: filter by category */
.filters { display: flex; gap: 2px; position: relative; }

/* the active pill travels between filters rather than blinking on and off */
.filters::before {
  content: '';
  position: absolute; top: 0; left: 0; height: 100%;
  width: var(--ind-w, 0);
  transform: translateX(var(--ind-x, 0));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  transition: transform 340ms var(--ease-back), width 340ms var(--ease-back);
  pointer-events: none;
}
.filters[data-ready="0"]::before { transition: none; }

.filter {
  position: relative; z-index: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  padding: 8px 14px;
  min-height: 36px;
  font-size: 13px; font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color var(--t-hover), background-color var(--t-hover), border-color var(--t-hover);
}
.filter:hover { color: var(--fg); }
.filter:active { background: var(--border-soft); }
.filter.is-on { color: var(--fg); }

.notice, .grid__empty {
  padding: var(--s6) 0;
  color: var(--fg-muted);
  font-size: 14.5px;
}

/* ── the grid ──────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: clamp(var(--s3), 2vw, var(--s5));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr));
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  padding: var(--s2);
  box-shadow: var(--shadow);
  transition:
    transform var(--t-hover) var(--ease-out),
    box-shadow var(--t-hover) var(--ease-out),
    border-color var(--t-hover),
    opacity var(--t-hover);
}

.card:has(.card__hit:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.card:active { transform: scale(.995); }

@media (hover: hover) {
  .card[data-status="free"]:hover,
  .card[data-status="mine"]:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
    border-color: var(--border);
  }
  .card[data-status="free"]:hover .card__plate,
  .card[data-status="mine"]:hover .card__plate { transform: scale(1.03); }
}

.card__frame {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: var(--border-soft);
  aspect-ratio: 4 / 5;
  box-shadow: inset 0 0 0 1px rgba(12, 10, 9, .055);
}

.card__plate {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: var(--plate-filter);
  transition: transform 450ms var(--ease-out), filter var(--t-hover);
}

.card__label { padding: var(--s3) 6px 6px; display: flex; flex-direction: column; flex: 1; }

.card__cat {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-muted);
}

.card__title {
  margin-top: var(--s1);
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -.005em;
}

.card__hit { all: unset; cursor: pointer; display: block; text-wrap: balance; }
.card__hit::after { content: ''; position: absolute; inset: 0; border-radius: var(--r); }

.card__blurb {
  margin-top: var(--s1);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__foot {
  position: relative;
  margin-top: auto;
  padding-top: var(--s3);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
}
.card__foot::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 380ms var(--ease-out);
}
@media (hover: hover) {
  .card[data-status="free"]:hover .card__foot::before,
  .card[data-status="mine"]:hover .card__foot::before { transform: scaleX(1); }
}

.card__price {
  font-family: var(--mono);
  font-size: 13px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.card__price[data-empty] { color: var(--fg-muted); font-size: 11.5px; letter-spacing: .02em; }

/* state carries a word and a mark, never colour alone (ux-guidelines.csv) */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .04em;
  color: var(--fg-muted);
  text-align: right;
}
.status::before {
  content: ''; flex: none;
  width: 7px; height: 7px; border-radius: 50%;
  border: 1.4px solid currentColor;
}
.card[data-status="other"] .status::before { background: currentColor; }
.card[data-status="mine"] .status { color: var(--accent); }
.card[data-status="mine"] .status::before { background: currentColor; }

/* taken by someone else: dimmed, still openable */
.card[data-status="other"] { background: transparent; box-shadow: none; border-color: var(--border-soft); }
.card[data-status="other"] .card__plate { filter: grayscale(.8) opacity(.5); }
.card[data-status="other"] .card__title,
.card[data-status="other"] .card__price { color: var(--fg-muted); }
.card[data-status="other"] .card__blurb { opacity: .7; }

/* yours: the single place gold is allowed to mark ownership */
.card[data-status="mine"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.card__seal {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(12, 10, 9, .25);
  animation: seal-stamp 460ms var(--ease-back) both;
  z-index: 2;
}
@keyframes seal-stamp {
  from { opacity: 0; transform: scale(1.9) rotate(-14deg); }
  to   { opacity: 1; transform: none; }
}

/* ── shared plate framing ──────────────────────────────────── */

.plate-frame {
  position: relative; overflow: hidden;
  border-radius: 2px;
  background: var(--border-soft);
  aspect-ratio: 4 / 5;
  box-shadow: inset 0 0 0 1px rgba(12, 10, 9, .055);
}
.plate-frame img { width: 100%; height: 100%; object-fit: cover; filter: var(--plate-filter); }

/* ── sheet ─────────────────────────────────────────────────── */

.sheet {
  border: none; padding: 0;
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 -8px 48px -16px rgba(0, 0, 0, .35);
  max-height: 92dvh;
  width: 100%; max-width: none;
  margin: auto auto 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.sheet::backdrop {
  background: color-mix(in srgb, #0C0A09 50%, transparent);
  backdrop-filter: blur(4px);
}
.sheet[open] { animation: sheet-up 340ms var(--ease-out); }
@keyframes sheet-up { from { transform: translateY(5%); opacity: 0; } }

.sheet__grip {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 4px; border-radius: 999px;
  background: var(--border);
  z-index: 3;
}

.sheet__close {
  position: absolute; top: var(--s3); right: var(--s3); z-index: 4;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: border-color var(--t-hover), color var(--t-hover);
}
.sheet__close:hover { border-color: var(--ink); }

.sheet__body { overflow-y: auto; max-height: 92dvh; overscroll-behavior: contain; }

.detail { display: grid; }
.detail__plate { padding: var(--s5) var(--s4) 0; }
.detail__plate .plate-frame { aspect-ratio: 16 / 11; }

.detail__text {
  padding: var(--s4) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--s3);
}

.detail__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 5.2vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.detail__price {
  font-family: var(--mono);
  font-size: 15px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.detail__price[data-empty] { font-size: 12.5px; color: var(--fg-muted); letter-spacing: .02em; }

.detail__desc { font-size: 15px; line-height: 1.65; color: var(--fg-muted); text-wrap: pretty; }

.detail__facts { border-top: 1px solid var(--border); padding-top: var(--s3); display: grid; gap: 10px; }
.detail__fact { display: flex; justify-content: space-between; gap: var(--s4); font-size: 13.5px; }
.detail__fact dt {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-muted);
}
.detail__fact dd { margin: 0; text-align: right; }

.detail__link {
  display: inline-flex; align-items: center; gap: var(--s1);
  align-self: flex-start;
  font-size: 13.5px; font-weight: 500;
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-2) 45%, transparent);
  padding-bottom: 2px;
  transition: border-color var(--t-hover);
}
.detail__link:hover { border-bottom-color: var(--accent-2); }
.detail__link small { font-family: var(--mono); font-size: 11px; color: var(--fg-muted); }

/* ── actions ───────────────────────────────────────────────── */

/* Панель непрозрачная: градиентная подложка просвечивала, и содержимое
   под липкой панелью читалось сквозь неё как наложение */
.actions {
  position: sticky; bottom: 0;
  margin-top: auto;
  padding: var(--s3) 0 calc(4px + env(safe-area-inset-bottom));
  background: var(--card);
  display: grid; gap: var(--s2);
}
.actions::before {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 100%;
  height: var(--s4);
  background: linear-gradient(to top, var(--card), transparent);
  pointer-events: none;
}

.actions__row { display: flex; gap: var(--s2); }

.btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  min-height: 48px;
  padding: 0 var(--s4);
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: background-color var(--t-hover), border-color var(--t-hover), color var(--t-hover), transform 120ms;
}
.btn:active { transform: scale(.99); }
.btn[disabled] { cursor: not-allowed; opacity: .5; }
.btn[data-busy] { opacity: 1; }

.btn__spin {
  width: 16px; height: 16px; flex: none;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn--primary { background: var(--ink); color: var(--on-ink); }
.btn--primary:hover:not([disabled]) { background: color-mix(in srgb, var(--ink) 84%, var(--accent)); }

.btn--ghost { background: transparent; border-color: var(--border); color: var(--fg); }
.btn--ghost:hover:not([disabled]) { border-color: var(--ink); }

.btn--quiet { background: transparent; color: var(--fg-muted); font-weight: 500; min-height: 44px; }
.btn--quiet:hover:not([disabled]) { color: var(--fg); }

.ask {
  font-size: 14.5px; line-height: 1.5;
  color: var(--fg);
  padding: var(--s3);
  background: var(--accent-wash);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  animation: ask-in 260ms var(--ease-out);
}
@keyframes ask-in { from { opacity: 0; transform: translateY(5px); } }

.held-note--mine {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-wash);
  color: var(--accent);
}

.held-note {
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3);
  border: 1px dashed var(--border);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 11.5px; letter-spacing: .04em;
  color: var(--fg-muted);
}

/* ── your claims ───────────────────────────────────────────── */

.claims { padding: var(--s6) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); display: grid; gap: var(--s4); }
/* элементы грида по умолчанию не сжимаются ниже своего содержимого,
   из-за этого строка восстановления уносила диалог вбок на 375px */
.claims > *, .claims__list, .claims__item { min-width: 0; }

.claims__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.75rem;
  letter-spacing: -.015em;
}

.claims__list { display: grid; gap: var(--s2); }

.claims__item {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  background: var(--bg);
  width: 100%; text-align: left;
  cursor: pointer;
  transition: border-color var(--t-hover);
}
.claims__item:hover { border-color: var(--ink); }
.claims__item:active { background: var(--border-soft); }
.claims__item img { width: 46px; height: 58px; object-fit: cover; border-radius: 2px; flex: none; filter: var(--plate-filter); }
.claims__item b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.claims__item span { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--fg-muted); margin-top: 3px; }

.claims__empty { color: var(--fg-muted); font-size: 14.5px; }
.claims__empty b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--fg); margin-bottom: 6px; }

/* ── toasts, auto-dismiss 3-5s per ux-guidelines.csv ───────── */

.toasts {
  position: fixed; z-index: 80;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--s3) + env(safe-area-inset-bottom));
  display: grid; gap: var(--s1);
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px var(--s3);
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--r-btn);
  font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 16px 36px -20px rgba(0, 0, 0, .8);
  animation: toast-in 280ms var(--ease-out);
}
.toast::before {
  content: ''; flex: none;
  width: 7px; height: 7px; margin-top: 6px; border-radius: 50%;
  background: currentColor; opacity: .5;
}
.toast[data-kind="good"]::before { background: #6EE7A8; opacity: 1; }
.toast[data-kind="bad"]::before { background: #FCA5A5; opacity: 1; }
.toast.is-out { animation: toast-out 220ms var(--ease-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ── footer ────────────────────────────────────────────────── */

/* the footer continues the band so the page ends on its dark chord
   instead of leaving the band floating as a stripe */
.foot {
  background: var(--band);
  color: var(--band-muted);
  border-top: 1px solid var(--band-border);
  padding: var(--s5) 0 calc(var(--s6) + env(safe-area-inset-bottom));
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .02em;
}
.foot p { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ── reveal: Stagger List (Standard), back.out(1.4) ────────── */

.reveal { opacity: 0; animation: rise var(--t-reveal) var(--ease-back) forwards; animation-delay: calc(var(--d, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card { opacity: 0; transform: translateY(16px) scale(.97); }  /* DEVIATION: dataset snippet uses scale .92, softened for a premium register */
.card.is-in { opacity: 1; transform: none; }

/* Телефон это и грубый указатель, и узкий экран. Правило продублировано по ширине,
   потому что (pointer: coarse) срабатывает не везде, где это телефон */
@media (max-width: 767px) {
  .rail__btn, .filter { min-height: 44px; }
  .rail__btn--icon { width: 44px; }
  .sheet__close { width: 44px; height: 44px; }
}

/* touch-target-size: 44x44 minimum wherever the pointer is a finger */
@media (pointer: coarse) {
  .rail__btn, .filter { min-height: 44px; }
  .rail__btn--icon { width: 44px; }
  .sheet__close { width: 44px; height: 44px; }
  .btn--quiet { min-height: 48px; }
}

/* ── breakpoints: 375 / 768 / 1024 / 1440 ──────────────────── */

@media (min-width: 768px) {
  .sheet {
    margin: auto;
    width: min(960px, 92vw);
    border-radius: var(--r);
    max-height: 88dvh;
  }
  .sheet[open] { animation: sheet-pop 300ms var(--ease-out); }
  @keyframes sheet-pop { from { transform: translateY(10px) scale(.99); opacity: 0; } }
  .sheet__grip { display: none; }
  .sheet__body { max-height: 88dvh; }

  .detail { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .detail__plate { padding: var(--s5) 0 var(--s5) var(--s5); display: flex; }
  /* height 100% together with aspect-ratio lets the frame drive its own width and
     overflow the column once the text side grows, so the ratio is dropped here */
  .detail__plate .plate-frame { flex: 1; aspect-ratio: auto; min-height: 340px; }
  .detail__text { padding: var(--s6) var(--s6) var(--s5); gap: var(--s4); }
  .detail__title { font-size: 2.2rem; }

  .sheet--narrow { width: min(520px, 92vw); }
  .claims { padding: var(--s6); }

  .toasts { left: var(--pad); transform: none; bottom: var(--s4); }
}

@media (min-width: 1024px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
    column-gap: clamp(var(--s6), 6vw, var(--s8));
    align-items: end;
  }
  .hero .eyebrow { grid-column: 1 / -1; }
  .hero__date { grid-column: 1; }
  .hero__aside { grid-column: 2; padding-bottom: var(--s2); border-left: 1px solid var(--border-soft); padding-left: clamp(var(--s4), 3vw, var(--s6)); }
  .hero__lead { margin-top: 0; max-width: 34ch; }
  .hero__cue { margin-top: var(--s5); }
}

@media (min-width: 1440px) {
  .hero { padding-top: clamp(var(--s7), 13vh, var(--s8)); }
}

/* ── quieter, on request ───────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal, .card { opacity: 1 !important; transform: none !important; }
  .card:hover { transform: none !important; }
  .ticker__row { animation: none !important; }
  .hero__meta::before { display: none; }
}

/* ── sheet dismissal ───────────────────────────────────────── */

.sheet.is-closing { animation: sheet-down 180ms ease forwards; }
@keyframes sheet-down { to { transform: translateY(6%); opacity: 0; } }
@media (min-width: 768px) {
  .sheet.is-closing { animation: sheet-fade 180ms ease forwards; }
  @keyframes sheet-fade { to { transform: translateY(6px) scale(.99); opacity: 0; } }
}
