/* ==========================================================================
   До тридцати. Тёмная комната, тридцать свечей, один огонь.
   Цвета: ночь, воск, пламя. Шрифты: Cormorant Garamond (голос) и Ysabeau Office (данные).
   ========================================================================== */

:root {
  color-scheme: dark;

  --night: #000;
  --soot: #14100b;                          /* подложка подсказок */
  --wax: #f3e9d6;                           /* основной текст */
  --tallow: #b9ae98;                        /* второстепенный текст */
  --ash: #80786a;                           /* подписи осей, примечания */
  --hair: rgba(243, 233, 214, 0.13);
  --hair-strong: rgba(243, 233, 214, 0.32);
  --flame: #ffb648;

  /* графики: проверено валидатором на чёрном фоне (различимость при дальтонизме, контраст) */
  --grid: #1d1a16;
  --axis: #3b362e;
  --s-out: #3987e5;                         /* съехали от родителей */
  --s-wed: #c98500;                         /* женились; капитал */
  --s-dad: #d55181;                         /* стали отцами */
  --r-1: #6b4700;                           /* семейное положение: один → в отношениях → женат */
  --r-2: #9a6600;
  --r-3: #c98500;
  --r-rest: #5f5a52;                        /* в разводе */

  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Ysabeau Office", "Ysabeau", "Segoe UI", system-ui, -apple-system, sans-serif;

  --gutter: clamp(20px, 5vw, 56px);
  --measure: 1120px;
  --dgw: 0.5em;                             /* ширина одной цифры; уточняется скриптом после загрузки шрифта */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--wax);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }

::selection { background: rgba(255, 182, 72, 0.32); color: #fff; }

:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.noscript { padding: 24px var(--gutter); color: var(--tallow); }

/* ---------- Шапка ---------- */

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
}
.wordmark { font: italic 500 22px/1 var(--serif); color: var(--wax); }

.lang { display: flex; gap: 2px; margin-right: -8px; }
.lang__btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 9px 8px;
  font: 500 14px/1 var(--sans);
  letter-spacing: 0.06em;
  color: var(--ash);
  cursor: pointer;
}
.lang__btn:hover { color: var(--wax); }
.lang__btn[aria-pressed="true"] {
  color: var(--wax);
  text-decoration: underline;
  text-decoration-color: var(--flame);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
}

/* ---------- Первый экран ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter);
  overflow: hidden;                         /* свечение не должно раздвигать страницу вбок */
}
@supports (overflow: clip) { .hero { overflow: visible; overflow-x: clip; } }
.hero__text {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 68px 0 24px;
}

