/* ============================================================================
   MANNKIND — engraved plates in the blue.   (2026-09-07 rebuild)

   No scroll engine. No camera. A normal document: full-screen plates stacked
   one per screen, each a white-line engraving floating in a deep brand blue
   with ONE immense light behind it. The only motion is a quiet fade as a block
   enters, plus hover. Everything else is still.
   ========================================================================== */

:root {
  --void:      #0A1650;   /* the ground — deep, vivid brand blue. NOT near-black. */
  --void-lift: #17298C;   /* where the light lifts it */
  --void-deep: #060C33;   /* the corners */
  --blue:      #1A2BFF;   /* THE LIGHT */
  --blue-soft: #4A5CFF;
  --ink:       #F2F3FF;   /* engraving white */
  --ink-2:     rgba(242,243,255,0.60);
  --ink-3:     rgba(242,243,255,0.34);
  --gold:      #C7A252;
  --gold-hi:   #E8C979;
  --hair:      rgba(242,243,255,0.14);
  --hair-gold: rgba(199,162,82,0.32);

  --display: 'Anton', 'Arial Narrow', sans-serif;
  --mono: 'Space Mono', ui-monospace, 'Courier New', monospace;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;

  --gutter: clamp(1.25rem, 4.5vw, 4.5rem);
  --step: clamp(0.82rem, 0.7rem + 0.55vw, 1.15rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--void); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  color: var(--ink);
  background: var(--void);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.locked { overflow: hidden; height: 100vh; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--blue); color: #fff; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- */
/*  THE VOID — fixed ground, one soft rise of light toward the top  */
/* ---------------------------------------------------------------- */
#void {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(125% 90% at 50% 18%, var(--void-lift) 0%, var(--void) 45%, var(--void-deep) 100%);
}

/* ---------------------------------------------------------------- */
/*  FRAME — technical marks, fixed to the viewport                  */
/* ---------------------------------------------------------------- */
#frame { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.reg {
  position: absolute; width: 15px; height: 15px;
  fill: none; stroke: var(--ink-3); stroke-width: 1;
}
.reg--tl { top: 16px; left: 16px; }
.reg--tr { top: 16px; right: 16px; }
.reg--bl { bottom: 16px; left: 16px; }
.reg--br { bottom: 16px; right: 16px; }

.plate-no {
  position: absolute; left: var(--gutter); bottom: 14px;
  font-family: var(--mono); font-size: clamp(0.62rem, 1vw, 0.8rem); letter-spacing: 0.34em;
  color: var(--ink-3); text-transform: uppercase; white-space: nowrap;
}
.margin-run {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%) rotate(90deg); transform-origin: right center;
  font-family: var(--mono); font-size: clamp(0.56rem, 0.9vw, 0.72rem); letter-spacing: 0.42em;
  color: var(--ink-3); text-transform: uppercase; white-space: nowrap; opacity: 0.7;
}
@media (max-width: 720px) {
  .reg--tr, .reg--br, .margin-run { display: none; }
  .plate-no { font-size: 0.52rem; letter-spacing: 0.24em; }
}

/* ---------------------------------------------------------------- */
/*  NAV                                                             */
/* ---------------------------------------------------------------- */
#nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 45;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: clamp(0.95rem, 2.6vw, 1.6rem) var(--gutter);
  font-family: var(--mono); font-size: var(--step); letter-spacing: 0.2em;
  text-transform: uppercase;
  mix-blend-mode: difference;   /* legible over dark OR a bright plate */
}
#nav .mark { font-family: var(--display); font-size: clamp(1.05rem, 2vw, 1.5rem); letter-spacing: 0.14em; }
#nav .links { display: flex; gap: clamp(1rem, 3vw, 2.2rem); }
#nav .links a { position: relative; padding-bottom: 3px; }
#nav .links a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: currentColor; transition: right 0.35s cubic-bezier(.2,.7,.2,1);
}
#nav .links a:hover::after { right: 0; }
@media (max-width: 560px) { #nav { padding: 0.85rem var(--gutter); } #nav .links { gap: 1.1rem; } }

/* ---------------------------------------------------------------- */
/*  THE STAGE — four engraved plates, fixed, cross-fading on scroll  */
/*  app.js sets each .plate-art opacity from scroll position, so the */
/*  images melt into one another as you move down and there is ALWAYS*/
/*  art behind the content (never a flat black stretch).             */
/* ---------------------------------------------------------------- */
#stage { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

/* the light — one broad bloom over the void, so the plates read as lit */
.halo {
  position: absolute; left: 50%; top: 44%;
  width: 96vmax; height: 96vmax; transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
    rgba(150,175,255,0.26) 0%,
    rgba(80,110,255,0.18) 17%,
    rgba(40,65,255,0.10) 31%,
    rgba(26,43,255,0.04) 45%,
    rgba(26,43,255,0) 58%);
}

