/* ————————————————————————————————
   MIKE PLOEGER — CUT THE NOISE.
   ink black · emerald · cream
———————————————————————————————— */

:root {
  --ink: #0a0a08;
  --ink-2: #111110;
  --cream: #f4efe4;
  --cream-dim: rgba(244, 239, 228, 0.55);
  --emerald: #0bdc84;
  --emerald-dim: rgba(11, 220, 132, 0.35);
  --display: 'Big Shoulders Display', sans-serif;
  --body: 'Instrument Sans', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

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

html { background: var(--ink); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--body);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.display { font-family: var(--display); font-weight: 800; text-transform: uppercase; }
.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; }
.accent { color: var(--emerald); }

a { color: inherit; text-decoration: none; }

/* ——— Header ——— */
/* Exists only at the top of the page (body.head-away, hysteresis in
   main.js) — below the hero the film runs without chrome, so passing
   display type never sits under header text. Rejected alternatives and
   rationale: AGENTS.md invariants. */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: flex-end; align-items: center;
  padding: 1.6rem 2.2rem;
  text-shadow: 0 1px 8px rgba(10,10,8,0.8);
  transition: opacity 0.4s ease;
}
body.head-away .site-head { opacity: 0; pointer-events: none; }
/* padding + negative margin: identical look, ~44px touch target (the
   bare mono line was ~12px tall — untappable on phones) */
.site-head__mail {
  color: var(--cream); opacity: 0.7; transition: opacity 0.3s;
  padding: 1rem; margin: -1rem;
}
.site-head__mail:hover { opacity: 1; }

/* ——— Pinned scrub sections ——— */
.pin { position: relative; }
/* Hero is a single viewport: the orbit auto-plays once as intro, scroll moves on */
.pin--hero { height: 100vh; height: 100svh; }
.pin--pillars { height: 420vh; }
.pin--work { height: 420vh; }

.pin__stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: hidden;
}
.pin__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
}
/* Slow breathing zoom so the resting hero never feels frozen.
   Compositor-only (transform) — free on every engine. */
#canvas-hero { animation: breathe 18s ease-in-out infinite alternate; }
body.hero-offscreen #canvas-hero { animation-play-state: paused; }
@keyframes breathe {
  from { transform: scale(1); }
  to { transform: scale(1.045); }
}
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(10,10,8,0.75) 100%);
}
.scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(10,10,8,0.82) 0%, rgba(10,10,8,0.35) 55%, rgba(10,10,8,0.15) 100%);
}
.scrim--deep {
  background: linear-gradient(180deg, rgba(10,10,8,0.5) 0%, rgba(10,10,8,0.25) 40%, rgba(10,10,8,0.9) 100%);
}

/* ——— Hero ——— */
/* Page renders instantly on ink; the stage fades in once frame 0 is decoded
   (Apple-style perceived load — no loader chrome). */
.pin--hero .pin__stage { opacity: 0; transition: opacity 1.4s ease; }
body.is-ready .pin--hero .pin__stage { opacity: 1; }