.intro, .count {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.intro { transition: opacity 0.3s ease; }
.intro.is-leaving { opacity: 0; }
.count { transition: opacity 1.5s ease; }
.count.is-entering { opacity: 0; }

.intro__title {
  margin: 0 0 0.3em;
  font: 500 clamp(34px, 4.6vw, 64px)/1.04 var(--serif);
  letter-spacing: -0.014em;
  text-wrap: balance;
}
.intro__lead {
  margin: 0;
  max-width: 34em;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.5;
  color: var(--tallow);
  text-wrap: pretty;
}

/* ---------- Форма ---------- */

.form {
  margin-top: clamp(22px, 3.2vw, 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.form__fields {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;                    /* линии под полями на одном уровне */
  gap: 20px clamp(24px, 4.5vw, 56px);
}
.field { border: 0; margin: 0; padding: 0; min-width: 0; text-align: left; }
.field__label { padding: 0; margin-bottom: 4px; font-size: 15px; line-height: 1.3; color: var(--tallow); }
.field__hint { color: var(--ash); }

.segs {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font: 500 clamp(30px, 4.4vw, 46px)/1 var(--serif);
}
.segs__sep { color: var(--ash); }
.seg {
  width: 1.5em;
  padding: 4px 0 6px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hair-strong);
  border-radius: 0;
  color: var(--wax);
  font: inherit;
  font-variant-numeric: lining-nums;
  text-align: center;
  caret-color: var(--flame);
  outline: none;
}
.seg--4 { width: 2.7em; }
.seg::placeholder { color: var(--ash); opacity: 0.55; font-weight: 400; }
.seg:hover { border-bottom-color: var(--tallow); }
.seg:focus { border-bottom-color: var(--flame); box-shadow: 0 1px 0 var(--flame); }

.form__error { margin: 0; max-width: 30em; font-weight: 500; font-size: 16px; color: #ffb39a; }
.form__note { margin: 0; max-width: 36em; font-size: 14.5px; line-height: 1.45; color: var(--ash); text-wrap: pretty; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 15px 30px 16px;
  background: var(--wax);
  color: #000;
  font: 600 17px/1 var(--sans);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.btn:hover { background: var(--flame); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline-offset: 4px; border-radius: 999px; }

.link {
  appearance: none;
  background: none;
  border: 0;
  padding: 6px 2px;
  color: var(--tallow);
  font: 500 16px/1.2 var(--sans);
  text-decoration: underline;
  text-decoration-color: var(--hair-strong);
  text-underline-offset: 5px;
  cursor: pointer;
}
.link:hover { color: var(--wax); text-decoration-color: var(--flame); }

/* ---------- Отсчёт: предложение с живыми числами ---------- */

.count__lead {
  margin: 0 0 0.5em;
  font: italic 500 clamp(21px, 2.4vw, 30px)/1.2 var(--serif);
  color: var(--tallow);
}
.count__time {
  margin: 0;
  font: 500 clamp(26px, 8.6vw, 44px)/1.14 var(--serif);
  letter-spacing: -0.012em;
}
html[lang="en"] .count__time { font-size: clamp(24px, 7.6vw, 42px); }

.ct-u { display: inline-block; white-space: nowrap; }
.ct-n { font-weight: 500; font-variant-numeric: lining-nums; }
.dg { display: inline-block; width: var(--dgw); text-align: center; }
.ct-w, .ct-and, .ct-ago { font-style: italic; font-weight: 400; color: var(--tallow); }
.ct-w > span { display: none; }
.ct-w > span.on { display: inline; }
/* У секунд все формы слова лежат в одной ячейке, видна одна: строка не дёргается, когда «секунд» сменяется «секундой». */
.ct-u[data-u="s"] .ct-w { display: inline-grid; text-align: left; }
.ct-u[data-u="s"] .ct-w > span { display: inline; grid-area: 1 / 1; visibility: hidden; }
.ct-u[data-u="s"] .ct-w > span.on { visibility: visible; }
.br-d { display: none; }

.count__when {
  margin: clamp(18px, 2.4vw, 28px) 0 0;
  max-width: 36em;
  color: var(--tallow);
  text-wrap: balance;
}
.count__actions { margin: 14px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; }

@media (min-width: 720px) {
  .count__time, html[lang="en"] .count__time { font-size: clamp(42px, 5.3vw, 76px); line-height: 1.07; }
  html[lang="en"] .count__time { font-size: clamp(38px, 4.8vw, 70px); }
  .br-d { display: inline; }
  .br-m { display: none; }
}

/* ---------- Свечи ---------- */

.candles {
  position: relative;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 0 16px;
}
.candles__row {
  --fw: clamp(10px, 1.7vw, 22px);           /* ширина пламени */
  --room: calc(var(--fw) * 2.2 + 14px);     /* место над самой высокой свечой под пламя */
  --glow: clamp(320px, 56vw, 760px);
  position: relative;
  isolation: isolate;
  height: clamp(112px, 20vh, 220px);
  transition: height 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  grid-template-rows: 100%;
  align-items: end;
  border-bottom: 1px solid var(--hair);
  outline-offset: 8px;
}
.candle {
  --h: 1;
  --lum: 0.17;
  --hl: 50%;
  --boost: 0;
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.candle.is-hover { --boost: 0.62; }
/* когда отсчёт запущен, свечам отдаётся больше места */
body[data-state="count"] .candles__row { height: clamp(132px, 31vh, 350px); }
.candle__body {
  position: relative;
  width: clamp(5px, 1vw, 13px);
  height: calc(var(--h) * (100% - var(--room)));
  min-height: 3px;
}
.candle__wax {
  --l: max(var(--lum), var(--boost));
  position: absolute;
  inset: 0;
  border-radius: 2.5px 2.5px 0 0;
  background: linear-gradient(90deg,
    hsl(34 30% calc(4% + var(--l) * 26%)) 0%,
    hsl(40 52% calc(7% + var(--l) * 66%)) var(--hl),
    hsl(32 28% calc(3% + var(--l) * 20%)) 100%);
}
.candle__wick {
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1.5px;
  height: 5px;
  margin-left: -0.75px;
  border-radius: 1px 1px 0 0;
  background: hsl(30 22% calc(9% + var(--lum) * 16%));
}
.candle__glow {
  display: none;
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 100%;
  width: var(--glow);
  aspect-ratio: 1;
  translate: -50% 47%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side,
    rgba(255, 190, 100, 0.36) 0%,
    rgba(255, 164, 64, 0.17) 20%,
    rgba(255, 140, 40, 0.07) 46%,
    rgba(255, 130, 30, 0) 100%);
}
.flame {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  width: var(--fw);
  height: calc(var(--fw) * 2.2);
  margin-left: calc(var(--fw) / -2);
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transform-origin: 50% 100%;
  filter: blur(0.35px);
}

.candle.is-lit .flame {
  opacity: 1;
  animation: flame-sway 2.3s ease-in-out infinite, flame-breathe 1.31s ease-in-out infinite alternate;
}
.candle.is-lit .candle__glow { display: block; animation: glow-pulse 3.7s ease-in-out infinite; }
.candle.is-lit .candle__wick { background: linear-gradient(0deg, #2a1c10, #ff9d3c); }
.candle.is-lit .candle__wax::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: min(100%, 64px);
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 228, 176, 0.95) 0%, rgba(255, 200, 120, 0.35) 45%, rgba(255, 190, 110, 0) 100%);
}
/* отблеск на столе */
.candle.is-lit::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: clamp(110px, 20vw, 280px);
  height: 2px;
  translate: -50% 0;
  background: radial-gradient(closest-side, rgba(255, 196, 110, 0.95), rgba(255, 170, 70, 0));
  pointer-events: none;
}

/* после тридцати: последний фитиль тлеет */
.candle.is-ember .candle__wick { background: #ff8a3a; box-shadow: 0 0 7px 1px rgba(255, 140, 60, 0.85); }
.candle.is-ember .candle__glow { display: block; width: calc(var(--glow) * 0.45); opacity: 0.5; }

@keyframes flame-sway {
  0%, 100% { rotate: -2.2deg; }
  22% { rotate: 1.6deg; }
  47% { rotate: -1deg; }
  71% { rotate: 2.4deg; }
  86% { rotate: -0.6deg; }
}
@keyframes flame-breathe {
  from { scale: 1 0.94; }
  to { scale: 1.05 1.07; }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.92; }
  35% { opacity: 1; }
  62% { opacity: 0.84; }
  80% { opacity: 0.97; }
}

.candles__axis {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  margin-top: 8px;
  font-size: 13px;
  line-height: 1;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}
.candles__axis span { justify-self: center; white-space: nowrap; }

.candles__caption {
  margin: 14px auto 0;
  max-width: 47em;
  text-align: center;
  font-size: 16px;
  line-height: 1.45;
  color: var(--tallow);
  text-wrap: balance;
}
.age-live { color: var(--wax); font-variant-numeric: tabular-nums; }

/* ---------- Разделы отчёта ---------- */

.section {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(88px, 13vw, 168px) var(--gutter) 0;
}
.section__title {
  margin: 0 0 0.32em;
  max-width: 15em;
  font: 500 clamp(34px, 4.8vw, 60px)/1.04 var(--serif);
  letter-spacing: -0.014em;
  text-wrap: balance;
}
.section__lead {
  margin: 0 0 clamp(36px, 5vw, 60px);
  max-width: 34em;
  font: 500 clamp(19px, 2vw, 23px)/1.42 var(--serif);
  color: var(--tallow);
  text-wrap: pretty;
}
.section__closing {
  margin: clamp(26px, 4vw, 40px) 0 0;
  max-width: 34em;
  font: italic 500 clamp(19px, 2vw, 23px)/1.42 var(--serif);
  color: var(--tallow);
}

/* ---------- В других единицах ---------- */

.qty {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: clamp(14px, 2vw, 24px);
}
.qty__row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
  padding: 12px 0 14px;
  border-top: 1px solid var(--hair);
}
.qty__row:last-child { border-bottom: 1px solid var(--hair); }
.qty__n {
  justify-self: end;
  font: 500 clamp(27px, 3.3vw, 40px)/1 var(--serif);
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}
.qty__l { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; line-height: 1.3; }
.qty__note { font-size: 15px; color: var(--ash); }

/* выходные: строка на каждый год жизни, точка на каждые выходные */
.weekends { margin: clamp(44px, 6vw, 76px) 0 0; min-width: 0; }
.weekends__title { margin: 0 0 8px; font: 500 clamp(26px, 3vw, 34px)/1.1 var(--serif); }
.weekends__note { margin: 0 0 22px; max-width: 40em; font-size: 16px; color: var(--tallow); }
.weekends__years { display: grid; row-gap: 12px; outline-offset: 8px; }
.wkyear { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
.wkyear__label { font-size: 15px; line-height: 18px; color: var(--ash); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wkyear__dots { display: flex; flex-wrap: wrap; margin-left: -5px; }
.wk { flex: none; width: 18px; height: 18px; display: grid; place-items: center; }
.wk::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tallow);
  opacity: 0.5;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.wk.is-hover::before { opacity: 1; background: var(--wax); transform: scale(1.4); }
.wk.is-next::before {
  opacity: 1;
  background: var(--flame);
  box-shadow: 0 0 0 3px rgba(255, 182, 72, 0.18), 0 0 14px rgba(255, 170, 60, 0.75);
}
.weekends__years.is-dense .wk { width: 14px; height: 14px; }
.weekends__years.is-dense .wkyear__dots { margin-left: -3px; }
.weekends__years.is-spent .wk::before { opacity: 0.32; }
.weekends__years.is-spent .wk.is-hover::before { opacity: 1; }

/* ---------- Средний мужчина ---------- */

.block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  padding: 30px 0 clamp(44px, 6vw, 76px);
  border-top: 1px solid var(--hair);
}
.block__title { grid-column: 1 / -1; margin: 0; font: 500 clamp(26px, 3vw, 34px)/1.1 var(--serif); }

.facts { min-width: 0; }
.fact { margin: 0 0 22px; display: flex; flex-direction: column; gap: 6px; }
.fact__v {
  font: 500 clamp(30px, 3.5vw, 42px)/1 var(--serif);
  font-variant-numeric: lining-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.fact--lead .fact__v { font-size: clamp(54px, 7vw, 88px); letter-spacing: -0.022em; }
.fact__l { font-size: 16px; line-height: 1.35; color: var(--tallow); }
.fact__note { margin: -12px 0 30px; font-size: 15px; color: var(--ash); }
.facts__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 4px 28px; }
.fact__lead { margin: 0 0 14px; font: 500 clamp(26px, 3vw, 34px)/1.14 var(--serif); }

/* семейное положение: одна полоса, разбитая на доли */
.split { display: flex; gap: 2px; height: 28px; margin: 0 0 14px; }
.split__part {
  flex: var(--share) 1 0;
  min-width: 3px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  border-radius: 4px;
  background: var(--c);
  color: #fff;
  font: 600 13.5px/1 var(--sans);
  white-space: nowrap;
  outline-offset: 2px;
}
.split__part--ink { color: #0b0b0b; }
.split__part.is-tight { padding-left: 0; }
.split__part.is-tight span { display: none; }
.split__part.is-hover { filter: brightness(1.18); }

.split-legend {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: grid;
  gap: 5px;
  font-size: 15px;
  line-height: 1.3;
  color: var(--tallow);
}
.split-legend li { display: flex; align-items: center; gap: 9px; }
.split-legend i { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.split-legend b { font-weight: 600; color: var(--wax); font-variant-numeric: tabular-nums; }

/* ---------- Графики ---------- */

.chart { margin: 0; min-width: 0; }
.chart__title { margin-bottom: 10px; font-weight: 600; font-size: 16px; line-height: 1.3; }
.chart__plot svg { display: block; width: 100%; height: auto; overflow: visible; outline-offset: 6px; touch-action: pan-y; }

.legend { display: flex; flex-wrap: wrap; gap: 5px 22px; margin: 0 0 8px; font-size: 15px; line-height: 1.3; color: var(--tallow); }
.legend__item { display: inline-flex; align-items: center; gap: 8px; }
.legend__key { flex: none; width: 16px; border-top: 2px solid var(--c); border-radius: 2px; }
.legend__val { font-weight: 600; color: var(--wax); font-variant-numeric: tabular-nums; }

.ch-grid { stroke: var(--grid); stroke-width: 1; }
.ch-axis { stroke: var(--axis); stroke-width: 1; }
.ch-thirty { stroke: var(--axis); stroke-width: 1; }
.ch-tick { fill: var(--ash); font: 400 12.5px var(--sans); font-variant-numeric: tabular-nums; }
.ch-tick--key { fill: var(--wax); font-weight: 600; }
.ch-area { opacity: 0.1; }
.ch-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch-you { stroke: var(--wax); stroke-opacity: 0.4; stroke-width: 1; }
.ch-dot { stroke: #000; stroke-width: 2; }
.ch-label, .ch-endlabel {
  font: 600 13.5px var(--sans);
  paint-order: stroke;
  stroke: #000;
  stroke-width: 4px;
  stroke-linejoin: round;
  font-variant-numeric: tabular-nums;
}
.ch-label { fill: var(--wax); }
.ch-endlabel { fill: var(--tallow); font-weight: 500; }
.ch-cross { stroke: var(--tallow); stroke-opacity: 0.7; stroke-width: 1; }
.ch-hit { fill: transparent; cursor: crosshair; }

.tableview { margin-top: 10px; font-size: 15px; color: var(--tallow); }
.tableview summary {
  width: fit-content;
  list-style: none;
  cursor: pointer;
  color: var(--ash);
  text-decoration: underline;
  text-decoration-color: var(--hair-strong);
  text-underline-offset: 4px;
}
.tableview summary::-webkit-details-marker { display: none; }
.tableview summary:hover { color: var(--wax); }
.tableview table { width: 100%; max-width: 560px; margin-top: 12px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tableview th, .tableview td { padding: 6px 0 6px 14px; border-top: 1px solid var(--hair); text-align: right; font-weight: 400; }
.tableview th:first-child { padding-left: 0; text-align: left; }
.tableview thead th { border-top: 0; color: var(--ash); vertical-align: bottom; }
.tableview tr.is-you th, .tableview tr.is-you td { color: var(--wax); font-weight: 600; }

/* ---------- Расписание ---------- */

.tt { list-style: none; margin: 0; padding: 0; max-width: 860px; border-bottom: 1px solid var(--hair); }
.tt__row {
  display: grid;
  grid-template-columns: 3.3em minmax(0, 1fr);
  column-gap: clamp(14px, 2.4vw, 28px);
  align-items: baseline;
  padding: 11px 0 13px;
  border-top: 1px solid var(--hair);
}
.tt__age {
  font: 500 clamp(22px, 2.4vw, 27px)/1 var(--serif);
  font-variant-numeric: lining-nums;
  text-align: right;
  white-space: nowrap;
}
.tt__what { line-height: 1.35; }
.tt__when { grid-column: 2; font-size: 15px; line-height: 1.35; color: var(--ash); font-variant-numeric: tabular-nums; }
.tt__row.is-past .tt__age, .tt__row.is-past .tt__what { color: var(--ash); }
.tt__row.is-next .tt__when { color: var(--wax); }

.tt__now { align-items: center; padding: 15px 0 16px; border-top-color: rgba(255, 182, 72, 0.6); }
.tt__now + .tt__row { border-top-color: rgba(255, 182, 72, 0.6); }
.tt__flame { justify-self: end; width: 12px; height: 26px; overflow: visible; }
.tt__nowtext { font: italic 500 clamp(21px, 2.3vw, 26px)/1.2 var(--serif); }

/* ---------- Подвал, подсказка, уведомление ---------- */

.footer {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: clamp(96px, 14vw, 180px) auto 0;
  padding: 30px var(--gutter) 56px;
  border-top: 1px solid var(--hair);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ash);
}
body[data-state="intro"] .footer { display: none; }
.footer__title { margin: 0 0 10px; font: 600 15px/1.3 var(--sans); color: var(--tallow); }
.footer p { margin: 0 0 12px; max-width: 46em; }
.footer a { color: var(--tallow); text-decoration: underline; text-decoration-color: var(--hair-strong); text-underline-offset: 3px; }
.footer a:hover { color: var(--wax); text-decoration-color: var(--flame); }
.footer__joke { color: var(--tallow); }

.tip {
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  max-width: min(290px, calc(100vw - 20px));
  padding: 9px 12px 10px;
  background: var(--soot);
  border: 1px solid var(--hair-strong);
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.75);
  font-size: 14.5px;
  line-height: 1.38;
  color: var(--tallow);
  pointer-events: none;
}
.tip__title { font-weight: 600; color: var(--wax); }
.tip__row { display: flex; align-items: baseline; gap: 8px; }
.tip__key { flex: none; align-self: center; width: 12px; border-top: 2px solid var(--c); }
.tip__val { font-weight: 600; color: var(--wax); font-variant-numeric: tabular-nums; white-space: nowrap; }

.toast {
  position: fixed;
  z-index: 110;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  translate: -50% 12px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--wax);
  color: #000;
  font: 600 15px/1 var(--sans);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, translate 0.25s ease;
}
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ---------- Вкладки ---------- */

.tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: clamp(22px, 5vw, 52px);
  height: 60px;
  background: var(--night);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.tabs__tab {
  position: relative;
  appearance: none;
  background: none;
  border: 0;
  padding: 0 2px;
  font: 500 clamp(19px, 2.1vw, 22px)/1 var(--serif);
  color: var(--ash);
  cursor: pointer;
}
.tabs__tab:hover, .tabs__tab[aria-selected="true"] { color: var(--wax); }
.tabs__tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--flame);
}
.tabs__tab:focus-visible { outline-offset: -6px; }
/* вкладки видны внизу первого экрана и прилипают к верху при прокрутке */
body[data-state="count"] .hero { min-height: calc(100vh - 61px); min-height: calc(100svh - 61px); }

