/* v23-split — «Два экрана»: the feed that never stops, the room that clears while your attention is on it */

:root {
  --feed-ground: #e9ebef;
  --feed-ink: #767f89;
  --ground: #f1f2ef;        /* the room and the page: warm-neutral, not cream */
  --surface: #ffffff;
  --tint: #e7ece7;
  --ink: #1b211f;
  --muted: #5a6562;
  --accent: #1f5b52;
  --accent-deep: #173f3a;
  --line: #d3d7d1;
  --gutter: max(16px, 5vw);
  --display: "Oranienbaum", "Times New Roman", serif;
  --text: "Onest", system-ui, sans-serif;
  --p: 0;                   /* attention progress 0..1 */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}
::selection { background: var(--tint); color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-deep); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0 0 0.45em; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 1.6rem + 3.2vw, 4.2rem); }
h2 { font-size: clamp(1.85rem, 1.4rem + 1.8vw, 2.5rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
.measure { max-width: 36em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 46rem; margin-inline: auto; padding-inline: var(--gutter); }

/* ========== the split ========== */

.split {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100svh;
  overflow: hidden;
}
.split > .feed, .split > .room-half { min-width: 0; min-height: 0; overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .split:not(.no-anim) { transition: grid-template-columns 0.9s cubic-bezier(0.16, 1, 0.3, 1), grid-template-rows 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
}
.split[data-state="up"] { grid-template-columns: 0fr 1fr; }
.split[data-state="usual"] { grid-template-columns: 1fr 0fr; }
/* a collapsing track must have no min-content: drop the room's padding while it closes */
.split[data-state="usual"] .room-half { padding-inline: 0; }
.split[data-state="usual"] .room-inner { width: 0; }

/* --- the feed --- */
.feed {
  position: relative;
  background: var(--feed-ground);
  color: var(--feed-ink);
  user-select: none;
}
.feed__col {
  position: absolute; left: 0; top: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 1.5rem 1rem;
  will-change: transform;
}
.feed__col span { display: block; line-height: 1.25; padding: 0.42rem 0; white-space: nowrap; }
.feed__col .w1 { font-size: 1.05rem; }
.feed__col .w2 { font-size: 1.35rem; }
.feed__col .w3 { font-size: 0.95rem; }
.feed::before, .feed::after {
  content: ""; position: absolute; left: 0; right: 0; height: 18%; pointer-events: none; z-index: 1;
}
.feed::before { top: 0; background: linear-gradient(var(--feed-ground), transparent); }
.feed::after { bottom: 0; background: linear-gradient(transparent, var(--feed-ground)); }

/* --- the room --- */
.room-half {
  position: relative;
  background: var(--ground);
  display: grid;
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2.5rem) var(--gutter);
  outline-offset: -4px;
}
/* until a door is chosen the page does not scroll and the split is not pannable */
html.is-locked { overflow: hidden; }
html.is-locked .split { touch-action: none; user-select: none; }
html.is-locked .split .room-half { cursor: default; }
.room-half:focus-visible { outline: 3px solid var(--accent); border-radius: 0; }
.room-inner { display: grid; gap: 1rem; width: 100%; max-width: 34rem; margin-inline: auto; }
/* only the headline rises above the frost; everything else waits behind it */
.room-text h1 { position: relative; z-index: 3; margin-bottom: 0.35em; }
.lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); line-height: 1.35; max-width: 26em; margin-bottom: 0.5em; }
.support { color: var(--muted); max-width: 32em; font-size: 0.98rem; margin-bottom: 1rem; }

.facts { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 0; max-width: 34em; font-size: 0.98rem; }
.facts li { padding-right: 0.7em; margin-right: 0.7em; border-right: 1px solid var(--line); line-height: 1.35; }
.facts li:last-child { border-right: 0; }
.facts__free { font-weight: 600; color: var(--accent); }
.facts__tz { color: var(--muted); }

.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin-bottom: 0.9rem; }
.picker__label { color: var(--muted); font-size: 0.98rem; }
.picker__options { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 3px; }
.picker__options button {
  font: inherit; font-size: 0.98rem; color: var(--ink);
  background: transparent; border: 0; border-radius: 999px;
  padding: 0.4em 1em; cursor: pointer;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}
.picker__options button:hover { background: var(--tint); }
.picker__options button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.room-more { margin: 0; font-size: 0.98rem; }

