/* ============================================================
   GENE HEW — portfolio v3 · "the evolution"
   DNA: paper white / deeper emerald / near-black green
   Editorial type · rich scroll motion · premium restraint
   ============================================================ */

:root {
  --green: #12B176;
  --green-deep: color-mix(in oklab, var(--green), #042e1f 42%);
  --green-pale: color-mix(in oklab, var(--green), white 84%);
  --green-ghost: color-mix(in oklab, var(--green), white 93%);
  --mint: color-mix(in oklab, var(--green), white 50%);

  --paper: #FAFBF9;
  --ink: #14201A;
  --ink-soft: #5A6B62;
  --black: #0B1410;
  --black-2: #081009;
  --on-dark: #E9F2EC;
  --on-dark-soft: #93A89C;
  --line: color-mix(in oklab, var(--ink), transparent 87%);
  --line-dark: color-mix(in oklab, var(--on-dark), transparent 88%);

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Hanken Grotesk', sans-serif;
  --font-mono: 'Spline Sans Mono', monospace;

  --maxw: 1280px;
  --pad: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --motion: 1; /* global motion multiplier (tweakable) */
}

body[data-type="serif"] { --font-display: 'Source Serif 4', Georgia, serif; }
body[data-type="soft"]  { --font-display: 'Sora', sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--green); color: var(--black); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.02; margin: 0; text-wrap: balance; font-weight: 700; }
p { text-wrap: pretty; margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
figure { margin: 0; }

.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ---------- reveals ---------- */
body.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.9s ease, transform 1.1s var(--ease-out); }
body.js .reveal.in { opacity: 1; transform: none; }
body.js [data-stagger] > * { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 1s var(--ease-out); }
body.js [data-stagger].in > * { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  body.js .reveal, body.js [data-stagger] > * { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* word-mask reveal (hero h1) */
.split .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.12em; margin-bottom: -0.12em; padding-inline: 0.04em; margin-inline: -0.04em; }
.split .wi { display: inline-block; transform: translateY(115%); }
.split.go-done .w { overflow: visible; }
body.js .split.go .wi { animation: wordUp 1s var(--ease-out) forwards; }
@keyframes wordUp { to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .split .wi { transform: none !important; animation: none !important; } .split .w { overflow: visible; } }

/* ---------- scroll progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 90; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--green); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- cursor ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 120; border-radius: 50%; will-change: transform; }
.cursor-dot { width: 7px; height: 7px; background: var(--green); margin: -3.5px 0 0 -3.5px; }
.cursor-ring { width: 34px; height: 34px; border: 1.5px solid color-mix(in oklab, var(--green), transparent 35%); margin: -17px 0 0 -17px; transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, opacity 0.25s ease, border-color 0.25s ease; }
body.cursor-hot .cursor-ring { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: var(--green); }
@media (hover: none), (prefers-reduced-motion: reduce) { .cursor-dot, .cursor-ring { display: none; } }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 600;
  text-decoration: none; padding: 17px 32px; border-radius: 999px; border: 0; cursor: pointer;
  overflow: hidden; isolation: isolate; will-change: transform;
  transition: color 0.35s ease, border-color 0.35s ease;
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  transform: translateY(101%); transition: transform 0.45s var(--ease-out);
}
.btn:hover::after { transform: translateY(0); }
.btn-green { background: var(--green); color: var(--black); }
.btn-green::after { background: var(--ink); }
.btn-green:hover { color: var(--paper); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-line::after { background: var(--green); }
.btn-line:hover { color: var(--black); box-shadow: inset 0 0 0 1.5px var(--green); }
.dark-zone .btn-line { color: var(--on-dark); box-shadow: inset 0 0 0 1.5px var(--line-dark); }
.dark-zone .btn-line:hover { color: var(--black); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 15px clamp(18px, 3.5vw, 44px);
  color: var(--ink);
  background: color-mix(in oklab, var(--paper), transparent 18%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: box-shadow 0.4s ease, background 0.4s ease;
}
.nav.scrolled { box-shadow: 0 1px 0 var(--line); background: color-mix(in oklab, var(--paper), transparent 6%); }
.nav-links { display: flex; gap: clamp(8px, 2vw, 26px); align-items: center; }
.nav-links a { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; opacity: 0.78; padding: 6px 2px; position: relative; }
.nav-links a:not(.nav-cta)::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 100%; background: var(--green); transform: scaleX(0); transform-origin: 100% 50%; transition: transform 0.35s var(--ease-out); }
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav-links a:hover { opacity: 1; color: var(--green-deep); }
/* selector is .nav-links a.nav-cta so its padding beats the `.nav-links a`
   rule above (which would otherwise force a cramped 6px 2px on the pill) */
.nav-links a.nav-cta {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; padding: 11px 24px; border-radius: 999px; white-space: nowrap;
  margin-left: clamp(10px, 1.6vw, 26px);
  background: var(--green); color: var(--black) !important; opacity: 1 !important; font-weight: 600;
  transition: background 0.3s ease, transform 0.3s ease;
}
.nav-cta:hover { background: var(--mint); }
@media (max-width: 820px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ============================================================
   HERO — three directions: flow | editorial | greenroom
   ============================================================ */
.hero { position: relative; overflow: clip; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 96px; background: var(--paper); }
#flow-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0.5; }
.hero-watermark {
  position: absolute; inset: auto 0 4%; z-index: 0; display: none;
  font-family: var(--font-display); font-weight: 800; text-align: center;
  font-size: clamp(6rem, 17vw, 15rem); line-height: 0.9; letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in oklab, var(--green), transparent 55%);
  user-select: none; white-space: nowrap;
}
.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 4vw, 72px); align-items: center; width: 100%; }
.hero-kicker { color: var(--green-deep); font-weight: 600; display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.hero-kicker::before { content: ""; width: 38px; height: 3px; background: var(--green); flex: 0 0 auto; }
.hero-kicker .wave-l { display: inline-block; }
body.js .hero-kicker.waving .wave-l { animation: kickWave 1.4s ease 1; animation-delay: calc(var(--i) * 0.045s); }
@keyframes kickWave { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-7px); } 55% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { body.js .hero-kicker.waving .wave-l { animation: none; } }

