/* v22-journey — «Проснуться»: noise → pause → choice → room, one place brightening by one step per act */
:root {
  --bg: #eef0f2;          /* act 1: the noise */
  --bg-pause: #f5f6f7;    /* act 2–3: the quiet */
  --bg-room: #f3f2ee;     /* act 4: the room, a warm light grey */
  --bg-tint: #e4e8ec;
  --ink: #171a1e;
  --ink-soft: #4f5862;
  --noise: #a9b0b8;
  --line: #cfd5db;
  --accent: #1f5b52;
  --accent-deep: #173f3a;
  --surface: #ffffff;
  --paper: #fafbfc;
  --text: "Onest", system-ui, sans-serif;
  --display: "Oranienbaum", Georgia, serif;
  --measure: 68ch;
  --gutter: 1rem;
  --hold: 0;
}
@media (min-width: 48rem) { :root { --gutter: 2rem; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-deep); }
p { margin: 0 0 1rem; max-width: var(--measure); }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.wrap { max-width: 46rem; margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.3; margin: 0 0 .6rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 8.5vw, 5.2rem); line-height: 1.05; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.4rem; }

/* =========================================================
   THE STAGE — one hero, four acts, driven by [data-act] + the script's state table
   1 noise · 2 pause · 3 doors · 4 room · 5 snooze · 6 plain · 7 opening
   ========================================================= */
html.is-locked { overflow: hidden; height: 100%; }
html.is-locked body { overflow: hidden; height: 100%; }
.stage {
  position: relative;
  z-index: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 4rem 0 3rem;
  overflow: hidden;
  background: var(--bg);
  transition: background-color 1.2s ease-out;
}
html.is-locked .stage { height: 100svh; }
html.js .stage:not(.is-ready) .doors, html.js .stage:not(.is-ready) .now, html.js .stage:not(.is-ready) .room { display: none; }
.stage[data-act="2"], .stage[data-act="3"] { background: var(--bg-pause); }
.stage[data-act="7"] { background: var(--bg-room); }
.stage[data-act="4"] { background: var(--bg-room); }
.stage[data-act="6"] { background: var(--bg-room); min-height: 0; padding: 3rem 0 2.5rem; }
main, .footer { position: relative; z-index: 1; }

/* ---- the chains: slow lines of automatic actions, one active word per line ---- */
.lines { position: absolute; inset: 0; overflow: hidden; color: var(--noise); user-select: none; -webkit-user-select: none; }
.chain {
  position: absolute;
  top: var(--y); left: var(--x); right: 0;
  margin: 0; max-width: none;
  font-size: clamp(.95rem, 1.3vw, 1.2rem);
  line-height: 1.6;
  white-space: nowrap;
  animation: chain-drift var(--per) ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.7s);
  transition: opacity 1.2s ease-out;
}
.chain span { display: inline-block; margin-right: 1.6em; opacity: .1; transition: opacity .9s ease-in-out; }
.chain span.is-on { opacity: .78; color: var(--ink-soft); }
@keyframes chain-drift { from { transform: translateX(0); } to { transform: translateX(8px); } }
.stage.is-quiet .chain { opacity: 0; }
.stage.is-quiet .chain span { transition: none; }
@media (max-width: 48rem) {
  .chain { white-space: normal; right: 1rem; font-size: .9rem; line-height: 1.5; }
}

/* ---- the centre column ---- */
.stage__center { position: relative; z-index: 1; width: 100%; max-width: 70rem; padding-inline: var(--gutter); text-align: center; }
.title { display: inline-block; }
.title h1 { margin: 0; }
/* the headline is the control: it breathes — surfaces among the chains and sinks again — and must be pressed itself */
.wake {
  appearance: none; display: inline-block;
  font: inherit; color: var(--ink); text-align: center;
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 1.1rem;
  padding: .5rem 1.25rem;
  margin: 0;
  cursor: pointer;
  box-shadow: 0 0 60px 44px var(--bg);   /* the soft knockout */
  animation: wake-breathe 7s ease-in-out infinite;
  transition: opacity .35s ease-out, background-color .25s ease-out, border-color .8s ease-out, box-shadow .8s ease-out, color .25s ease-out;
}
@keyframes wake-breathe { 0%, 100% { opacity: .12; } 50% { opacity: 1; } }
/* hover, or keyboard focus after a real key press, holds it at full; the programmatic focus on load must not */
.wake:hover, html.is-keyed .wake:focus-visible { animation: none; opacity: 1; background: var(--surface); outline: none; }
.wake:focus-visible { outline: none; }
html.is-keyed .wake:focus-visible { box-shadow: 0 0 60px 44px var(--bg), 0 0 0 4px var(--accent); }
.wake:active { transform: translateY(1px); }
/* once pressed, the headline is just the headline again */
.wake:disabled, html:not(.js) .wake {
  background: transparent; border-color: transparent; box-shadow: none; animation: none; opacity: 1; cursor: default; color: var(--ink);
}
.stage[data-act="4"] .title, .stage[data-act="6"] .title { padding-top: 0; }