.plate-art {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;                 /* JS-driven */
  will-change: opacity;
}
.plate-art img {
  width: 100%; height: 100%;
  object-fit: contain;        /* whole figure, standing in the void — nothing cut off */
  object-position: 50% 50%;
  padding: 4vh var(--gutter) 5vh;
  filter: brightness(1.05) contrast(1.3) saturate(0.92);
}
[data-plate="open"]   img { object-position: 50% 50%; padding: 3vh 2vw 6vh; }
[data-plate="king"]   img { object-position: 50% 50%; padding: 2vh 2vw 4vh;
  filter: brightness(1.12) contrast(1.24); }
[data-plate="weight"] img { object-position: 50% 46%; padding: 2vh 2vw 4vh; }
[data-plate="mark"]   img { object-fit: cover; object-position: 50% 28%; padding: 0;
  filter: brightness(1.05) contrast(1.18) saturate(0.9); }

@media (max-width: 560px) {
  .plate-art img { padding: 3vh 0.5rem 5vh; }
  [data-plate="mark"] img { padding: 0; }
}

/* ---------------------------------------------------------------- */
/*  SCENES — transparent scroll length; the fixed stage shows through */
/* ---------------------------------------------------------------- */
main { position: relative; z-index: 10; }
#top { position: absolute; top: 0; }

.scene {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
}
#s-open  { min-height: 108vh; }

.scene-copy {
  position: relative; z-index: 3;
  padding: 0 var(--gutter) clamp(3rem, 9vh, 7rem);
  width: 100%;
}
.wordmark {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(3.4rem, 15vw, 15rem); line-height: 0.82;
  letter-spacing: 0.005em; color: var(--ink);
  text-shadow: 0 0 60px rgba(26,43,255,0.4);
}
.wordmark span { display: block; }

/* ---------------------------------------------------------------- */
/*  THE DROPS                                                       */
/* ---------------------------------------------------------------- */
#drops {
  position: relative; z-index: 10; padding: 16vh 0 16vh;
  /* a soft scrim so the type stays legible over whatever plate is fading
     behind it — the art is never fully hidden, never a flat black block */
  background: linear-gradient(180deg,
    rgba(10,22,80,0) 0%, rgba(8,16,58,0.55) 14%, rgba(8,16,58,0.62) 82%, rgba(10,22,80,0) 100%);
}

.drops-head { padding: 0 var(--gutter); display: grid; gap: 1.4rem; }
.drops-head .idx {
  font-family: var(--mono); font-size: var(--step); letter-spacing: 0.36em;
  text-transform: uppercase; color: var(--gold);
}
.drops-head h2 {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(3.6rem, 15vw, 13rem); line-height: 0.86; letter-spacing: 0.005em;
}
.drops-head .blurb {
  max-width: 40ch; font-size: clamp(0.95rem, 0.82rem + 0.6vw, 1.4rem);
  line-height: 1.85; color: var(--ink-2);
}

.artifacts { list-style: none; margin: clamp(8vh, 14vh, 16vh) 0 0; }
.artifact {
  position: relative;
  min-height: clamp(52vh, 66vh, 74vh);
  display: flex; flex-direction: column; justify-content: center;
  padding: 5vh var(--gutter);
}
.artifact:nth-child(odd)  { align-items: flex-start; text-align: left; }
.artifact:nth-child(even) { align-items: flex-end;   text-align: right; }

.artifact .tag {
  font-family: var(--mono); font-size: clamp(0.8rem, 1.4vw, 1.1rem); letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold);
  display: flex; gap: 1rem; align-items: center;
}
.artifact:nth-child(even) .tag { flex-direction: row-reverse; }
.artifact .tag::before {
  content: ''; width: clamp(1.4rem, 5vw, 3.4rem); height: 1px; background: var(--hair-gold);
}
.artifact .name {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(3.8rem, 13vw, 12rem); line-height: 0.95; margin: 0.4rem 0 0;
  letter-spacing: 0.005em;
  transition: color 0.4s ease;
}
.artifact .kind {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(1.3rem, 4.2vw, 2.8rem); letter-spacing: 0.1em;
  color: var(--ink-2); margin-top: 0.5rem;
}
.artifact .meta {
  margin-top: 1.6rem;
  font-family: var(--mono); font-size: clamp(0.8rem, 1.5vw, 1.1rem); letter-spacing: 0.08em;
  color: var(--ink-2);
}
.artifact .lock {
  margin-top: 1.2rem;
  font-family: var(--mono); font-size: clamp(0.76rem, 1.4vw, 1rem); letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--gold-hi);
}
.artifact .lock::before { content: '— '; color: var(--ink-3); }
.artifact:hover .name { color: var(--gold-hi); }