.hero h1 { font-size: clamp(2.9rem, 6vw, 5.5rem); font-weight: 740; letter-spacing: -0.028em; max-width: 13.5ch; }
.hero h1 em { font-style: normal; color: var(--green-deep); position: relative; }
.hero h1 em .hl { position: absolute; left: -0.06em; right: -0.06em; bottom: 0.02em; height: 0.26em; background: color-mix(in oklab, var(--green), transparent 58%); z-index: -1; transform: scaleX(0); transform-origin: 0 50%; }
body.js .hero h1.go em .hl { animation: hlIn 0.9s var(--ease-out) 0.9s forwards; }
body:not(.js) .hero h1 em .hl, .hero h1.go-done em .hl { transform: scaleX(1); }
@keyframes hlIn { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .hero h1 em .hl { transform: scaleX(1) !important; animation: none !important; } }

.hero-sub { font-size: clamp(17px, 1.45vw, 20px); color: var(--ink-soft); max-width: 46ch; margin: 26px 0 14px; }
.hero-role { color: var(--ink-soft); margin: 0 0 34px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* mosaic (flow mode) */
.hero-mosaic { position: relative; }
.mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mosaic img { width: 100%; aspect-ratio: 0.86; object-fit: cover; border-radius: 8px; filter: saturate(1.04); transition: transform 0.6s var(--ease-out), box-shadow 0.6s ease; }
.mosaic img:hover { transform: scale(1.045) rotate(-1deg); box-shadow: 0 18px 40px -18px color-mix(in oklab, var(--green-deep), transparent 45%); z-index: 2; position: relative; }
.mosaic img:nth-child(2), .mosaic img:nth-child(5), .mosaic img:nth-child(8) { translate: 0 22px; }
.mosaic-tag { display: block; margin-top: 40px; text-align: right; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }

/* filmstrip (editorial mode) */
.hero-film { display: none; margin-top: clamp(40px, 6vh, 80px); overflow: hidden; }
.hero-film .film-track { display: flex; gap: 14px; width: max-content; animation: filmScroll 46s linear infinite; }
.hero-film img { height: clamp(150px, 22vh, 230px); width: auto; aspect-ratio: 1.35; object-fit: cover; border-radius: 8px; }
@keyframes filmScroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .hero-film .film-track { animation: none; } }

.hero-scroll {
  position: absolute; right: clamp(14px, 2.5vw, 34px); bottom: 24px; z-index: 3;
  writing-mode: vertical-rl; color: var(--ink-soft); font-size: 11px; letter-spacing: 0.22em;
  display: flex; align-items: center; gap: 10px;
}
.hero-scroll::after { content: ""; width: 1.5px; height: 52px; background: linear-gradient(var(--green), transparent); }