.room { position: relative; width: 100%; max-width: min(24rem, calc(38svh * 480 / 520)); margin-inline: auto; aspect-ratio: 480 / 520; }
.split:not([data-state="up"]) .room-text h1 { font-size: clamp(2.2rem, 1.5rem + 2vw, 3.4rem); }
.room__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.win { display: none; }
html:not([data-city]) .win--riga, html[data-city="riga"] .win--riga, html[data-city="kyiv"] .win--kyiv, html[data-city="online"] .win--online { display: block; }
.line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.line--thin { stroke-width: 1.5; }
.line--wall { stroke: var(--line); }
.line--ring { stroke: var(--line); stroke-dasharray: 2 7; }

.seat {
  position: absolute; left: 50%; top: 86%;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 0.8rem;
  padding: 0.5rem 1.15rem 0.5rem 0.6rem;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 999px; white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(23, 63, 58, 0.55);
  transition: background-color 160ms ease-out, transform 220ms cubic-bezier(.2,.8,.2,1);
}
.seat:hover { background: var(--accent-deep); color: #fff; transform: translate(-50%, -50%) translateY(3px); }
.seat:focus-visible { outline-color: var(--accent-deep); outline-offset: 4px; }
.seat__chair { width: 2.3rem; height: 2.3rem; flex: none; overflow: visible; }
.seat__seat { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.seat__back { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.seat__text { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; font-size: 1rem; }
.seat__text small { font-weight: 400; font-size: 0.82rem; opacity: 0.85; }
@media (max-width: 26rem) { .seat { white-space: normal; padding-right: 0.9rem; } .seat__text { font-size: 0.92rem; } }

/* --- the frost: a ground-colour layer whose opacity and blur fall with the hold --- */
.frost {
  position: absolute; inset: 0; z-index: 2;
  background: var(--ground);
  opacity: calc(0.92 * (1 - var(--p)));
  -webkit-backdrop-filter: blur(calc(10px * (1 - var(--p))));
  backdrop-filter: blur(calc(10px * (1 - var(--p))));
}
.split[data-state="clear"] .frost, .split[data-state="up"] .frost, .split[data-state="usual"] .frost { display: none; }
/* until the «Проснуться» door is chosen the room's own controls are not reachable: the doors are the only interaction */
.split[data-state="frosted"] .room-inner { pointer-events: none; }
.split:not([data-state="up"]) .room-rest, .split:not([data-state="up"]) .room { pointer-events: none; }
.split[data-state="frosted"] .room-text h1 { opacity: 1; }
/* the first touch of attention is felt at once: a small lift before the slow clearing begins */
.room-half.is-attended .frost { opacity: calc(0.84 * (1 - var(--p))); }
@media (prefers-reduced-motion: no-preference) {
  .frost { transition: opacity 120ms ease-out; }
}
/* without JS: the room is clear, the doors are links, the page scrolls */
html:not(.js) .frost { display: none; }
html:not(.js) .room-inner, html:not(.js) .room-rest, html:not(.js) .room { pointer-events: auto; }
html:not(.js) .doors { opacity: 1; visibility: visible; pointer-events: auto; }

/* --- the two doors, side by side, centred on the boundary --- */
.doors {
  position: absolute; z-index: 4;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: row; gap: 1rem;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.split[data-state="clear"] .doors { opacity: 1; visibility: visible; pointer-events: auto; }
/* while the doors stand on the boundary, the room's text steps aside so nothing sits under them */
@media (min-width: 53.8rem) {
  .room-half { transition: padding-left 0.5s ease-out; }
  .split[data-state="clear"] .room-half { padding-left: calc(var(--gutter) + 8.5rem); }
}
@media (prefers-reduced-motion: no-preference) {
  .split:not(.no-anim) .doors { transition: opacity 0.6s ease-out 0.2s, visibility 0s linear 0.2s; }
  .split[data-state="frosted"]:not(.no-anim) .doors { transition: opacity 0.35s ease-out, visibility 0s linear 0.35s; }
}
.door {
  display: flex; align-items: flex-end; justify-content: center;
  width: 7.5rem; height: 9.5rem;
  padding: 0 0.5rem 0.9rem;
  border: 1px solid var(--ink);
  border-radius: 999px 999px 8px 8px;
  background: var(--ground);
  color: var(--ink); text-decoration: none;
  font-size: 1rem; line-height: 1.2; text-align: center;
  transition: background-color 0.2s ease-out, transform 0.2s ease-out;
}
.door:hover { background: var(--tint); color: var(--ink); transform: translateY(-2px); }
.door:focus-visible { outline-offset: 4px; }

/* --- the open room: the whole hero --- */
.split[data-state="up"] .room-half { padding-block: clamp(2rem, 6vw, 4rem); }
.split[data-state="up"] .room-inner { max-width: 70rem; }
@media (min-width: 60rem) {
  .split[data-state="up"] .room-inner { grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(1.5rem, 4vw, 4rem); }
  .split[data-state="up"] .room { max-width: 34rem; }
  .split[data-state="up"] h1 { font-size: clamp(2.75rem, 2rem + 4.5vw, 5.25rem); }
}
@keyframes pull-out { from { transform: translate(-50%, -50%) translateY(-14px); } to { transform: translate(-50%, -50%) translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
  .split[data-state="up"]:not(.no-anim) .seat { animation: pull-out 900ms cubic-bezier(.16,1,.3,1) 500ms both; }
}

/* the plain offer after «Как обычно» (and without JS, where it is the only hero) */
html.js .offer { display: none; }
html.js .split[data-state="usual"] ~ main .offer { display: block; }
.offer__title { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.6rem); }

/* --- phones: the halves stack --- */
@media (max-width: 53.75rem) {
  .split { grid-template-columns: 1fr; grid-template-rows: 50svh 50svh; min-height: 100svh; }
  .split[data-state="up"] { grid-template-columns: 1fr; grid-template-rows: 0fr 1fr; }
  .split[data-state="usual"] { grid-template-columns: 1fr; grid-template-rows: 1fr 0fr; }
  .split[data-state="up"] .room-half { min-height: 100svh; }
  .feed__col { padding-block: 1rem; }
  .room-half { padding: 1rem var(--gutter); align-items: start; overflow: hidden; }
  .room-inner { gap: 0.6rem; }
  .room-text h1 { font-size: clamp(1.9rem, 7vw, 2.4rem); margin-bottom: 0.25em; }
  .lead { font-size: 1rem; margin-bottom: 0.3em; }
  .support, .room-more, .lead { display: none; }
  .facts { font-size: 0.88rem; margin-bottom: 0.4rem; }
  .picker { margin-bottom: 0.4rem; }
  .room { max-width: min(11rem, calc(22svh * 480 / 520)); }
  .split[data-state="up"] .support, .split[data-state="up"] .room-more, .split[data-state="up"] .lead { display: block; }
  .split[data-state="up"] .room { max-width: 22rem; }
  .split[data-state="up"] .facts { font-size: 0.98rem; }
  .doors { gap: 0.75rem; }
  .door { width: 6.5rem; height: 7rem; font-size: 0.9rem; padding: 0 0.25rem 0.7rem; }
  /* the doors straddle the horizontal boundary; the headline moves down out from under them */
  .split[data-state="clear"] .room-half { padding-top: 4.75rem; }
}

/* ========== sections ========== */

/* everything after the hero sits above any hero layer, whatever state the hero is in */
main, .footer { position: relative; z-index: 1; }
.section { padding: 3rem 1rem; }
@media (min-width: 48rem) { .section { padding: 5rem 2rem; } }
.section > .wrap { padding-inline: 0; }
.section--tint { background: var(--tint); }
.section .wrap > :last-child { margin-bottom: 0; }

.concepts { margin: 2rem 0 0; display: grid; gap: 0; max-width: 42em; }
.concepts > div { display: grid; gap: 0.15rem 1.5rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.concepts > div:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 40rem) { .concepts > div { grid-template-columns: 12em 1fr; align-items: baseline; } }
.concepts dt { font-family: var(--display); font-size: 1.4rem; color: var(--accent); }
.concepts dd { margin: 0; }

.steps { counter-reset: step; list-style: none; margin: 0 0 1.5rem; padding: 0; max-width: 36em; }
.steps li { counter-increment: step; position: relative; padding: 0.55rem 0 0.55rem 3rem; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.45rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 2px solid var(--accent); color: var(--accent);
  display: grid; place-items: center; font-weight: 600; font-size: 0.95rem; line-height: 1;
  background: var(--surface);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: calc(1rem - 1px); top: 2.6rem; bottom: -0.4rem; border-left: 2px dashed var(--line); }

.people { display: grid; gap: 1.5rem 3rem; align-items: start; }
@media (min-width: 48rem) { .people { grid-template-columns: 14rem 1fr; } }
.people__photo {
  aspect-ratio: 4 / 5; max-width: 14rem; border-radius: 14px; border: 2px dashed var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--muted); padding: 1rem; text-align: center;
}
.people__name { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.25em; }

/* buttons */
.button {
  font: inherit; font-weight: 600; font-size: 1.02rem;
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.8em 1.5em; border-radius: 10px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff; text-decoration: none; cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}
.button:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.button:disabled { opacity: 0.6; cursor: default; }
.button[data-loading]::after { content: ""; width: 1em; height: 1em; border-radius: 50%; border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.button--secondary { background: transparent; color: var(--accent); }
.button--secondary:hover { background: var(--accent); color: #fff; }

/* registration: the detached stub */
.stub { padding-block: clamp(2rem, 6vw, 4rem); }
.stub__card {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 2rem;
  box-shadow: 0 18px 40px -26px rgba(27, 33, 31, 0.4);
  transform-origin: left top;
}
@media (prefers-reduced-motion: no-preference) {
  .stub__card { transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
  .stub__card.is-torn { transform: translateY(10px) rotate(-1.2deg); }
}
.perf { position: absolute; left: 0; right: 0; top: 0; height: 0; border-top: 2px dashed var(--line); }
.perf::before, .perf::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--ground); }
.perf::before { left: -12px; }
.perf::after { right: -12px; }

.preview-note { display: inline-block; font-size: 0.92rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: 0.35em 0.75em; margin-bottom: 1.5rem; }
.form { max-width: 34em; }
.form fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
.form legend, .field > label { display: block; font-weight: 600; margin-bottom: 0.5rem; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choices label { display: inline-flex; align-items: center; gap: 0.5em; cursor: pointer; padding: 0.55em 0.9em; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color 160ms ease-out, background-color 160ms ease-out; }
.choices label:hover { border-color: var(--accent); }
.choices label:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.choices label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.choices input { margin: 0; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); width: 1.1em; height: 1.1em; }
.field { margin-bottom: 1.4rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  font: inherit; width: 100%; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 0.7em 0.9em; caret-color: var(--accent);
  transition: border-color 160ms ease-out;
}
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field input:user-invalid { border-color: #9b3b2e; }
.field textarea { resize: vertical; min-height: 5.5em; }
.field input::placeholder { color: #66716d; opacity: 1; }
.hint { font-size: 0.92rem; color: var(--muted); margin: 0.4rem 0 0; }
.field--check label { display: grid; grid-template-columns: auto 1fr; gap: 0.6em; align-items: start; font-weight: 400; }
.field--check input { margin-top: 0.3em; }
.microcopy { font-size: 0.92rem; color: var(--muted); margin: 1rem 0 0; max-width: 34em; }
.done { max-width: 34em; padding: 1.5rem; border-radius: 12px; background: var(--tint); border: 1px solid var(--line); }
.done h3 { margin-bottom: 0.4em; }
.done > :last-child { margin-bottom: 0; }

.faq { margin: 2rem 0 0; }
.faq div { display: grid; gap: 0.15rem; padding: 0.8rem 0; border-top: 1px solid var(--line); }
.faq div:last-child { border-bottom: 1px solid var(--line); }
.faq dt { font-weight: 600; }
.faq dd { margin: 0; color: var(--muted); }

/* countdown */
.countdown { text-align: center; }
.countdown__label { font-size: 1.05rem; color: var(--muted); margin-bottom: 0.75rem; }
.countdown__clock { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 2rem; margin-bottom: 1rem; }
.countdown__clock span { display: flex; flex-direction: column; align-items: center; min-width: 4.5rem; }
.countdown__clock b { font-family: var(--display); font-weight: 400; font-size: clamp(2.5rem, 2rem + 3vw, 4.5rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown__clock i { font-style: normal; color: var(--muted); font-size: 0.95rem; }
.countdown__date { font-size: 1.1rem; margin: 0; }
.countdown .countdown__live, .countdown .countdown__ended { display: none; }
.countdown[data-state="live"] .countdown__before, .countdown[data-state="ended"] .countdown__before { display: none; }
.countdown[data-state="live"] .countdown__live { display: block; color: var(--accent); font-size: 1.6rem; font-weight: 600; }
.countdown[data-state="ended"] .countdown__ended { display: block; font-size: 1.6rem; font-weight: 600; color: var(--ink); }

.footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--line); font-size: 0.98rem; }
.footer p { margin-bottom: 0.4em; }
