/* ==========================================================================
   mia16.party — style
   Palette + type tokens from the brand board. Mobile-first (390px), dark only.
   Structure: one pinned .stage holds every .scene stacked; scroll cross-fades
   between them (see main.js). Reduced-motion / no-js collapse to normal flow.
   ========================================================================== */

:root {
  --noir:      #080808;
  --bordeaux:  #5B2032;
  --plum:      #432231;
  --gold:      #D8B46A;
  --cream:     #F8F5EF;
  --rose:      #CFA2AE;

  --gold-pale: #F6E7B8;
  --gold-text: #E8CB88;              /* brighter gold for small labels on noir */
  --cream-60:  rgba(248, 245, 239, .80);
  --cream-40:  rgba(248, 245, 239, .62);
  --gold-30:   rgba(216, 180, 106, .30);
  --gold-15:   rgba(216, 180, 106, .15);

  /* Licensed brand faces first; free fallbacks after.
     Add @font-face rules for Editorial New / Beloved Script / Neue Haas
     Grotesk here when the files are available and they take over automatically. */
  --serif:   "Editorial New", "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --script:  "Beloved Script", "Pinyon Script", "Snell Roundhand", cursive;
  --grotesk: "Neue Haas Grotesk Display", "Neue Haas Grotesk", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-lux: cubic-bezier(.65, 0, .2, 1);
}

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

html {
  background: var(--noir);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--noir);
  color: var(--cream);
  font-family: var(--grotesk);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Filmic vignette over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(0,0,0,.55) 100%),
    radial-gradient(60% 40% at 50% 100%, rgba(91,32,50,.18), transparent 70%);
}

/* Subtle grain so the black reads as film, not flat pixels */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: .055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .8 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

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

main {
  position: relative;
  z-index: 3;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
/* Solid champagne gold everywhere. (Gradient-clipped text made iOS Safari
   rescale it during momentum scroll — and solid simply looks better here.) */
.metal {
  color: #E3C27E;
  -webkit-text-fill-color: #E3C27E;
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--grotesk);
  font-weight: 500;
  font-size: .68rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold-text);
  text-indent: .3em; /* balance the trailing tracking */
}
.eyebrow__rule {
  display: block;
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-30));
}
.eyebrow__rule:last-child {
  background: linear-gradient(90deg, var(--gold-30), transparent);
}
.eyebrow__text { white-space: nowrap; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   The stage — one pinned viewport, scenes stacked and cross-faded
   -------------------------------------------------------------------------- */
.stage {
  position: relative;
  height: calc(var(--scenes, 5) * 108vh); /* scroll budget ≈ 90vh per scene */
}
.stage__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden; /* clips the parting mask + oversized ghost type */
}
.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 24px;
  opacity: 0;              /* JS cross-fades these; no-js/reduced-motion show them */
  will-change: opacity;
  pointer-events: none;
}

/* No JS: fall back to a normal stacked document */
html.no-js .stage { height: auto; }
html.no-js .stage__pin { position: static; height: auto; overflow: visible; }
html.no-js .scene { position: relative; opacity: 1; min-height: 100svh; }

/* --------------------------------------------------------------------------
   1. Hero
   -------------------------------------------------------------------------- */
.scene--hero { padding: max(32px, env(safe-area-inset-top)) 24px 90px; }

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}
.hero__eyebrow { margin-bottom: 8px; }

/* Monogram — M and Q interlock via negative tracking, Q sits a hair lower */
.monogram {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(6.5rem, 30vw, 13.5rem);
  line-height: .86;
  letter-spacing: -.035em;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-inline: .24em;     /* room for the high-contrast Q's bowl */
  max-width: 100%;
  filter: drop-shadow(0 6px 30px rgba(216,180,106,.10));
}
.monogram__m { margin-right: -.02em; }
.monogram__q { display: inline-block; transform: translateY(.045em); }

/* XVI in bordeaux, hairlines either side (echoes the brand lockup) */
.numeral {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: .36em;
  text-indent: .36em;
  color: #AC475F; /* bordeaux, lifted for legibility on noir */
}
.numeral__rule {
  display: block;
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-30));
}
.numeral__rule:last-child {
  background: linear-gradient(90deg, var(--gold-30), transparent);
}