@media (max-width: 640px) {
  .artifact:nth-child(n) { align-items: flex-start; text-align: left; }
  .artifact:nth-child(even) .tag { flex-direction: row; }
}

/* ---- notify ---- */
#notify { margin: clamp(10vh, 18vh, 20vh) 0 0; padding: 0 var(--gutter); }
#notify .lbl {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  color: var(--ink); margin-bottom: 1.6rem; max-width: 22ch;
}
#notify .row {
  display: flex; max-width: 34rem; border: 1px solid var(--hair-gold);
  background: rgba(6,12,51,0.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
#notify input {
  flex: 1; min-width: 0; background: transparent; border: 0; color: var(--ink);
  font-family: var(--mono); font-size: clamp(0.86rem, 1.4vw, 1.05rem); letter-spacing: 0.1em;
  padding: 1.15rem 1.2rem;
}
#notify input::placeholder { color: var(--ink-3); }
#notify input:focus { outline: none; background: rgba(242,243,255,0.04); }
#notify button {
  position: relative; overflow: hidden;
  background: transparent; color: var(--gold-hi); border: 0; border-left: 1px solid var(--hair-gold);
  font-family: var(--display); font-size: clamp(0.9rem, 1.5vw, 1.15rem); letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0 1.9rem; cursor: pointer;
}
#notify button::before {
  content: ''; position: absolute; inset: 0; background: var(--gold);
  transform: translateX(-101%); transition: transform 0.32s cubic-bezier(.3,.7,.2,1); z-index: 0;
}
#notify button:hover { color: var(--void); }
#notify button:hover::before { transform: translateX(0); }
#notify button span { position: relative; z-index: 1; }
#notify .status { min-height: 1.1em; margin-top: 0.9rem; font-size: clamp(0.72rem, 1.2vw, 0.9rem); letter-spacing: 0.12em; color: var(--gold-hi); }
#notify .fine { margin-top: 1rem; font-size: clamp(0.68rem, 1vw, 0.82rem); line-height: 1.8; letter-spacing: 0.03em; color: var(--ink-3); }

/* ---------------------------------------------------------------- */
/*  THE MARK — footer (the villa plate lives in #stage now)         */
/* ---------------------------------------------------------------- */
#s-mark {
  position: relative; z-index: 10;
  min-height: 100vh; display: flex; align-items: flex-end;
  padding: var(--gutter);
  background: linear-gradient(180deg, rgba(10,22,80,0) 0%, rgba(6,11,44,0.5) 40%, rgba(6,11,44,0.72) 100%);
}
#s-mark .mark-inner { position: relative; z-index: 2; width: 100%; }
#s-mark .big {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(3rem, 12vw, 10rem); line-height: 0.88; letter-spacing: 0.025em;
  text-shadow: 0 0 40px rgba(26,43,255,0.3);
}
#s-mark .mark-links { display: flex; flex-wrap: wrap; gap: 1.6rem; margin: 2.2rem 0 1.6rem; }
#s-mark .mark-links a {
  font-family: var(--mono); font-size: var(--step); letter-spacing: 0.18em; text-transform: uppercase;
  border-bottom: 1px solid var(--hair); padding-bottom: 3px;
  transition: border-color 0.3s, color 0.3s;
}
#s-mark .mark-links a:hover { border-color: var(--gold); color: var(--gold-hi); }
#s-mark .fine {
  font-family: var(--mono); font-size: clamp(0.66rem, 1.1vw, 0.84rem); letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ---------------------------------------------------------------- */
