/* twilight-hall — one continuous flight.
   The engine's own selectors (.sc-world, .sc-copy, [data-sc-*]) are the
   mechanism and are not restyled here. Everything below is this page. */

:root {
  /* Six roles, one accent, sampled from the approved reference frame. */
  --sc-canvas:     #0b1220;
  --sc-surface:    #131c2e;
  --sc-ink:        #f4efe6;
  --sc-ink-soft:   #a3b0c4;
  --sc-accent:     #e8a24a;
  --sc-accent-ink: #14110b;

  --sc-font-display: "Frank Ruhl Libre", "Times New Roman", serif;
  --sc-font-text:    "Assistant", system-ui, sans-serif;

  --rule: color-mix(in oklab, var(--sc-ink) 18%, transparent);
}

html { background: var(--sc-canvas); }
body {
  background: var(--sc-canvas);
  font-family: var(--sc-font-text);
  letter-spacing: 0.006em;
}

::selection { background: var(--sc-accent); color: var(--sc-accent-ink); }
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; border-radius: 4px; }

.candlelight {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(115% 78% at 50% 76%,
              color-mix(in oklab, var(--sc-accent) 16%, transparent) 0%,
              transparent 60%);
}

/* ---------- fixed chrome ------------------------------------------------- */

.bar {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sc-4);
  padding: clamp(0.9rem, 2.4vw, 1.3rem) var(--sc-gutter);
  background: linear-gradient(to bottom,
              color-mix(in oklab, var(--sc-canvas) 78%, transparent),
              transparent);
}
.bar__mark {
  font-family: var(--sc-font-display);
  font-size: 1.05rem; letter-spacing: 0.18em; color: var(--sc-ink);
}

.cta {
  font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
  padding: 0.6rem 1.15rem;
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.02em;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--sc-accent) 70%, transparent);
  background: transparent; color: var(--sc-accent);
  transition: transform 140ms var(--sc-ease-out),
              background-color 200ms var(--sc-ease-out),
              color 200ms var(--sc-ease-out);
}
.cta:hover { background: var(--sc-accent); color: var(--sc-accent-ink); transform: translateY(-1px); }
.cta:active { transform: translateY(1px) scale(0.985); }

/* The route rail. Vertical on the inline edge, because the flight is vertical
   and a horizontal rail would fight the scroll direction. */
.route {
  position: fixed; z-index: 40;
  inset-inline-start: clamp(0.9rem, 2.2vw, 1.6rem);
  inset-block-start: 50%; transform: translateY(-50%);
}
.route__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.route__leg {
  font: inherit; cursor: pointer; background: none; border: 0; padding: 0;
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--sc-ink-soft);
  transition: color 200ms var(--sc-ease-out);
}
.route__leg::before {
  content: ""; inline-size: 7px; block-size: 7px; border-radius: 50%; flex: none;
  border: 1px solid currentColor; background: transparent;
  transition: background-color 220ms var(--sc-ease-out),
              transform 220ms var(--sc-ease-out);
}
.route__leg span {
  font-size: 0.78rem; letter-spacing: 0.08em;
  opacity: 0; transform: translateX(4px);
  transition: opacity 220ms var(--sc-ease-out), transform 220ms var(--sc-ease-out);
}
.route__leg:hover, .route__leg[aria-current="true"] { color: var(--sc-accent); }
.route__leg[aria-current="true"]::before { background: var(--sc-accent); transform: scale(1.25); }
.route:hover .route__leg span,
.route__leg:focus-visible span,
.route__leg[aria-current="true"] span { opacity: 1; transform: none; }

@media (max-width: 700px) {
  /* On a phone the rail is a set of marks, never labels: there is no room for
     a second column of type over the film. */
  .route { inset-inline-start: 0.7rem; }
  .route__list { gap: 0.7rem; }
  .route__leg span { display: none; }
}

