/* ==========================================================================
   Jose Almanza — Portfolio design system
   "The Ledger": warm paper, ink, one cardinal accent, dashboard-grade data.
   Display: Instrument Serif · Text: Inter · Figures & labels: JetBrains Mono
   ========================================================================== */

@view-transition { navigation: auto; }

:root {
  --paper: #f5f2eb;
  --paper-2: #ece7dc;
  --surface: #fcfaf6;
  --surface-2: #ffffff;
  --ink: #141414;
  --ink-2: #3b3a36;
  --muted: #6b675f;
  --rule: #ddd6c8;
  --rule-strong: #bdb4a4;
  --accent: #9d2235;
  --accent-ink: #ffffff;
  --accent-soft: #f4e3e5;
  --ok: #2f6b4f;
  --deep: #0f1316;
  --deep-2: #161b1f;
  --deep-3: #1e252a;
  --deep-rule: #2a3238;
  --deep-ink: #eef0ec;
  --deep-muted: #9aa49f;
  --data-hi: #e36b7c;
  --data-base: #5f6b74;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1240px;
  --gutter: clamp(16px, 4.5vw, 48px);
  --r: 18px;
  --r-lg: 26px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --nav-h: 68px;
  --shadow-sm: 0 1px 2px rgba(20,20,20,.04), 0 6px 18px -10px rgba(20,20,20,.16);
  --shadow-lg: 0 2px 4px rgba(20,20,20,.04), 0 30px 60px -32px rgba(20,20,20,.38);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111211;
    --paper-2: #181917;
    --surface: #1c1d1b;
    --surface-2: #222321;
    --ink: #efebe3;
    --ink-2: #cfcac0;
    --muted: #9c978d;
    --rule: #2e2d2a;
    --rule-strong: #4a4640;
    --accent: #e3697b;
    --accent-ink: #1a0b0e;
    --accent-soft: #2f1b1e;
    --ok: #7cc4a0;
    --deep: #0b0e10;
    --deep-2: #12171a;
    --deep-3: #192025;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px -10px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 30px 60px -32px rgba(0,0,0,.85);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
html:not(.reduce-motion) { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg { max-width: 100%; }
img { display: block; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 10px; z-index: 300; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; }
.skip:focus { left: 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Type ---------- */
.label { font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.label b { color: var(--accent); font-weight: 500; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
.display { font-family: var(--serif); font-weight: 400; letter-spacing: -.012em; line-height: .96; }
.display em { font-style: italic; color: var(--accent); }
.fig { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; line-height: .95; }
.lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); line-height: 1.55; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper); --bd: var(--ink);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  overflow: hidden; isolation: isolate;
  transition: transform .25s var(--ease), color .25s var(--ease), border-color .25s, box-shadow .3s;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent); border-radius: inherit; transform: translateY(101%); transition: transform .35s var(--ease); }
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }
.btn:hover, .btn:focus-visible { color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 12px 26px -16px var(--accent); }
.btn:active { transform: scale(.97); }
.btn .arrow { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn.ghost { --bg: transparent; --fg: var(--ink); --bd: var(--rule-strong); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }

.text-link { font-weight: 600; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: background-size .3s var(--ease), color .2s; padding-bottom: 2px; }
.text-link:hover { color: var(--accent); background-size: 0 1px; background-position: 100% 100%; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li, .tag { font: 500 11.5px/1 var(--mono); letter-spacing: .02em; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-2); }

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; padding-top: env(safe-area-inset-top, 0px); transition: background .35s, box-shadow .35s; }
.nav.scrolled { background: color-mix(in srgb, var(--paper) 76%, transparent); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: 0 1px 0 var(--rule); }
.nav-inner { height: var(--nav-h); display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: italic 400 19px/1 var(--serif); transition: background .3s, transform .45s var(--ease); flex: none; }
.brand:hover .brand-mark { background: var(--accent); transform: rotate(-10deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand-text span { font: 500 10px/1.2 var(--mono); letter-spacing: .07em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }

.nav-menu { display: flex; align-items: center; gap: 16px; }
.nav-links { position: relative; display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a { position: relative; z-index: 1; display: block; padding: 9px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink-2); transition: color .25s; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--ink); }
.nav-indicator { position: absolute; z-index: 0; top: 50%; height: 36px; margin-top: -18px; left: 0; width: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); opacity: 0; transition: transform .45s var(--ease), width .45s var(--ease), opacity .3s; pointer-events: none; }
.nav-indicator.on { opacity: 1; }
.nav-cta { display: flex; gap: 8px; }
.nav-cta .btn { min-height: 40px; padding: 0 16px; font-size: 14px; }