/* ---- act 2: the present second ---- */
.now { margin-top: 1rem; }
.now__clock {
  margin: 0;
  font-family: var(--text); font-weight: 500;
  font-size: clamp(3rem, 12vw, 7.5rem);
  line-height: 1.1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  max-width: none;
}
.now__sep { opacity: .45; }
.now__line { margin: .5rem auto 0; max-width: none; font-family: var(--display); font-size: clamp(1.4rem, 3.2vw, 2.1rem); line-height: 1.3; }
.stage[data-act="2"] .now { animation: settle .9s ease-out both; }
.stage[data-act="3"] .now {
  transform: translateY(-.5rem) scale(.62); transform-origin: top center; opacity: .4;
  transition: transform .9s cubic-bezier(.16, 1, .3, 1), opacity .9s ease-out;
  margin-bottom: -2rem;
}
@keyframes settle { from { opacity: 0; transform: translateY(.6rem); } to { opacity: 1; transform: none; } }

/* ---- act 3: the doors ---- */
.doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.75rem, 3vw, 2.5rem);
  width: min(100%, 44rem);
  margin: 2.5rem auto 0;
}
.stage[data-act="3"] .doors { animation: rise .9s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(1.5rem); } to { opacity: 1; transform: none; } }
.door {
  appearance: none; border: 0; margin: 0; padding: 0;
  background: transparent; color: var(--ink); font: inherit; text-decoration: none;
  cursor: pointer; display: block; min-width: 0;
  outline: none;
}
.door__arch {
  box-sizing: border-box;
  display: flex; align-items: flex-end; justify-content: center;
  height: clamp(16rem, 52vh, 30rem);
  padding: 1rem .5rem 2rem;
  border: 1px solid var(--ink);
  border-radius: 999px 999px 10px 10px;
  transition: background-color .25s ease-out, transform .25s ease-out;
}
.door:hover .door__arch, .door:focus-visible .door__arch { background: var(--surface); }
.door:focus-visible .door__arch { outline: 3px solid var(--accent); outline-offset: -8px; }
.door:active .door__arch { transform: translateY(2px); }
.door__label { font-family: var(--display); font-size: clamp(1.15rem, 2.6vw, 2.1rem); line-height: 1.2; }
@media (max-width: 40rem) {
  .door__arch { height: clamp(12rem, 42svh, 18rem); padding: .75rem .25rem 1.25rem; }
  .door__label { font-size: 1.1rem; }
}
/* opening (act 7): a copy of the chosen arch, fixed at its own screen position, grows until its opening
   fills the viewport; its interior brightens to the room's light; the headline and the clock fade;
   the room (already laid out beneath) fades in with a short delay */
.opening {
  position: fixed; z-index: 1;
  box-sizing: border-box;
  border: 1px solid var(--ink);
  border-radius: 999px 999px 10px 10px;
  background: var(--bg-pause);
  transform-origin: 50% 50%;
  will-change: transform;
  pointer-events: none;
  transition: transform 1.1s cubic-bezier(.45, .02, .2, 1), background-color .7s ease-out, border-color .35s ease-out;
}
.opening.is-open { transform: scale(var(--k, 6)); background: var(--bg-room); border-color: transparent; }
.stage[data-act="7"] .stage__center { z-index: 2; }
.stage[data-act="7"] .title, .stage[data-act="7"] .now { opacity: 0; transition: opacity .4s ease-out; }
.stage[data-act="7"] .room { animation: room-fade .45s ease-out .65s both; }
@keyframes room-fade { from { opacity: 0; } to { opacity: 1; } }
.stage.is-opened[data-act="4"] .room { animation: none; }
.stage.is-opened[data-act="4"] .title { animation: title-back .45s ease-out both; }
@keyframes title-back { from { opacity: 0; } to { opacity: 1; } }