/*  REVEAL — the only motion. a quiet fade-up as a block enters.    */
/* ---------------------------------------------------------------- */
.rv { opacity: 0; transform: translateY(22px); transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
.rv-2 { transition-delay: 0.08s; }
.rv-3 { transition-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) {
  .rv { transition: opacity 0.4s ease; transform: none; }
}

/* ---------------------------------------------------------------- */
/*  GRAIN — a whisper of plate texture + a soft edge fall-off       */
/* ---------------------------------------------------------------- */
#grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  /* just a soft fall-off toward the corners — no heavy vignette, no grid noise */
  background: radial-gradient(180% 155% at 50% 40%, transparent 80%, rgba(6,12,51,0.22) 100%);
}
#grain::after {   /* a whisper of plate grain, barely there */
  content: ''; position: absolute; inset: 0; opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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");
}

/* ---------------------------------------------------------------- */
/*  GATE                                                            */
/* ---------------------------------------------------------------- */
#gate {
  position: fixed; inset: 0; z-index: 100; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(130% 100% at 50% 34%, #1b2c96 0%, #142372 44%, #0a1350 100%);
  transition: opacity 0.9s ease;
}
#gate .g-art {
  position: absolute; left: 50%; top: 50%;
  width: min(112vh, 128vw); height: min(112vh, 128vw); object-fit: cover;
  transform: translate(-50%, -50%);
  opacity: 0.82;
  transition: transform 1.1s cubic-bezier(.4,0,.2,1), opacity 1s ease;
}
#gate .g-glow {
  position: absolute; left: 50%; top: 42%; width: 78vmax; height: 78vmax;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(120,140,255,0.26), rgba(26,43,255,0.08) 46%, transparent 70%);
}
#gate .g-inner { position: relative; z-index: 2; text-align: center; width: min(92vw, 40rem); }
#gate .g-tag {
  font-family: var(--mono); font-size: clamp(0.68rem, 1.3vw, 0.92rem); letter-spacing: 0.42em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1.8rem;
}
#gate .g-mark {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(3.6rem, 16vw, 8rem); letter-spacing: 0.1em; line-height: 1;
  margin-bottom: 2.6rem; text-shadow: 0 0 44px rgba(26,43,255,0.45);
}
#gate .g-field { display: flex; border: 1px solid var(--hair-gold); background: rgba(6,10,40,0.6); }
#gate input {
  flex: 1; min-width: 0; background: transparent; border: 0; color: var(--ink);
  font-family: var(--mono); font-size: clamp(0.86rem, 1.6vw, 1.1rem); letter-spacing: 0.28em;
  text-align: center; text-transform: uppercase; padding: 1.25rem 1rem;
}
#gate input::placeholder { color: var(--ink-3); letter-spacing: 0.28em; }
#gate input:focus { outline: none; background: rgba(242,243,255,0.04); }
#gate button {
  background: var(--gold); color: var(--void); border: 0;
  font-family: var(--display); font-size: clamp(0.86rem, 1.6vw, 1.15rem); letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0 2.2rem; cursor: pointer; transition: background 0.25s;
}
#gate button:hover { background: var(--gold-hi); }
#gate .g-err {
  margin-top: 1.2rem; font-family: var(--mono); font-size: clamp(0.68rem, 1.3vw, 0.88rem); letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--gold-hi); opacity: 0; transition: opacity 0.15s;
}
#gate.gate--out { opacity: 0; pointer-events: none; }
#gate.gate--out .g-art { transform: translate(-50%,-50%) scale(1.28); opacity: 0; }

/* ---------------------------------------------------------------- */
/*  KEYBOARD EASTER EGG                                             */
/* ---------------------------------------------------------------- */
#egg {
  position: fixed; inset: 0; z-index: 120; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,10,40,0.82); opacity: 0;
  transition: opacity 0.08s steps(1);
}
#egg.in { opacity: 1; }
#egg p {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: clamp(2rem, 8vw, 4.6rem); line-height: 1.1; text-align: center;
  color: var(--ink); letter-spacing: 0.01em;
}
#egg.in p { animation: eggGlitch 2.2s steps(2, end) 1; }
@keyframes eggGlitch {
  0%   { transform: translate(0,0); text-shadow: none; opacity: 0; }
  3%   { opacity: 1; transform: translate(3px,0); text-shadow: 3px 0 #1A2BFF, -3px 0 #E8C979; }
  7%   { transform: translate(-3px,0); text-shadow: -3px 0 #1A2BFF, 3px 0 #E8C979; }
  12%  { transform: translate(1px,0); text-shadow: none; }
  88%  { transform: translate(0,0); text-shadow: none; }
  92%  { transform: translate(-3px,0); text-shadow: -3px 0 #1A2BFF, 3px 0 #E8C979; }
  100% { transform: translate(0,0); text-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { #egg.in p { animation: none; } }