.menu-toggle { display: none; width: 48px; height: 48px; margin-right: -10px; background: none; border: 0; cursor: pointer; position: relative; z-index: 3; }
.menu-toggle span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--ink); transition: transform .35s var(--ease), top .35s var(--ease); }
.menu-toggle span:nth-child(1) { top: 20px; }
.menu-toggle span:nth-child(2) { top: 27px; }
.menu-open .menu-toggle span:nth-child(1) { top: 23.5px; transform: rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { top: 23.5px; transform: rotate(-45deg); }

@media (max-width: 1080px) {
  .menu-toggle { display: block; }
  .brand { position: relative; z-index: 3; }
  .nav-menu {
    position: fixed; inset: 0; z-index: 2;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 28px;
    padding: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 12px) var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
    background: var(--paper); overflow-y: auto;
    visibility: hidden; opacity: 0; transition: opacity .3s, visibility 0s .3s;
  }
  .menu-open .nav-menu { visibility: visible; opacity: 1; transition: opacity .3s; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links li { border-bottom: 1px solid var(--rule); opacity: 0; transform: translateY(12px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
  .menu-open .nav-links li { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 40ms + 60ms); }
  .nav-links a { padding: 13px 0; border-radius: 0; font: 400 clamp(30px, 8.5vw, 42px)/1.1 var(--serif); color: var(--ink); }
  .nav-links a[aria-current="true"] { color: var(--accent); }
  .nav-indicator { display: none; }
  .nav-cta { flex-wrap: wrap; }
  .nav-cta .btn { flex: 1 1 140px; min-height: 52px; font-size: 15px; }
  .menu-open { overflow: hidden; }
  .menu-open .nav { background: var(--paper); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ==========================================================================
   Reveal system (JS adds .js to <html>; content is visible without JS)
   ========================================================================== */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Section heads
   ========================================================================== */
.section { padding-block: clamp(80px, 11vw, 150px); position: relative; }
.section.tint { background: var(--paper-2); }
.section-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 18px; margin-bottom: clamp(40px, 6vw, 72px); align-items: end; }
.section-head .label { grid-column: 1 / 4; padding-bottom: .9em; }
.section-head h2 { grid-column: 4 / 13; font-size: clamp(44px, 6.6vw, 92px); }
.section-head p { grid-column: 4 / 11; margin: 0; }
.section-head .rule { grid-column: 1 / -1; height: 1px; background: var(--rule-strong); transform-origin: left; }
.js .section-head .rule { transform: scaleX(0); transition: transform 1.2s var(--ease) .1s; }
.js .section-head.in .rule { transform: scaleX(1); }
@media (max-width: 760px) {
  .section-head { display: block; }
  .section-head .label { display: block; margin-bottom: 14px; padding: 0; }
  .section-head p { margin-top: 16px; }
  .section-head .rule { margin-top: 24px; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { position: relative; padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + clamp(24px, 4.5vw, 60px)); padding-bottom: clamp(48px, 6vw, 84px); overflow: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.hero-kicker { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); margin-bottom: clamp(20px, 3vw, 30px); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(64px, 10vw, 150px); line-height: .9; letter-spacing: -.02em; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.hero h1 .ch { display: inline-block; }
.js .hero h1 .ch { transform: translateY(110%); animation: rise 1s var(--ease) forwards; animation-delay: calc(var(--i) * 40ms + 120ms); }
@keyframes rise { to { transform: none; } }
.tagline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: clamp(18px, 2.4vw, 26px) 0 0; font: 500 clamp(15px, 1.5vw, 19px)/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.tagline .x { color: var(--accent); }
.js .tagline > * { opacity: 0; transform: translateY(8px); animation: fadeUp .7s var(--ease) forwards; animation-delay: calc(var(--i) * 90ms + 650ms); }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
.hero-intro { max-width: 35rem; margin: 20px 0 0; }
.hero-intro strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; }
.hero-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 22px; font-size: 14px; color: var(--muted); }
.hero-contact a { color: var(--ink); font-weight: 500; }
.js .hero-copy .fade { opacity: 0; animation: fadeUp .8s var(--ease) forwards; animation-delay: var(--d, 900ms); }

.hero-visual { position: relative; }
.plate { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 4.9; background: #d8d7da; box-shadow: var(--shadow-lg); view-transition-name: portrait; }
.plate img { width: 100%; height: 110%; object-fit: cover; object-position: 50% 12%; transform: translate3d(0, var(--py, 0px), 0); will-change: transform; }
.js .plate { clip-path: inset(100% 0 0 0 round var(--r-lg)); animation: unveil 1.3s var(--ease) .15s forwards; }
.js .plate img { animation: settle 1.8s var(--ease) .15s both; }
@keyframes unveil { to { clip-path: inset(0 0 0 0 round var(--r-lg)); } }
@keyframes settle { from { scale: 1.14; } to { scale: 1; } }
.plate::after { content: ""; position: absolute; inset: auto 0 0 0; height: 42%; background: linear-gradient(to top, rgba(8,10,12,.7), rgba(8,10,12,0)); pointer-events: none; z-index: 1; }
.dataviz { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 36%; z-index: 2; pointer-events: none; }
.dataviz .grid line { stroke: rgba(255,255,255,.16); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dataviz .area { fill: rgba(227,107,124,.22); opacity: 0; }
.dataviz .line { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.dataviz .pt { fill: #fff; opacity: 0; }
.dataviz .pt.hi { fill: var(--data-hi); }
.js .dataviz .line { animation: draw 1.8s var(--ease) 1.2s forwards; }
.js .dataviz .area { animation: fade 1s ease 2.2s forwards; }
.js .dataviz .pt { animation: fade .4s ease forwards; animation-delay: calc(var(--i) * 140ms + 1.5s); }
html:not(.js) .dataviz .line { stroke-dashoffset: 0; }
html:not(.js) .dataviz .area, html:not(.js) .dataviz .pt { opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
.plate-cap { position: absolute; left: 18px; right: 18px; bottom: 14px; z-index: 3; display: flex; justify-content: space-between; color: rgba(255,255,255,.85); font: 500 10.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.kpi-chip { position: absolute; z-index: 4; display: flex; flex-direction: column; padding: 14px 16px; border-radius: 16px; width: 200px; background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--rule); box-shadow: var(--shadow-lg); transition: transform .6s var(--ease); }
.kpi-chip .num { font-size: 36px; color: var(--accent); }
.kpi-chip p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.kpi-chip .label { font-size: 10px; margin-bottom: 4px; }
.kpi-chip.a { left: -36px; top: 12%; }
.kpi-chip.b { right: -28px; top: auto; bottom: 17%; }
.js .kpi-chip { opacity: 0; translate: 0 14px; animation: chipIn .8s var(--ease) forwards; }
.js .kpi-chip.a { animation-delay: 1.3s; }
.js .kpi-chip.b { animation-delay: 1.5s; }
@keyframes chipIn { to { opacity: 1; translate: 0 0; } }
.hero-visual:hover .kpi-chip.a { transform: translate(-4px, -4px); }
.hero-visual:hover .kpi-chip.b { transform: translate(4px, 4px); }

@media (max-width: 1180px) { .kpi-chip.a { left: -16px; } .kpi-chip.b { right: -12px; } }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 560px; width: 100%; }
  .kpi-chip.a { left: 12px; top: auto; bottom: 44px; }
  .kpi-chip.b { right: 12px; top: auto; bottom: 44px; }
  .dataviz { height: 26%; }
}
@media (max-width: 560px) {
  .plate { aspect-ratio: 4 / 4.4; }
  .kpi-chip { width: auto; max-width: 46%; padding: 10px 12px; border-radius: 12px; }
  .kpi-chip .num { font-size: 24px; }
  .kpi-chip p { font-size: 11px; }
  .kpi-chip .label { display: none; }
  .hero-actions .btn { flex: 1 1 auto; }
}

/* ==========================================================================
   CURRENTLY
   ========================================================================== */
.currently { padding-block: clamp(44px, 5.5vw, 72px); background: var(--paper-2); border-block: 1px solid var(--rule); }
.currently-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.currently-head h2 { font: 400 clamp(32px, 3.6vw, 46px)/1 var(--serif); display: flex; align-items: center; gap: 14px; }
.now-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.now-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 10px; transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s; }
.now-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--rule-strong); }
.now-card .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.now-card h3 { font: 600 16px/1.3 var(--sans); letter-spacing: -.01em; }
.now-card p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
@media (max-width: 980px) { .now-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .now-grid { grid-template-columns: 1fr; } .now-card { flex-direction: row; align-items: flex-start; gap: 14px; } }

/* ==========================================================================
   ABOUT — story with threads
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; }
.about-lead { grid-column: 4 / 12; font: 400 clamp(28px, 3.4vw, 44px)/1.16 var(--serif); margin: 0; }
.about-lead em { color: var(--accent); }
.threads { grid-column: 1 / 4; align-self: start; position: sticky; top: calc(var(--nav-h) + 24px); }
.threads p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.thread-list { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.thread { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; cursor: pointer; font-weight: 500; font-size: 14.5px; text-align: left; transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease); }
.thread .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.thread:hover { border-color: var(--ink); transform: translateX(3px); }
.thread[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.story { grid-column: 4 / 11; color: var(--ink-2); font-size: 17px; line-height: 1.72; }
.story p { margin: 0 0 1.1em; transition: color .35s; }
.story [data-thread] { transition: background-color .35s, color .35s, box-shadow .35s; border-radius: 3px; }
.story.dim p { color: color-mix(in srgb, var(--muted) 85%, transparent); }
.story [data-thread].lit { color: var(--ink); background: color-mix(in srgb, var(--c) 17%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 17%, transparent); }
[data-thread="finance"], [data-t="finance"] { --c: #b33a4d; }
[data-thread="data"], [data-t="data"] { --c: #2f6f96; }
[data-thread="marketing"], [data-t="marketing"] { --c: #b27a26; }
[data-thread="leadership"], [data-t="leadership"] { --c: #2f7a55; }
[data-thread="soccer"], [data-t="soccer"] { --c: #7552a3; }
.facts { grid-column: 4 / 13; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule-strong); margin: 0; }
.facts div { padding: 16px 16px 0 0; }
.facts div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.facts dd { margin: 6px 0 0; font-weight: 500; }
@media (max-width: 900px) {
  .about-lead, .story, .facts { grid-column: 1 / -1; }
  .threads { grid-column: 1 / -1; position: static; }
  .thread-list { flex-direction: row; flex-wrap: wrap; }
  .thread { width: auto; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div + div { padding-left: 0; border-left: 0; }
  .facts div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--rule); margin-top: 16px; }
}

/* ==========================================================================
   HOW I THINK
   ========================================================================== */
.process { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; list-style: none; margin: 0; padding: 0; }
.process-track { position: absolute; left: 28px; right: 28px; top: 27px; height: 2px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.process-track span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
.step { position: relative; z-index: 1; }
.step-dot { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--rule-strong); font: 500 14px/1 var(--mono); color: var(--muted); transition: background .5s var(--ease), color .5s, border-color .5s, transform .5s var(--ease); }
.step.active .step-dot { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: scale(1.06); }
.step h3 { font: 400 clamp(32px, 3.2vw, 42px)/1 var(--serif); margin: 22px 0 8px; }
.step > p { margin: 0 0 16px; color: var(--ink-2); }
.step .eg { border-top: 1px dashed var(--rule-strong); padding-top: 14px; font-size: 14px; color: var(--ink-2); transition: opacity .5s; }
.step .eg .label { display: block; margin-bottom: 6px; font-size: 10.5px; }
.js .step:not(.active) .eg { opacity: .5; }
@media (max-width: 900px) {
  .process { grid-template-columns: 1fr; gap: 0; }
  .process-track { left: 27px; right: auto; top: 28px; bottom: 28px; width: 2px; height: auto; }
  .process-track span { transform-origin: top; transform: scaleY(var(--p, 0)); }
  .step { display: grid; grid-template-columns: 56px 1fr; column-gap: 20px; padding-bottom: 34px; }
  .step-dot { grid-row: 1 / 4; }
  .step h3 { margin: 10px 0 6px; }
}

/* ==========================================================================
   EXPERIENCE — career timeline
   ========================================================================== */
.timeline { --gut: clamp(52px, 7vw, 96px); --x: clamp(18px, 2.6vw, 34px); position: relative; list-style: none; margin: 0; padding: 0 0 0 var(--gut); }
.spine { position: absolute; left: var(--x); top: 10px; bottom: 10px; width: 2px; margin-left: -1px; background: var(--rule); border-radius: 2px; }
.spine span { position: absolute; inset: 0; background: linear-gradient(var(--accent), var(--ink)); transform-origin: top; transform: scaleY(var(--p, 0)); border-radius: 2px; }
.chapter { position: relative; padding-top: 6px; margin-bottom: 14px; }
.chapter:not(:first-child) { margin-top: 44px; }
.chapter::before { content: ""; position: absolute; left: calc(var(--x) - var(--gut) - 4px); top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chapter .label { color: var(--accent); }
.milestone { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 22px 0; color: var(--ink-2); font-size: 14.5px; }
.milestone::before { content: ""; position: absolute; left: calc(var(--x) - var(--gut) - 7px); top: 4px; width: 14px; height: 14px; transform: rotate(45deg); background: var(--paper-2); border: 2px solid var(--accent); }
.role { position: relative; }
.role::before { content: ""; position: absolute; left: calc(var(--x) - var(--gut) - 9px); top: 34px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--rule-strong); transition: border-color .5s, background .5s, transform .5s var(--ease); z-index: 1; }
.role.in::before { border-color: var(--accent); }
.role.open::before { background: var(--accent); transform: scale(1.12); }
.role + .role { margin-top: 14px; }
.role-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); transition: box-shadow .45s var(--ease), border-color .3s; }
.role-card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-sm); }
.role.open .role-card { box-shadow: var(--shadow-lg); border-color: var(--rule-strong); }
.role h3 { margin: 0; }
.role-btn { width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 40px; gap: 18px; align-items: center; padding: 20px 22px; background: none; border: 0; text-align: left; cursor: pointer; border-radius: var(--r); }
.mono { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font: 500 14px/1 var(--mono); letter-spacing: .03em; color: var(--paper); background: var(--ink); transition: background .4s; }
.role.open .mono { background: var(--accent); color: var(--accent-ink); }
.role-main { min-width: 0; }
.role-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; }
.role-title { display: block; font: 400 clamp(24px, 2.4vw, 32px)/1.1 var(--serif); }
.role-org { display: block; margin-top: 4px; font: 600 14.5px/1.3 var(--sans); color: var(--accent); }
.role-kpi { text-align: right; }
.role-kpi .num { display: block; font-size: clamp(28px, 2.6vw, 36px); }
.role-kpi .label { font-size: 10px; }
.chev { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule-strong); display: grid; place-items: center; transition: transform .45s var(--ease), background .3s, color .3s, border-color .3s; }
.chev svg { width: 14px; height: 14px; }
.role-btn:hover .chev { border-color: var(--ink); }
.role-btn[aria-expanded="true"] .chev { transform: rotate(180deg); background: var(--ink); color: var(--paper); border-color: var(--ink); }
.role-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.role.open .role-panel { grid-template-rows: 1fr; }
.role-panel > div { overflow: hidden; }
.role-body { padding: 0 22px 24px calc(22px + 52px + 18px); }
.wins { margin: 0 0 16px; padding: 0; list-style: none; }
.wins li { position: relative; padding-left: 24px; margin-bottom: 10px; color: var(--ink-2); max-width: 66ch; }
.wins li::before { content: "→"; position: absolute; left: 0; top: 1px; color: var(--accent); font: 500 14px/1.6 var(--mono); }
.wins strong { color: var(--ink); font-weight: 600; }
.role-kpi-m { display: none; align-items: baseline; gap: 10px; margin-bottom: 14px; padding: 10px 12px; background: var(--paper-2); border-radius: 10px; }
.role-kpi-m .num { font-size: 26px; color: var(--accent); }
@media (max-width: 760px) {
  .timeline { --gut: 34px; --x: 10px; }
  .role-btn { grid-template-columns: minmax(0, 1fr) 40px; gap: 12px; padding: 18px; }
  .mono, .role-kpi { display: none; }
  .role-body { padding: 0 18px 20px; }
  .role-kpi-m { display: flex; }
  .role::before { top: 26px; }
}

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.edu-card { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: clamp(24px, 3.4vw, 40px); background: var(--surface); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.edu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.edu-card.feature { background: var(--deep); color: var(--deep-ink); border-color: var(--deep); }
.edu-card.feature .label { color: var(--deep-muted); }
.edu-card h3 { font: 400 clamp(30px, 3.4vw, 44px)/1.02 var(--serif); margin: 18px 0 12px; }
.edu-card .school { font-weight: 600; margin: 0; }
.edu-card .where { margin: 4px 0 0; opacity: .75; font-size: 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px; background: var(--data-hi); color: #1a0b0e; }
.edu-sub { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-top: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0; }
.chips li { padding: 8px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); font-size: 14px; color: var(--ink-2); }
.certs { list-style: none; margin: 14px 0 0; padding: 0; }
.certs li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--rule); }
.certs li:first-child { border-top: 0; padding-top: 4px; }
.certs .fig { color: var(--accent); }
.certs span { display: block; font-size: 13.5px; color: var(--muted); }
@media (max-width: 860px) { .edu-grid, .edu-sub { grid-template-columns: 1fr; } }