.hero__title {
  margin-top: 22px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: .38em;
  text-indent: .38em;
  text-transform: uppercase;
}

.hero__meta {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--grotesk);
  font-weight: 400;
  font-size: .76rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cream-60);
}
.hero__dot { color: var(--gold-text); opacity: .9; }

/* Scroll cue: a single gold hairline that breathes */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: var(--gold-text);
  pointer-events: auto;   /* tappable (JS disables it once the hero scrolls away) */
  cursor: pointer;
  padding: 6px 14px;
  -webkit-tap-highlight-color: transparent;
}
.scroll-cue:focus-visible { outline: 1px solid var(--gold-30); outline-offset: 6px; border-radius: 2px; }
.scroll-cue__text {
  font-family: var(--grotesk);
  font-weight: 500;
  font-size: .56rem;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  opacity: .85;
}
.scroll-cue__chev {
  width: 22px;
  height: 13px;
  animation: bob 1.9s var(--ease-lux) infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0);   opacity: .5; }
  50%      { transform: translateY(7px); opacity: 1; }
}

/* ---- Hero entrance (plays once fonts are ready) ---- */
.hero__eyebrow, .monogram, .numeral, .hero__title, .hero__meta, .scroll-cue { opacity: 0; }
html.no-js .hero__eyebrow, html.no-js .monogram, html.no-js .numeral,
html.no-js .hero__title, html.no-js .hero__meta, html.no-js .scroll-cue { opacity: 1; }

.is-ready .hero__eyebrow { animation: rise 1.4s var(--ease-out) .15s both; }
.is-ready .monogram      { animation: emboss 2.4s var(--ease-lux) .35s both; }
.is-ready .numeral       { animation: rise 1.4s var(--ease-out) 1.35s both; }
.is-ready .numeral__rule { animation: grow 1.6s var(--ease-lux) 1.35s both; }
.is-ready .hero__title   { animation: rise 1.4s var(--ease-out) 1.6s both; }
.is-ready .hero__meta    { animation: rise 1.4s var(--ease-out) 1.85s both; }
.is-ready .scroll-cue    { animation: fade 1.2s ease 2.6s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes emboss {
  0%   { opacity: 0; filter: blur(18px) drop-shadow(0 6px 30px rgba(216,180,106,0)); transform: scale(1.05); }
  45%  { opacity: 1; }
  100% { opacity: 1; filter: blur(0)    drop-shadow(0 6px 30px rgba(216,180,106,.10)); transform: scale(1); }
}

/* --------------------------------------------------------------------------
   2. Countdown
   -------------------------------------------------------------------------- */
.countdown__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.countdown__eyebrow { margin-bottom: 40px; }

.clock {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 720px;
}
.unit {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 4px;
}
.unit + .unit::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  height: 76%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-30), transparent);
}
.unit__num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.7rem, 11.5vw, 5.6rem);
  line-height: 1;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  min-width: 2ch;
}
.unit__num.is-tick { animation: tick .6s var(--ease-out); }
@keyframes tick {
  from { opacity: .35; transform: translateY(-4px); }
  to   { opacity: 1;   transform: translateY(0); }
}
.unit__label {
  margin-top: 14px;
  font-family: var(--grotesk);
  font-weight: 500;
  font-size: .62rem;
  letter-spacing: .22em;
  text-indent: .22em;
  text-transform: uppercase;
  color: var(--cream-60);
}

.clock-state { display: flex; flex-direction: column; align-items: center; }
.clock-state__big {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(4rem, 20vw, 9rem);
  line-height: 1;
  letter-spacing: .04em;
}
.clock-state__small {
  margin-top: 18px;
  font-size: .7rem;
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  color: var(--cream-60);
}

/* --------------------------------------------------------------------------
   3. The cipher — scroll to decrypt
   -------------------------------------------------------------------------- */