/* The engine sizes leg media with a direct-child selector
   (.sc-world__seg > :is(video, img, canvas)). Wrapping the poster in a
   <picture> so the phone gets a portrait frame-holder makes the <img> a
   grandchild, which drops it out of that rule and lays it out at its intrinsic
   size. Put it back, without touching the engine. */
.sc-world__seg > picture { position: absolute; inset: 0; display: block; }
.sc-world__seg > picture > .sc-world__poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ---------- the copy layer ---------------------------------------------- */

/* Every block is a plate on the world. The engine owns their opacity and their
   capped translateY; these rules own where they sit and how the type inside
   them arrives. */
/* The copy layer is a plain fixed box, not a grid, so blocks left in normal
   flow stack one under another and everything past the first falls off the
   screen. Each plate is placed against the layer instead. */
.plate {
  position: absolute;
  inset-inline: 0; margin-inline: auto;
  inline-size: min(46rem, calc(100% - 2 * var(--sc-gutter)));
  text-align: center;
}
/* Every plate sits in the lower band, off the bright centre of the frame,
   because that is the one region the single static scrim protects. A centred
   plate over a lit archway measures 1.68:1 no matter how it is styled. */
.plate--low   { inset-block-end: clamp(4.5rem, 12vh, 9rem); }
.plate--names { inset-block-end: clamp(5rem, 16vh, 11rem); }
.plate--form  { inset-block-end: clamp(1.2rem, 4vh, 2.4rem);
                inline-size: min(34rem, calc(100% - 2 * var(--sc-gutter))); }

/* Density where the copy actually sits, and nowhere else. A centred plate over
   a lit archway cannot be protected by a bottom band, and a full-frame overlay
   would flatten the whole shot to fix one block. */
/* One scrim shape for the whole flight, and it is a plain element rather than
   a copy block: the contrast pass hides every [data-sc-copy] node to photograph
   the frame underneath, so a scrim declared as one is never measured. The stock
   band tops out around 58% of the frame; this world stays bright well past that,
   so the band is taller and denser than the default. */
.sc-world__scrim.sc-scrim--band {
  background: linear-gradient(to top,
    color-mix(in oklab, var(--sc-canvas) 93%, transparent) 0%,
    color-mix(in oklab, var(--sc-canvas) 78%, transparent) 20%,
    color-mix(in oklab, var(--sc-canvas) 44%, transparent) 42%,
    color-mix(in oklab, var(--sc-canvas) 14%, transparent) 62%,
    transparent 78%);
}

.scrim-landing {
  background: linear-gradient(to top,
    color-mix(in oklab, var(--sc-canvas) 90%, transparent) 0%,
    color-mix(in oklab, var(--sc-canvas) 76%, transparent) 40%,
    color-mix(in oklab, var(--sc-canvas) 48%, transparent) 64%,
    color-mix(in oklab, var(--sc-canvas) 16%, transparent) 82%,
    transparent 95%);
  opacity: calc(
    clamp(0, (var(--sc-seg, 0) - 3.2) * 5, 1) *
    clamp(0, (var(--sc-segp, 0) - 0.22) / 0.34, 1));
}

/* Lines arrive on the film. Each `.ink` declares its own place in the queue
   with --i and wipes up from its baseline as the current leg advances, so the
   writing is paced by the camera rather than by a timer. The wipe sits on a
   block with room for descenders; a clip-path on tight display type shears the
   tails off g, y and ץ. */
.ink, .amp {
  --t: clamp(0, calc((var(--sc-segp, 1) - 0.10 - var(--i, 0) * 0.055) / 0.16), 1);
  display: inline-block;
  padding-block: 0.1em;
  clip-path: inset(0 0 calc((1 - var(--t)) * 110%) 0);
  transform: translateY(calc((1 - var(--t)) * 0.22em));
}