/* ---------- Место рождения: поле с подсказками ---------- */

.place { position: relative; width: 9.2em; max-width: 100%; font: 500 clamp(26px, 3.4vw, 34px)/1.2 var(--serif); }
.place__input {
  width: 100%;
  padding: 4px 0 6px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hair-strong);
  border-radius: 0;
  color: var(--wax);
  font: inherit;
  caret-color: var(--flame);
  outline: none;
  text-overflow: ellipsis;
}
.place__input::placeholder { color: var(--ash); opacity: 0.55; font-weight: 400; }
.place__input:hover { border-bottom-color: var(--tallow); }
.place__input:focus { border-bottom-color: var(--flame); box-shadow: 0 1px 0 var(--flame); }
.place__list {
  position: absolute;
  z-index: 40;
  left: 0;
  top: calc(100% + 6px);
  min-width: 100%;
  width: max-content;
  max-width: min(360px, 86vw);
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--soot);
  border: 1px solid var(--hair-strong);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8);
  font: 400 16px/1.3 var(--sans);
  text-align: left;
}
.place__item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.place__item:hover, .place__item[aria-selected="true"] { background: rgba(243, 233, 214, 0.09); }
.place__name { font-weight: 500; color: var(--wax); }
.place__sub { font-size: 14px; color: var(--ash); }
.place__status { margin: 6px 0 0; max-width: 18em; font: 400 14px/1.35 var(--sans); color: var(--ash); text-align: left; }
.place__status:empty { display: none; }

