/* ============================================================
   think in grey — v4 "The Seam"
   Split-screen hero: half black, half white, meeting in a grey
   seam that follows the cursor. Hero content sits in a
   mix-blend-mode:difference layer so it self-inverts over each
   half — the brand, made physical.
   ============================================================ */

:root {
  --black: #0a0a0b;
  --white: #f4f4f3;
  --bg: #0a0a0b;
  --bg-soft: #141416;
  --ink: #f4f4f3;
  --ink-soft: #a8a8a6;
  --ink-faint: #6b6b69;
  --line: #2a2a2c;
  --grey: #8a8a88;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ink-mix: 0%;
  /* the seam */
  --split: 50%;
  --band: 5%;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--black); }
body {
  /* post-hero journey: black → grey plateau (manifesto) → white (contact) */
  background: linear-gradient(180deg,
    #0a0a0b 0%, #0a0a0b 38%,
    #4a4a49 46%,
    #737371 53%, #737371 84%,
    #f4f4f3 93%, #f4f4f3 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  min-height: 100%;
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Continuous scroll-linked ink fade (same machinery as v3).
   Fallback for browsers without color-mix(): a soft binary flip. */
@supports not (color: color-mix(in srgb, red, blue)) {
  body { transition: color 0.5s var(--ease); }
  body * { transition: color 0.5s var(--ease), border-color 0.5s var(--ease), background-color 0.5s var(--ease), fill 0.5s var(--ease); }
}
body.light-zone {
  --ink: #0c0c0d;
  --ink-soft: #4a4a48;
  --ink-faint: #7a7a78;
  --line: rgba(0, 0, 0, 0.16);
  --grey: #5a5a59;
  --bg: #f4f4f3;
}
@supports (color: color-mix(in srgb, red, blue)) {
  body {
    --ink: color-mix(in srgb, #0c0c0d var(--ink-mix), #f4f4f3) !important;
    --ink-soft: color-mix(in srgb, #4a4a48 var(--ink-mix), #a8a8a6) !important;
    --ink-faint: color-mix(in srgb, #7a7a78 var(--ink-mix), #6b6b69) !important;
    --line: color-mix(in srgb, rgba(0, 0, 0, 0.16) var(--ink-mix), #2a2a2c) !important;
    --grey: color-mix(in srgb, #5a5a59 var(--ink-mix), #8a8a88) !important;
  }
}

/* drifting grain */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.04;
  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.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: drift 14s steps(6) infinite;
}
@keyframes drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, -20px); }
}

main, .footer { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* ============ THE SEAM (hero) ============ */
.stage {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  /* black | seam gradient | white — the band interpolates through every grey */
  background: linear-gradient(90deg,
    var(--black) 0%,
    var(--black) calc(var(--split) - var(--band)),
    var(--white) calc(var(--split) + var(--band)),
    var(--white) 100%);
}

/* fades both halves to black at the foot of the stage, so it always lands
   cleanly on the dark section below instead of the white half cutting off
   abruptly — sits above the split background, below the seam/content */
.stage__fade {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 72%, var(--black) 100%);
}

/* the hairline + brand mark riding the seam */
.stage__seam {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--split);
  width: 0;
  z-index: 2;
  pointer-events: none;
  color: #808080;
}
.stage__seam::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -0.5px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(128,128,128,0.9) 18%, rgba(128,128,128,0.9) 82%, transparent);
}
.stage__seam-mark {
  position: absolute;
  bottom: 8svh;
  left: 0;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  transition: transform 0.4s var(--ease);
  /* it's the one thing in .stage__seam meant to be grabbed */
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
.stage__seam-mark:active { cursor: grabbing; }

/* touch: bigger target + a quiet pulse so it reads as "drag me" */
@media (pointer: coarse) {
  .stage__seam-mark {
    width: 42px;
    height: 42px;
    animation: seam-pulse 2.6s ease-in-out infinite;
  }
  .stage__seam-mark.was-dragged { animation: none; }
}
@keyframes seam-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* keyboard access — invisible until focused */
.stage__range {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(420px, 70vw);
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  accent-color: #808080;
}
.stage__range:focus-visible { opacity: 1; }

/* everything in here self-inverts: white over black, black over white,
   dissolving into grey right at the seam */
.stage__ink {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  mix-blend-mode: difference;
  color: #ffffff;
}

/* nav (inside the blend layer) */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  max-width: var(--max); margin: 0 auto; padding: 28px 32px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 24px; height: 24px; color: currentColor; display: inline-block; flex: none; }
.brand__mark--sm { width: 16px; height: 16px; color: var(--ink); }
.brand__name { font-family: "Space Grotesk", sans-serif; font-weight: 700; letter-spacing: -0.01em; font-size: 18px; }
.brand__grey { opacity: 0.55; }
.nav__links { display: flex; align-items: center; gap: 32px; font-size: 15px; }
.nav__links a { opacity: 0.75; transition: opacity 0.25s var(--ease); }
.nav__links a:hover { opacity: 1; }
.nav__cta {
  border: 1px solid rgba(255,255,255,0.4); padding: 8px 18px; border-radius: 999px; opacity: 1 !important;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.nav__cta:hover { background: #ffffff; color: #000000; border-color: #ffffff; }

/* hero content */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 32px 96px;
}
.eyebrow { font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.55; margin-bottom: 28px; }

.hero__title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(52px, 10.5vw, 148px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin-bottom: 44px;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .word {
  display: inline-block;
  animation: word-in 0.9s var(--ease) both;
}
@keyframes word-in {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}
.hero__title .line:nth-child(1) .word:nth-child(1) { animation-delay: 0.05s; }
.hero__title .line:nth-child(1) .word:nth-child(2) { animation-delay: 0.11s; }
.hero__title .line:nth-child(1) .word:nth-child(3) { animation-delay: 0.17s; }
.hero__title .line:nth-child(2) .word:nth-child(1) { animation-delay: 0.23s; }
.hero__title .line:nth-child(2) .word:nth-child(2) { animation-delay: 0.29s; }
.hero__title .line:nth-child(2) .word:nth-child(3) { animation-delay: 0.35s; }
.hero__title .line:nth-child(2) .word:nth-child(4) { animation-delay: 0.39s; }

[data-stagger] { animation: fade-up 0.8s var(--ease) both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
.eyebrow[data-stagger] { animation-delay: 0.02s; }
.hero__lead[data-stagger] { animation-delay: 0.5s; }
.hero__actions[data-stagger] { animation-delay: 0.58s; }
.hero__hint[data-stagger] { animation-delay: 0.9s; }

.hero__lead { max-width: 620px; font-size: clamp(17px, 2vw, 21px); opacity: 0.8; margin-bottom: 40px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.hero__hint {
  margin-top: 56px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.45;
}
.hero__hint--coarse { display: none; }
@media (pointer: coarse) {
  .hero__hint--fine { display: none; }
  .hero__hint--coarse { display: block; }
}

/* buttons — inside the blend layer these are pure white/black and self-invert */
.btn {
  display: inline-flex; align-items: center;
  font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 16px;
  padding: 14px 28px; border-radius: 999px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.stage__ink .btn--solid { background: #ffffff; color: #000000; }
.stage__ink .btn--solid:hover { opacity: 0.85; }
.stage__ink .btn--ghost { border: 1px solid rgba(255,255,255,0.4); color: #ffffff; }
.stage__ink .btn--ghost:hover { border-color: #ffffff; }

/* buttons outside the hero use the scroll-linked ink */
main .btn--solid { background: var(--ink); color: var(--bg); }
main .btn--solid:hover { opacity: 0.85; }
main .btn--ghost { border: 1px solid var(--line); color: var(--ink); }
main .btn--ghost:hover { border-color: var(--ink); }

/* ============ shared section chrome ============ */
section { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.section-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 48px; }
.section-num { font-family: "Space Grotesk", sans-serif; font-size: 14px; color: var(--ink-faint); letter-spacing: 0.1em; }
.section-head h2 { font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.02em; }

/* ============ Approach ============ */
.approach { padding: 140px 32px 100px; }
.approach__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.approach__quote {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  /* slow sheen sweeping through the greys */
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 38%, var(--grey) 50%, var(--ink) 62%, var(--ink) 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 7s var(--ease) infinite;
}
@keyframes sheen {
  0% { background-position: 120% 0; }
  55% { background-position: -20% 0; }
  100% { background-position: -20% 0; }
}
.approach__body p { color: var(--ink-soft); font-size: 18px; margin-bottom: 20px; }
.approach__body p:last-child { margin-bottom: 0; }

/* ============ Work / cards ============ */
.work { padding: 100px 32px; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: transparent; }
.card {
  --cx: 50%; --cy: 50%;
  position: relative;
  background: transparent;
  padding: 44px 40px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: transform 0.35s var(--ease);
  overflow: hidden;
}
.card::before {
  /* grey light pooling under the cursor */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--cx) var(--cy), rgba(140,140,140,0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover { transform: translateY(-4px); }
.card:nth-child(2n) { border-right: none; }
.card--wide { grid-column: 1 / -1; border-right: none; }
.card:last-child { border-bottom: none; }
.card__index { font-family: "Space Grotesk", sans-serif; font-size: 13px; color: var(--ink-faint); letter-spacing: 0.1em; transition: color 0.35s var(--ease); }
.card:hover .card__index { color: var(--ink); }
.card h3 { font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 26px; letter-spacing: -0.01em; margin: 16px 0 12px; }
.card p { color: var(--ink-soft); font-size: 16px; max-width: 36ch; }

/* ============ Manifesto — three beats, sticky theatre ============ */
.manifesto {
  position: relative;
  max-width: none;
  padding: 0;
}
.manifesto__sticky {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 32px;
  text-align: center;
  padding: 120px 32px;
}
.beat {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(30px, 5.4vw, 64px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 16ch;
}
/* literal blacks and whites — the grey plateau behind holds both.
   Each beat pairs its key word against the opposite tone:
   black word / white rest, white word / black rest, grey word / black rest. */
.beat--black { color: #f4f4f3; }
.beat--black .beat__word { color: #0a0a0b; font-weight: 700; }
.beat--white { color: #0a0a0b; }
.beat--white .beat__word { color: #f4f4f3; font-weight: 700; }
.beat--grey { color: #0a0a0b; }
/* "Grey" is actually grey — lighter than the plateau behind it, bold like
   the other beats' key words, same size as the rest of its line */
.beat--grey .beat__word {
  color: #cfcfcc;
  font-weight: 700;
}

/* JS + motion OK → the beats become a full-viewport sticky sequence */
@media (prefers-reduced-motion: no-preference) {
  body.js .manifesto { height: 280svh; }
  body.js .manifesto__sticky {
    position: sticky;
    top: 0;
    height: 100svh;
    padding: 0 32px;
    gap: 0;
  }
  /* opacity/transform are driven per-scroll-frame from JS (a continuous
     crossfade tied to scroll position) — no time-based transition here,
     that's what made beat changes feel like a snap on fast mobile scrolls */
  body.js .beat {
    position: absolute;
    opacity: 0;
    will-change: opacity, transform;
  }
}

/* ============ Contact — the white payoff ============ */
.contact { padding: 140px 32px 120px; text-align: center; }
.contact .section-head { justify-content: center; }
.contact__lead { color: var(--ink-soft); font-size: 20px; margin-bottom: 32px; }
.contact__actions { display: flex; justify-content: center; }

/* ============ Footer ============ */
.footer { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 40px 32px 56px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 14px; }
.footer .brand__grey { color: var(--grey); opacity: 1; }

/* ============ scroll-progress mark ============ */
.scroll-mark {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  width: 44px;
  height: 44px;
  color: var(--ink);
  transition: transform 0.25s var(--ease);
}
.scroll-mark:hover { transform: scale(1.08); }
.scroll-mark svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.scroll-mark__track { fill: none; stroke: var(--line); stroke-width: 2; }
.scroll-mark__fill {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 119.4;
  stroke-dashoffset: 119.4;
}
.scroll-mark__dot { fill: none; stroke: currentColor; stroke-width: 1.6; }
.scroll-mark__half { fill: currentColor; }

/* ============ Reveal-on-scroll (progressive) ============ */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      opacity: 0;
      transform: translateY(24px);
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 25%;
    }
  }
}
@keyframes reveal-in {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title .word, [data-stagger] { animation: none !important; opacity: 1 !important; transform: none !important; }
  .grain { animation: none; }
  .approach__quote { animation: none; background: none; color: var(--ink); -webkit-background-clip: unset; background-clip: unset; }
  .stage__seam-mark { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============ Mobile ============ */
@media (max-width: 760px) {
  .nav { padding: 22px 22px; }
  .nav__links { gap: 18px; font-size: 14px; }
  .nav__links a:not(.nav__cta) { display: none; }
  section, .approach, .work, .contact { padding-left: 22px; padding-right: 22px; }
  .approach { padding-top: 100px; }
  .approach__grid { grid-template-columns: 1fr; gap: 28px; }
  .cards { grid-template-columns: 1fr; }
  .card { border-right: none; }
  .hero { padding-bottom: 72px; }
  .hero__hint { margin-top: 40px; }
  .stage__seam-mark { bottom: 6svh; width: 28px; height: 28px; }
  .scroll-mark { right: 16px; bottom: 16px; width: 36px; height: 36px; }
}
