/* The Tour teaser. The coat of the Winesy demo, pinned by the brief: warm
   obsidian ground, gold as the only colour, cream for reading, Bodoni Moda for
   display, Jost for text, square corners and unhurried easing. The uppercase
   tracked labels and the gold sheen are the Winesy look the brief asks for. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("fonts/bodoni-moda-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("fonts/jost-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---- tokens ----------------------------------------------------------- */

:root {
  /* Primitives */
  --obsidian-1000: #000000;
  --obsidian-950: #0b0908;
  --obsidian-900: #131010;
  --obsidian-850: #1b1613;
  --obsidian-800: #241d19;
  --obsidian-700: #3a2f27;
  --gold-300: #eed9a3;
  --gold-400: #e2c275;
  --gold-500: #c9a227;
  --cream-100: #f5efe4;
  --cream-300: #d6cbb8;
  --cream-500: #a1937e;

  /* Roles */
  --ground: var(--obsidian-950);
  --panel: var(--obsidian-900);
  --panel-raised: var(--obsidian-850);
  --stage: var(--obsidian-700);
  --ink-title: var(--cream-100);
  --ink: var(--cream-300);
  --ink-muted: var(--cream-500);
  --gold: var(--gold-400);
  --gold-light: var(--gold-300);
  --gold-leaf: var(--gold-500);
  --on-gold: var(--obsidian-950);
  --line-faint: rgb(226 194 117 / 0.18);
  --line: rgb(226 194 117 / 0.34);
  /* A border that alone draws a control: 3:1 or more on the ground. */
  --line-control: rgb(226 194 117 / 0.62);
  --wash: rgb(226 194 117 / 0.1);
  --light: rgb(226 194 117 / 0.11);
  --light-strong: rgb(226 194 117 / 0.14);
  --silhouette-lit: var(--obsidian-800);
  --silhouette-dark: var(--obsidian-1000);
  --focus: var(--gold-400);
  --sheen: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.35) 50%, transparent 65%);

  /* Faces and sizes */
  --face-display: "Bodoni Moda", Didot, Georgia, serif;
  --face-body: "Jost", system-ui, sans-serif;
  --size-micro: 0.625rem;
  --size-label: 0.6875rem;
  --size-note: 0.75rem;
  --size-button: 0.8125rem;
  --size-brand: 0.875rem;
  --size-small: 0.9375rem;
  --size-body: 1rem;
  --size-name: 1.5rem;
  --size-figure: 1.875rem;
  --size-invite: 2.125rem;
  --size-display: clamp(2.25rem, 10vw, 3rem);
  --size-display-tight: clamp(2.125rem, 9.6vw, 2.75rem);
  --size-title: clamp(2.375rem, 12vw, 4rem);
  --track-label: 0.26em;
  --track-button: 0.2em;
  --track-brand: 0.32em;
  --track-title: 0.08em;

  /* Space */
  --gutter: 1.5rem;
  --gap-xs: 0.25rem;
  --gap-sm: 0.875rem;
  --gap-md: 1.125rem;
  --gap-lg: 1.5rem;
  --gap-xl: 1.75rem;

  /* Motion */
  --ease-lux: cubic-bezier(0.16, 1, 0.3, 1);
  --t-hover: 160ms;
  --t-swap: 600ms;
  --t-enter: 500ms;
  --t-light: 900ms;
  --t-lock: 520ms;

  --layer-content: 1;
  --layer-chrome: 10;

  color-scheme: dark;
}

/* ---- base ------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--face-body);
  font-size: var(--size-body);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

body.locked {
  overflow: hidden;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: var(--layer-chrome);
  padding: var(--gap-sm) var(--gap-lg);
  background: var(--gold-leaf);
  color: var(--on-gold);
  font-size: var(--size-button);
  text-decoration: none;
}

.skip:focus {
  top: var(--gutter);
}

#dust {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: var(--layer-content);
}

.brand {
  position: fixed;
  top: max(1.25rem, env(safe-area-inset-top));
  left: 50%;
  translate: -50% 0;
  margin: 0;
  z-index: var(--layer-chrome);
  font-family: var(--face-display);
  font-size: var(--size-brand);
  font-weight: 600;
  letter-spacing: var(--track-brand);
  padding-left: var(--track-brand);
  color: var(--gold);
  transition: opacity var(--t-swap) var(--ease-lux);
}

.brand.hide {
  opacity: 0;
}

/* ---- screens ---------------------------------------------------------- */