/* ---------- Натальная карта ---------- */

.glyph { font-family: "Noto Sans Symbols", "Segoe UI Symbol", "Apple Symbols", sans-serif; font-style: normal; font-weight: 400; }

#panel-natal .block__title { margin-top: clamp(36px, 5vw, 56px); }
#panel-natal .section__lead + .block__title, #panel-natal .verdict .block__title { margin-top: 0; }

.natal__meta .link { font-size: 16px; }
.natal__notice {
  max-width: 46em;
  margin: 0 0 30px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  font-size: 16px;
  color: var(--tallow);
}
.natal__notice p { margin: 0 0 12px; }
.natal__note { margin: 0 0 10px; max-width: 46em; color: var(--tallow); }
.natal__disclaimer {
  margin: clamp(40px, 6vw, 64px) 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  max-width: 46em;
  font-size: 15px;
  color: var(--ash);
}

.natal__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: start; }

.wheel { margin: 0; min-width: 0; }
.wheel__svg { display: block; width: 100%; max-width: 600px; height: auto; margin: 0 auto; overflow: visible; outline-offset: 6px; }
.wheel__cap { margin-top: 14px; display: grid; gap: 6px; justify-items: center; text-align: center; font-size: 15px; color: var(--ash); }
.wheel__cap .legend { justify-content: center; margin: 0; }