/* ---- act 4: the room ---- */
.room {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem 3rem;
  align-items: center;
  width: 100%;
  margin: 1.5rem auto 0;
  text-align: left;
  outline: none;
}
.stage[data-act="4"] .room { animation: offer-in .7s cubic-bezier(.16, 1, .3, 1) both; }
html:not(.js) .room { margin-top: 3rem; }
@keyframes offer-in { from { opacity: 0; transform: translateY(.75rem); } to { opacity: 1; transform: none; } }
@media (min-width: 60rem) {
  .room { grid-template-columns: 1fr 1.05fr; }
  .stage[data-act="4"] .title, html:not(.js) .title { margin-bottom: .5rem; }
}
.stage[data-act="6"] .room__scene { display: none; }     /* the plain page keeps no theatre */
.stage[data-act="6"] .room { grid-template-columns: 1fr; max-width: 46rem; margin-inline: auto; }
.stage[data-act="6"] .stage__center { max-width: 46rem; text-align: left; }
.stage[data-act="6"] .title { padding-inline: 0; display: block; }
.stage[data-act="6"] .wake { text-align: left; padding-inline: 0; }
.stage[data-act="6"] .room__text { margin-inline: 0; max-width: 42rem; }

.room__scene { position: relative; width: 100%; max-width: 30rem; margin-inline: auto; aspect-ratio: 480 / 520; }
.room__svg { position: absolute; inset: 0; width: 100%; height: auto; 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: 85%;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: .9rem;
  padding: .55rem 1.25rem .55rem .65rem;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: 999px; white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(23, 63, 58, .55);
  transition: background-color .16s ease-out, transform .22s 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.5rem; height: 2.5rem; flex: none; overflow: visible; }
.seat__text { display: flex; flex-direction: column; line-height: 1.3; font-weight: 600; font-size: 1.05rem; }
.seat__text small { font-weight: 400; font-size: .85rem; opacity: .85; }
@keyframes pull-out { from { transform: translate(-50%, -50%) translateY(-14px); } to { transform: translate(-50%, -50%) translateY(0); } }
.stage[data-act="4"] .seat { animation: pull-out .9s cubic-bezier(.16, 1, .3, 1) .35s both; }
@media (max-width: 26rem) { .seat { white-space: normal; padding-right: 1rem; } .seat__text { font-size: .95rem; } }

.room__text { max-width: 36rem; margin-inline: auto; }
.lede { font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.35; max-width: 26em; margin-bottom: .6rem; font-family: var(--display); }
.support { color: var(--ink-soft); max-width: 32em; margin-bottom: 1.5rem; }
.facts { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 0; max-width: 36em; }
.facts li { padding-right: .75em; margin-right: .75em; 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(--ink-soft); }
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1.25rem; }
.picker__label { color: var(--ink-soft); }
.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: 1rem; color: var(--ink);
  background: transparent; border: 0; border-radius: 999px;
  padding: .45em 1.1em; cursor: pointer;
  transition: background-color .16s ease-out, color .16s ease-out;
}
.picker__options button:hover { background: var(--bg-tint); }
.picker__options button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.room__actions { max-width: none; margin: 0; }
.btn--plain { display: none; }
.stage[data-act="6"] .btn--plain { display: inline-block; }
.textlink { display: inline-block; margin-left: .25rem; }