.screen {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 5.5rem var(--gutter) 4rem;
  text-align: center;
}

.stack {
  position: relative;
  z-index: var(--layer-content);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-lg);
  width: 100%;
  max-width: 26rem;
}

.eyebrow {
  margin: 0;
  font-size: var(--size-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  padding-left: var(--track-label);
  text-transform: uppercase;
  color: var(--gold);
}

.display {
  margin: 0;
  font-family: var(--face-display);
  font-weight: 500;
  font-size: var(--size-display);
  line-height: 1.12;
  letter-spacing: 0.01em;
  color: var(--ink-title);
}

.body {
  margin: 0;
  max-width: 34ch;
  color: var(--ink);
}

.small {
  margin: 0;
  font-size: var(--size-small);
  color: var(--ink);
}

.note {
  margin: 0;
  font-size: var(--size-note);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

/* ---- buttons ---------------------------------------------------------- */

.cta,
.ghost {
  appearance: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--face-body);
  text-transform: uppercase;
  transition:
    background-color var(--t-hover) var(--ease-lux),
    border-color var(--t-hover) var(--ease-lux),
    color var(--t-hover) var(--ease-lux),
    transform var(--t-hover) var(--ease-lux);
}

.cta {
  position: relative;
  overflow: hidden;
  width: 16.25rem;
  max-width: 100%;
  height: 3.25rem;
  background: var(--gold-leaf);
  color: var(--on-gold);
  font-size: var(--size-button);
  font-weight: 600;
  letter-spacing: var(--track-button);
  padding-left: var(--track-button);
}

/* Gold leaf catches the light: one slow sweep, the shine the brief asks for. */
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sheen);
  transform: translateX(-120%);
  animation: sheen 5s var(--ease-lux) 1.2s infinite;
}

.cta:hover {
  background: var(--gold);
}

.cta:active {
  transform: translateY(1px);
}

.cta:disabled {
  cursor: default;
}

.ghost {
  width: 13.75rem;
  max-width: 100%;
  height: 3rem;
  background: var(--ground);
  border: 1px solid var(--line-control);
  color: var(--gold);
  font-size: var(--size-note);
  font-weight: 500;
  letter-spacing: var(--track-button);
  padding-left: var(--track-button);
}

.ghost:hover {
  background: var(--wash);
  border-color: var(--gold);
  color: var(--gold-light);
}

.cta:focus-visible,
.ghost:focus-visible,
.pause:focus-visible,
.skip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@keyframes sheen {
  0% {
    transform: translateX(-120%);
  }
  30%,
  100% {
    transform: translateX(120%);
  }
}

/* ---- the invitation --------------------------------------------------- */

.hero .stack {
  gap: var(--gap-xl);
}

.invite {
  position: relative;
  width: 16.25rem;
  height: 21.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-lg);
  padding-top: 3.5rem;
}

.arch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.arch-outer {
  fill: var(--panel);
  stroke: var(--line);
  stroke-width: 1;
}

.arch-inner {
  fill: none;
  stroke: var(--line-faint);
  stroke-width: 1;
}

.arch-shine {
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 90 1400;
  stroke-dashoffset: 0;
  animation: trace 7s linear infinite;
}

@keyframes trace {
  to {
    stroke-dashoffset: -1490;
  }
}

.faces {
  position: relative;
  display: grid;
}

.invite-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  transition:
    opacity var(--t-swap) var(--ease-lux),
    transform var(--t-swap) var(--ease-lux);
}

.invite .display {
  font-size: var(--size-invite);
}

.face-open {
  opacity: 0;
  transform: translateY(10px);
}

/* The seal: the lock set in a gold-ringed medallion. */
.seal {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-raised);
  box-shadow:
    inset 0 0 0 1px var(--line),
    inset 0 0 0 6px var(--panel-raised),
    inset 0 0 0 7px var(--line-faint);
}

.lock {
  width: 2.25rem;
  height: 2.625rem;
  overflow: visible;
}

.shackle {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3.4;
  transition: transform var(--t-lock) var(--ease-lux);
}

.lock-body {
  fill: var(--gold-leaf);
}

.keyhole {
  fill: var(--on-gold);
}

.invite.opened .shackle {
  transform: translateY(-9px);
}