/* --- mode: editorial --- */
body[data-hero="editorial"] #flow-canvas { display: none; }
body[data-hero="editorial"] .hero-mosaic { display: none; }
body[data-hero="editorial"] .hero-grid { grid-template-columns: 1fr; align-items: end; }
body[data-hero="editorial"] .hero h1 { font-size: clamp(3.2rem, 8.4vw, 8rem); max-width: 12ch; letter-spacing: -0.034em; }
body[data-hero="editorial"] .hero-sub { font-size: clamp(18px, 1.6vw, 22px); max-width: 52ch; }
body[data-hero="editorial"] .hero-film { display: block; }
body[data-hero="editorial"] .hero { justify-content: flex-end; padding-bottom: 0; }
body[data-hero="editorial"] .hero-film { margin-bottom: 0; }

/* --- mode: greenroom --- */
body[data-hero="greenroom"] .hero { background: var(--green-ghost); }
body[data-hero="greenroom"] #flow-canvas { opacity: 0.32; }
body[data-hero="greenroom"] .hero-watermark { display: block; }
body[data-hero="greenroom"] .mosaic { grid-template-columns: repeat(2, 1fr); gap: 0; }
body[data-hero="greenroom"] .mosaic img { display: none; border: 8px solid white; border-bottom-width: 34px; border-radius: 3px; box-shadow: 0 22px 44px -20px rgba(10, 30, 20, 0.4); aspect-ratio: 0.92; }
body[data-hero="greenroom"] .mosaic img:nth-child(-n+4) { display: block; }
body[data-hero="greenroom"] .mosaic img:nth-child(1) { rotate: -4deg; translate: 8px 6px; }
body[data-hero="greenroom"] .mosaic img:nth-child(2) { rotate: 3deg; translate: -4px 30px; }
body[data-hero="greenroom"] .mosaic img:nth-child(3) { rotate: 2.5deg; translate: 14px -2px; }
body[data-hero="greenroom"] .mosaic img:nth-child(4) { rotate: -2deg; translate: -10px 22px; }
body[data-hero="greenroom"] .mosaic img:hover { rotate: 0deg; transform: scale(1.04); }
body[data-hero="greenroom"] .mosaic-tag { text-align: center; }

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 110px; padding-bottom: 40px; }
  .hero-mosaic { display: none; }
  body[data-hero="flow"] .hero-film, body[data-hero="greenroom"] .hero-film { display: block; }
  .hero-watermark { display: none !important; }
}

/* ---------- marquee ---------- */
.marquee { overflow: hidden; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); position: relative; z-index: 3; }
.marquee .mq-track { display: flex; gap: 0; width: max-content; animation: mqScroll 36s linear infinite; }
.marquee:hover .mq-track { animation-play-state: paused; }
.marquee span { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; padding-right: 18px; }
.marquee span b { color: var(--green-deep); font-weight: 600; }
.marquee span::after { content: "·"; color: var(--green); padding-left: 18px; }
@keyframes mqScroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee .mq-track { animation: none; } }

/* ---------- section scaffolding ---------- */
section { position: relative; }
.sec-head { position: relative; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-eyebrow { display: inline-flex; align-items: center; gap: 12px; color: var(--green-deep); font-weight: 600; margin-bottom: 18px; }
.sec-eyebrow::before { content: ""; width: 30px; height: 2.5px; background: var(--green); }
.sec-title { font-size: clamp(2.1rem, 4.4vw, 3.8rem); letter-spacing: -0.025em; font-weight: 730; max-width: 22ch; }
.sec-intro { margin-top: 20px; color: var(--ink-soft); max-width: 58ch; font-size: 17.5px; }
.sec-index {
  position: absolute; top: -0.18em; right: 0; z-index: 0; pointer-events: none; user-select: none;
  font-family: var(--font-display); font-weight: 800; line-height: 1;
  font-size: clamp(5rem, 11vw, 10rem); letter-spacing: -0.03em;
  color: transparent; -webkit-text-stroke: 1.2px color-mix(in oklab, var(--green), transparent 62%);
}
.dark-zone .sec-eyebrow { color: var(--green); }
.dark-zone .sec-title { color: var(--on-dark); }
.dark-zone .sec-intro { color: var(--on-dark-soft); }
.dark-zone .sec-index { -webkit-text-stroke-color: color-mix(in oklab, var(--green), transparent 55%); }
@media (max-width: 700px) { .sec-index { display: none; } }