.cipher__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  width: 100%;
}
.cipher__eyebrow { margin-bottom: 6px; }
.cipher__lines {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}
.cipher__line {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(1.4rem, 6.6vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: .04em;
  white-space: pre;
  word-break: break-word;
}
.cipher__line--sm {
  font-size: clamp(.82rem, 3.6vw, 1.25rem);
  letter-spacing: .16em;
}
.cipher__lit { color: var(--cream); }
.cipher__enc { color: var(--gold); opacity: .6; }
.cipher__line--sm .cipher__lit { color: var(--gold-text); }

.cipher__hint {
  font-family: var(--grotesk);
  font-weight: 500;
  font-size: .6rem;
  letter-spacing: .26em;
  text-indent: .26em;
  text-transform: uppercase;
  color: var(--cream-60);
  min-height: 1em;
}
.cipher__hint-done { display: none; color: var(--gold-text); }
.scene--cipher.is-done .cipher__hint-scroll { display: none; }
.scene--cipher.is-done .cipher__hint-done { display: inline; }

/* --------------------------------------------------------------------------
   4. The city
   -------------------------------------------------------------------------- */
.scene--city { padding: 72px 0 30vh; overflow: hidden; } /* bottom room for horizon */
.city__bg {
  position: absolute;
  inset: -6% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vh;
  pointer-events: none;
  will-change: transform;
}
.city__ghost {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(4rem, 27vw, 16rem);
  line-height: .82;
  letter-spacing: .02em;
  white-space: nowrap;
  /* interior fill driven by --fill (0→1) as you scroll; outline always on */
  color: rgba(216, 180, 106, calc(var(--fill, 0) * 0.32));
  -webkit-text-stroke: 1px rgba(216, 180, 106, .12);
}
.city__ghost--2 {
  color: rgba(207, 162, 174, calc(var(--fill, 0) * 0.32));
  -webkit-text-stroke: 1px rgba(207, 162, 174, .11);
}
.city__skyline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 32vh;
  max-height: 300px;
  pointer-events: none;
  opacity: .6;
  will-change: transform;
  -webkit-mask-image: linear-gradient(to top, #000 52%, transparent);
          mask-image: linear-gradient(to top, #000 52%, transparent);
}
.city__skyline svg { width: 100%; height: 100%; display: block; }
.city__inner { position: relative; z-index: 2; text-align: center; padding-inline: 24px; }
.city__kicker {
  font-weight: 500;
  font-size: .64rem;
  letter-spacing: .26em;
  text-indent: .26em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 26px;
}
.city__line {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 12vw, 5rem);
  line-height: 1.04;
}
.city__fr {
  margin-top: 24px;
  font-family: var(--script);
  font-size: clamp(1.5rem, 8vw, 2.6rem);
  line-height: 1;
  color: var(--rose);
}

/* --------------------------------------------------------------------------
   5. The reveal — the mask lifts
   -------------------------------------------------------------------------- */
.reveal__stage {
  position: relative;
  width: 100%;
  max-width: 640px;
  min-height: 380px;
  display: grid;
  place-items: center;
}
.reveal__mask {
  position: absolute;
  z-index: 3;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, 420px);
  aspect-ratio: 200 / 96;
  pointer-events: none;
}
.mask-clip {
  position: absolute;
  inset: 0;
  will-change: transform, opacity; /* scrubbed by scroll in main.js */
}
.mask-clip--l { clip-path: inset(0 50% 0 0); }
.mask-clip--r { clip-path: inset(0 0 0 50%); }
.mask-svg {
  width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 4px 20px rgba(216, 180, 106, .18));
}
.reveal__body {
  position: relative;
  z-index: 2;
  text-align: center;
  opacity: 0; /* scrubbed in by scroll; reduced-motion shows it */
}
.reveal__eyebrow { margin-bottom: 26px; }
.reveal__line {
  margin: 0 auto;
  max-width: 9ch;
  text-align: center;
  text-transform: uppercase;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 12vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: .02em;
}
.reveal__sub {
  margin: 24px auto 0;
  max-width: 26ch;
  font-family: var(--grotesk);
  font-weight: 400;
  font-size: clamp(.95rem, 4.2vw, 1.15rem);
  line-height: 1.6;
  color: var(--cream-60);
}
.reveal__code {
  margin-top: 30px;
  font-family: var(--grotesk);
  font-weight: 600;
  font-size: clamp(.72rem, 3.4vw, .84rem);
  letter-spacing: .24em;
  text-indent: .24em;
  line-height: 1.9;
  text-transform: uppercase;
  color: var(--gold-text);
}