/* ---- buttons ---- */
.btn {
  display: inline-block;
  font: inherit; font-weight: 600;
  padding: .95rem 1.6rem; border-radius: .5rem;
  background: var(--accent); color: #fff; text-decoration: none;
  border: 1px solid var(--accent); cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(23, 26, 30, .4);
  transition: background .2s ease-out, transform .2s ease-out;
}
.btn:hover { background: var(--accent-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[data-loading] { opacity: .65; cursor: progress; }
.btn[data-loading]::after { content: "…"; }
.btn--secondary { background: transparent; color: var(--accent); box-shadow: none; }
.btn--secondary:hover { background: var(--accent); color: #fff; }

/* =========================================================
   SECTIONS
   ========================================================= */
main { background: var(--bg-room); }
.section { position: relative; padding: 3.5rem 0; }
.section--tint { background: var(--bg-tint); padding-left: 1rem; padding-right: 1rem; }
.section--tint .wrap { padding-inline: 0; max-width: calc(46rem - 2 * var(--gutter)); }
@media (min-width: 48rem) { .section--tint { padding-left: 2rem; padding-right: 2rem; } }
.concepts, .faq { margin: 1.5rem 0 0; max-width: var(--measure); }
.concepts div, .faq div { display: grid; gap: .25rem 1.5rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.concepts div:last-child, .faq div:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 40rem) { .concepts div, .faq div { grid-template-columns: 14rem 1fr; } }
dt { font-family: var(--display); font-size: 1.3rem; line-height: 1.3; }
dd { margin: 0; }
.steps { padding-left: 1.4rem; margin: 1rem 0 1.5rem; max-width: var(--measure); }
.steps li { padding-left: .4rem; margin-bottom: .5rem; }
.steps li::marker { color: var(--accent); font-weight: 600; }
.people { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .people { grid-template-columns: 16rem 1fr; gap: 2.5rem; } }
.photo {
  aspect-ratio: 4 / 5; max-width: 16rem;
  display: grid; place-items: center; padding: 1rem;
  background: var(--paper); border: 1px dashed var(--noise); border-radius: .5rem;
  color: var(--ink-soft);
}
.name { font-weight: 600; margin-bottom: .25rem; }

/* ---- the registration stub (v11's torn ticket) ---- */
.stub { background: var(--surface); margin: 2.5rem auto 0; max-width: 50rem; border-radius: .75rem; padding: 3rem 0 2.5rem; transform-origin: left top; }
@media (max-width: 52rem) { .stub { margin-inline: var(--gutter); } }
.perf { position: absolute; left: 0; right: 0; top: 0; height: 0; border-top: 2px dashed var(--line); margin: 0 .9rem; }
.perf::before, .perf::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-room); }
.perf::before { left: -.9rem; transform: translateX(-50%); }
.perf::after { right: -.9rem; transform: translateX(50%); }
@media (prefers-reduced-motion: no-preference) {
  .stub { transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
  .stub.is-torn { transform: translateY(10px) rotate(-1.2deg); }
}
.note { font-size: .9rem; color: var(--ink-soft); border-left: 1px solid var(--line); padding-left: .75rem; }
.form { max-width: 34rem; margin-top: 1.5rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
legend, .field label { display: block; font-weight: 500; margin-bottom: .5rem; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ink); }
.choice input { accent-color: var(--accent); margin: 0; }
.field { margin-bottom: 1.25rem; }
input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%; font: inherit; padding: .7rem .85rem;
  border: 1px solid var(--line); border-radius: .5rem; background: var(--paper); color: var(--ink);
  caret-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: #66747a; }
input:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
.hint { font-size: .9rem; color: var(--ink-soft); margin: .5rem 0 0; }
.consent { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: 1.5rem; max-width: var(--measure); }
.consent input { accent-color: var(--accent); margin-top: .3rem; }
.done { max-width: 34rem; margin-top: 1.5rem; padding: 1.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: .5rem; }
.done h3 { margin-bottom: .75rem; }

/* ---- countdown ---- */
.countdown { text-align: center; }
.countdown p { margin-inline: auto; }
.countdown__label, .countdown__live, .countdown__ended { color: var(--ink-soft); margin-bottom: 1rem; }
.countdown__live, .countdown__ended { display: none; font-family: var(--display); font-size: 1.8rem; color: var(--ink); }
.countdown[data-state="live"] .countdown__label, .countdown[data-state="live"] .countdown__grid,
.countdown[data-state="ended"] .countdown__label, .countdown[data-state="ended"] .countdown__grid { display: none; }
.countdown[data-state="live"] .countdown__live, .countdown[data-state="ended"] .countdown__ended { display: block; }
.countdown__grid { display: flex; justify-content: center; gap: 1.5rem 2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.countdown__grid b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(2.5rem, 7vw, 4rem); line-height: 1.3; font-variant-numeric: tabular-nums; }
.countdown__grid span { font-size: .9rem; color: var(--ink-soft); }
.countdown__date { font-weight: 500; }

/* ---- footer ---- */
.footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--line); font-size: .95rem; background: var(--bg-room); }
.footer p { margin-bottom: .5rem; }

/* ---- reduced motion: no cycling, the choice shown directly ---- */
@media (prefers-reduced-motion: reduce) {
  .chain, .wake { animation: none; }
  .stage, .title, .now, .doors, .room, .seat, .door__arch, .stub, .chain, .chain span, .opening { animation: none !important; transition: none !important; }
  .wake { opacity: 1; }
}
/* ?act=N previews: the resting state of an act, with no motion (review aid) */
html.is-still .stage, html.is-still .stage * { animation: none !important; transition: none !important; }
/* no JS: lines static with one active word each, the doors under the headline, the room below, page scrollable */
html:not(.js) .chain { animation: none; opacity: .5; }
html:not(.js) .now { display: none; }
html:not(.js) .doors { display: grid; animation: none; }
html:not(.js) .room { display: grid; margin-top: 3rem; }
html:not(.js) .stage { min-height: 0; }
