/* Лендинг «Климат спальни» в бохо «Вечер у костра». Один мотив — нить-день: год соткан как килим с бахромой */

* { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 4.5rem;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --m: clamp(16px, 3vw, 40px);
}

h1, h2, h3 { margin: 0; font-family: var(--display); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--heading); outline-offset: 3px; }

button, .btn, .tabs a, .jump a {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.fig, .gauge-val, .rtile b, .menu-item .price, .scrub-read b { font-variant-numeric: tabular-nums; }

/* Кнопка — та же полоса, уложенная набок */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.5rem; border-radius: 999px;
  background: var(--accent); color: var(--bg-deep); font-weight: 500; text-decoration: none;
  transition: transform 150ms var(--ease-out), background-color 150ms ease;
}
.btn:active { transform: scale(0.96); }
.btn-small { min-height: 40px; padding: 0 1.1rem; font-size: 0.9375rem; }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--heading); } }

/* ---------- Шапка сайта ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  padding: max(10px, env(safe-area-inset-top)) var(--m) 10px;
  background: var(--bg-deep);
}
.brand { font: italic 600 1.375rem/1 var(--display); color: var(--heading); text-decoration: none; padding: 8px 0; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 8px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); }

/* ---------- Первый экран ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px;
  padding: 12px; min-height: calc(100svh - 56px);
}
.hero-card {
  display: flex; flex-direction: column; gap: 20px;
  position: relative; background: var(--surface); border-radius: var(--r-blob); overflow: hidden; padding-bottom: 32px;
}
.hero-card > :not(.scrub):not(.fringe) { margin-inline: clamp(20px, 3vw, 44px); }
.scrub { position: relative; height: 96px; cursor: ew-resize; touch-action: pan-y; }
/* Уток поверх нитей: ковёр, а не диаграмма */
.scrub::after, .ribbon::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(30, 19, 16, 0.14) 0 1px, transparent 1px 5px);
}
.ribbon::after { bottom: 18px; }
.fringe { display: block; width: 100%; height: 18px; margin-top: -1px; opacity: 0.85; }
.scrub-hint { color: var(--sage); font-size: 1.375rem; margin-top: -8px; }
.weave-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8125rem; color: var(--muted); margin-top: -12px; }
.weave-key span { display: inline-flex; align-items: center; gap: 6px; }
.weave-key i { width: 10px; height: 14px; border-radius: 2px 2px 5px 5px; }
.hero-moon { position: absolute; right: 24px; top: 132px; width: 64px; height: 64px; color: var(--ochre); }
.scrub svg { display: block; width: 100%; height: 100%; }
.scrub-read { min-height: 3.1em; color: var(--muted); font-size: 0.9375rem; margin-top: -12px; max-width: 46ch; }
.scrub-read b { color: var(--ink); font-weight: 500; }
.hero h1 { font-weight: 600; font-size: clamp(3rem, 6.2vw, 6.25rem); line-height: 0.95; letter-spacing: -0.01em; color: var(--heading); margin-top: auto; }
.lead { font-size: clamp(1.125rem, 1.5vw, 1.375rem); max-width: 36ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.jump { display: flex; gap: 20px; font-size: 0.9375rem; }
.jump a { color: var(--ink); text-underline-offset: 4px; padding: 8px 0; }

/* Фото сезонов внутри огромной полосы-капсулы */
/* Фото в арке, как в старом зеркале */
.season { position: relative; margin: 0; border-radius: var(--r-arch); overflow: hidden; min-height: 420px; isolation: isolate; }
.season-photos, .finale-photo { position: relative; }
.season-photos { position: absolute; inset: 0; }
.season-photos img, .finale-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: url(#duo); /* одна обработка для всех фото */
}
.season-photos img { opacity: 0; transition: opacity 1600ms ease; }
.season-photos img.on { opacity: 1; }
.season-cap {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); z-index: 1;
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
  padding: 6px 8px 6px 20px; border-radius: 999px; background: var(--bg-deep); font-size: 1.375rem;
}
.season-pause { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--edge); background: none; cursor: pointer; font: 0.9375rem var(--text); }

/* ---------- Три числа ---------- */
.numbers {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: 14vh auto;
  gap: 8px; padding: 96px var(--m) 0;
}
.tile { display: flex; flex-direction: column; justify-content: space-between; padding: 28px; border-radius: var(--r-blob); color: var(--bg-deep); }
.tile span { font-size: 1.0625rem; max-width: 26ch; }
.fig { font: 700 clamp(4.5rem, 8vw, 8rem)/0.9 var(--display); }
.tile-a { grid-column: 1 / 7; grid-row: 1 / 3; min-height: 70vh; background: var(--accent); }
.numbers h2 { grid-column: 7 / 13; grid-row: 1; align-self: center; display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: clamp(2.25rem, 3vw, 3rem); color: var(--heading); }
.sprig { width: 26px; height: 52px; color: var(--sage); flex: 0 0 auto; }
.tile-b { grid-column: 7 / 10; grid-row: 2; min-height: 44vh; align-self: start; background: var(--ink); border-radius: var(--r-blob-2); }
.tile-c { grid-column: 10 / 13; grid-row: 2; min-height: 34vh; align-self: start; margin-top: 12vh; background: var(--ochre); border-radius: 28px 8px 28px 28px; }
.tile-b .fig, .tile-c .fig { font-size: clamp(3.25rem, 5.4vw, 5.5rem); }