/* ==========================================================================
   SKILLS — evidence trace
   ========================================================================== */
.skills-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.skill-groups { display: grid; gap: 14px; }
.skill-group { border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 20px 20px; background: var(--surface); }
.skill-group h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 400 26px/1.1 var(--serif); margin: 0 0 12px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.skill { min-height: 40px; padding: 6px 8px 6px 14px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); transition: background .2s, color .2s, border-color .2s, transform .25s var(--ease); display: inline-flex; align-items: center; gap: 8px; }
.skill .n { font: 500 10.5px/1 var(--mono); color: var(--muted); background: var(--paper-2); padding: 5px 7px; border-radius: 999px; transition: background .2s, color .2s; }
.skill:hover { border-color: var(--ink); transform: translateY(-1px); }
.skill[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.skill[aria-pressed="true"] .n { background: var(--accent); color: var(--accent-ink); }
.trace { position: sticky; top: calc(var(--nav-h) + 20px); background: var(--deep); color: var(--deep-ink); border-radius: var(--r-lg); padding: clamp(20px, 2.6vw, 30px); box-shadow: var(--shadow-lg); }
.trace-head .label { color: var(--deep-muted); }
.trace h3 { font: 400 clamp(34px, 3.6vw, 48px)/1 var(--serif); margin: 8px 0 20px; }
.trace h3 em { color: var(--data-hi); }
.trace-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.trace-col { background: var(--deep-2); border: 1px solid var(--deep-rule); border-radius: 14px; padding: 14px; min-height: 160px; position: relative; }
.trace-col + .trace-col::before { content: "→"; position: absolute; left: -12px; top: 14px; width: 10px; text-align: center; color: var(--data-hi); font: 500 12px/1 var(--mono); }
.trace-col .label { color: var(--deep-muted); display: block; margin-bottom: 10px; font-size: 10.5px; }
.trace-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.trace-col li { font-size: 13.5px; line-height: 1.4; color: var(--deep-ink); animation: fadeUp .45s var(--ease) both; animation-delay: calc(var(--k, 0) * 60ms); }
.trace-col li small { display: block; color: var(--deep-muted); font-size: 12px; margin-top: 2px; }
.trace-col a { color: var(--deep-ink); text-decoration: none; border-bottom: 1px solid #3f4a52; transition: border-color .2s, color .2s; }
.trace-col a:hover { color: var(--data-hi); border-color: var(--data-hi); }
.trace-col .none { color: var(--deep-muted); font-size: 13px; }
.trace-foot { margin: 14px 0 0; font-size: 13px; color: var(--deep-muted); }
.trace-foot strong { color: var(--deep-ink); font-weight: 500; }
@media (max-width: 980px) { .skills-layout { grid-template-columns: 1fr; } .trace { position: relative; top: 0; } }
@media (max-width: 620px) {
  .trace-cols { grid-template-columns: 1fr; gap: 16px; }
  .trace-col { min-height: 0; }
  .trace-col + .trace-col::before { content: "↓"; left: 16px; top: -14px; }
}

/* ==========================================================================
   Charts (shared)
   ========================================================================== */
.bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 36%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .bl { color: var(--ink-2); line-height: 1.25; }
.bar-track { position: relative; height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }
.bar-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--rule-strong); transform-origin: left; transform: scaleX(var(--v)); transition: transform 1.2s var(--ease); transition-delay: calc(var(--k, 0) * 90ms + 150ms); }
.bar-row.hi .bar-fill { background: var(--accent); }
.bar-row .bv { font: 500 12px/1 var(--mono); font-variant-numeric: tabular-nums; min-width: 4.6ch; text-align: right; color: var(--ink-2); }
.bar-row.hi .bv { color: var(--accent); }
.js .chart:not(.in) .bar-fill { transform: scaleX(0); }