.eyebrow {
  margin: 0; font-size: clamp(0.82rem, 2.6vw, 0.95rem);
  letter-spacing: 0.2em; text-indent: 0.2em;
  color: color-mix(in oklab, var(--sc-ink) 82%, transparent);
}

.names {
  margin: 0; font-family: var(--sc-font-display); font-weight: 400;
  font-size: clamp(2.9rem, 12vw, 7rem);
  line-height: 1.02; letter-spacing: -0.02em;
  display: flex; align-items: baseline; justify-content: center;
  gap: clamp(0.5rem, 2.2vw, 1.4rem); flex-wrap: wrap;
}
.names .amp {
  font-size: 0.42em; color: var(--sc-accent);
  font-family: var(--sc-font-text); font-weight: 400;
  transform: translateY(calc((1 - var(--t)) * 0.22em));
}
.under {
  margin: clamp(0.8rem, 2.5vw, 1.3rem) 0 0;
  font-size: clamp(0.86rem, 2.8vw, 1.02rem);
  letter-spacing: 0.18em; text-indent: 0.18em;
  color: color-mix(in oklab, var(--sc-ink) 76%, transparent);
}

.date {
  margin: 0; font-family: var(--sc-font-display);
  font-size: clamp(1.6rem, 6vw, 3rem); font-weight: 400; line-height: 1.2;
  display: flex; justify-content: center; gap: 0 clamp(0.6rem, 2vw, 1.2rem);
  flex-wrap: wrap;
}
.date .ink + .ink::before {
  content: "·"; color: var(--sc-accent);
  margin-inline-end: clamp(0.6rem, 2vw, 1.2rem);
}
.hebdate {
  margin: clamp(0.6rem, 2vw, 0.9rem) 0 0;
  font-size: clamp(0.84rem, 2.6vw, 0.98rem); letter-spacing: 0.14em;
  color: var(--sc-ink-soft);
}

.times { margin: 0; display: grid; gap: clamp(0.7rem, 2.4vw, 1.1rem); justify-items: center; }
.times__row { display: flex; align-items: baseline; gap: clamp(0.7rem, 2.4vw, 1.2rem); }
.times dt {
  font-size: clamp(0.82rem, 2.6vw, 0.95rem); letter-spacing: 0.12em;
  color: var(--sc-ink-soft);
}
.times dd {
  margin: 0; font-family: var(--sc-font-display);
  font-size: clamp(1.7rem, 6.5vw, 3.2rem); font-weight: 400; line-height: 1;
}