/* ---------- Термометр ---------- */
.gauge {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 24px;
  min-height: 100svh; padding: 96px var(--m);
}
.gauge-list { position: relative; grid-column: 1 / 6; grid-row: 1; }
.gauge-sun { width: 64px; height: 64px; color: var(--ochre); margin-bottom: 8px; }
.gauge-list h2 { font-weight: 600; font-style: italic; font-size: clamp(2.25rem, 3.6vw, 3.5rem); line-height: 1.05; color: var(--heading); margin-bottom: 8px; }
.gauge-names { display: flex; flex-direction: column; align-items: flex-start; }
.gauge-names button {
  display: inline-flex; align-items: center; gap: 0.4em;
  border: 0; background: none; padding: 2px 0; cursor: pointer;
  font: 600 clamp(2.25rem, 3.6vw, 3.5rem)/1.08 var(--display); color: var(--muted);
  transition: color 150ms ease;
}
.gauge-names button::before { content: ''; width: 0.28em; height: 0.85em; border-radius: 999px; background: transparent; }
.gauge-names button[aria-pressed="true"] { color: var(--ink); }
.gauge-names button[aria-pressed="true"]::before { background: var(--accent); }
.gauge-col { grid-column: 6 / 10; grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; align-self: center; }
.gauge-track { position: relative; width: min(22vh, 180px); height: 64vh; border-radius: 999px; background: var(--surface); overflow: hidden; }
.gauge-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: 50% 100%; transform: scaleY(0); }
.gauge-val { font: 700 clamp(3rem, 5vw, 4.5rem)/1 var(--display); color: var(--heading); }
.gauge-fact { grid-column: 10 / 13; grid-row: 1; font-size: 1.0625rem; max-width: 26ch; }

/* ---------- Лента года ---------- */
.ribbon { position: relative; height: 74px; }
.ribbon svg:first-child { height: 56px; }
.ribbon .fringe { height: 18px; }
.ribbon svg, .mark svg { display: block; width: 100%; height: 100%; }

/* ---------- Рекорды ---------- */
.records { padding: 96px var(--m); }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rtile { aspect-ratio: 3 / 2; padding: 24px; border-radius: var(--r-blob); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.rtile:nth-child(odd) { border-radius: var(--r-blob-2); }
.rtile b { font: 700 clamp(2.125rem, 3.2vw, 3.125rem)/1 var(--display); color: var(--heading); overflow-wrap: anywhere; }
.rtile span { font-size: 1rem; }
.rtile-head { grid-column: span 2; aspect-ratio: auto; background: var(--accent); color: var(--bg-deep); }
.rtile-head h2 { font-weight: 700; font-size: clamp(2.5rem, 3.8vw, 3.75rem); line-height: 1; }

/* ---------- Меню года ---------- */
.months { padding: 0 var(--m) 96px; }
.months > h2 { font-weight: 600; font-style: italic; font-size: clamp(3rem, 6vw, 5.5rem); color: var(--heading); }
.menu-cat { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 72px 0 32px; }
.menu-cat h3 { font-weight: 600; font-size: clamp(2.125rem, 4vw, 3.5rem); line-height: 1.05; color: var(--heading); }
.menu-cat span { font-size: 1rem; color: var(--muted); white-space: nowrap; }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 64px; }
.menu-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; align-items: start; }
.menu-item svg { width: 64px; height: 40px; border-radius: 6px 6px 14px 14px; display: block; }
.menu-item .row { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; font-size: 1.125rem; }
.menu-item p { font-size: 0.9375rem; color: var(--muted); max-width: 38ch; margin-top: 4px; }
.menu-item .note { color: var(--accent); }

/* ---------- Финал ---------- */
.finale {
  position: relative; overflow: hidden; min-height: 90svh;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; padding: 0 var(--m);
  background: var(--bg-deep);
}
/* Ночное фото в капсуле, срезанное нижним и левым краем секции */
.finale-photo { position: absolute; left: -6vw; bottom: -24svh; width: 58vw; height: 104svh; border-radius: var(--r-arch); overflow: hidden; }
.finale-text { position: relative; grid-column: 9 / 13; grid-row: 1; align-self: center; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 64px 0; }
.finale-text h2 { font-weight: 600; font-size: clamp(2.5rem, 3.4vw, 3.25rem); line-height: 1.02; color: var(--heading); }
.finale-moon { width: 56px; height: 56px; color: var(--ochre); }
.finale-fact { font-size: 2rem; color: var(--ochre); }