.ring { position: relative; width: 132px; aspect-ratio: 1; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bg { fill: none; stroke: color-mix(in srgb, var(--ink) 9%, transparent); stroke-width: 8; }
.ring .fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--v)); transition: stroke-dashoffset 1.6s var(--ease) .2s; }
.js .chart:not(.in) .ring .fg { stroke-dashoffset: 100; }
.ring .rv { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .rv .num { font-size: 30px; }

.dots { display: grid; grid-template-columns: repeat(var(--cols, 22), minmax(0, 1fr)); gap: 3px; max-width: 280px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--rule-strong); transition: transform .4s var(--ease); transition-delay: calc(var(--k) * 5ms); }
.dots i.hi { background: var(--accent); }
.js .chart:not(.in) .dots i { transform: scale(0); }

.matrix { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 6px; font-size: 12px; max-width: 340px; }
.matrix .cell { border-radius: 10px; padding: 12px 8px; text-align: center; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2); }
.matrix .cell .num { display: block; font-size: 30px; color: var(--ink); }
.matrix .cell.ok { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.matrix .cell.ok .num { color: var(--accent); }
.matrix .ax { font: 500 10px/1.25 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: grid; place-items: center; text-align: center; }

.venn { position: relative; height: 116px; width: 210px; }
.venn span { position: absolute; top: 8px; width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; font: 500 10px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-align: center; transition: transform 1.2s var(--ease); }
.venn .p { left: 10px; border: 1.5px solid var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); padding-right: 28px; }
.venn .e { left: 96px; border: 1.5px solid var(--ink-2); color: var(--ink-2); padding-left: 28px; }
.js .chart:not(.in) .venn .p { transform: translateX(-22px); }
.js .chart:not(.in) .venn .e { transform: translateX(22px); }

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.work-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; cursor: pointer; font: 500 13px/1 var(--mono); letter-spacing: .02em; color: var(--ink-2); transition: background .2s, color .2s, border-color .2s; }
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter .count { opacity: .6; margin-left: 4px; }
.work-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.proj { grid-column: span 2; position: relative; display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s; }
.proj.feature { grid-column: span 3; }
.proj:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--rule-strong); }
.proj.is-hidden { display: none; }
.proj.fade-in { animation: cardIn .55s var(--ease) both; animation-delay: calc(var(--k, 0) * 60ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } }
.proj-viz { position: relative; padding: 24px 22px 20px; background: var(--paper-2); border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 20px; align-items: end; min-height: 200px; }
.proj.feature .proj-viz { min-height: 230px; }
.kr .num { display: block; font-size: clamp(50px, 5vw, 76px); transition: color .35s; }
.proj:hover .kr .num { color: var(--accent); }
.kr > span:last-child { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; max-width: 17ch; line-height: 1.35; }
.mini { min-width: 0; }
.mini .cap { display: block; margin-top: 10px; font: 500 10px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.proj-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.proj-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding-right: 44px; }
.proj h3 { font: 600 20px/1.25 var(--sans); letter-spacing: -.015em; margin: 0 0 8px; }
.proj h3 a { text-decoration: none; }
.proj h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.proj .desc { margin: 0 0 16px; color: var(--ink-2); font-size: 14.5px; }
.flow { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.flow li { padding: 10px 10px 12px; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.flow li + li { border-left: 1px solid var(--rule); }
.flow li .label { display: block; font-size: 9.5px; margin-bottom: 4px; }
.flow li:last-child { background: var(--accent-soft); color: var(--ink); }
.flow li:last-child .label { color: var(--accent); }
.proj .tags { margin-bottom: 18px; }
.proj-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.proj .go { position: absolute; z-index: 1; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--rule-strong); transition: background .3s, color .3s, transform .5s var(--ease), border-color .3s; pointer-events: none; }
.proj:hover .go { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: rotate(-45deg); }
.proj.pro { background: transparent; border-style: dashed; }
.proj.pro .proj-viz { background: transparent; min-height: 0; grid-template-columns: 1fr; border-bottom-style: dashed; }
.proj.pro .kr .num { font-size: clamp(40px, 4vw, 54px); }
@media (max-width: 1100px) {
  .proj, .proj.feature { grid-column: span 3; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li:nth-child(3) { border-left: 0; }
  .flow li:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 680px) {
  .work-grid { grid-template-columns: 1fr; }
  .proj, .proj.feature { grid-column: 1; }
  .proj-viz { grid-template-columns: 1fr; min-height: 0; }
  .filters { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + var(--gutter) * 2); margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; }
}

/* ==========================================================================
   DOCUMENTS
   ========================================================================== */
.docs { margin-top: clamp(64px, 9vw, 110px); }
.docs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 24px; }
.docs-head h3 { font: 400 clamp(36px, 4.6vw, 58px)/1 var(--serif); }
.docs-head h3 em { color: var(--accent); }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
.doc { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); overflow: hidden; transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.doc:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.doc-thumb { position: relative; height: 210px; background: var(--paper-2); overflow: hidden; border-bottom: 1px solid var(--rule); display: flex; justify-content: center; align-items: flex-start; padding-top: 24px; }
.doc-thumb img { width: 64%; border-radius: 3px 3px 0 0; box-shadow: 0 12px 30px -12px rgba(0,0,0,.35); transform: translateY(6px); transition: transform .6s var(--ease); background: #fff; }
.doc-thumb.wide { align-items: center; padding-top: 0; }
.doc-thumb.wide img { width: 84%; border-radius: 4px; transform: none; }
.doc:hover .doc-thumb img { transform: translateY(-4px) rotate(-1deg); }
.doc-type { position: absolute; top: 12px; left: 12px; font: 500 10.5px/1 var(--mono); letter-spacing: .06em; padding: 6px 8px; border-radius: 6px; background: var(--ink); color: var(--paper); z-index: 1; }
.doc-body { padding: 18px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.doc-body h4 { font: 600 16px/1.3 var(--sans); }
.doc-body p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.doc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
.doc-actions .btn { flex: 1; }
@media (max-width: 980px) { .doc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) {
  .doc-grid { grid-template-columns: 1fr; }
  .doc { display: grid; grid-template-columns: 104px minmax(0, 1fr); }
  .doc-thumb, .doc-thumb.wide { height: auto; border-bottom: 0; border-right: 1px solid var(--rule); padding: 36px 10px 12px; align-items: flex-start; }
  .doc-thumb img, .doc-thumb.wide img { width: 100%; }
  .doc-body { padding: 14px; }
  .doc-actions { flex-wrap: wrap; }
}

/* ==========================================================================
   ANALYTICS LAB (dark dashboard)
   ========================================================================== */
.lab { background: var(--deep); color: var(--deep-ink); --ink: var(--deep-ink); --ink-2: #c9cfcb; --muted: var(--deep-muted); --rule: var(--deep-rule); --rule-strong: #3a444b; --accent: var(--data-hi); --accent-ink: #1a0b0e; --accent-soft: #2c1a1e; --surface: var(--deep-2); --paper: var(--deep); --paper-2: var(--deep-2); color-scheme: dark; }
.lab-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.panel { grid-column: span 4; background: var(--deep-2); border: 1px solid var(--deep-rule); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 16px; transition: border-color .3s, transform .45s var(--ease); min-width: 0; }
.panel:hover { border-color: #3a444b; transform: translateY(-2px); }
.panel.w6 { grid-column: span 6; }
.panel.w8 { grid-column: span 8; }
.panel-head h3 { font: 600 15.5px/1.3 var(--sans); letter-spacing: -.01em; margin-top: 4px; }
.panel .src { font-size: 12px; color: var(--deep-muted); margin: auto 0 0; padding-top: 10px; border-top: 1px dashed var(--deep-rule); }
.panel .src a { color: var(--deep-ink); }
.lab .bar-track { background: rgba(255,255,255,.07); }
.lab .bar-fill { background: var(--data-base); }
.kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { padding: 18px 20px; border-radius: var(--r); background: var(--deep-2); border: 1px solid var(--deep-rule); }
.kpi .num { display: block; font-size: clamp(42px, 4.4vw, 60px); }
.kpi p { margin: 8px 0 0; font-size: 13px; color: var(--deep-muted); }
.gantt { display: grid; gap: 9px; position: relative; }
.g-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; font-size: 12.5px; }
.g-row .gl { color: #c9cfcb; padding-right: 10px; line-height: 1.2; }
.g-lane { position: relative; height: 18px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px calc(100% / 7)); border-radius: 4px; }
.g-bar { position: absolute; top: 3px; bottom: 3px; left: var(--s); width: var(--w); border-radius: 999px; background: var(--data-base); transform-origin: left; transition: transform 1.1s var(--ease); transition-delay: calc(var(--k, 0) * 110ms + 200ms); }
.g-bar.hi { background: var(--data-hi); }
.g-mark { position: absolute; top: 2px; left: var(--s); width: 13px; height: 13px; margin-left: -6.5px; transform: rotate(45deg); border: 2px solid var(--data-hi); background: var(--deep-2); }
.js .chart:not(.in) .g-bar { transform: scaleX(0); }
.g-axis { display: grid; grid-template-columns: 150px minmax(0, 1fr); font: 500 10.5px/1 var(--mono); color: var(--deep-muted); }
.g-axis .ticks { position: relative; height: 14px; }
.g-axis .ticks span { position: absolute; transform: translateX(-50%); }
.g-axis .ticks span:first-child { transform: none; }
.g-now { position: absolute; top: 0; bottom: 18px; width: 1px; background: var(--data-hi); left: calc(150px + (100% - 150px) * var(--x)); }
.g-now::before { content: "NOW"; position: absolute; top: -2px; left: 5px; font: 500 9.5px/1 var(--mono); color: var(--data-hi); letter-spacing: .06em; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--deep-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--data-base); }
.legend i.hi { background: var(--data-hi); }
.legend i.dia { transform: rotate(45deg) scale(.8); border: 2px solid var(--data-hi); background: transparent; border-radius: 0; }
@media (max-width: 1000px) { .panel, .panel.w6, .panel.w8 { grid-column: span 6; } .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) {
  .panel, .panel.w6, .panel.w8 { grid-column: 1 / -1; }
  .g-row, .g-axis { grid-template-columns: 92px minmax(0, 1fr); }
  .g-now { left: calc(92px + (100% - 92px) * var(--x)); }
  .g-row .gl { font-size: 11.5px; }
}

/* ==========================================================================
   NUMBERS + BEYOND
   ========================================================================== */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); }