.place {
  margin: 0; font-family: var(--sc-font-display);
  font-size: clamp(1.7rem, 6.5vw, 3.2rem); font-weight: 400; line-height: 1.1;
}
.addr {
  margin: clamp(0.4rem, 1.6vw, 0.6rem) 0 0;
  font-size: clamp(0.92rem, 3vw, 1.06rem); color: var(--sc-ink-soft);
}
.actions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(0.6rem, 2vw, 0.9rem);
  margin-block-start: clamp(1.2rem, 4vw, 1.8rem);
}
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.15rem; border-radius: 999px;
  font-size: 0.95rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--rule); color: var(--sc-ink);
  background: color-mix(in oklab, var(--sc-canvas) 55%, transparent);
  transition: transform 140ms var(--sc-ease-out), border-color 180ms var(--sc-ease-out);
}
.btn:hover { border-color: color-mix(in oklab, var(--sc-accent) 65%, transparent); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn svg { inline-size: 1.05em; block-size: 1.05em; flex: none; }

/* ---------- the landing: the form --------------------------------------- */

.plate--form { text-align: start; }
.form {
  display: grid; gap: clamp(0.7rem, 2.2vw, 1rem);
  padding: clamp(1.3rem, 4vw, 1.9rem);
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: color-mix(in oklab, var(--sc-canvas) 94%, transparent);
  box-shadow: 0 clamp(14px, 4vw, 34px) clamp(30px, 8vw, 70px) color-mix(in oklab, #04060c 60%, transparent);
}
.form h2 {
  margin: 0 0 0.2rem; font-family: var(--sc-font-display); font-weight: 400;
  font-size: clamp(1.5rem, 5.5vw, 2rem); text-align: center;
}
.field { display: grid; gap: 0.35rem; }
.field > label, .fieldset > legend {
  font-size: 0.85rem; color: var(--sc-ink-soft); letter-spacing: 0.04em;
}
.field input {
  font: inherit; color: var(--sc-ink);
  background: color-mix(in oklab, #060a13 62%, transparent);
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 0.62rem 0.8rem; inline-size: 100%;
  transition: border-color 160ms var(--sc-ease-out);
}
.field input:hover { border-color: color-mix(in oklab, var(--sc-ink) 32%, transparent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.7rem, 2.2vw, 1rem); }

.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.choices { display: flex; gap: 0.55rem; }
.choice { position: relative; flex: 1; }
.choice input { position: absolute; inset: 0; opacity: 0; inline-size: 100%; block-size: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: block; text-align: center; padding: 0.62rem 0.5rem;
  border: 1px solid var(--rule); border-radius: 8px; font-weight: 600;
  transition: border-color 160ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out);
}
.choice input:checked + span {
  border-color: var(--sc-accent);
  background: color-mix(in oklab, var(--sc-accent) 18%, transparent);
}
.choice input:focus-visible + span { outline: 2px solid var(--sc-accent); outline-offset: 3px; }

.form button[type="submit"] {
  font: inherit; font-weight: 700; cursor: pointer;
  margin-block-start: 0.2rem;
  inline-size: 100%; padding: 0.82rem 1.2rem; border-radius: 999px;
  border: 1px solid var(--sc-accent);
  background: var(--sc-accent); color: var(--sc-accent-ink);
  transition: transform 140ms var(--sc-ease-out), opacity 160ms var(--sc-ease-out);
}
.form button[type="submit"]:hover { transform: translateY(-1px); }
.form button[type="submit"]:active { transform: translateY(1px) scale(0.99); }
.form button[type="submit"][disabled] { opacity: 0.55; cursor: default; transform: none; }

.result {
  margin: 0; padding: 0.75rem 0.9rem; border-radius: 10px;
  font-size: 0.95rem; line-height: 1.45; border: 1px solid var(--rule);
}
.result[hidden] { display: none; }
.result--ok {
  border-color: color-mix(in oklab, var(--sc-accent) 55%, transparent);
  background: color-mix(in oklab, var(--sc-accent) 14%, transparent);
}
.result--bad { border-color: #c9705a; background: color-mix(in oklab, #c9705a 18%, transparent); }

.foot {
  margin: clamp(0.8rem, 2.5vw, 1.1rem) 0 0; text-align: center;
  color: var(--sc-ink-soft); font-size: 0.8rem; letter-spacing: 0.08em;
}

/* ---------- portrait ----------------------------------------------------- */

@media (max-width: 700px) {
  .plate { inline-size: calc(100% - 2 * var(--sc-gutter)); }
  .plate--low { margin-block-end: clamp(3rem, 9vh, 5.5rem); }
  .names { font-size: clamp(2.6rem, 15vw, 4.2rem); }
  .date { font-size: clamp(1.4rem, 8vw, 2rem); }
  .times dd, .place { font-size: clamp(1.5rem, 9vw, 2.2rem); }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .form { padding: 1.1rem; gap: 0.62rem; }
  .field input { padding: 0.55rem 0.7rem; }
  .form button[type="submit"] { padding: 0.72rem 1.1rem; }
}

/* ---------- reduced motion ----------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  /* The posters are the film. Every line is already written; nothing is
     withheld, the invitation just stops being a performance. */
  .ink, .amp { --t: 1; clip-path: none; transform: none; }
  .route__leg span { opacity: 1; transform: none; }
}
