/* ============================================================================
   APEC — LANDING · STYLESHEET
   A cover page: the promotion film full-bleed behind an ink vignette, the
   brand mark, and two doorway buttons. Ink / warm cream / brass — the shared
   language of the APEC pages. Content renders from data/landing-data.js.
   ========================================================================== */

:root {
  --ink:        #0a0b0d;
  --ink-2:      #101217;
  --line:       rgba(237, 231, 216, 0.13);
  --cream:      #ede7d8;
  --cream-dim:  #b6afa0;
  --gold:       #c9a45c;
  --gold-hi:    #e6c581;
  --gold-dim:   rgba(201, 164, 92, 0.35);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text:    "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", Consolas, "Courier New", monospace;

  --pad: clamp(1.25rem, 4vw, 4rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 125%; /* +25%: 16→20px base type scale, for PC legibility */ -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-text);
  line-height: 1.6;
  overflow: clip;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

[hidden] { display: none !important; }

::selection { background: var(--gold); color: var(--ink); }

a { color: var(--gold-hi); }

:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

.skip-link {
  position: fixed; top: -4rem; left: 1rem; z-index: 300;
  background: var(--gold); color: var(--ink);
  padding: 0.6rem 1rem; font-family: var(--font-mono); font-size: 0.8rem;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ---- Boot veil ------------------------------------------------------------ */
.veil {
  position: fixed; inset: 0; z-index: 260; background: var(--ink);
  pointer-events: none; opacity: 1; transition: opacity 0.9s var(--ease-out);
}
body.booted .veil { opacity: 0; }

/* The veil returns when the Explore doorway is taken (JS sets body.leaving):
   ink swallows the page while the film gets a slow push-in and the caption
   sinks away. Home boots behind the same ink, so the hand-over reads as one
   continuous cut. */
body.leaving .veil { opacity: 1; transition-duration: 0.62s; }
body.leaving .hero { scale: 1.04; transition: scale 1.2s var(--ease-out); }
body.leaving .hero__stack { opacity: 0; transition: opacity 0.4s ease; }

/* ---- Film grain ----------------------------------------------------------- */
.grain {
  position: fixed; inset: -50%; z-index: 120; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}

/* ---- Custom cursor (identical to the sister pages) ------------------------ */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 500; pointer-events: none;
  border-radius: 50%; opacity: 0;
  will-change: transform;
}
.cursor-dot { width: 6px; height: 6px; background: var(--gold-hi); margin: -3px 0 0 -3px; }
.cursor-ring {
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border: 1px solid rgba(201, 164, 92, 0.65);
  display: grid; place-items: center;
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
              margin 0.3s var(--ease-out), border-color 0.3s, background-color 0.3s;
}
.cursor-ring span {
  font-family: var(--font-mono); font-size: 0.55rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity 0.2s;
  user-select: none;
}
body.cursor-on { cursor: none; }
body.cursor-on a, body.cursor-on button, body.cursor-on [role="button"] { cursor: none; }
body.cursor-on .cursor-dot, body.cursor-on .cursor-ring { opacity: 1; }
.cursor-ring.is-link { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--gold); }
.cursor-ring.is-down { transform: scale(0.85); }

/* ---- Brand mark ------------------------------------------------------------ */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center;
  padding: 1.1rem var(--pad);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand__mark { width: 40px; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong {
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  letter-spacing: 0.04em; color: var(--cream);
}
.brand__text small {
  font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--cream-dim);
}

/* ============================================================================
   THE FILM
   ========================================================================== */
.hero {
  position: relative; height: 100svh;
  overflow: hidden; isolation: isolate;
}

.hero__film { position: absolute; inset: 0; z-index: -2; background: var(--ink-2); }

/* Poster paints first; the film fades in over it once it plays. */
.hero__poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(0.92) contrast(1.02);
  transform: scale(1.04);
}
.hero__vid {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease 0.15s;
}
.hero__vid.is-on { opacity: 1; }

/* When the film and the screen disagree on orientation (a landscape film on
   a portrait phone), JS adds .fit-contain: the WHOLE frame shows, letter-
   boxed in ink, instead of a violent center crop. */
.hero__vid.fit-contain, .hero__poster.fit-contain {
  object-fit: contain; transform: none;
}

/* A quiet vignette so the buttons and brand stay readable on any frame. */
.hero__shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__shade::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(10,11,13,0.5), transparent 26%, transparent 60%, rgba(10,11,13,0.66));
}
.hero__shade::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 16vmin rgba(10, 11, 13, 0.72);
}

/* ---- The two doorways ------------------------------------------------------ */
.hero__stack {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(1.4rem, 3.2vh, 2.1rem);
  padding: 0 var(--pad);
  translate: 0 26vh;
}
.hero__ctas {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 1.1rem;
}

