/* ============================================================
   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);    /* easeOutExpo — arrivals */
  --ease-move: cubic-bezier(0.65, 0, 0.35, 1);  /* easeInOutCubic — glides */
}

*, *::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: swipe-triggered morph (JS + no reduced motion).

   Instead of scrubbing the animation to the scrollbar, the page is
   pinned to one viewport and a single swipe / wheel / arrow key flips
   between two states: the hero lockup and the phrase. The transition
   then plays on its own, time-based, with premium easing.
   Everything above remains the graceful, scrollable default.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  html.js, html.js body {
    height: 100%;
    overflow: hidden;             /* no continuous scrolling; swipe = trigger */
    overscroll-behavior: none;
  }

  html.js .track { height: 100vh; height: 100svh; }

  html.js .stage {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100svh;
    display: block;
  }

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

  /* --- The three pieces leave together ------------------------
     People glides off left, First off right, the STUDIOS bar rises
     and fades — all starting at the same instant the state flips.
     easeInOutCubic gives a smooth, weighty glide you can watch. */
  html.js .piece {
    transition: transform 1s var(--ease-move);
  }
  html.js .piece--studios {
    transition: transform 1s var(--ease-move),
                opacity 0.8s var(--ease-move);
  }
  html.js.revealed .piece--people  { transform: translateX(-125vw); }
  html.js.revealed .piece--first   { transform: translateX(125vw); }
  html.js.revealed .piece--studios { transform: translateY(-64vh); opacity: 0; }

  /* The "Scroll" cue and glow fade as the morph begins. */
  html.js .cue,
  html.js .glow { transition: opacity 0.5s var(--ease-out); }
  html.js.revealed .cue,
  html.js.revealed .glow { opacity: 0; }

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

  html.js .ltr {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(0.4em);
    transition: opacity 0.7s var(--ease-out),
                filter 0.7s var(--ease-out),
                transform 0.7s var(--ease-out);
  }
  html.js.revealed .ltr {
    opacity: 1;
    filter: none;
    transform: none;
    /* --i / --n set per letter by JS; begins after the mark clears. */
    transition-delay: calc(0.55s + (var(--i) / var(--n)) * 0.5s);
  }

  /* Footer fades in with the phrase, then rests at the bottom. */
  html.js .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s var(--ease-out);
  }
  html.js.revealed .site-footer {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 1.3s;
  }
}

/* ------------------------------------------------------------
   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); }
}