.number { padding: 26px 22px 28px 0; border-bottom: 1px solid var(--rule); }
.number:not(:nth-child(4n+1)) { padding-left: 22px; border-left: 1px solid var(--rule); }
.number .num { display: block; font-size: clamp(50px, 6vw, 84px); }
.number .num small { font-size: .5em; }
.number p { margin: 10px 0 4px; font-size: 14.5px; color: var(--ink-2); }
@media (max-width: 900px) {
  .numbers { grid-template-columns: 1fr 1fr; }
  .number:not(:nth-child(4n+1)) { padding-left: 0; border-left: 0; }
  .number:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--rule); }
}
.lead-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: clamp(48px, 7vw, 80px); }
.lead-card { border: 1px solid var(--rule); border-radius: var(--r); padding: 24px; background: var(--surface); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.lead-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.lead-card h3 { font: 400 26px/1.1 var(--serif); margin: 14px 0 6px; }
.lead-card .org { font-weight: 600; font-size: 14px; color: var(--accent); margin: 0 0 12px; }
.lead-card p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.lead-card a { font-size: 14px; display: inline-block; margin-top: 14px; }
@media (max-width: 900px) { .lead-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact { background: var(--deep); color: var(--deep-ink); padding-block: clamp(90px, 13vw, 170px) clamp(48px, 6vw, 72px); position: relative; overflow: hidden; --ink: var(--deep-ink); --ink-2: #c9cfcb; --muted: var(--deep-muted); --rule: var(--deep-rule); --accent: var(--data-hi); --accent-ink: #1a0b0e; color-scheme: dark; }
.contact-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.contact-bg circle { fill: #3a444b; }
.contact-bg line { stroke: #232b30; stroke-width: 1; }
.contact .wrap { position: relative; }
.contact h2 { font-size: clamp(52px, 9vw, 136px); line-height: .94; max-width: 13ch; margin-top: 18px; }
.contact .lede { color: #c9cfcb; max-width: 46ch; margin: 24px 0 0; }
.options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: clamp(36px, 5vw, 60px); }
.option { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px; min-height: 200px; border-radius: var(--r-lg); background: var(--deep-2); border: 1px solid var(--deep-rule); text-decoration: none; color: var(--deep-ink); overflow: hidden; transition: transform .5s var(--ease), border-color .3s; }
.option::after { content: ""; position: absolute; inset: 0; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 120%), rgba(227,107,124,.16), transparent 60%); opacity: 0; transition: opacity .4s; pointer-events: none; }
.option:hover { transform: translateY(-5px); border-color: #3e4950; }
.option:hover::after { opacity: 1; }
.option .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--deep-3); color: var(--deep-ink); transition: background .3s, color .3s; }
.option:hover .ico { background: var(--data-hi); color: #1a0b0e; }
.option h3 { font: 400 34px/1 var(--serif); margin-top: auto; }
.option p { margin: 0; font-size: 14px; color: var(--deep-muted); overflow-wrap: anywhere; }
.option .arr { position: absolute; top: 24px; right: 24px; transition: transform .4s var(--ease); }
.option:hover .arr { transform: translate(3px, -3px); }
.option-extra { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 24px; font-size: 14px; color: var(--deep-muted); align-items: center; }
.option-extra a { color: var(--deep-ink); }
.copy-btn { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #3a444b; background: transparent; cursor: pointer; font: 500 12.5px/1 var(--mono); color: var(--deep-ink); transition: background .2s, color .2s; }
.copy-btn:hover { background: var(--deep-ink); color: var(--deep); }
@media (max-width: 860px) { .options { grid-template-columns: 1fr; } .option { min-height: 0; } .option h3 { margin-top: 6px; } }

.footer { padding-block: 26px calc(26px + env(safe-area-inset-bottom, 0px)); background: var(--deep); color: var(--deep-muted); border-top: 1px solid var(--deep-rule); font-size: 13px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.footer a { color: #c9cfcb; }
.footer.light { background: transparent; color: var(--muted); border-top: 1px solid var(--rule); }
.footer.light a { color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; z-index: 300; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font: 500 13px/1 var(--mono); opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

/* ==========================================================================
   CASE STUDY PAGES
   ========================================================================== */
.cs-hero { padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + clamp(32px, 6vw, 72px)); padding-bottom: clamp(28px, 4vw, 48px); }
.crumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 28px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.cs-title { font-size: clamp(44px, 7.2vw, 104px); line-height: .98; max-width: 16ch; }
.cs-lede { font: 400 clamp(20px, 2.1vw, 26px)/1.4 var(--serif); color: var(--ink-2); max-width: 52ch; margin: 24px 0 0; }
.cs-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule-strong); margin: clamp(32px, 5vw, 56px) 0 0; }
.cs-meta div { padding: 16px 16px 16px 0; }
.cs-meta div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.cs-meta dd { margin: 6px 0 0; font-weight: 500; font-size: 14.5px; }
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 24px 0 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.pipeline li { padding: 16px 18px; position: relative; }
.pipeline li + li { border-left: 1px solid var(--rule); }
.pipeline .label { display: block; margin-bottom: 6px; font-size: 10.5px; }
.pipeline p { margin: 0; font-size: 14px; color: var(--ink-2); }
.pipeline li:last-child { background: var(--accent-soft); }
.pipeline li:last-child .label { color: var(--accent); }
@media (max-width: 760px) {
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .cs-meta div + div { padding-left: 0; border-left: 0; }
  .cs-meta div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--rule); }
  .cs-meta div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .cs-actions .btn { flex: 1 1 auto; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline li:nth-child(3) { border-left: 0; }
  .pipeline li:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
.cs-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.cs-metric { background: var(--deep); color: var(--deep-ink); border-radius: var(--r); padding: 24px; }
.cs-metric .num { display: block; font-size: clamp(44px, 5vw, 64px); }
.cs-metric p { margin: 10px 0 0; font-size: 14px; color: var(--deep-muted); }
.cs-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding-block: clamp(48px, 8vw, 96px); }
.cs-toc { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; }
.cs-toc ol { list-style: none; margin: 14px 0 0; padding: 0; border-left: 1px solid var(--rule); }
.cs-toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; font-size: 14px; color: var(--muted); transition: color .2s, border-color .2s; }
.cs-toc a:hover, .cs-toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); }
.cs-section { padding-bottom: 44px; margin-bottom: 44px; border-bottom: 1px solid var(--rule); max-width: 76ch; min-width: 0; }
.cs-section:last-child { border-bottom: 0; }
.cs-section h2 { font: 400 clamp(32px, 3.6vw, 44px)/1.05 var(--serif); margin: 10px 0 18px; }
.cs-section > p, .cs-section > ul > li { color: var(--ink-2); font-size: 16.5px; }
.cs-section > ul { padding-left: 0; list-style: none; }
.cs-section > ul > li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.cs-section > ul > li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); font-size: 14px; top: 2px; }
.cs-section strong { color: var(--ink); }
.figure { margin: 22px 0 6px; padding: 22px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
.figure figcaption { margin-top: 16px; font-size: 13px; color: var(--muted); }
.figure-title { display: block; margin-bottom: 16px; }
.figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 24px; align-items: center; }
.tool-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tool-list li { padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); font-size: 14px; }
.artifact-list { display: grid; gap: 12px; }
.artifact { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.artifact img { width: 72px; border-radius: 3px; box-shadow: var(--shadow-sm); background: #fff; }
.artifact strong { display: block; }
.artifact span { font-size: 13.5px; color: var(--muted); }
.artifact .btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .artifact { grid-template-columns: 56px minmax(0, 1fr); } .artifact img { width: 56px; } .artifact .btns { grid-column: 1 / -1; } }
.note { padding: 16px 18px; border-radius: 12px; background: var(--paper-2); color: var(--ink-2); font-size: 15px; }
.cs-next { border-top: 1px solid var(--rule-strong); }
.cs-next a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; padding-block: clamp(40px, 7vw, 80px); text-decoration: none; }
.cs-next .display { font-size: clamp(34px, 6vw, 80px); transition: color .3s; }
.cs-next a:hover .display { color: var(--accent); }
.cs-next .circle { width: clamp(56px, 8vw, 96px); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--rule-strong); display: grid; place-items: center; font-size: 24px; transition: background .3s, color .3s, transform .5s var(--ease); }
.cs-next a:hover .circle { background: var(--accent); color: var(--accent-ink); transform: rotate(-45deg); }
@media (max-width: 860px) { .cs-body { grid-template-columns: 1fr; } .cs-toc { display: none; } }