.wh-ring { fill: none; stroke: var(--hair-strong); stroke-width: 1; }
.wh-ring--in { stroke: var(--axis); }
.wh-div { stroke: var(--hair-strong); stroke-width: 1; }
.wh-tick, .wh-cusp, .wh-lead { stroke: var(--axis); stroke-width: 1; }
.wh-axis { stroke: var(--tallow); stroke-width: 1.5; }
.wh-mark { stroke: var(--wax); stroke-width: 1.5; }
.wh-asp { stroke-width: 1.25; }
.wh-sign, .wh-glyph { font-family: "Noto Sans Symbols", "Segoe UI Symbol", "Apple Symbols", sans-serif; text-anchor: middle; dominant-baseline: central; }
.wh-sign { fill: var(--tallow); font-size: 24px; font-weight: 300; }
.wh-glyph { fill: var(--wax); font-size: 25px; font-weight: 400; }
.wh-house, .wh-deg, .wh-angle { font-family: var(--sans); text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; }
.wh-house, .wh-deg { fill: var(--ash); font-size: 11.5px; }
.wh-angle { fill: var(--wax); font-size: 12px; font-weight: 600; }
.wh-hit { fill: transparent; }
.wh-body.is-hover .wh-glyph { fill: var(--flame); }

.big3 { display: grid; gap: 24px; }
.big3__item { padding-top: 18px; border-top: 1px solid var(--hair); }
.big3__title { margin: 0; display: flex; align-items: baseline; gap: 10px; font: 500 clamp(26px, 3vw, 34px)/1.1 var(--serif); }
.big3__title .glyph { font-size: 0.78em; color: var(--tallow); }
.big3__role { margin: 4px 0 8px; font-size: 15px; color: var(--ash); }
.big3__text { margin: 0; max-width: 34em; color: var(--tallow); }