.invite.opened .face-closed {
  opacity: 0;
  transform: translateY(-10px);
}

.invite.opened .face-open {
  opacity: 1;
  transform: none;
}

/* ---- stage scenes ----------------------------------------------------- */

#chapter-one,
.mystery {
  align-content: end;
  grid-template-rows: auto auto;
  gap: 0.5rem;
}

.scene {
  width: min(24.375rem, 100%);
  height: auto;
  display: block;
  overflow: visible;
}

.cone {
  fill: var(--light);
  transition: opacity var(--t-light) ease-out;
}

.cone.strong {
  fill: var(--light-strong);
}

.pool {
  fill: var(--light);
}

.pool.strong {
  fill: var(--light-strong);
}

.platform {
  fill: var(--stage);
}

.platform-edge {
  fill: var(--line);
}

/* Backlit by the spot: a thin gold rim keeps the lit figure readable. */
.figure {
  fill: var(--silhouette-lit);
  stroke: var(--silhouette-lit);
  filter: drop-shadow(0 0 1px var(--line-control));
}

.figure.dark {
  fill: var(--silhouette-dark);
  stroke: var(--silhouette-dark);
  filter: none;
}

.figure .limb {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.figure .mic {
  fill: var(--gold);
  stroke: none;
}

/* The light switches on as the chapter arrives. */
.scene .lights {
  opacity: 0;
}

.screen.lit .lights {
  opacity: 1;
  animation: switch-on var(--t-light) steps(1, end);
}

@keyframes switch-on {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  30% {
    opacity: 0.3;
  }
  45%,
  100% {
    opacity: 1;
  }
}

/* ---- names ------------------------------------------------------------ */

.names {
  display: flex;
  gap: var(--gap-sm);
  width: 100%;
  justify-content: center;
}

.name {
  flex: 0 1 9.375rem;
  min-width: 0;
  height: 3.5rem;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--stage);
  font-family: var(--face-display);
  font-size: var(--size-name);
  color: var(--ink-muted);
}

.name s {
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
}

#chapter-two .display {
  font-size: var(--size-display-tight);
}

/* ---- the mystery ------------------------------------------------------ */

.mystery .stack {
  gap: var(--gap-md);
}

.title {
  margin: 0;
  font-family: var(--face-display);
  font-size: var(--size-title);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--track-title);
  padding-left: var(--track-title);
  color: var(--gold);
  white-space: nowrap;
}

.countdown {
  display: flex;
  gap: 0.625rem;
  width: 100%;
  justify-content: center;
}

.unit {
  flex: 0 1 4.5rem;
  min-width: 0;
  height: 5.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
  border: 1px solid var(--line);
  background: var(--ground);
}

.unit span {
  font-family: var(--face-display);
  font-size: var(--size-figure);
  font-weight: 500;
  line-height: 1;
  color: var(--ink-title);
  font-variant-numeric: lining-nums tabular-nums;
}

.unit small {
  font-size: var(--size-micro);
  font-weight: 500;
  letter-spacing: var(--track-button);
  padding-left: var(--track-button);
  text-transform: uppercase;
  color: var(--gold);
}

/* ---- the one control for the moving shine ------------------------------ */

.pause {
  position: fixed;
  right: max(0.5rem, env(safe-area-inset-right));
  top: max(0.5rem, env(safe-area-inset-top));
  z-index: var(--layer-chrome);
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--t-hover) var(--ease-lux);
}

.pause:hover {
  color: var(--gold);
}

.pause svg {
  width: 1.125rem;
  height: 1.125rem;
}

.pause .when-paused,
.pause[aria-pressed="true"] .when-running {
  display: none;
}

.pause[aria-pressed="true"] .when-paused {
  display: block;
}

body.still-shine .cta::after,
body.still-shine .arch-shine {
  animation: none;
  opacity: 0;
}

/* ---- arrivals --------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--t-enter) var(--ease-lux),
    transform var(--t-enter) var(--ease-lux);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transform: none;
  }
  .invite-face,
  .shackle {
    transition: opacity var(--t-swap) linear;
    transform: none !important;
  }
  .cta::after,
  .arch-shine {
    animation: none;
    opacity: 0;
  }
  .scene .lights,
  .screen.lit .lights {
    animation: none;
    opacity: 1;
  }
  .pause {
    display: none;
  }
}