/* ---------- Подвал ---------- */
.foot { padding: 0 var(--m) max(24px, env(safe-area-inset-bottom)); background: var(--bg-deep); }
.mark { height: 34svh; padding-top: 48px; }
.foot-cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; margin-top: 56px; font-size: 0.9375rem; }
.foot-cols nav { grid-column: 1 / 9; display: grid; grid-template-columns: repeat(3, max-content); gap: 0 48px; }
.foot-cols nav a { color: var(--ink); text-underline-offset: 4px; padding: 6px 0; }
.foot-cols p { grid-column: 9 / 13; color: var(--muted); }
.foot-cols .credits { grid-row: 2; }
.foot-last { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 40px; font-size: 0.9375rem; color: var(--muted); }

/* ---------- Движение: появление при первой прокрутке до блока ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes sweep { from { clip-path: inset(0 100% 0 0); } }
@keyframes fade { from { opacity: 0; } }
.scrub svg, .ribbon svg { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: no-preference) {
  .motion [data-rise]:not(.in) { opacity: 0; }
  [data-rise].in { animation: rise 400ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
  .scrub svg { animation: sweep 1100ms var(--ease-in-out) both; }
  .motion .ribbon:not(.in) svg { clip-path: inset(0 100% 0 0); }
  .ribbon.in svg { animation: sweep 900ms var(--ease-in-out) both; }
  .gauge-fill { transition: transform 300ms var(--ease-out); }
  .mark rect { transform-box: fill-box; transform-origin: 50% 100%; }
  .motion .mark:not(.in) rect { transform: scaleY(0.04); }
  .mark.in rect { animation: grow 600ms var(--ease-out) both; animation-delay: var(--d, 0ms); }
}
@keyframes grow { from { transform: scaleY(0.04); } }

@media (prefers-reduced-motion: reduce) {
  .motion [data-rise]:not(.in) { opacity: 0; }
  [data-rise].in { animation: fade 200ms ease both; }
  .season-photos img, .btn, .gauge-names button { transition: none; }
}

/* Луне в карточке нужен простор: на iPad в портрете и уже она наезжает на подсказку */
@media (max-width: 1023px) {
  .hero-moon { display: none; }
}

/* ---------- Телефон ---------- */
@media (max-width: 760px) {
  body { font-size: 1rem; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .season { order: -1; min-height: 0; height: 48svh; }
  .hero-card { margin-top: -24px; position: relative; z-index: 1; }
  .scrub { height: 72px; }
  .hero h1 { font-size: 12vw; margin-top: 4px; }

  .numbers { grid-template-columns: 1fr 1fr; grid-template-rows: auto; gap: 6px; padding-top: 64px; }
  .numbers h2 { grid-column: 1 / 3; grid-row: 1; font-size: 2.125rem; }
  .tile-a { grid-column: 1 / 3; grid-row: 2; min-height: 56vw; }
  .tile-a .fig { font-size: 19vw; }
  .tile-b { grid-column: 1; grid-row: 3; min-height: 44vw; }
  .tile-c { grid-column: 2; grid-row: 3; min-height: 44vw; margin-top: 32px; }
  .tile-b .fig, .tile-c .fig { font-size: 14vw; }
  .tile { padding: 18px; }

  .gauge { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-block: 72px; justify-items: center; }
  .gauge-col, .gauge-list, .gauge-fact { grid-column: 1; grid-row: auto; }
  .gauge-track { height: 46svh; width: 34vw; }
  .gauge-list { width: 100%; }
  .gauge-list h2 { font-size: 2.125rem; }
  .gauge-names { flex-direction: row; overflow-x: auto; gap: 24px; scrollbar-width: none; padding-bottom: 4px; }
  .gauge-names button { font-size: 2.125rem; white-space: nowrap; }
  .gauge-fact { justify-self: start; font-size: 1rem; }

  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .rtile-head { min-height: 120px; }
  .rtile { padding: 16px; aspect-ratio: auto; min-height: 128px; }
  .rtile b { font-size: 1.75rem; }

  .months > h2 { font-size: 13vw; }
  .menu-cat h3 { font-size: 9.5vw; }
  .menu-grid { grid-template-columns: minmax(0, 1fr); }
  .menu-item { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; }
  .menu-item svg { width: 52px; height: 32px; }

  .finale { grid-template-columns: minmax(0, 1fr); align-content: start; min-height: 0; padding-bottom: 46svh; }
  .finale-text { grid-column: 1; grid-row: 1; padding: 64px 0 24px; }
  .finale-photo { left: -15vw; bottom: -16svh; width: 130vw; height: 58svh; }
  .finale-text .btn { align-self: stretch; }

  .mark { height: 22svh; }
  .foot-cols { grid-template-columns: minmax(0, 1fr); }
  .foot-cols nav, .foot-cols p { grid-column: 1; }
  .foot-cols nav { grid-template-columns: repeat(2, max-content); }
  .foot-cols .credits { grid-row: auto; }
}

/* Последним: сокращённое свойство font выше сбрасывает вид цифр */
.facts dd, .score b, .rec .big, .outlook li b, .fig, .gauge-val, .rtile b, .readout b, .weekdays b, .menu-item .price, .scrub-read b, .cal .c {
  font-variant-numeric: lining-nums tabular-nums;
}