.verdict { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.verdict__col { padding-top: 22px; border-top: 1px solid var(--hair); }
.verdict__col--go { border-top-color: rgba(255, 182, 72, 0.6); }
.verdict__list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.verdict__list li { position: relative; max-width: 34em; padding-left: 22px; line-height: 1.45; }
.verdict__list li::before { content: ""; position: absolute; left: 2px; top: 0.66em; width: 9px; height: 1.5px; background: var(--tallow); }
.verdict__col--go li::before { background: var(--flame); }

.star {
  margin: 0 0 clamp(40px, 6vw, 64px);
  padding: 26px 0 30px;
  border-top: 1px solid rgba(255, 182, 72, 0.6);
  border-bottom: 1px solid var(--hair);
}
.star__label { margin: 0 0 8px; font: italic 500 clamp(21px, 2.3vw, 26px)/1.2 var(--serif); color: var(--tallow); }
.star__date { margin: 0 0 14px; font: 500 clamp(40px, 6.4vw, 84px)/1.02 var(--serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.star__text { margin: 0; max-width: 40em; color: var(--tallow); }

.sky { list-style: none; margin: 14px 0 0; padding: 0; max-width: 860px; }
.sky li { padding: 12px 0 13px; border-top: 1px solid var(--hair); line-height: 1.45; }
.sky li:last-child { border-bottom: 1px solid var(--hair); }

.ahead { list-style: none; margin: 14px 0 0; padding: 0; max-width: 860px; border-bottom: 1px solid var(--hair); }
.ahead__row { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding: 13px 0 15px; border-top: 1px solid var(--hair); }
.ahead__date { font: 500 clamp(21px, 2.3vw, 25px)/1.1 var(--serif); font-variant-numeric: lining-nums; white-space: nowrap; }
.ahead__what { display: grid; gap: 3px; }
.ahead__title { font-weight: 600; }
.ahead__text { font-size: 16px; line-height: 1.45; color: var(--tallow); }
.ahead__when { font-size: 15px; color: var(--ash); font-variant-numeric: tabular-nums; }

.pos { list-style: none; margin: 14px 0 16px; padding: 0; border-bottom: 1px solid var(--hair); }
.pos__row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 3px;
  align-items: baseline;
  padding: 11px 0 12px;
  border-top: 1px solid var(--hair);
}
.pos__glyph { font-size: 21px; line-height: 1; text-align: center; }
.pos__glyph--abbr { font: 600 12px/1 var(--sans); color: var(--tallow); }
.pos__name { font-weight: 600; }
.pos__where { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos__where .glyph { color: var(--tallow); }
.pos__r { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--flame); text-decoration: none; cursor: help; }
.pos__house { grid-column: 2 / -1; font-size: 15px; color: var(--ash); }
.pos__house:empty { display: none; }
.pos__text { grid-column: 2 / -1; font-size: 16px; line-height: 1.45; color: var(--tallow); }

.meters { display: grid; gap: 8px; max-width: 520px; margin: 16px 0 18px; }
.meter { display: grid; grid-template-columns: 5.5em minmax(0, 1fr) 2em; column-gap: 12px; align-items: center; font-size: 16px; }
.meter__name { color: var(--tallow); }
.meter__bar { height: 8px; border-radius: 4px; background: rgba(201, 133, 0, 0.2); }
.meter__bar i { display: block; height: 100%; border-radius: 4px; background: var(--r-3); }
.meter__val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.asp { list-style: none; margin: 14px 0 0; padding: 0; max-width: 860px; border-bottom: 1px solid var(--hair); }
.asp__row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 3px;
  align-items: center;
  padding: 11px 0 13px;
  border-top: 1px solid var(--hair);
}
.asp__icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.asp__title { font-weight: 600; }
.asp__orb { font-size: 15px; color: var(--ash); white-space: nowrap; font-variant-numeric: tabular-nums; }
.asp__text { grid-column: 2 / -1; font-size: 16px; line-height: 1.45; color: var(--tallow); }

@media (min-width: 720px) {
  .ahead__row { grid-template-columns: 9.5em minmax(0, 1fr) auto; column-gap: clamp(14px, 2.4vw, 28px); align-items: baseline; }
  .ahead__when { text-align: right; white-space: nowrap; }
}
@media (min-width: 900px) {
  .natal__top { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: clamp(40px, 5vw, 80px); }
  .verdict { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(48px, 7vw, 104px); }
  .pos__row { grid-template-columns: 30px 9.5em 11.5em 4.5em minmax(0, 1fr); column-gap: 14px; }
  .pos__house, .pos__text { grid-column: auto; }
  .pos__house:empty { display: block; }
}

/* На узком экране дата и время стоят друг под другом с общим левым краем. */
@media (max-width: 519px) {
  .form__fields { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; }
}

/* ---------- Широкие экраны ---------- */

@media (min-width: 720px) {
  .tt__row { grid-template-columns: 4.4em minmax(0, 1fr) auto; }
  .tt__when { grid-column: auto; text-align: right; white-space: nowrap; }
  .tt__now { grid-template-columns: 4.4em minmax(0, 1fr); }
}

@media (min-width: 720px) {
  .wkyear { grid-template-columns: 5.4em minmax(0, 1fr); column-gap: 14px; }
}

@media (min-width: 900px) {
  /* восемь строк в две колонки по четыре */
  .qty { grid-template-columns: max-content minmax(0, 1fr) clamp(8px, 4vw, 56px) max-content minmax(0, 1fr); }
  .qty__row { grid-column: 1 / span 2; grid-row: var(--r); }
  .qty__row:nth-child(n+5) { grid-column: 4 / span 2; }
  .qty__row:nth-child(4) { border-bottom: 1px solid var(--hair); }
  .block {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    column-gap: clamp(48px, 7vw, 104px);
    row-gap: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
