/* ============================================================
   People First Studios — holding page
   Baseline is fully legible with no JS and under reduced motion.
   The scroll morph is a progressive enhancement layered on top.
   ============================================================ */

:root {
  --bg: #000000;
  --ink: #ffffff;
  --ink-soft: #d0d0d0;   /* 13.6:1 on black */
  --ink-mute: #9a9a9a;   /*  7.5:1 on black */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Helvetica Neue", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.skip-link {
  position: absolute;
  left: 50%;
  top: -4rem;
  transform: translateX(-50%);
  padding: 0.6rem 1rem;
  background: #fff;
  color: #000;
  border-radius: 0 0 6px 6px;
  font-size: 0.9rem;
  text-decoration: none;
  z-index: 10;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 0; }

/* ------------------------------------------------------------
   Baseline layout (no JS / reduced motion):
   mark and phrase each occupy a full screen, both fully visible.
   ------------------------------------------------------------ */
.track { position: relative; }

.stage {
  display: flex;
  flex-direction: column;
}

.layer {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  text-align: center;
}

/* Mark ------------------------------------------------------- */
.layer--mark { overflow: hidden; }

.glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(120vw, 1100px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
              rgba(255, 255, 255, 0.08) 0%,
              rgba(255, 255, 255, 0.03) 34%,
              rgba(255, 255, 255, 0) 62%);
  pointer-events: none;
  z-index: 0;
}

.lockup {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  line-height: 0;
}

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

/* The mark is three independently-animatable pieces (People, First,
   STUDIOS bar) reconstructing the logo. Each .piece is absolutely
   positioned via inline left/top/width/height percentages measured
   from the original artwork, so the lockup is pixel-faithful and
   scales with its container. Width is padding-aware (never overflows). */
.mark {
  display: block;
  position: relative;
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  aspect-ratio: 3.9576;
  color: var(--ink);   /* pieces fill: currentColor */
}

.piece {
  position: absolute;
  display: block;
  color: inherit;
  will-change: transform;
}

/* Geometry measured from the original artwork (must live in the
   stylesheet, not inline style attrs — the CSP forbids inline styles). */
.piece--people  { left: 0;       top: 0;       width: 55.357%; height: 53.357%; }
.piece--first   { left: 64.911%; top: 0;       width: 35.089%; height: 44.876%; }
.piece--studios { left: 0.089%;  top: 65.018%; width: 99.911%; height: 34.982%; }

.cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 5vh, 3rem);
  transform: translateX(-50%);
  margin: 0;
  z-index: 1;
  color: var(--ink-mute);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.cue__word { position: relative; }
.cue__word::after {
  content: "";
  display: block;
  width: 1px;
  height: 2.4rem;
  margin: 0.75rem auto 0;
  background: linear-gradient(var(--ink-mute), transparent);
}

/* Phrase ----------------------------------------------------- */
.phrase {
  margin: 0;
  max-width: 20ch;
  font-weight: 200;
  font-size: clamp(2rem, 8.5vw, 5rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.word { display: inline-block; white-space: nowrap; }
.word + .word { margin-left: 0.32em; }
.ltr { display: inline-block; will-change: transform, filter, opacity; }

/* Footer ----------------------------------------------------- */
.site-footer {
  padding: clamp(2.5rem, 8vh, 5rem) clamp(1.5rem, 5vw, 4rem);
  text-align: center;
}
.site-footer__name {
  margin: 0 0 0.4rem;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.site-footer__meta {
  margin: 0;
  font-size: clamp(0.8rem, 2vw, 0.92rem);
  color: var(--ink-mute);
}
.site-footer__link {
  color: var(--ink-mute);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
}
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ------------------------------------------------------------
   ENHANCEMENT: scroll-driven morph.
   Applies only when JS is active AND the user has not requested
   reduced motion. Everything above remains the graceful default.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  html.js .track {
    height: 260vh;
  }

  html.js .stage {
    --p: 0;                     /* scroll progress 0..1, set by JS */
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: block;
  }

  html.js .layer {
    position: absolute;
    inset: 0;
    min-height: 0;
  }

  /* --- Choreographed exit -------------------------------------
     People slides off to the left, First slides off to the right;
     once they've cleared, the STUDIOS bar rises up and fades, and
     the phrase resolves in. All eased with easeOutCubic (no bounce). */
  html.js .layer--mark { opacity: 1; }

  /* People + First: exit horizontally over p 0 -> 0.18. */
  html.js .piece--people,
  html.js .piece--first {
    --t: clamp(0, calc(var(--p) / 0.18), 1);
    --inv: calc(1 - var(--t));
    --e: calc(1 - var(--inv) * var(--inv) * var(--inv));   /* easeOutCubic */
  }
  html.js .piece--people {
    transform: translateX(calc(var(--e) * -120vw));
  }
  html.js .piece--first {
    transform: translateX(calc(var(--e) * 120vw));
  }

  /* STUDIOS bar: holds until the words have just cleared, then rises +
     fades over p 0.22 -> 0.48. */
  html.js .piece--studios {
    --t: clamp(0, calc((var(--p) - 0.22) / 0.26), 1);
    --inv: calc(1 - var(--t));
    --e: calc(1 - var(--inv) * var(--inv) * var(--inv));
    transform: translateY(calc(var(--e) * -62vh));
    opacity: calc(1 - var(--t));
  }

  html.js .cue {
    opacity: calc(1 - clamp(0, calc(var(--p) * 6), 1));
  }
  html.js .glow {
    opacity: calc(1 - clamp(0, calc(var(--p) * 1.6), 1));
  }

  /* Phrase resolves in, per letter, blur-to-focus, staggered. */
  html.js .layer--phrase { pointer-events: none; }

  html.js .ltr {
    /* --i and --n are assigned per element by JS. Letters begin
       resolving as the STUDIOS bar clears; each opens a 0.22-wide
       window, staggered across the back of the scroll. */
    --start: calc(0.42 + (var(--i) / var(--n)) * 0.20);
    --lp: clamp(0, calc((var(--p) - var(--start)) / 0.22), 1);
    --inv: calc(1 - var(--lp));
    --e: calc(1 - var(--inv) * var(--inv) * var(--inv));
    opacity: var(--e);
    filter: blur(calc(var(--inv) * 14px));
    transform: translateY(calc(var(--inv) * 0.42em));
  }
}

/* ------------------------------------------------------------
   Reduced motion: keep the calm, static, fully-legible baseline.
   (Enhancement block above is simply never applied.)
   Neutralize will-change so nothing is promoted needlessly.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .ltr { will-change: auto; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------
   Responsive polish
   ------------------------------------------------------------ */
@media (max-width: 480px) {
  .phrase { max-width: 14ch; }
}

/* Very large displays: keep the lockup deliberate, not gigantic. */
@media (min-width: 1800px) {
  .mark { max-width: 1320px; }
  .phrase { font-size: clamp(3rem, 5vw, 5.5rem); }
}

/* Short landscape (e.g. phones on their side): tighten vertical rhythm. */
@media (max-height: 520px) and (min-width: 640px) {
  .mark { max-width: min(72vw, 900px); }
}