/* --------------------------------------------------------------------------
   6. The teaser video
   -------------------------------------------------------------------------- */
.video__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  width: 100%;
}
.video-frame {
  position: relative;
  width: min(92vw, 880px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--gold-15);
  border-radius: 2px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .6);
}
.video-frame::after { /* seat it in the dark with a soft inner vignette */
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .45);
}
.video-frame video {
  width: 100%; height: 100%;
  object-fit: cover; /* frame is 16:9, so this fills with no crop */
  display: block;
}

/* --------------------------------------------------------------------------
   Footer + The Court door
   -------------------------------------------------------------------------- */
[data-reveal] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.3s var(--ease-out), transform 1.3s var(--ease-out);
}
[data-reveal] > *:nth-child(2) { transition-delay: .12s; }
[data-reveal] > *:nth-child(3) { transition-delay: .24s; }
[data-reveal].is-in > *,
html.no-js [data-reveal] > * { opacity: 1; transform: none; }

.footer {
  min-height: 78svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 44px;
  padding: 72px 24px calc(48px + env(safe-area-inset-bottom));
}
.footer__more {
  font-family: var(--script);
  font-size: clamp(2.2rem, 11vw, 3.6rem);
  line-height: 1;
  color: var(--gold);
}
.footer__more-en {
  margin-top: 8px;
  font-weight: 500;
  font-size: .62rem;
  letter-spacing: .26em;
  text-indent: .26em;
  text-transform: uppercase;
  color: var(--cream-60);
}
.footer__mark {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  font-family: var(--serif);
  font-size: .95rem;
  letter-spacing: .22em;
}
.footer__dot { color: var(--gold); opacity: .5; }

.court-door {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  color: var(--cream-40);
  transition: color .5s ease;
}
.court-door:hover, .court-door:focus-visible { color: var(--gold-text); outline: none; }
.court-door__glyph { width: 40px; height: 22px; opacity: .5; transition: opacity .5s ease; }
.court-door:hover .court-door__glyph,
.court-door:focus-visible .court-door__glyph { opacity: 1; }
.court-door__glyph svg { width: 100%; height: 100%; display: block; }
.court-door__label { font-family: var(--script); font-size: 1.05rem; }

/* --------------------------------------------------------------------------
   Larger screens — desktop is the enhancement
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .eyebrow { font-size: .72rem; }
  .eyebrow__rule { width: 40px; }
  .monogram { font-size: clamp(14rem, 26vw, 22rem); }
  .numeral { font-size: 1.9rem; margin-top: 34px; }
  .numeral__rule { width: 64px; }
  .hero__title { font-size: 1.3rem; margin-top: 26px; }
  .hero__meta { font-size: .82rem; margin-top: 36px; }
  .unit__label { font-size: .66rem; }
}

/* --------------------------------------------------------------------------
   Reduced motion — no pins/scrub; scenes become a normal stacked document
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage { height: auto; }
  .stage__pin { position: static; height: auto; overflow: visible; }
  .scene {
    position: relative;
    opacity: 1 !important;
    min-height: 92svh;
  }
  .hero__inner { transform: none !important; }
  .hero__eyebrow, .monogram, .numeral, .hero__title, .hero__meta, .scroll-cue {
    opacity: 1; animation: none !important;
  }
  .numeral__rule, .unit__num, .clock-state__big, .scroll-cue__chev { animation: none !important; }
  .scroll-cue__chev { transform: none; }
  .countdown__eyebrow, .scene--countdown .unit { opacity: 1 !important; transform: none !important; }
  .city__bg, .city__skyline { transform: none !important; }
  .reveal__mask { display: none; }
  .reveal__body { opacity: 1 !important; transform: none !important; }
  [data-reveal] > * { opacity: 1; transform: none; transition: none; }
}