.hero__content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 19vh;
  pointer-events: none;
}
.hero__name {
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(3.8rem, 12vw, 12.5rem);
  /* looser than the finale's 0.86: a two-line pair with a colour change
     at the seam needs more air than a three-line stack */
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.hero__line { display: block; overflow: hidden; }
.hero__line--accent { color: var(--emerald); }
.hero__line .char {
  display: inline-block;
  transform: translateY(110%) rotate(6deg);
  will-change: transform;
}
.hero__tag {
  margin-top: 2.3rem;
  display: flex; gap: 1.3rem;
  font-size: 0.92rem; letter-spacing: 0.26em;
  color: rgba(244, 239, 228, 0.9);
  text-shadow: 0 1px 10px rgba(10, 10, 8, 0.7);
  opacity: 0; transform: translateY(14px);
  will-change: opacity, transform;
}
.hero__tag-b { color: var(--emerald); }

.hero__scrollhint {
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  /* 0.55 + shadow: must survive skin tones, not just ink; the pulsing
     line stays the eye-catcher */
  color: rgba(244, 239, 228, 0.55); font-size: 0.58rem; letter-spacing: 0.3em;
  text-shadow: 0 1px 6px rgba(10, 10, 8, 0.6);
  transition: opacity 0.5s;
}
.hero__scrollhint-line {
  width: 1px; height: 42px;
  background: linear-gradient(var(--emerald), transparent);
  animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint { 0%,100% { transform: scaleY(0.4); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

/* ——— Stats ——— */
/* A compact interlude between film acts: proof (numbers) and mantra
   (marquee) read as one breath — generous padding here made the pause
   feel like emptiness between the two unequal-height neighbours. */
.stats {
  /* two equal statements, one cap height, no divider. 1fr halves keep
     the seam on the screen axis (pair-centering shoved it left — the
     word is 3× wider than the number; size contrast also reverted) */
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  padding: clamp(3.5rem, 8vh, 5.5rem) 2rem;
  background: var(--ink);
}
.stats__item { text-align: center; }
.stats__num {
  font-size: clamp(3rem, 7.5vw, 6.5rem); line-height: 1;
  color: var(--cream);
}
.stats__num sup { color: var(--emerald); font-size: 0.45em; vertical-align: super; }
/* Per-glyph spans for the decode: width is locked by JS before flipping
   characters so the line box never reflows mid-animation. */
.stats__num--word .dchar { display: inline-block; text-align: center; }
.stats__num--word .dchar--fix { color: var(--emerald); }
.stats__label { margin-top: 0.9rem; color: var(--cream-dim); }

/* ——— Marquee ——— */
.marquee {
  overflow: hidden; white-space: nowrap;
  border-top: 1px solid rgba(244,239,228,0.1);
  border-bottom: 1px solid rgba(244,239,228,0.1);
  padding: 1.1rem 0;
  background: var(--ink);
}
.marquee__canvas { display: block; width: 100%; height: 2rem; }

/* ——— Pillars ——— */
.pillars__head, .work__head {
  position: absolute; top: 6.5rem; left: 2.2rem;
  color: var(--emerald); z-index: 2;
}
.pillars__head::before, .work__head::before {
  content: ''; display: inline-block;
  width: 2.2rem; height: 1px; background: var(--emerald);
  vertical-align: middle; margin-right: 0.8rem;
}
.pillars__list {
  position: absolute; left: 2.2rem; top: 50%; transform: translateY(-50%);
  list-style: none; z-index: 2;
  display: flex; flex-direction: column; gap: clamp(1.6rem, 4vh, 3rem);
  max-width: min(620px, 88vw);
}
.pillar {
  opacity: 0; transform: translateY(46px);
  will-change: opacity, transform;
}
.pillar__idx { color: var(--emerald); display: block; margin-bottom: 0.3rem; }
.pillar__title {
  font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: 0.95;
  color: var(--cream);
}
.pillar__copy {
  margin-top: 0.5rem; color: var(--cream-dim);
  font-size: clamp(0.92rem, 1.4vw, 1.05rem); line-height: 1.55;
  max-width: 46ch;
}

/* ——— Work ——— */
.work__cards {
  position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%);
  z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  width: min(1240px, calc(100vw - 4.4rem));
}
.card {
  background: rgba(14, 14, 13, 0.92);
  border: 1px solid rgba(244,239,228,0.12);
  padding: 1.7rem 1.6rem 1.5rem;
  opacity: 0; transform: translateY(60px);
  will-change: opacity, transform;
  transition: border-color 0.35s ease, background 0.35s ease;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--emerald);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.card:hover { border-color: var(--emerald-dim); background: rgba(14,14,13,0.97); }
.card:hover::after { transform: scaleX(1); }
.card:hover .card__title { transform: translateX(6px); color: var(--emerald); }
.card__idx { color: var(--emerald); margin-bottom: 0.9rem; }
.card__title {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 0.95;
  color: var(--cream);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), color 0.35s;
}
.card__pitch {
  margin-top: 0.9rem; color: var(--cream-dim);
  font-size: 0.86rem; line-height: 1.55;
}
.card__tags {
  margin-top: 1.2rem; color: var(--emerald);
  font-size: 0.6rem; opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.card:hover .card__tags { opacity: 1; transform: translateY(0); }
/* Below 504px the tags would wrap into permanent green lines (no hover on
   touch) and stretch each card differently — drop them entirely: less
   content, shorter cards, calmer stack. From 504px up they fit one line. */
@media (max-width: 503px) {
  .card__tags { display: none; }
}

/* ——— Finale ——— */
.finale {
  min-height: 100vh; min-height: 100svh; /* svh like the pin stages: 100vh overshoots on phones */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.6rem;
  padding: 8rem 2rem 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 110%, rgba(11,220,132,0.13), transparent 70%),
    var(--ink);
  position: relative;
}
.finale__title {
  margin-top: auto; /* pairs with .foot's auto margin: content centers, footer bottoms */
  font-size: clamp(3.2rem, 10.5vw, 10.5rem);
  line-height: 0.86; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.finale__title span {
  display: block; overflow: hidden;
}
.finale__title span > i {
  font-style: normal; display: inline-block;
  transform: translateY(110%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.finale.is-inview span > i { transform: translateY(0); }
.finale__title span:nth-child(2) > i { transition-delay: 0.1s; }
.finale__title span:nth-child(3) > i { transition-delay: 0.2s; }

.finale__ctas { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.btn {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 1.1rem 2.2rem;
  border: 1px solid var(--emerald);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.btn--primary { background: var(--emerald); color: var(--ink); }
.btn--primary:hover { box-shadow: 0 0 34px rgba(11,220,132,0.45); }
.btn--ghost { color: var(--cream); border-color: rgba(244,239,228,0.3); }
.btn--ghost:hover { border-color: var(--emerald); color: var(--emerald); }

/* the address mails (same semantics as the header link); copying is its own
   explicitly labelled control beside it */
.finale__contact { display: flex; align-items: center; gap: 1.1rem; }
.finale__mail {
  color: var(--cream-dim); font-size: 0.72rem; letter-spacing: 0.18em;
  transition: color 0.3s;
  padding: 1rem; margin: -1rem; /* invisible ~44px touch target */
}
.finale__mail:hover { color: var(--emerald); }
.finale__copy {
  background: none; cursor: pointer;
  border: 1px solid rgba(244, 239, 228, 0.22);
  color: var(--cream-dim); font-size: 0.6rem; letter-spacing: 0.16em;
  padding: 0.5rem 0.75rem;
  transition: color 0.3s, border-color 0.3s;
  position: relative;
}
/* invisible hit-area extension — the visible chip stays this delicate */
.finale__copy::after { content: ''; position: absolute; inset: -0.6rem; }
.finale__copy:hover { color: var(--emerald); border-color: var(--emerald-dim); }
.finale__copy.is-copied { color: var(--emerald); border-color: var(--emerald); }

.foot {
  width: 100%;
  /* 1fr | auto | 1fr keeps the © in the true page centre regardless of how
     wide the link groups on either side are */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 2rem 2.2rem;
  margin-top: auto; /* pin to the section's bottom edge (flex gap keeps min spacing) */
  border-top: 1px solid rgba(244,239,228,0.1);
}
.foot > :first-child { justify-self: start; }
.foot__legal { justify-self: end; }
.foot a { color: var(--cream-dim); transition: color 0.3s; padding: 0.7rem; margin: -0.7rem; } /* invisible touch targets */
.foot a:hover { color: var(--emerald); }
.foot__c { color: rgba(244,239,228,0.3); }
.foot__legal { display: flex; gap: 1.6rem; }

@media (max-width: 700px) {
  .foot { grid-template-columns: 1fr; justify-items: center; gap: 1.2rem; padding: 2rem 1.4rem; }
  .foot > :first-child, .foot__legal { justify-self: center; }
  .foot__c { order: 3; } /* copyright reads as the closing line */
}

/* ——— Debug FPS ——— */
.fps {
  position: fixed; bottom: 10px; right: 12px; z-index: 200;
  font-family: var(--mono); font-size: 11px; color: var(--emerald);
  background: rgba(10,10,8,0.8); padding: 4px 8px;
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
  .work__cards { grid-template-columns: 1fr; bottom: 4vh; gap: 0.7rem; }
  .card { padding: 1.2rem 1.1rem 1rem; }
  .card__pitch { font-size: 0.8rem; }
  .stats { grid-template-columns: 1fr; gap: 2.2rem; }
  .pillars__list { left: 1.4rem; right: 1.4rem; }
  .site-head { padding: 1.2rem 1.4rem; }
}

@media (max-width: 600px) {
  .hero__content { padding-left: 1.2rem; padding-right: 1.2rem; }
  /* stacked CTAs share one edge — content-driven widths read as accident */
  .finale__ctas { flex-direction: column; width: min(100%, 22rem); }
  .finale__ctas .btn { width: 100%; text-align: center; }
  /* stacked (side by side wraps raggedly); letter-spaced mono caps
     need a clear slot between lines */
  .hero__tag {
    flex-direction: column; align-items: center; gap: 0.95rem;
    text-align: center;
    font-size: 0.78rem; letter-spacing: 0.22em;
  }
}

/* ——— Reduced motion ——— */
@media (prefers-reduced-motion: reduce) {
  .hero__scrollhint-line, #canvas-hero { animation: none !important; }
  .pin--hero .pin__stage { opacity: 1; transition: none; }
  .pin--hero, .pin--pillars, .pin--work { height: auto; }
  .pin__stage { position: relative; height: 100vh; }
  .hero__line .char, .hero__tag, .pillar, .card { opacity: 1 !important; transform: none !important; }
}