/* The caption around the buttons — only shown on portrait screens, where
   the letterboxed film leaves ink to fill (see .hero--top below). */
.hero__tagline {
  display: none;
  font-family: var(--font-display); font-weight: 380;
  font-size: clamp(1.5rem, 6.4vw, 2.3rem); line-height: 1.15;
  letter-spacing: -0.01em; text-align: center; text-wrap: balance;
  max-width: 16ch;
}
.hero__tagline em { font-style: italic; font-weight: 430; color: var(--gold-hi); }
.hero__event {
  display: none;
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--cream-dim); text-align: center;
  line-height: 2;
}

.btn {
  display: inline-flex; align-items: center; gap: 0.8rem;
  font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none; white-space: nowrap;
  padding: 1.15rem 1.9rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.25s var(--ease-out),
    background-color 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--gold {
  background: var(--gold); color: var(--ink);
  box-shadow: 0 10px 40px -12px rgba(201, 164, 92, 0.55);
}
.btn--gold:hover { background: var(--gold-hi); color: var(--ink); box-shadow: 0 14px 46px -12px rgba(230, 197, 129, 0.6); }

.btn--ghost {
  background: rgba(10, 11, 13, 0.3); color: var(--cream);
  border-color: rgba(237, 231, 216, 0.38); backdrop-filter: blur(8px);
}
.btn--ghost:hover { border-color: var(--cream); color: var(--cream); }

.btn__arrow { font-style: normal; transition: translate 0.25s var(--ease-out); }
.btn:hover .btn__arrow { translate: 0.18rem -0.1rem; }

/* ---- Sound toggle ----------------------------------------------------------- */
.sound {
  position: absolute; right: var(--pad); bottom: 1.4rem; z-index: 5;
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: rgba(10, 11, 13, 0.35); color: var(--cream-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.6rem 1.05rem; backdrop-filter: blur(8px);
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
}
.sound:hover { color: var(--cream); border-color: var(--gold-dim); }
.sound i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cream-dim); transition: background-color 0.25s;
}
.sound.is-on { color: var(--gold-hi); border-color: var(--gold-dim); }
.sound.is-on i { background: var(--gold-hi); animation: sound-pulse 1.6s ease infinite; }
@keyframes sound-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.55; }
}

/* ---- Load reveal ------------------------------------------------------------ */
.reveal-load { opacity: 0; translate: 0 22px; animation: rise 1s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
body:not(.booted) .reveal-load { animation-play-state: paused; }
@keyframes rise { to { opacity: 1; translate: 0 0; } }

/* ---- Noscript ---------------------------------------------------------------- */
.noscript-note {
  position: fixed; inset: auto 1rem 1rem; z-index: 400;
  background: var(--ink-2); border: 1px solid var(--line);
  padding: 1rem 1.25rem; font-size: 0.9rem;
}

/* ---- Responsive --------------------------------------------------------------- */
@media (max-width: 640px) {
  .brand__text small { display: none; }
  .hero__ctas { flex-direction: column; }
  .hero__stack { translate: 0 22vh; }
  .btn { width: min(100%, 20rem); justify-content: center; }
}
@media (max-height: 560px) {
  .hero__stack { translate: 0 18vh; }
}
/* Portrait screens letterbox a landscape film. JS adds .hero--top and sets
   --film-top / --film-bottom (px): the picture is anchored right under the
   brand mark, and the caption group (tagline · buttons · event line) is
   centered in the ink left below it. */
.hero--top .hero__vid.fit-contain,
.hero--top .hero__poster.fit-contain {
  object-position: center var(--film-top, 25%);
}
.hero--top .hero__stack {
  inset: var(--film-bottom, 55vh) 0 3.5rem;   /* bottom clears the sound pill */
  translate: 0 0;
}
.hero--top .hero__tagline, .hero--top .hero__event { display: block; }
/* Same portrait state centers the sound pill under the caption group.
   (Centered with auto margins, NOT translate — the reveal-load animation's
   "forwards" fill pins translate to 0 0 and would undo a -50% shift.) */
.hero--top .sound { left: 0; right: 0; width: fit-content; margin-inline: auto; }

/* ---- Reduced motion & static mode (?static=1 for screenshots/print) ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .veil { transition: none; }
  .reveal-load { animation: none; opacity: 1; translate: 0 0; }
  .cursor-dot, .cursor-ring { display: none; }
  .hero__vid { transition: none; }
  .sound.is-on i { animation: none; }
}

html.static .grain { animation: none; }
html.static .veil { display: none; }
html.static .reveal-load { animation: none; opacity: 1; translate: 0 0; }
html.static .cursor-dot, html.static .cursor-ring { display: none; }
