/* ==========================================================================
   Md. Imam Hasan - portfolio, v2
   Hand-written CSS. No framework.
   ========================================================================== */

/* Fonts, served from this site (Latin subsets, SIL Open Font License). */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap; src: url("/assets/fonts/bricolage.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/assets/fonts/inter.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2"); }

:root {
  --bg: #060c16;
  --bg-2: #0a1423;
  --surface: #0d1929;
  --surface-2: #112035;
  --line: rgba(160, 190, 230, .10);
  --line-2: rgba(160, 190, 230, .18);
  --text: #e9eff8;
  --muted: #93a5bf;
  --dim: #5f7290;
  --teal: #2fd4bd;
  --teal-2: #7cf0de;
  --teal-glow: rgba(47, 212, 189, .18);
  --pop: #ff6f61;
  --pop-2: #ff9a8f;
  --pop-glow: rgba(255, 111, 97, .16);
  --amber: var(--pop);
  --amber-glow: var(--pop-glow);
  --before: #6d7f9c;
  --radius: 20px;
  --maxw: 1200px;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--pop); color: #1a0705; }

body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(47, 212, 189, .13), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(56, 104, 196, .12), transparent 65%),
    radial-gradient(700px 500px at 100% 70%, rgba(255, 111, 97, .05), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .05;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { width: min(var(--maxw), 100% - 48px); margin-inline: auto; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; }
.teal { color: var(--teal); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 500 .8em/1 var(--mono); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: rgba(255, 255, 255, .05); color: var(--text); }

/* ---------- Intro: a two-second "ranking" moment, once per visit ---------- */
.intro-screen { display: none; }
html.intro .intro-screen {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 300;
  background: var(--bg); border-bottom: 6px solid var(--pop);
  animation: introOut .8s cubic-bezier(.7, 0, .2, 1) 1.55s forwards;
}
@keyframes introOut { to { transform: translateY(-101%); visibility: hidden; } }
.intro-inner { text-align: center; }
.intro-q {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font: 500 15px/1 var(--mono);
}
.intro-q svg { width: 16px; height: 16px; color: var(--teal); }
.intro-q span::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -2px; background: var(--teal); animation: blink .8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.intro-rank { font: 800 clamp(110px, 22vw, 260px)/1 var(--display); letter-spacing: -.05em; margin: 18px 0 6px; color: var(--text); }
.intro-rank.won { color: var(--teal-2); text-shadow: 0 0 60px rgba(47, 212, 189, .5); }
.intro-sub { font: 500 13px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
html.intro .hero .reveal { animation-delay: calc(var(--d, 0s) + 1.75s); }

/* ---------- Scroll progress ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--teal), var(--pop)); }

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 1.5px solid rgba(124, 240, 222, .7); display: grid; place-items: center; transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s, border-color .3s, opacity .3s; }
.cursor span { font: 600 12px/1 var(--sans); color: #1a0705; opacity: 0; transition: opacity .2s; letter-spacing: .02em; }
.cursor.label { width: 78px; height: 78px; margin: -39px 0 0 -39px; background: var(--pop); border-color: var(--pop); }
.cursor.label span { opacity: 1; }
.cursor.hide { opacity: 0; }
.cursor.press { width: 26px; height: 26px; margin: -13px 0 0 -13px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(var(--maxw), 100% - 28px);
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(8, 16, 28, .62); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-color: var(--line-2); background: rgba(8, 16, 28, .85); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; transition: transform .6s var(--spring); }
.brand:hover svg { transform: rotate(-12deg) scale(1.08); }
.brand span { font-size: 15px; }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a { position: relative; font-size: 14.5px; color: var(--muted); padding: 8px 13px; border-radius: 999px; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.on { color: var(--text); background: rgba(255, 255, 255, .06); }
.nav-links a.on::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--pop); }
.x-toggle {
  display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted);
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); transition: border-color .2s, color .2s;
}
.x-toggle:hover { color: var(--text); border-color: var(--line-2); }
.x-toggle .knob { width: 28px; height: 16px; border-radius: 99px; background: var(--surface-2); position: relative; transition: background .25s; }
.x-toggle .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform .35s var(--spring), background .25s; }
body.expanded .x-toggle { color: var(--teal-2); border-color: rgba(47, 212, 189, .4); }
body.expanded .x-toggle .knob { background: rgba(47, 212, 189, .25); }
body.expanded .x-toggle .knob::after { transform: translateX(12px); background: var(--teal); }
.btn {
  display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; letter-spacing: -.005em;
  padding: 14px 22px; border-radius: 999px; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .3s, background .2s, border-color .2s, translate .25s var(--ease);
}
.btn-primary { background: var(--teal); color: #03201b; }
.btn-primary:hover { box-shadow: 0 12px 36px -6px rgba(47, 212, 189, .6); }
.btn-primary svg { transition: transform .3s var(--ease); }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--pop); color: var(--pop-2); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; }
.menu-btn { display: none; }

.menu { position: fixed; inset: 0; z-index: 45; background: var(--bg); display: flex; flex-direction: column; justify-content: center; padding: 100px 28px 40px; clip-path: circle(0 at calc(100% - 44px) 40px); transition: clip-path .6s cubic-bezier(.7, 0, .2, 1); visibility: hidden; }
.menu.open { clip-path: circle(150% at calc(100% - 44px) 40px); visibility: visible; }
.menu nav { display: flex; flex-direction: column; gap: 6px; }
.menu nav a { font: 800 clamp(44px, 12vw, 72px)/1.05 var(--display); letter-spacing: -.04em; display: flex; align-items: baseline; gap: 14px; }
.menu nav a small { font: 500 13px/1 var(--mono); color: var(--pop); letter-spacing: .1em; }
.menu-foot { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 40px; font: 500 14px/1 var(--mono); color: var(--teal); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 140px 0 80px; min-height: 100vh; display: flex; align-items: center; overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: 1.18fr .82fr; gap: 20px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: pulse 2.2s infinite; }
.eyebrow .sep { color: var(--dim); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 212, 189, .6); } 70% { box-shadow: 0 0 0 10px rgba(47, 212, 189, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 212, 189, 0); } }
.rotator { display: inline-grid; overflow: hidden; height: 1.25em; line-height: 1.25em; color: var(--pop); vertical-align: bottom; }
.rotator span { grid-area: 1 / 1; transform: translateY(110%); opacity: 0; transition: transform .55s var(--ease), opacity .4s; white-space: nowrap; }
.rotator span.on { transform: none; opacity: 1; }
.rotator span.out { transform: translateY(-110%); opacity: 0; }
.rotator:not(.live) span:first-child { transform: none; opacity: 1; }
.hero h1 { font: 800 clamp(44px, 5.7vw, 84px)/.95 var(--display); letter-spacing: -.035em; margin: 24px 0 40px; }
.hero h1 .line { display: block; }
.hero h1 .serif { font-size: 1.06em; letter-spacing: -.015em; color: var(--teal-2); font-weight: 400; }
.squiggle { position: relative; display: inline-block; white-space: nowrap; }
.squiggle svg { position: absolute; left: -2%; bottom: -.36em; width: 104%; height: .32em; overflow: visible; }
.squiggle path { fill: none; stroke: var(--pop); stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw .75s cubic-bezier(.6, .05, .3, 1) 1.15s forwards; }
.squiggle path.sq2 { stroke-width: 3; opacity: .65; animation-delay: 1.65s; animation-duration: .55s; }
html.intro .squiggle path { animation-delay: 2.9s; }
html.intro .squiggle path.sq2 { animation-delay: 3.4s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero .lede { font-size: clamp(17px, 1.45vw, 19.5px); color: var(--muted); max-width: 560px; margin: 0 0 34px; }
.h-touch { display: none; }
@media (hover: none) { .h-fine { display: none; } .h-touch { display: inline; } }
.hero .lede strong { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-meta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 10px 26px; font: 500 13px/1.4 var(--mono); color: var(--dim); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 14px; height: 14px; color: var(--teal); }
.hero-meta kbd { font-size: 11px; }

.hero-visual { position: relative; aspect-ratio: 1 / 1.08; max-width: 580px; justify-self: end; width: 100%; }
.hero-visual .halo { position: absolute; inset: 4% 6% 6%; border-radius: 50%; background: radial-gradient(circle at 50% 42%, rgba(47, 212, 189, .32), rgba(47, 212, 189, .05) 55%, transparent 70%); filter: blur(4px); }
.hero-visual .ring { position: absolute; inset: 2% 4% 6%; border-radius: 50%; border: 1px solid rgba(47, 212, 189, .25); }
.hero-visual .ring.r2 { inset: -4% -2% 0; border-color: rgba(255, 111, 97, .16); border-style: dashed; animation: spin 80s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-visual .curve { position: absolute; inset: auto -12% 8% -12%; width: 124%; height: auto; overflow: visible; }
.hero-visual img.portrait {
  position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%); width: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 97%); mask-image: linear-gradient(to bottom, #000 70%, transparent 97%);
}
.sticker {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px;
  padding: 10px 15px 10px 10px; border-radius: 16px; line-height: 1.2; font-size: 13px;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  rotate: var(--rot, 0deg); translate: var(--tx, 0) var(--ty, 0);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .75);
  animation: float 6s ease-in-out infinite;
  transition: rotate .4s var(--spring), scale .3s var(--spring), box-shadow .3s;
}
.sticker:hover { scale: 1.06; }
.sticker.dragging { cursor: grabbing; scale: 1.1; rotate: 0deg; animation-play-state: paused; box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .9); z-index: 5; transition: scale .3s var(--spring), rotate .3s; }
.sticker b { display: block; font: 800 21px/1 var(--display); letter-spacing: -.02em; }
.sticker .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.sticker .ic svg { width: 17px; height: 17px; }
.sticker.s1 { top: 9%; left: -10%; --rot: -6deg; background: var(--teal); color: #03201b; }
.sticker.s1 .ic { background: rgba(3, 32, 27, .14); }
.sticker.s2 { top: 42%; right: -9%; --rot: 5deg; background: var(--pop); color: #1a0705; animation-delay: -2s; }
.sticker.s2 .ic { background: rgba(26, 7, 5, .12); }
.sticker.s3 { bottom: 14%; left: -5%; --rot: -3deg; background: rgba(13, 25, 41, .92); border: 1px solid var(--line-2); color: var(--muted); backdrop-filter: blur(10px); animation-delay: -4s; }
.sticker.s3 b { color: var(--text); }
.sticker.s3 .ic { background: var(--teal-glow); color: var(--teal); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.drag-hint { position: absolute; top: 1%; left: 10%; font: 500 12px/1 var(--mono); color: var(--pop-2); rotate: -6deg; transition: opacity .4s; }
.drag-hint::after { content: "↙"; display: inline-block; margin-left: 4px; font-size: 15px; }
.drag-hint.gone { opacity: 0; }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll-cue i { width: 1px; height: 34px; background: linear-gradient(var(--teal), transparent); animation: drip 2s infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Section headings: big, filled in as you scroll ---------- */
section { position: relative; }
.section { padding: 110px 0; }
.big-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 54px; }
.big-head .idx { font: 500 14px/1 var(--mono); color: var(--pop); letter-spacing: .1em; padding-top: .9em; }
.big-title {
  position: relative; margin: 0; font: 800 clamp(52px, 9.4vw, 140px)/.9 var(--display); letter-spacing: -.045em;
  color: transparent; -webkit-text-stroke: 1.5px rgba(233, 239, 248, .28);
}
.big-title::after {
  content: attr(data-text); position: absolute; inset: 0; color: var(--text); -webkit-text-stroke: 0;
  clip-path: inset(0 calc(100% - var(--p, 100%)) 0 0);
}
.big-title::before {
  content: ""; position: absolute; left: 0; bottom: -.06em; height: .07em; width: var(--p, 100%); max-width: 100%;
  background: linear-gradient(90deg, var(--teal), var(--pop)); border-radius: 99px;
}
.sub-head { display: flex; align-items: center; gap: 16px; margin: 100px 0 34px; }
.sub-head:first-of-type { margin-top: 0; }
.sub-k { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 800 19px/1 var(--display); background: var(--pop); color: #1a0705; rotate: -8deg; }
.sub-head h3 { margin: 0; font: 800 clamp(32px, 4.2vw, 58px)/1 var(--display); letter-spacing: -.035em; }
.sub-head h3 .serif { color: var(--teal-2); }

/* ---------- Results bento (flip cards) ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(210px, auto); gap: 14px; }
.kpi { position: relative; outline: none; }
.kpi.k-hero { grid-column: span 2; grid-row: span 2; }
.kpi.k-wide { grid-column: span 2; }
.k-flip { position: relative; height: 100%; display: grid; transform-style: preserve-3d; transition: transform .8s var(--spring); transition-delay: calc(var(--i, 0) * 45ms); }
.k-face {
  grid-area: 1 / 1; position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 24px 22px 22px; border-radius: var(--radius);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: linear-gradient(180deg, rgba(17, 32, 53, .92), rgba(11, 22, 38, .92)); border: 1px solid var(--line);
}
.k-back { transform: rotateY(180deg); background: linear-gradient(160deg, var(--surface-2), #0b1626); border-color: rgba(47, 212, 189, .35); }
.kpi:focus-visible .k-face { outline: 2px solid var(--teal); outline-offset: 3px; }
@media (hover: hover) { .kpi:hover .k-flip { transform: rotateY(180deg); transition-delay: 0s; } }
.kpi.flipped .k-flip, body.expanded .kpi .k-flip { transform: rotateY(180deg); }
body.expanded .kpi.flipped .k-flip { transform: none; }
.k-label { font: 500 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.k-num { font: 800 clamp(50px, 5vw, 76px)/.95 var(--display); letter-spacing: -.05em; margin: 18px 0 8px; color: var(--text); }
.k-sub { font: 500 16px/1.35 var(--sans); color: var(--text); opacity: .86; }
.k-desc { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 10px 0 0; }
.k-mini { margin-top: 16px; font: 600 15px/1.3 var(--sans); color: var(--text); }
.k-mini b { display: block; font: 800 34px/1 var(--display); letter-spacing: -.04em; color: var(--teal-2); margin-bottom: 4px; }
.k-hero .k-mini b { font-size: 72px; }
.k-hero .k-mini { font-size: 20px; margin-top: 26px; }
.k-flipic { position: absolute; right: 16px; top: 16px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--dim); border: 1px solid var(--line); transition: color .3s, border-color .3s; }
.k-flipic svg { width: 13px; height: 13px; }
.kpi:hover .k-flipic { color: var(--pop); border-color: var(--pop); }
.kpi .spark { margin-top: auto; padding-top: 16px; height: 50px; width: 100%; }
.delta { margin-top: auto; padding-top: 16px; font: 500 13px/1 var(--mono); color: var(--dim); display: flex; align-items: center; gap: 10px; }
.delta b { color: var(--teal); font-weight: 500; }
.delta i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), var(--teal)); }
.kpi.accent .k-front { background: radial-gradient(600px 300px at 0% 0%, rgba(47, 212, 189, .28), transparent 60%), linear-gradient(160deg, #0f2a36, #0b1626 70%); border-color: rgba(47, 212, 189, .35); }
.k-hero .k-num { font-size: clamp(96px, 12vw, 178px); margin-top: 26px; background: linear-gradient(180deg, #fff 30%, var(--teal-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.k-hero .k-sub { font-size: 21px; }
.k-hero .k-desc { font-size: 17px; }
.ratio { margin-top: auto; padding-top: 26px; display: grid; gap: 12px; }
.ratio div { display: grid; gap: 6px; }
.ratio span { display: block; height: 12px; width: var(--w); border-radius: 99px; background: rgba(160, 190, 230, .2); transform-origin: left; }
.ratio span.on { background: linear-gradient(90deg, var(--teal), var(--teal-2)); box-shadow: 0 0 22px rgba(47, 212, 189, .45); }
.ratio em { font: 500 12px/1 var(--mono); font-style: normal; color: var(--dim); }
.reveal.in .ratio span { animation: grow 1.2s var(--ease) .3s both; }
@keyframes grow { from { transform: scaleX(0); } }
.k-row { display: flex; align-items: flex-end; gap: 22px; flex: 1; }
.k-row > div:first-child { flex: none; }
.k-row .spark { flex: 1; height: 90px; padding: 0; margin: 0; }

/* ---------- Toolbox ribbons ---------- */
.ribbons { position: relative; height: 210px; overflow: hidden; margin: 0 0 -10px; }
.rb-k { position: absolute; left: max(24px, calc((100% - var(--maxw)) / 2)); top: 14px; font: 500 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.rb-k::before { content: "✺ "; color: var(--pop); }
.ribbon { position: absolute; left: -6%; width: 112%; top: 54%; padding: 9px 0; overflow: hidden; box-shadow: 0 16px 40px -20px rgba(0, 0, 0, .8); }
.ribbon.r-a { background: var(--teal); transform: translateY(-50%) rotate(-3deg); z-index: 2; }
.ribbon.r-b { background: var(--pop); transform: translateY(-50%) rotate(2.6deg); }
.ribbon-track { display: flex; align-items: center; gap: 8px; width: max-content; animation: marquee 48s linear infinite; }
.r-b .ribbon-track { animation-direction: reverse; animation-duration: 56s; }
.ribbons.paused .ribbon-track, .marquee.paused .marquee-track { animation-play-state: paused; }
.ribbon .tool { font: 500 13.5px/1 var(--sans); padding: 9px 14px; border-radius: 999px; white-space: nowrap; }
.r-a .tool { background: rgba(3, 32, 27, .1); border: 1px solid rgba(3, 32, 27, .22); color: rgba(3, 32, 27, .78); }
.r-b .tool { background: rgba(26, 7, 5, .08); border: 1px solid rgba(26, 7, 5, .2); color: rgba(26, 7, 5, .78); }
.ribbon .tool.b { font-weight: 700; color: #03201b; }
.r-b .tool.b { color: #1a0705; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Skills ---------- */
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cap {
  position: relative; overflow: hidden; text-align: left; width: 100%;
  border-radius: var(--radius); padding: 22px 22px 20px;
  background: rgba(13, 25, 41, .75); border: 1px solid var(--line);
  transition: border-color .3s, background .3s, transform .4s var(--spring);
  display: flex; flex-direction: column; gap: 12px;
}
.cap::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--teal), var(--pop)); transform: scaleY(0); transform-origin: top; transition: transform .45s var(--ease); }
.cap:hover { border-color: var(--line-2); transform: translateY(-4px); }
.cap:hover::before, .cap[aria-expanded="true"]::before { transform: scaleY(1); }
.cap[aria-expanded="true"] { border-color: rgba(47, 212, 189, .4); background: rgba(17, 32, 53, .95); }
.cap-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.cap-title { display: flex; align-items: center; gap: 12px; font: 700 19px/1.2 var(--display); letter-spacing: -.01em; }
.cap-title .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--teal); flex: none; transition: transform .6s var(--spring), background .3s, color .3s; }
.cap:hover .cap-title .ic { transform: rotate(-12deg) scale(1.08); background: var(--teal); color: #03201b; }
.cap-title .ic svg { width: 18px; height: 18px; }
.cap .plus { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; flex: none; transition: transform .45s var(--spring), background .3s; color: var(--muted); }
.cap .plus svg { width: 12px; height: 12px; }
.cap[aria-expanded="true"] .plus { transform: rotate(135deg); background: var(--pop); color: #1a0705; border-color: var(--pop); }
.cap-proof { display: block; font-size: 15px; color: var(--text); }
.cap-proof b { color: var(--teal-2); font-weight: 600; }
.cap-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.cap-more > span { display: block; overflow: hidden; min-height: 0; }
.cap-more .cap-p { display: block; margin: 4px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.cap[aria-expanded="true"] .cap-more { grid-template-rows: 1fr; }

/* ---------- Case studies: cards that stack as you scroll ---------- */
.stack { display: grid; gap: 26px; }
.case {
  position: sticky; top: calc(96px + var(--i, 0) * 18px);
  display: grid; grid-template-columns: 1.1fr 1fr; min-height: 290px;
  border-radius: 26px; overflow: hidden;
  background: linear-gradient(160deg, #0f1e32, #0a1525); border: 1px solid var(--line-2);
  box-shadow: 0 -20px 60px -30px rgba(0, 0, 0, .9);
  transition: border-color .3s, box-shadow .45s;
}
.case:hover { border-color: rgba(47, 212, 189, .5); }
.case-viz {
  position: relative; padding: 44px 26px 14px; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(180deg, transparent, rgba(6, 12, 22, .5)), repeating-linear-gradient(0deg, transparent 0 37px, rgba(160, 190, 230, .05) 37px 38px);
  border-right: 1px solid var(--line);
}
.case-viz svg { width: 100%; height: 100%; overflow: visible; }
.case-viz .viz-label { position: absolute; top: 20px; left: 30px; font: 500 11.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.case-body { padding: 28px 32px 26px; display: flex; flex-direction: column; gap: 10px; }
.case-top { display: flex; justify-content: space-between; align-items: center; font: 500 12.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.case-top .num { font: 800 34px/1 var(--display); color: var(--pop); letter-spacing: -.03em; }
.case h4 { font: 800 clamp(30px, 3vw, 42px)/1.02 var(--display); letter-spacing: -.035em; margin: 6px 0 0; }
.case .result { font-size: 17px; color: var(--muted); margin: 0; }
.case .result b { color: var(--text); font-weight: 600; }
.case-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 500 11.5px/1 var(--mono); padding: 7px 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--muted); }
.arrow { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--line-2); transition: background .3s, border-color .3s, transform .5s var(--spring); }
.arrow svg { width: 19px; height: 19px; }
.case:hover .arrow { background: var(--pop); border-color: var(--pop); color: #1a0705; transform: rotate(-45deg) scale(1.08); }

/* ---------- What I shipped ---------- */
.video { position: relative; overflow: hidden; background: #000; cursor: pointer; }
.video img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .3s; opacity: .9; }
.video:hover img { transform: scale(1.05); opacity: 1; }
.video .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--pop); color: #1a0705; box-shadow: 0 0 0 10px rgba(255, 111, 97, .22); transition: transform .4s var(--spring); }
.video:hover .play { transform: translate(-50%, -50%) scale(1.12); }
.video .play svg { width: 20px; height: 20px; margin-left: 3px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }
.phones { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; padding: 6px 4px 10px; }
.phone { margin: 0; rotate: var(--r, 0deg); transition: rotate .5s var(--spring), translate .5s var(--spring); }
.phone:hover, .phone:focus-within { rotate: 0deg; translate: 0 -10px; }
.phone .video { aspect-ratio: 9 / 16; border-radius: 30px; border: 7px solid #141f30; box-shadow: 0 0 0 1px var(--line-2), 0 30px 60px -28px rgba(0, 0, 0, .9); }
.phone .video::before { content: ""; position: absolute; top: 9px; left: 50%; width: 34%; height: 15px; margin-left: -17%; border-radius: 99px; background: #141f30; z-index: 2; }
.phone .video.playing::before { display: none; }
.phone figcaption, .wide figcaption { margin-top: 14px; font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.phone figcaption b, .wide figcaption b { display: block; color: var(--text); font: 700 16px/1.25 var(--display); margin-bottom: 3px; letter-spacing: -.01em; }
.shipped-row { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; margin-top: 44px; align-items: start; }
.wide { margin: 0; }
.wide .video { aspect-ratio: 16 / 9; border-radius: 22px; border: 1px solid var(--line-2); }
.writing { border-radius: 22px; border: 1px solid var(--line); background: rgba(13, 25, 41, .7); padding: 8px 8px 16px; }
.w-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.w-head a { color: var(--pop-2); letter-spacing: .06em; }
.w-head a:hover { color: var(--pop); }
.article { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; padding: 14px 16px; border-radius: 14px; overflow: hidden; isolation: isolate; }
.article::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(47, 212, 189, .14), rgba(255, 111, 97, .08)); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.article:hover::before { transform: scaleX(1); }
.article + .article { border-top: 1px solid var(--line); }
.article .type { grid-column: 1; font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.article .t { grid-column: 1; font: 700 16.5px/1.3 var(--display); letter-spacing: -.01em; }
.article .go { grid-column: 2; grid-row: 1 / span 2; color: var(--dim); font-size: 18px; transition: transform .35s var(--spring), color .2s; }
.article:hover .go { color: var(--pop); transform: translate(3px, -3px); }
.w-note { margin: 12px 16px 0; font-size: 13.5px; color: var(--muted); }
.w-note a { color: var(--teal); border-bottom: 1px solid rgba(47, 212, 189, .4); }

/* ---------- Quote ---------- */
.quote-sec { padding-top: 0; }
.quote {
  position: relative; border-radius: 30px; padding: clamp(32px, 5vw, 70px); margin: 0;
  background: linear-gradient(135deg, rgba(47, 212, 189, .12), rgba(13, 25, 41, .6) 55%, rgba(255, 111, 97, .08));
  border: 1px solid rgba(47, 212, 189, .22); display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: start;
}
.quote .mark { font: 400 170px/.7 var(--serif); color: var(--pop); }
.quote blockquote { margin: 0; font: 400 clamp(23px, 2.7vw, 36px)/1.28 var(--serif); font-style: italic; letter-spacing: -.005em; }
.quote figcaption { margin-top: 22px; font-size: 15px; color: var(--muted); }
.quote figcaption b { color: var(--text); font-weight: 600; }
.quote figcaption a { color: var(--teal); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.about-card { border-radius: var(--radius); padding: 32px; background: rgba(13, 25, 41, .75); border: 1px solid var(--line); }
.about-card h3 { font: 800 clamp(26px, 2.6vw, 34px)/1.1 var(--display); margin: 0 0 14px; letter-spacing: -.03em; }
.about-card h3 .serif { color: var(--teal-2); }
.about-card > p { color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 15px; }
.timeline .yr { font: 500 12.5px/1.6 var(--mono); color: var(--pop-2); }
.timeline b { font-weight: 600; }
.timeline span { color: var(--muted); }
.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.langs span { font: 500 12px/1 var(--mono); padding: 8px 11px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.about-side { display: grid; gap: 18px; align-content: start; }
.trophy { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 260px; border: 1px solid var(--line); }
.trophy img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; opacity: .75; transition: transform .8s var(--ease); }
.trophy:hover img { transform: scale(1.05); }
.trophy figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 50px 22px 18px; background: linear-gradient(transparent, rgba(4, 9, 17, .95)); font-size: 14px; color: var(--muted); }
.trophy figcaption b { display: block; color: var(--text); font: 700 18px/1.3 var(--display); }
.toolbox { border-radius: var(--radius); padding: 22px; background: rgba(13, 25, 41, .75); border: 1px solid var(--line); }
.tb-k { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }
.tb-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tb-list span { font-size: 13.5px; padding: 7px 11px; border-radius: 99px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--muted); transition: background .2s, color .2s, border-color .2s, rotate .3s var(--spring); }
.tb-list span:hover { background: var(--teal); color: #03201b; border-color: var(--teal); rotate: -3deg; }

/* ---------- Contact ---------- */
.contact {
  position: relative; overflow: hidden; text-align: center; isolation: isolate;
  border-radius: 34px; padding: clamp(46px, 7vw, 90px) 24px;
  background: radial-gradient(700px 320px at 50% 0%, rgba(47, 212, 189, .22), transparent 70%), radial-gradient(500px 260px at 100% 100%, rgba(255, 111, 97, .14), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--bg-2));
  border: 1px solid rgba(47, 212, 189, .25);
}
.contact .grid-bg { position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: linear-gradient(rgba(160, 190, 230, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(160, 190, 230, .06) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 70%); mask-image: radial-gradient(circle at 50% 40%, #000, transparent 70%); }
.cup svg { width: 100%; overflow: visible; }
.cup .steam { stroke: var(--teal-2); stroke-width: 4; stroke-linecap: round; opacity: 0; animation: steam 2.8s ease-in-out infinite; }
.cup .s2 { animation-delay: .6s; }
.cup .s3 { animation-delay: 1.2s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes bob { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-4px); } }
.contact h2 { font: 800 clamp(42px, 6.4vw, 92px)/.98 var(--display); letter-spacing: -.045em; margin: 10px auto 20px; max-width: 980px; }
.contact h2 .serif { color: var(--teal-2); display: block; }
.contact > p { color: var(--muted); max-width: 600px; margin: 0 auto 40px; font-size: 18px; }
.channels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 1060px; margin: 0 auto; text-align: left; }
.channel { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-radius: 18px; background: rgba(6, 12, 22, .55); border: 1px solid var(--line-2); transition: border-color .3s, background .3s, translate .25s var(--ease), transform .3s var(--spring); }
.channel:hover { border-color: var(--teal); background: rgba(47, 212, 189, .1); transform: translateY(-3px); }
.channel:first-child { background: var(--teal); color: #03201b; border-color: var(--teal); }
.channel:first-child span:last-child { color: rgba(3, 32, 27, .75); }
.channel:first-child .ch-ic { background: rgba(3, 32, 27, .14); color: #03201b; }
.ch-ic { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, .05); color: var(--teal); }
.ch-ic svg { width: 19px; height: 19px; }
.channel > span:last-child { font-size: 13px; color: var(--muted); line-height: 1.3; }
.channel b { display: block; font: 700 16.5px/1.2 var(--display); color: inherit; }
.channel:not(:first-child) b { color: var(--text); }

/* ---------- Footer ---------- */
footer { padding: 30px 0 50px; color: var(--dim); font-size: 14px; }
.giant {
  font: 800 clamp(48px, 10.5vw, 150px)/.84 var(--display); letter-spacing: -.06em; text-align: center; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px rgba(160, 190, 230, .16);
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), var(--teal) 0%, var(--pop) 45%, transparent 70%);
  -webkit-background-clip: text; background-clip: text; padding: 6px 0 22px; user-select: none;
}
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: center; border-top: 1px solid var(--line); padding-top: 26px; }
.foot-row a:hover { color: var(--teal); }
.foot-links { display: flex; gap: 20px; }
.clock b { color: var(--teal); font-weight: 500; font-family: var(--mono); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); z-index: 320; padding: 12px 18px; border-radius: 999px; background: var(--teal); color: #03201b; font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .25s, transform .35s var(--spring); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Command palette (Ctrl/Cmd + K) ---------- */
.cmdk { position: fixed; inset: 0; z-index: 350; display: none; background: rgba(3, 7, 13, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cmdk.on { display: block; animation: fadeIn .2s; }
.cmdk-panel { width: min(580px, 100% - 32px); margin: 16vh auto 0; border-radius: 20px; background: #0d1929; border: 1px solid var(--line-2); box-shadow: 0 40px 100px -30px #000; overflow: hidden; animation: pop .35s var(--spring); }
@keyframes pop { from { transform: scale(.94) translateY(10px); opacity: 0; } }
.cmdk input { width: 100%; padding: 20px 22px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: 500 17px/1 var(--sans); outline: none; }
.cmdk ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.cmdk li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 12px; cursor: pointer; font-size: 15px; color: var(--muted); }
.cmdk li small { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.cmdk li.on { background: rgba(47, 212, 189, .12); color: var(--text); }
.cmdk li.on small { color: var(--teal); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font: 500 11.5px/1 var(--mono); color: var(--dim); }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Charts (shared) ---------- */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: rgba(160, 190, 230, .08); }
.chart .axis text { fill: var(--dim); font: 500 11px var(--mono); }
.chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .line.after { stroke: var(--teal); filter: drop-shadow(0 0 8px rgba(47, 212, 189, .45)); }
.chart .line.before { stroke: var(--before); stroke-dasharray: 5 6; }
.chart .area { fill: url(#gArea); opacity: .9; }
.chart .hover-line { stroke: rgba(255, 255, 255, .25); stroke-width: 1; }
.chart .dot { fill: var(--bg); stroke-width: 2.5; }
.chart .dot.after { stroke: var(--teal); }
.chart .dot.before { stroke: var(--before); }
.chart .bar.before { fill: rgba(109, 127, 156, .55); }
.chart .bar.after { fill: var(--teal); }
.chart .val { font: 700 15px var(--display); fill: var(--text); }
.chart .annot { font: 500 11.5px var(--mono); fill: var(--pop); }
.chart-tip { position: absolute; pointer-events: none; z-index: 4; padding: 9px 12px; border-radius: 10px; background: #0f1d30; border: 1px solid var(--line-2); font: 500 12px/1.5 var(--mono); color: var(--text); white-space: nowrap; opacity: 0; transition: opacity .15s; transform: translate(-50%, calc(-100% - 14px)); }
.chart-tip.on { opacity: 1; }
.chart-tip .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font: 500 12px/1 var(--mono); color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }

/* ==========================================================================
   Case study pages
   ========================================================================== */
.cs-hero { padding: 150px 0 50px; }
.back { display: flex; width: max-content; align-items: center; gap: 8px; font: 500 13px/1 var(--mono); color: var(--muted); margin-bottom: 30px; transition: color .2s, gap .2s; }
.back:hover { color: var(--pop); gap: 12px; }
.back svg { width: 15px; height: 15px; }
.cs-kicker { display: inline-flex; align-items: center; gap: 12px; font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cs-kicker b { font-weight: 500; padding: 7px 11px; border-radius: 99px; background: var(--pop); color: #1a0705; letter-spacing: .08em; }
.cs-hero h1 { font: 800 clamp(42px, 6vw, 86px)/.96 var(--display); letter-spacing: -.045em; margin: 22px 0 22px; max-width: 1050px; }
.cs-hero h1 .serif { color: var(--teal-2); font-weight: 400; }
.cs-hero .lede { color: var(--muted); font-size: 19px; max-width: 700px; margin: 0; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 44px 0 0; border-radius: 18px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.facts div { background: var(--bg-2); padding: 18px 20px; }
.facts dt { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 9px; }
.facts dd { margin: 0; font-size: 14.5px; color: var(--text); line-height: 1.4; }
.cs-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cs-kpi { padding: 24px 22px 22px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(17, 32, 53, .85), rgba(11, 22, 38, .85)); border: 1px solid var(--line); transition: transform .4s var(--spring), border-color .3s; }
.cs-kpi:hover { transform: translateY(-4px); border-color: rgba(47, 212, 189, .35); }
.cs-kpi.accent { background: radial-gradient(400px 200px at 0% 0%, rgba(47, 212, 189, .25), transparent 60%), linear-gradient(160deg, #0f2a36, #0b1626 70%); border-color: rgba(47, 212, 189, .35); }
.cs-kpi .k-num { font-size: clamp(40px, 4vw, 58px); margin: 16px 0 10px; }
.cs-kpi .k-desc { margin: 0; }
.panel { border-radius: 24px; padding: clamp(22px, 3vw, 36px); background: linear-gradient(180deg, rgba(17, 32, 53, .7), rgba(11, 22, 38, .7)); border: 1px solid var(--line); }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.panel-head .fig { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--pop); }
.panel-head h3 { font: 700 24px/1.2 var(--display); margin: 10px 0 0; letter-spacing: -.02em; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; max-width: 560px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.seg button { font: 500 12.5px/1 var(--mono); padding: 9px 14px; border-radius: 999px; color: var(--muted); transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--teal); color: #03201b; }
.story { display: grid; grid-template-columns: 270px 1fr; gap: 56px; }
.story-nav { position: sticky; top: 110px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.story-nav a { font: 500 13px/1 var(--mono); color: var(--dim); padding: 13px 14px; border-radius: 10px; border-left: 2px solid var(--line); transition: color .2s, border-color .2s, background .2s; }
.story-nav a.on, .story-nav a:hover { color: var(--text); border-color: var(--pop); background: rgba(255, 255, 255, .03); }
.story-body { display: flex; flex-direction: column; gap: 64px; }
.ch-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; }
.ch-head span { font: 500 13px/1 var(--mono); color: var(--pop); letter-spacing: .08em; }
.ch-head h2 { margin: 0; font: 800 clamp(34px, 4vw, 52px)/1 var(--display); letter-spacing: -.04em; }
.chapter > p { color: var(--muted); font-size: 17.5px; margin: 0 0 14px; max-width: 720px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 17px 18px 17px 60px; border-radius: 16px; background: rgba(13, 25, 41, .75); border: 1px solid var(--line); color: var(--text); font-size: 16px; transition: border-color .3s, transform .35s var(--spring); }
.steps li:hover { border-color: var(--line-2); transform: translateX(4px); }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 18px; top: 18px; font: 500 12.5px/1.5 var(--mono); color: var(--teal); }
.steps li span { color: var(--muted); }
.steps.results li::before { content: "↗"; font-size: 16px; top: 16px; color: var(--pop); }
.steps.results li b { color: var(--teal-2); font-weight: 600; }
.callout { border-left: 3px solid var(--pop); padding: 16px 20px; border-radius: 0 14px 14px 0; background: var(--pop-glow); color: var(--text); font-size: 16px; }
.callout b { color: var(--pop-2); font-weight: 600; }
details.method { margin-top: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(13, 25, 41, .6); }
details.method summary { cursor: pointer; list-style: none; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; font: 500 14px/1 var(--mono); color: var(--muted); }
details.method summary::-webkit-details-marker { display: none; }
details.method summary::after { content: "+"; font-size: 20px; color: var(--teal); transition: transform .3s; }
details.method[open] summary::after { transform: rotate(45deg); }
details.method > div { padding: 0 20px 18px; color: var(--muted); font-size: 15px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.shot { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #fff; cursor: zoom-in; position: relative; margin: 0; }
.shot img { width: 100%; height: 260px; object-fit: cover; object-position: top left; transition: transform .6s var(--ease); }
.shot:hover img { transform: scale(1.03); }
.shot figcaption { position: absolute; left: 10px; bottom: 10px; right: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(6, 12, 22, .88); color: var(--text); font: 500 12px/1.35 var(--mono); }
.next-case { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 36px 38px; border-radius: 26px; border: 1px solid var(--line-2); background: linear-gradient(160deg, #0f1e32, #0a1525); transition: border-color .3s, transform .45s var(--spring); }
.next-case:hover { border-color: rgba(255, 111, 97, .5); transform: translateY(-4px); }
.next-case .n-k { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--pop); }
.next-case .n-t { font: 800 clamp(28px, 3.6vw, 46px)/1.05 var(--display); letter-spacing: -.035em; margin-top: 10px; }
.next-case:hover .arrow { background: var(--pop); border-color: var(--pop); color: #1a0705; transform: rotate(-45deg); }
.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.flow .st { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: rgba(13, 25, 41, .8); border: 1px solid var(--line); font-size: 14.5px; }
.flow .st i { font: 500 11px/1 var(--mono); color: var(--teal); font-style: normal; }
.flow .st.ai { border-color: rgba(47, 212, 189, .35); }
.flow .st.me { border-color: rgba(255, 111, 97, .45); }
.flow .sep { color: var(--dim); }
.flow-legend { display: flex; gap: 18px; margin-top: 14px; font: 500 12px/1 var(--mono); color: var(--muted); }
.flow-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.flow-legend .l-ai::before { border: 1px solid var(--teal); }
.flow-legend .l-me::before { border: 1px solid var(--pop); }
.vids { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.vids .phone { --r: 2deg; max-width: 250px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(3, 7, 13, .92); display: none; place-items: center; padding: 30px; cursor: zoom-out; }
.lightbox.on { display: grid; animation: fadeIn .25s; }
.lightbox img { max-width: min(1400px, 100%); max-height: 88vh; border-radius: 12px; box-shadow: 0 40px 80px -30px #000; }
.lightbox p { color: var(--muted); font: 500 13px var(--mono); margin: 14px 0 0; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .caps { grid-template-columns: repeat(2, 1fr); }
  .phones { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 34%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 4px 24px; scrollbar-width: none; }
  .phones::-webkit-scrollbar { display: none; }
  .phone { scroll-snap-align: start; }
  .shipped-row { grid-template-columns: 1fr; }
  .cs-kpis { grid-template-columns: repeat(2, 1fr); }
  .story { grid-template-columns: 1fr; gap: 30px; }
  .story-nav { display: none; }
  .case { grid-template-columns: 1fr; }
  .case-viz { height: 240px; border-right: 0; border-bottom: 1px solid var(--line); }
  .channels { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .x-toggle { margin-left: auto; }
  .menu-btn { display: grid; place-content: center; gap: 6px; width: 42px; height: 42px; border-radius: 50%; background: var(--teal); flex: none; }
  .menu-btn i { display: block; width: 16px; height: 2px; border-radius: 2px; background: #03201b; transition: transform .35s var(--spring); }
  .menu-btn[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }
  .hero { padding-top: 110px; min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { justify-self: center; max-width: 340px; order: -1; margin-top: 6px; }
  .hero-visual .curve { inset: auto -4% 8% -4%; width: 108%; }
  .sticker.s1 { left: -4%; }
  .sticker.s2 { right: -4%; }
  .k-hint, .scroll-cue, .drag-hint { display: none !important; }
  .about, .gallery { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .quote { grid-template-columns: 1fr; gap: 0; }
  .quote .mark { font-size: 110px; }
  .case { position: relative; top: 0; }
  .ribbons { height: 170px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .bento, .caps, .cs-kpis, .channels { grid-template-columns: 1fr; }
  .kpi.k-hero, .kpi.k-wide { grid-column: auto; grid-row: auto; }
  .k-hero .k-num { font-size: 104px; }
  .k-row { flex-direction: column; align-items: stretch; }
  .k-row .spark { height: 60px; }
  .nav { padding-left: 14px; }
  .brand span { display: none; }
  .sticker { padding: 7px 11px 7px 8px; font-size: 11.5px; }
  .sticker b { font-size: 17px; }
  .sticker .ic { width: 26px; height: 26px; }
  .phones { grid-auto-columns: 62%; }
  .case-body { padding: 26px 22px; }
  .case-viz { height: 200px; padding: 44px 18px 14px; }
  .next-case { padding: 24px; }
  .big-head { gap: 10px; margin-bottom: 36px; }
  .big-head .idx { padding-top: .4em; }
  .sub-head { margin-top: 70px; }
  .timeline li { grid-template-columns: 80px 1fr; }
  .vids { grid-template-columns: 1fr; }
  .vids .phone { max-width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .squiggle path { stroke-dashoffset: 0; }
  .cup .steam { opacity: .6; }
}

/* Hero and case-study headers animate on load, without waiting for JavaScript */
.hero .reveal, .cs-hero .reveal { opacity: 1; transform: none; animation: rise .9s var(--ease) both; animation-delay: var(--d, 0s); }
html.intro .hero .reveal { animation-delay: calc(var(--d, 0s) + 1.75s); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   v3 additions
   ========================================================================== */

/* Menu: six links, folds into the menu button earlier */
.nav-links a { padding: 8px 11px; font-size: 14px; }
@media (max-width: 1180px) {
  .nav-links, .nav-cta { display: none; }
  .x-toggle { margin-left: auto; }
  .menu-btn { display: grid; place-content: center; gap: 6px; width: 42px; height: 42px; border-radius: 50%; background: var(--teal); flex: none; }
  .menu-btn i { display: block; width: 16px; height: 2px; border-radius: 2px; background: #03201b; transition: transform .35s var(--spring); }
  .menu-btn[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }
}
.menu nav a { font-size: clamp(38px, 9vw, 64px); }

/* Videos: two Shorts, a laptop-framed feature video, one campaign Short */
.phones { align-items: center; }
.phone.wide-slot { grid-column: span 2; }
.phone.wide-slot .video { aspect-ratio: 16 / 9; border-radius: 16px; border-width: 8px; }
.phone.wide-slot .video::before { width: 6px; height: 6px; top: 1px; margin-left: -3px; border-radius: 50%; background: #2a3a52; }
.phone.wide-slot figcaption::before { content: ""; display: block; height: 11px; margin: -14px -5% 14px; border-radius: 0 0 14px 14px; background: linear-gradient(#1b2a40, #111c2c); box-shadow: 0 14px 30px -14px #000; }
.vintage { display: inline-block; margin-right: 6px; padding: 4px 8px; border-radius: 6px; rotate: -3deg; font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; background: #e3c58f; color: #2a1d08; }
.wide .video img { filter: sepia(.45) saturate(.85) contrast(1.05); transition: filter .6s var(--ease), transform .7s var(--ease); }
.wide .video:hover img { filter: none; }
.wide .video::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: overlay; transition: opacity .6s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.wide .video:hover::after, .wide .video.playing::after { opacity: 0; }

/* About: a timeline that draws itself, language greetings, a tilting trophy */
.about { align-items: stretch; }
.about-side { display: flex; }
.about-side .trophy { flex: 1; min-height: 420px; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; }
.timeline::before { background: var(--line-2); }
.timeline::after { background: linear-gradient(var(--teal), var(--pop)); transform-origin: top; transform: scaleY(var(--tp, 1)); }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 19px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); transition: background .4s, border-color .4s, box-shadow .4s, transform .4s var(--spring); }
.timeline li:first-child::before { top: 5px; }
.timeline li.lit::before { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 0 5px rgba(47, 212, 189, .18); transform: scale(1.1); }
.langs span { position: relative; cursor: default; transition: border-color .3s, color .3s; }
.langs span::after { content: attr(data-hello); position: absolute; left: 50%; bottom: calc(100% + 10px); translate: -50% 6px; scale: .8; opacity: 0; pointer-events: none; white-space: nowrap;
  padding: 7px 11px; border-radius: 12px 12px 12px 3px; background: var(--pop); color: #1a0705; font: 700 14px/1 var(--sans); transition: opacity .25s, translate .35s var(--spring), scale .35s var(--spring); }
.langs span:hover, .langs span.say { border-color: var(--pop); color: var(--text); }
.langs span:hover::after, .langs span.say::after { opacity: 1; translate: -50% 0; scale: 1; }
.trophy { transform-style: preserve-3d; transition: transform .5s var(--ease); will-change: transform; }
.trophy::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: linear-gradient(115deg, transparent 30%, rgba(124, 240, 222, .22) 45%, rgba(255, 111, 97, .18) 55%, transparent 70%); background-size: 250% 250%; background-position: var(--sx, 50%) 50%; mix-blend-mode: screen; }
.trophy:hover::after { opacity: 1; }
.trophy figcaption { transform: translateZ(30px); }

/* Contact: brew-a-chat mini game */
.contact { padding-top: clamp(40px, 6vw, 70px); }
.brew { position: static; }
.beans { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.bean { position: absolute; left: var(--x); top: var(--y); pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  padding: 10px 16px; border-radius: 999px; font: 700 14.5px/1 var(--sans); letter-spacing: -.01em;
  rotate: var(--r, 0deg); translate: var(--tx, 0) var(--ty, 0); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .8);
  animation: float 6s ease-in-out infinite; transition: scale .3s var(--spring), rotate .3s var(--spring), opacity .3s; }
.bean:nth-child(3n+1) { background: var(--teal); color: #03201b; }
.bean:nth-child(3n+2) { background: var(--pop); color: #1a0705; animation-delay: -2s; }
.bean:nth-child(3n) { background: #13233a; color: var(--text); border: 1px solid var(--line-2); animation-delay: -4s; }
.bean:hover { scale: 1.08; }
.bean.dragging { cursor: grabbing; scale: 1.12; rotate: 0deg; animation-play-state: paused; z-index: 5; transition: scale .3s var(--spring); }
.bean.in { pointer-events: none; opacity: 0; scale: .2; transition: translate .55s cubic-bezier(.5, -.3, .6, 1), scale .55s, opacity .55s .1s; }
.cup { position: relative; width: 126px; margin: 0 auto; cursor: pointer; animation: bob 4s ease-in-out infinite; }
.cup svg { width: 100%; overflow: visible; display: block; }
.cup .coffee, .cup .crema { transform: translateY(calc((1 - var(--lvl, 0)) * 62px)); transition: transform .9s var(--spring); }
.cup .steam { stroke: var(--teal-2); stroke-width: 4; stroke-linecap: round; fill: none; opacity: 0; animation: steam 2.8s ease-in-out infinite; }
.cup .s2 { animation-delay: .6s; }
.cup .s3 { animation-delay: 1.2s; }
.cup.hot { animation: wiggle .6s var(--spring); }
.cup.full .steam { stroke-width: 5; animation-duration: 1.8s; }
.cup.near { scale: 1.12; transition: scale .3s var(--spring); }
@keyframes steam { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes bob { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-4px); } }
@keyframes wiggle { 0% { transform: rotate(0); } 30% { transform: rotate(-9deg) scale(1.08); } 60% { transform: rotate(7deg); } 100% { transform: rotate(0); } }
.brew-hint { margin: 6px 0 0; font: 500 12.5px/1.4 var(--mono); color: var(--dim); min-height: 1.4em; }
.brew-hint b { color: var(--teal-2); font-weight: 500; }
.brew-hint button { color: var(--pop-2); text-decoration: underline; text-underline-offset: 3px; font: inherit; margin-left: 6px; }
.contact.ready .channel { animation: nudge 1.4s var(--spring) both; }
.contact.ready .channel:nth-child(2) { animation-delay: .08s; }
.contact.ready .channel:nth-child(3) { animation-delay: .16s; }
.contact.ready .channel:nth-child(4) { animation-delay: .24s; }
.contact.ready .channel:nth-child(5) { animation-delay: .32s; }
@keyframes nudge { 0% { transform: none; } 30% { transform: translateY(-8px); box-shadow: 0 0 0 3px rgba(47, 212, 189, .5); } 100% { transform: none; } }
.confetti { position: fixed; z-index: 330; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; }

/* Page transitions between the homepage and case studies (modern browsers; others just navigate) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .32s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vtIn .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-14px) scale(.99); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(22px); } }

/* Lighter on phones and tablets: no grain, no blur, nothing animating off-screen */
@media (hover: none), (max-width: 860px) {
  body::after { display: none; }
  .nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(8, 16, 28, .94); }
  .sticker.s3 { backdrop-filter: none; }
  .hero-visual .ring.r2 { animation: none; }
}
@media (max-width: 1080px) {
  .channels { grid-template-columns: repeat(3, 1fr); }
  .phone.wide-slot { grid-column: span 2; }
}
@media (max-width: 860px) {
  .beans { position: static; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 16px; max-width: 460px; }
  .bean { position: relative; left: auto; top: auto; animation: none; padding: 9px 13px; font-size: 13.5px; }
  .about-side .trophy { min-height: 300px; }
  .ribbons { height: 170px; }
  .rb-k { top: 6px; }
}
@media (max-width: 560px) {
  .channels { grid-template-columns: 1fr; }
  .phones { grid-auto-columns: 62%; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .timeline { --tp: 1; }
}

/* Off-screen sections are not laid out or painted until they come near the screen (faster first load on phones). */
#results, #what, .ribbons, .quote-sec, #about, #contact, footer { content-visibility: auto; contain-intrinsic-size: auto 1100px; }
/* The photo slides in without fading, so phones count it as painted immediately (faster Largest Contentful Paint). */
.hero .hero-visual.reveal { animation-name: riseSolid; }
@keyframes riseSolid { from { transform: translateY(26px) scale(.97); } to { transform: none; } }