/* ==========================================================================
   Reduced motion — everything visible, nothing moves
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .js .reveal, .js .kpi-chip, .js .plate, .js .hero h1 .ch, .js .tagline > *, .js .hero-copy .fade { opacity: 1 !important; transform: none !important; translate: none !important; clip-path: none !important; }
  .js .section-head .rule { transform: none; }
  .js .chart:not(.in) .bar-fill { transform: scaleX(var(--v)); }
  .js .chart:not(.in) .ring .fg { stroke-dashoffset: calc(100 - var(--v)); }
  .js .chart:not(.in) .g-bar, .js .chart:not(.in) .dots i, .js .chart:not(.in) .venn span { transform: none; }
  .js .dataviz .line { stroke-dashoffset: 0; }
  .js .dataviz .area, .js .dataviz .pt { opacity: 1; }
  .pulse { animation: none; }
  @view-transition { navigation: none; }
}

/* Standard project cards stack the headline metric above the mini chart */
.proj:not(.feature) .proj-viz { grid-template-columns: 1fr; align-items: start; }
.proj:not(.feature) .kr > span:last-child { max-width: none; }

.proj:not(.feature) .flow { grid-template-columns: 1fr 1fr; }
.proj:not(.feature) .flow li:nth-child(3) { border-left: 0; }
.proj:not(.feature) .flow li:nth-child(n+3) { border-top: 1px solid var(--rule); }
.g-bar { min-width: 7px; }

/* Case-study tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 300px; }
.tbl th { text-align: left; font: 500 10.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 10px 0; border-bottom: 1px solid var(--rule-strong); }
.tbl td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.sig { display: inline-block; font: 500 11px/1 var(--mono); padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--muted); white-space: nowrap; }
.sig.yes { background: var(--accent-soft); color: var(--accent); }
.cs-section .figure-row .figure { margin: 0; }
.cs-section .figure-row { margin-top: 22px; }
.cs-section > ul.tool-list > li { padding: 8px 12px; margin: 0; font-size: 14px; }
.cs-section > ul.tool-list > li::before { display: none; }
.cs-section .figure-row { align-items: start; }
.cs-body > article, .figure, .figure-row > * { min-width: 0; }
@media (max-width: 860px) { .cs-body { grid-template-columns: minmax(0, 1fr); } }
