/* ==========================================================================
   Shahin Alam — Portfolio · Editorial design system
   Plain CSS. Paper (light) by default, Ink (dark) theme via [data-theme].
   ========================================================================== */

/* ---------- Tokens ---------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1ea;
  --bg-2: #ebe7dd;
  --surface: #faf8f3;
  --ink: #151412;
  --ink-2: #3b3934;
  --muted: #6e6a61;
  --rule: #d9d4c8;
  --rule-strong: #b8b2a4;
  --accent: #c2410c;
  --accent-2: #9a3412;
  --accent-soft: rgba(194, 65, 12, 0.09);
  --shadow: 0 40px 80px -40px rgba(60, 40, 10, 0.45);
  --grain-opacity: 0.05;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12110f;
  --bg-2: #1b1a17;
  --surface: #1d1c19;
  --ink: #efebe2;
  --ink-2: #cdc8bc;
  --muted: #9b968b;
  --rule: #2e2c28;
  --rule-strong: #4a463f;
  --accent: #f0702f;
  --accent-2: #ff9a5c;
  --accent-soft: rgba(240, 112, 47, 0.12);
  --shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  --grain-opacity: 0.035;
}
:root {
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: var(--grain-opacity);
  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");
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, figure, dl, dd, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 500; transition: top .2s; }
.skip-link:focus { top: 14px; }

/* ---------- Type ---------- */
.display, h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; line-height: 1; }
.display em, h1 em, h2 em, h3 em { font-style: italic; color: var(--accent); }
h3 { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.3; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--accent); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.lead { font-size: clamp(1.08rem, 1.45vw, 1.25rem); line-height: 1.55; color: var(--ink-2); max-width: 58ch; }
.muted { color: var(--muted); }

.text-link { position: relative; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.text-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(.25); transform-origin: left; transition: transform .45s var(--ease); }
.text-link:hover::after { transform: scaleX(1); }
.text-link svg { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.text-link:hover svg { transform: translateX(4px); }
p a, dd a, .prose a, .answer a, .bullets a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
p a:hover, dd a:hover, .prose a:hover, .answer a:hover, .bullets a:hover { color: var(--accent-2); }

/* ---------- Buttons & tags ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border-radius: 999px; white-space: nowrap;
  font-weight: 500; font-size: .96rem; border: 1px solid transparent;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.btn svg { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(.98); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { background: var(--accent); color: #fff; }
.btn-line { border-color: var(--rule-strong); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); background: var(--surface); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .88rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-family: var(--mono); font-size: .72rem; letter-spacing: .02em; padding: 5px 11px; border: 1px solid var(--rule-strong); border-radius: 999px; color: var(--ink-2); }
.tags.is-accent li { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; height: var(--header-h); isolation: isolate; }
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bg);
  box-shadow: 0 8px 24px -18px rgba(0, 0, 0, .35);
  border-bottom: 1px solid var(--rule);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.wordmark { font-family: var(--serif); font-size: 1.6rem; letter-spacing: -0.01em; line-height: 1; margin-right: auto; }
.wordmark span { color: var(--accent); }
.site-nav ul { display: flex; gap: 4px; }
.site-nav a { position: relative; display: block; padding: 8px 12px; font-size: .94rem; color: var(--ink-2); transition: color .25s; }
.site-nav a .n { display: none; }
.site-nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.clock { font-family: var(--mono); font-size: .74rem; color: var(--muted); letter-spacing: .04em; white-space: nowrap; padding-right: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule-strong); color: var(--ink); transition: border-color .25s, background-color .25s; }
.icon-btn:hover { border-color: var(--ink); background: var(--surface); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.nav-toggle { display: none; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(72px, 10vw, 136px); }
.section.tight { padding-top: 0; }
.sec-head { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: baseline; gap: 0 24px; border-top: 1px solid var(--ink); padding-top: 22px; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-num { font-family: var(--mono); font-size: .78rem; color: var(--muted); letter-spacing: .08em; }
.sec-head h2 { font-size: clamp(2.3rem, 4.8vw, 4rem); }
.sec-head .sec-lede { grid-column: 2; margin-top: 14px; color: var(--muted); max-width: 58ch; }
.sec-head .text-link { font-size: .94rem; }

/* ---------- Reveal ---------- */
[data-rise] { animation: rise 1.1s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
.hero-mail { margin-top: 36px; }
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(40px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4.6fr); gap: clamp(36px, 6vw, 104px); align-items: start; }
.hero h1 { font-size: clamp(2.9rem, 6vw, 5.4rem); line-height: .97; margin: 26px 0 30px; }
.hero h1 .name { display: block; font-size: .42em; line-height: 1.2; color: var(--muted); font-style: normal; margin-bottom: .25em; }
.hero .lead { max-width: 50ch; }
.hero .btn-row { margin-top: 36px; }
.hero-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--rule); }
.hero-meta div { padding: 16px 16px 0 0; }
.hero-meta dt { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hero-meta dd { font-family: var(--serif); font-size: 1.45rem; line-height: 1.2; margin-top: 4px; }

/* Portrait */
.portrait { position: relative; perspective: 1100px; justify-self: end; align-self: start; width: 100%; max-width: 440px; }
.hero .portrait { margin-top: clamp(44px, 4.5vw, 64px); }
.portrait-frame { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 3px; background: var(--bg-2); box-shadow: var(--shadow); transform-style: preserve-3d; transition: transform .6s var(--ease); will-change: transform; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92) contrast(1.02); }
.portrait-frame::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at var(--gx, 30%) var(--gy, 20%), rgba(255,255,255,.18), transparent 50%); mix-blend-mode: soft-light; pointer-events: none; }
.portrait figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.stamp { position: absolute; top: -44px; right: -40px; width: 124px; height: 124px; z-index: 2; }
.stamp circle { fill: var(--accent); }
.stamp text { font-family: var(--mono); font-size: 9.4px; letter-spacing: .5px; fill: #fff; text-transform: uppercase; }
.stamp .stamp-mid { font-family: var(--serif); font-size: 30px; letter-spacing: 0; }
.stamp .ring { transform-origin: 62px 62px; animation: spin 22s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge {
  position: absolute; left: -32px; bottom: 76px; z-index: 2; display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.35); font-size: .84rem; font-weight: 500; white-space: nowrap;
  animation: float 6s ease-in-out infinite;
}
.badge svg { width: 16px; height: 16px; color: var(--accent); }
@keyframes float { 50% { transform: translateY(-8px); } }

/* 3D wave field */
.wave { position: relative; height: clamp(200px, 26vw, 340px); margin-top: clamp(28px, 5vw, 64px); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 72%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 72%, transparent); }
.wave canvas { width: 100%; height: 100%; }
.wave-caption { position: absolute; right: var(--gutter); bottom: 22%; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Marquee */
.marquee { border-block: 1px solid var(--rule); overflow: hidden; padding: 20px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee span { font-family: var(--serif); font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1; padding: 0 28px; white-space: nowrap; }
.marquee span:nth-child(4n+2) { font-style: italic; color: var(--accent); }
.marquee i { font-style: normal; color: var(--rule-strong); align-self: center; font-size: 1.2rem; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Metrics & mini charts ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.metric { padding: 30px 28px 34px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; }
.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: 0; padding-right: 0; }
.metric-value { font-family: var(--serif); font-size: clamp(3.4rem, 5.4vw, 5rem); line-height: .95; letter-spacing: -0.02em; }
.metric-value small { font-size: .45em; color: var(--muted); margin-left: 4px; }
.metric h3 { margin: 12px 0 22px; }
.metric-note { margin-top: auto; padding-top: 20px; font-size: .88rem; color: var(--muted); line-height: 1.5; }
.mini-bars { display: grid; gap: 10px; }
.mb { display: grid; grid-template-columns: 52px minmax(0, 1fr) 46px; align-items: center; gap: 10px; font-family: var(--mono); font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mb i { display: block; height: 10px; width: var(--w); background: var(--rule-strong); border-radius: 2px; transform-origin: left; }
.mb.after i { background: var(--accent); }
.mb b { font-weight: 500; color: var(--ink-2); text-align: right; }
.js .mb i { transform: scaleX(0); transition: transform 1.4s var(--ease) .2s; }
.js .is-visible .mb i { transform: scaleX(1); }
.js .is-visible .mb.after i { transition-delay: .5s; }
.ring { width: 92px; height: 92px; }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: var(--rule); }
.ring .val { stroke: var(--accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: 238.76; stroke-dashoffset: var(--off, 11.94); }
.js .ring .val { stroke-dashoffset: 238.76; transition: stroke-dashoffset 1.8s var(--ease) .3s; }
.js .is-visible .ring .val { stroke-dashoffset: var(--off, 11.94); }
.ring text { font-family: var(--mono); font-size: 13px; fill: var(--ink-2); }
.yearline { display: flex; gap: 4px; align-items: flex-end; height: 44px; }
.yearline span { flex: 1; background: var(--ink); border-radius: 2px; height: var(--h); transform-origin: bottom; }
.yearline span.partial { background: repeating-linear-gradient(135deg, var(--ink) 0 3px, transparent 3px 6px); border: 1px solid var(--ink); }
.js .yearline span { transform: scaleY(0); transition: transform 1s var(--ease) calc(var(--i) * .12s + .2s); }
.js .is-visible .yearline span { transform: scaleY(1); }
.yearline-labels { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--mono); font-size: .68rem; color: var(--muted); }

/* ---------- Feature (Cliento) ---------- */
.feature { border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); padding: clamp(24px, 4vw, 48px); }
.feature-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; margin-bottom: clamp(28px, 4vw, 44px); }
.feature h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -0.015em; margin: 14px 0 16px; }
.feature p { color: var(--ink-2); }
.feature .tags { margin-bottom: 22px; }

/* Architecture diagram */
.arch { position: relative; border: 1px solid var(--rule); border-radius: 3px; padding: clamp(12px, 2vw, 24px);
  background-color: var(--bg); background-image: radial-gradient(var(--rule-strong) 1px, transparent 1.2px); background-size: 22px 22px; }
.arch svg { width: 100%; height: auto; overflow: visible; }
.arch .arch-m { display: none; }
.arch-node rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; }
.arch-node.svc rect { fill: var(--accent-soft); stroke: var(--accent); }
.arch-node .t { font-family: var(--sans); font-weight: 600; font-size: 15px; fill: var(--ink); }
.arch-node .s { font-family: var(--mono); font-size: 11.5px; fill: var(--muted); }
.arch-group rect { fill: none; stroke: var(--rule-strong); stroke-dasharray: 5 6; }
.arch-group text, .arch-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; fill: var(--muted); text-transform: uppercase; }
.arch-edge { fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-dasharray: 4 6; animation: dash 1.4s linear infinite; }
.arch-edge.rev { animation-direction: reverse; stroke: var(--rule-strong); }
.packet { fill: var(--accent); }
@keyframes dash { to { stroke-dashoffset: -20; } }

/* ---------- Rows (editorial lists) ---------- */
.rows { border-top: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 64px minmax(0, 1.15fr) minmax(0, 1fr) 44px; gap: 8px 28px; align-items: baseline; padding: 28px 4px; border-bottom: 1px solid var(--rule); transition: background-color .35s var(--ease), padding .45s var(--ease); }
a.row:hover { background: var(--bg-2); padding-left: 18px; padding-right: 18px; }
.row-num { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.row-title { font-family: var(--serif); font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.05; }
.row-meta { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: block; margin-top: 8px; }
.row-desc { color: var(--ink-2); font-size: .98rem; }
.row-desc .tags { margin-top: 14px; }
.row-arrow { justify-self: end; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule-strong); display: grid; place-items: center; transition: background-color .3s, border-color .3s, transform .45s var(--ease); }
.row-arrow svg { width: 16px; height: 16px; }
a.row:hover .row-arrow { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: rotate(-45deg); }
.row-group-title { font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 48px 0 16px; }

/* ---------- Gantt timeline ---------- */
.gantt { --label: 230px; position: relative; display: grid; grid-template-columns: var(--label) minmax(0, 1fr); margin-bottom: 40px; }
.gantt-row { display: contents; }
.gantt-label { padding: 20px 20px 20px 0; border-top: 1px solid var(--rule); }
.gantt-label strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.1; }
.gantt-label span { font-family: var(--mono); font-size: .7rem; color: var(--muted); letter-spacing: .04em; }
.gantt-track { position: relative; min-height: 84px; border-top: 1px solid var(--rule); }
.gantt-row:last-of-type .gantt-label, .gantt-row:last-of-type .gantt-track { border-bottom: 1px solid var(--rule); }
.gantt-bar { position: absolute; top: 50%; height: 16px; margin-top: -2px; border-radius: 999px; background: var(--ink); transform-origin: left; }
.gantt-bar.edu { background: repeating-linear-gradient(135deg, var(--rule-strong) 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.gantt-bar.now { background: linear-gradient(90deg, var(--accent) 78%, color-mix(in srgb, var(--accent) 0%, transparent)); }
.gantt-dates { position: absolute; top: 14px; font-family: var(--mono); font-size: .68rem; color: var(--muted); white-space: nowrap; }
.gantt-marker { position: absolute; top: 50%; width: 18px; height: 18px; margin-top: 6px; transform: translate(-50%, -50%) rotate(45deg); background: var(--bg); border: 2px solid var(--ink); z-index: 2; }
.gantt-marker-label { position: absolute; bottom: 8px; transform: translateX(-50%); font-family: var(--mono); font-size: .64rem; color: var(--ink-2); white-space: nowrap; background: var(--bg); padding: 0 4px; }
.gantt-overlay { position: absolute; top: 0; bottom: 0; left: var(--label); right: 0; pointer-events: none; }
.gantt-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); opacity: .7; }
.gantt-tick span { position: absolute; bottom: -28px; transform: translateX(-50%); font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.gantt-today { position: absolute; top: -10px; bottom: 0; width: 0; border-left: 1px dashed var(--accent); }
.gantt-today span { position: absolute; top: -18px; transform: translateX(-50%); font-family: var(--mono); font-size: .66rem; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.js .gantt-bar { transform: scaleX(0); transition: transform 1.6s var(--ease) var(--d, 0s); }
.js .gantt.is-visible .gantt-bar { transform: scaleX(1); }
.js .gantt-marker { opacity: 0; transition: opacity .6s 1.4s; }
.js .gantt.is-visible .gantt-marker { opacity: 1; }

/* ---------- 3D tag sphere ---------- */
.stack-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.stack-groups { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.stack-groups div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.stack-groups dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.stack-groups dd { font-family: var(--serif); font-size: 1.3rem; line-height: 1.35; }
.sphere-wrap { position: relative; isolation: isolate; width: 100%; max-width: 560px; aspect-ratio: 1; margin-inline: auto; touch-action: pan-y; }
.sphere-wrap::before, .sphere-wrap::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 1px dashed var(--rule-strong); pointer-events: none; }
.sphere-wrap::after { inset: 6% 30%; border-radius: 50%; border-style: solid; border-color: var(--rule); }
.sphere { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; align-content: center; height: 100%; padding: 12%; }
.sphere li { font-family: var(--serif); font-size: 1.3rem; line-height: 1; }
.sphere li.key { color: var(--accent); font-style: italic; }
.sphere.is-3d { display: block; padding: 0; cursor: grab; }
.sphere.is-3d:active { cursor: grabbing; }
.sphere.is-3d li { position: absolute; left: 50%; top: 50%; white-space: nowrap; will-change: transform, opacity; user-select: none; }
.sphere-hint { text-align: center; margin-top: 10px; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Stack map (bipartite) ---------- */
.stackmap { border-top: 1px solid var(--rule); padding-top: 24px; }
.stackmap svg { width: 100%; height: auto; }
.sm-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 20px; font-family: var(--mono); font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.sm-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sm-legend i { width: 22px; height: 0; border-top: 2px solid; }
.sm-legend .l-ot i { border-color: var(--accent); }
.sm-legend .l-cl i { border-color: var(--ink); }
.sm-legend .l-cd i { border-color: var(--muted); border-top-style: dashed; }
.sm-edge { fill: none; stroke-width: 1.4; transition: opacity .3s, stroke-width .3s; }
.sm-edge.from-orangetoolz { stroke: var(--accent); opacity: .55; }
.sm-edge.from-cliento { stroke: var(--ink); opacity: .35; }
.sm-edge.from-core-devs { stroke: var(--muted); opacity: .6; stroke-dasharray: 4 4; }
.sm-src rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; transition: fill .3s; }
.sm-src .t { font-family: var(--serif); font-size: 22px; fill: var(--ink); }
.sm-src .s { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.sm-src, .sm-tech { cursor: pointer; transition: opacity .3s; }
.sm-tech circle { fill: var(--bg); stroke: var(--ink); stroke-width: 1.2; }
.sm-tech text { font-family: var(--sans); font-size: 14px; fill: var(--ink); }
.sm-group { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; fill: var(--muted); }
.stackmap.is-dim .sm-edge { opacity: .07; }
.stackmap.is-dim .sm-edge.is-on { opacity: 1; stroke-width: 2.2; }
.stackmap.is-dim .sm-tech, .stackmap.is-dim .sm-src { opacity: .28; }
.stackmap.is-dim .sm-tech.is-on, .stackmap.is-dim .sm-src.is-on { opacity: 1; }
.stackmap .sm-src.is-on rect { fill: var(--accent-soft); }
.stackmap .sm-tech.is-on circle { fill: var(--accent); stroke: var(--accent); }
.sm-list { display: none; }

/* ---------- Globe ---------- */
.place { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.globe-wrap { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1; margin-inline: auto; touch-action: pan-y; cursor: grab; }
.globe-wrap canvas { width: 100%; height: 100%; }
.place-time { font-family: var(--serif); font-size: clamp(3.6rem, 8vw, 6.4rem); line-height: 1; letter-spacing: -0.02em; margin: 18px 0 8px; font-variant-numeric: tabular-nums; }

/* ---------- Page hero ---------- */
.page-hero { padding-block: clamp(40px, 7vw, 100px) clamp(36px, 5vw, 64px); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.breadcrumbs a:hover { color: var(--ink); }
.page-hero h1 { font-size: clamp(3rem, 7.2vw, 6.4rem); line-height: .96; margin: 26px 0 26px; max-width: 15ch; }
.page-hero .btn-row { margin-top: 32px; }

/* ---------- Editorial blocks ---------- */
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 104px); align-items: start; }
.sticky { position: sticky; top: calc(var(--header-h) + 32px); }
.pull { border-left: 2px solid var(--accent); padding: 4px 0 4px 26px; font-family: var(--serif); font-size: clamp(1.4rem, 2.2vw, 1.85rem); line-height: 1.32; color: var(--ink); }
.pull .eyebrow { display: flex; margin-bottom: 12px; }
.prose { color: var(--ink-2); font-size: 1.08rem; line-height: 1.75; max-width: 66ch; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); color: var(--ink); margin-top: 1.8em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose.dropcap > p:first-of-type::first-letter { float: left; font-family: var(--serif); font-size: 4.9em; line-height: .78; padding: 8px 12px 0 0; color: var(--accent); }
.prose ul { display: grid; gap: 14px; }
.prose ul li { position: relative; padding-left: 26px; }
.prose ul li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.facts div { padding: 18px 24px 18px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts dd { font-family: var(--serif); font-size: 1.35rem; line-height: 1.25; margin-top: 6px; }
.facts.one { grid-template-columns: minmax(0, 1fr); }

.numbered { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); counter-reset: n; }
.numbered li { counter-increment: n; padding: 26px 0 30px; border-top: 1px solid var(--rule); }
.numbered li::before { content: counter(n, decimal-leading-zero); display: block; font-family: var(--mono); font-size: .74rem; color: var(--accent); margin-bottom: 14px; }
.numbered h3 { font-family: var(--serif); font-weight: 400; font-size: 1.75rem; line-height: 1.1; margin-bottom: 10px; }
.numbered p { color: var(--ink-2); }
.numbered.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 48px); }
.col-item { border-top: 1px solid var(--ink); padding-top: 18px; }
.col-item .eyebrow { margin-bottom: 14px; }
.col-item h3 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.1; margin-bottom: 8px; }
.col-item p { color: var(--ink-2); }

.bullets { display: grid; gap: 12px; }
.bullets li { position: relative; padding-left: 24px; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 10px; height: 1px; background: var(--accent); }
.bullets strong { color: var(--ink); font-weight: 600; }

/* Experience entries */
.xp { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 6vw, 104px); padding: clamp(32px, 4vw, 48px) 0; border-top: 1px solid var(--rule); }
.xp:first-child { border-top-color: var(--ink); }
.xp h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1; }
.xp .role { color: var(--accent); font-weight: 500; margin-top: 10px; }
.xp .when { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; color: var(--muted); margin-top: 10px; text-transform: uppercase; }
.xp .tags { margin-top: 22px; }

/* Contact channels */
.channels { border-top: 1px solid var(--ink); }
.channel { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px 28px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.channel .k { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.channel .v { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.1; word-break: break-word; }
.channel .v a:hover { color: var(--accent); }
.channel .btn-row { justify-content: flex-end; }
.copy-btn[data-copied="true"] { border-color: var(--accent); color: var(--accent); }
.big-mail { display: inline-block; font-family: var(--serif); font-size: clamp(1.7rem, 5.6vw, 4.6rem); line-height: 1.05; letter-spacing: -0.02em; word-break: break-word; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .6s var(--ease), color .3s; }
.big-mail:hover { color: var(--accent); background-size: 100% 1px; }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 0; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.2; }
.faq .plus { flex: none; position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule-strong); transition: transform .45s var(--ease), background-color .3s, border-color .3s; }
.faq .plus::before, .faq .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); }
.faq .plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq details[open] .plus { transform: rotate(45deg); background: var(--ink); color: var(--bg); border-color: var(--ink); }
.faq .answer { padding: 0 64px 30px 0; color: var(--ink-2); max-width: 72ch; font-size: 1.04rem; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--ink); padding-top: clamp(56px, 8vw, 112px); overflow: hidden; }
.footer-cta .eyebrow { margin-bottom: 18px; }
.footer-cta .alt { margin-top: 16px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-top: clamp(56px, 8vw, 96px); padding-top: 28px; border-top: 1px solid var(--rule); }
.footer-grid h2 { font-family: var(--mono); font-size: .7rem; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; line-height: 1.4; }
.footer-grid p { color: var(--ink-2); font-size: .95rem; max-width: 34ch; }
.footer-grid ul { display: grid; gap: 8px; }
.footer-grid ul a { font-size: .95rem; color: var(--ink-2); transition: color .2s; }
.footer-grid ul a:hover { color: var(--accent); }
.footer-grid .footer-time { font-family: var(--serif); font-size: 2.6rem; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-block: 20px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.footer-bottom a:hover { color: var(--ink); }
.footer-giant { font-family: var(--serif); font-size: clamp(3.4rem, 16vw, 15rem); line-height: 1; letter-spacing: -0.03em; white-space: nowrap; text-align: center; margin: 16px 0 0; padding-bottom: clamp(20px, 3vw, 40px); color: var(--ink); user-select: none; }
.footer-giant em { color: var(--accent); }

/* ---------- 404 ---------- */
.nf { min-height: 62vh; display: grid; place-items: center; text-align: center; padding-block: 64px; }
.nf .code { font-family: var(--serif); font-size: clamp(7rem, 24vw, 16rem); line-height: .85; letter-spacing: -0.04em; }
.nf .code em { color: var(--accent); }
.nf p { color: var(--muted); margin: 16px auto 32px; max-width: 44ch; }
.nf .btn-row { justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; padding-right: 0; }
  .metric:nth-child(3) { padding-left: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .numbered.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .hero-grid, .split, .stack-grid, .place, .feature-top, .xp { grid-template-columns: minmax(0, 1fr); }
  .portrait { justify-self: start; max-width: 380px; margin-top: 8px; }
  .stamp { right: -16px; }
  .badge { left: 12px; }
  .sticky { position: static; }
  .js .nav-toggle { display: inline-grid; }
  .clock { display: none; }
  .js .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 59; background: var(--bg);
    padding: 24px var(--gutter) 40px; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-12px);
    transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
  }
  .js .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav a { display: flex; align-items: baseline; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--ink); }
  .js .site-nav a .n { display: inline; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
  .js .site-nav a::after { display: none; }
  .js .site-nav a[aria-current="page"] { color: var(--accent); font-style: italic; }
  html:not(.js) .site-header { height: auto; }
  html:not(.js) .header-inner { flex-wrap: wrap; padding-block: 12px; }
  html:not(.js) .site-nav { order: 3; width: 100%; overflow-x: auto; }
  .arch .arch-d { display: none; }
  .arch .arch-m { display: block; max-width: 420px; margin-inline: auto; }
  .stackmap svg { display: none; }
  .sm-legend { display: none; }
  .sm-list { display: grid; gap: 0; }
  .sm-list div { padding: 18px 0; border-bottom: 1px solid var(--rule); }
  .sm-list dt { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 10px; }
  .sm-list dt span { font-family: var(--mono); font-size: .7rem; color: var(--muted); margin-left: 8px; }
  .gantt { --label: 150px; }
  .channel { grid-template-columns: minmax(0, 1fr); }
  .channel .btn-row { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .sec-head { grid-template-columns: minmax(0, 1fr) auto; }
  .sec-head .sec-num { grid-column: 1 / -1; margin-bottom: 10px; }
  .sec-head .sec-lede { grid-column: 1 / -1; }
  .row { grid-template-columns: 40px minmax(0, 1fr) 40px; padding: 24px 0; }
  .row-desc { grid-column: 2 / 3; grid-row: 2; }
  .row-arrow { grid-row: 1; grid-column: 3; }
  a.row:hover { padding-left: 0; padding-right: 0; }
  .facts, .cols-3, .numbered, .numbered.three { grid-template-columns: minmax(0, 1fr); }
  .col-item + .col-item { margin-top: 32px; }
  .hero-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-meta div:last-child { grid-column: 1 / -1; }
  .stack-groups div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .gantt { --label: 104px; }
  .gantt-label strong { font-size: 1.12rem; }
  .gantt-label span { display: none; }
  .gantt-dates { font-size: .6rem; }
  .gantt-marker-label { display: none; }
  .gantt-tick span { font-size: .62rem; }
  .faq .answer { padding-right: 0; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .metric, .metric:first-child, .metric:nth-child(3) { padding: 26px 0 30px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .metric:last-child { border-bottom: 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .btn-row .btn { flex: 1 1 auto; }
  .stamp { width: 96px; height: 96px; top: -30px; right: -6px; }
  .wordmark { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  .site-header, .wave, .marquee, .footer-giant, .theme-toggle, .nav-toggle, .stamp, .badge, body::before { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   Project case studies: EduFusion, ColdMailer
   ========================================================================== */
:root, :root[data-theme="light"] { --c-edu: #1d4ed8; --c-cold: #0f766e; }
:root[data-theme="dark"] { --c-edu: #6b9bff; --c-cold: #34c7b2; }

/* Browser + phone screenshot composite */
.shot { position: relative; padding-bottom: clamp(28px, 6%, 64px); }
.shot-browser { border: 1px solid var(--rule-strong); border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--rule); background: var(--bg-2); }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule-strong); }
.shot-bar span { margin-left: 10px; font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.shot-browser img, .shot-phone img { display: block; width: 100%; height: auto; }
.shot-phone { position: absolute; right: 3%; bottom: 0; width: 21%; min-width: 108px; border-radius: 22px; border: 6px solid #151412; background: #151412; overflow: hidden; box-shadow: 0 30px 60px -24px rgba(0,0,0,.55); animation: float 7s ease-in-out infinite; }

/* Screens gallery */
.gallery { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; }
.gallery figure { margin: 0; }
.gallery .wide { grid-column: 1 / -1; }
.gallery .frame { border: 1px solid var(--rule-strong); border-radius: 8px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.gallery .frame img { display: block; width: 100%; height: auto; }
.gallery .phone-frame { max-width: 300px; margin-inline: auto; border-radius: 26px; border: 7px solid #151412; background: #151412; }
.gallery figcaption { display: flex; gap: 10px; margin-top: 12px; font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.gallery figcaption b { color: var(--accent); font-weight: 500; }

/* Warm-up ramp chart */
.ramp-card { border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); padding: clamp(20px, 3vw, 36px); }
.ramp { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.ramp-y { display: flex; flex-direction: column; justify-content: space-between; height: 240px; font-family: var(--mono); font-size: .68rem; color: var(--muted); text-align: right; }
.ramp-bars { position: relative; display: flex; align-items: flex-end; gap: clamp(3px, .8vw, 8px); height: 240px; border-left: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); padding: 0 6px;
  background: repeating-linear-gradient(to top, transparent 0 79px, var(--rule) 79px 80px); }
.ramp-bars span { flex: 1; height: var(--h); background: var(--ink); border-radius: 2px 2px 0 0; transform-origin: bottom; }
.ramp-bars span.cap { background: var(--accent); }
.ramp-cap { position: absolute; left: 0; right: 0; top: 0; border-top: 1px dashed var(--accent); }
.ramp-cap em { position: absolute; right: 4px; top: -20px; font-style: normal; font-family: var(--mono); font-size: .68rem; color: var(--accent); }
.ramp-x { display: flex; justify-content: space-between; margin: 8px 0 0 44px; font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.js .ramp-bars span { transform: scaleY(0); transition: transform .9s var(--ease) calc(var(--i) * .05s + .1s); }
.js .is-visible .ramp-bars span { transform: scaleY(1); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 2px; background: var(--ink); }
.chart-legend i.a { background: var(--accent); }

/* Stacked commit chart */
.cchart { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: clamp(8px, 2vw, 22px); align-items: end; height: 260px; border-bottom: 1px solid var(--rule-strong);
  background: repeating-linear-gradient(to top, transparent 0 64px, var(--rule) 64px 65px); }
.cbar { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; transform-origin: bottom; }
.cbar b { font-family: var(--mono); font-weight: 500; font-size: .74rem; color: var(--ink-2); text-align: center; margin-bottom: 6px; }
.cbar i { display: block; background: var(--ink); }
.cbar i.srv { background: var(--accent); border-radius: 0; }
.cbar i:first-of-type { border-radius: 3px 3px 0 0; }
.cbar.zero b { color: var(--muted); }
.cchart-x { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: clamp(8px, 2vw, 22px); margin-top: 8px; font-family: var(--mono); font-size: .72rem; color: var(--muted); text-align: center; }
.js .cbar { transform: scaleY(0); transition: transform 1.1s var(--ease) calc(var(--i) * .08s + .1s); }
.js .is-visible .cbar { transform: scaleY(1); }

/* Timeline: side projects */
.gantt-bar.side { background: transparent; box-shadow: inset 0 0 0 2px var(--c-edu); }
.gantt-bar.side.cold { box-shadow: inset 0 0 0 2px var(--c-cold); }
.gantt-dates.end { left: auto !important; right: 0; text-align: right; }

/* Stack map: 5 sources */
.stackmap svg { max-width: 920px; margin-inline: auto; display: block; }
.sm-edge.from-edufusion { stroke: var(--c-edu); opacity: .5; }
.sm-edge.from-coldmailer { stroke: var(--c-cold); opacity: .55; }
.sm-legend .l-ef i { border-color: var(--c-edu); }
.sm-legend .l-cm i { border-color: var(--c-cold); }

@media (max-width: 720px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery .phone-frame { max-width: 240px; }
  .ramp-y, .ramp-bars { height: 180px; }
  .ramp-bars { background: repeating-linear-gradient(to top, transparent 0 59px, var(--rule) 59px 60px); }
  .cchart { height: 200px; }
  .cbar b { font-size: .62rem; }
  .shot-phone { border-width: 4px; border-radius: 16px; }
}

/* ==========================================================================
   Motion layer: 3D headings, hero wireframes, scroll 3D, tilt cards,
   footer letters, progress bar, page transitions
   ========================================================================== */
:root, :root[data-theme="light"] { --glare: rgba(255, 255, 255, .55); }
:root[data-theme="dark"] { --glare: rgba(255, 255, 255, .07); }

/* Scroll progress */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90; background: var(--accent); transform: scaleX(0); transform-origin: left; pointer-events: none; }

/* 3D word-by-word headline entrance */
h1 .w { display: inline-block; perspective: 700px; }
h1 .w > span { display: inline-block; transform-origin: 50% 100%; backface-visibility: hidden; animation: wordIn 1.1s var(--ease) both; animation-delay: calc(var(--wi) * 55ms + 80ms); }
@keyframes wordIn { from { opacity: 0; transform: translateY(45%) rotateX(-80deg); } }

/* Page-hero 3D wireframe objects */
.page-hero { position: relative; }
.page-hero .wrap { position: relative; z-index: 1; }
.hero-3d { position: absolute; z-index: 0; top: 50%; right: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))); width: min(34vw, 430px); aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; animation: fadeIn 1.6s var(--ease) .25s both; }
@keyframes fadeIn { from { opacity: 0; } }
@media (max-width: 860px) { .hero-3d { display: none; } }

/* Scroll-linked 3D: screens and diagrams swing flat as they arrive */
.scroll-3d { transform: perspective(1600px) rotateX(calc((1 - var(--p, 1)) * 16deg)) translateY(calc((1 - var(--p, 1)) * 36px)) scale(calc(.95 + var(--p, 1) * .05)); transform-origin: 50% 100%; will-change: transform; }

/* 3D tilt cards with glare */
.tilt-card { position: relative; transform-style: preserve-3d; will-change: transform; }
.tilt-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s; background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), var(--glare), transparent 45%); }
.tilt-card:hover::after { opacity: 1; }

/* Section headings slide up from a mask */
.js .sec-head h2 { clip-path: inset(-20% -12% 100% -12%); transform: translateY(35%); transition: clip-path 1.1s var(--ease) .1s, transform 1.1s var(--ease) .1s; }
.js .sec-head.is-visible h2 { clip-path: inset(-20% -12% -30% -12%); transform: none; }

/* Images settle (zoom out) as they reveal */
.js [data-reveal] .frame img, .js .shot .shot-browser img { transform: scale(1.06); transition: transform 1.8s var(--ease); }
.js [data-reveal].is-visible .frame img, .js .shot.is-visible .shot-browser img { transform: none; }

/* Footer giant name: letters flip in, jump on hover */
.footer-giant { perspective: 900px; }
.footer-giant .l { display: inline-block; transform-origin: 50% 100%; transition: transform .35s var(--ease), color .2s; }
.js .footer-giant .l { opacity: 0; transform: translateY(40%) rotateX(-70deg); transition: transform 1.1s var(--ease), opacity 1.1s var(--ease), color .2s; transition-delay: calc(var(--li) * 45ms); }
.js .footer-giant.is-visible .l { opacity: 1; transform: none; }
.footer-giant.is-visible .l:hover, .footer-giant .l:hover { transform: translateY(-12%) rotate(-4deg); color: var(--accent); transition-delay: 0s; transition-duration: .35s; }
.footer-giant em .l:hover { color: var(--ink); }

/* Smooth cross-page transitions (Chromium; others just navigate normally) */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vtOut .32s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .55s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-14px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(18px); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .js .sec-head h2 { clip-path: none; transform: none; }
  .js .footer-giant .l { opacity: 1; transform: none; }
  .js [data-reveal] .frame img, .js .shot .shot-browser img { transform: none; }
}

/* About: at-work photo */
.workshot { margin: 0; }
.workshot .frame { border-radius: 4px; overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow); }
.workshot img { display: block; width: 100%; height: auto; }
.workshot figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ==========================================================================
   Homepage sections: What I do, product cards, Behind the work, How I work
   ========================================================================== */
/* What I do */
.svc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.svc { display: flex; flex-direction: column; gap: 14px; padding: 30px 26px 34px; border-right: 1px solid var(--rule); }
.svc:first-child { padding-left: 0; }
.svc:last-child { border-right: 0; padding-right: 0; }
.svc-n { font-family: var(--mono); font-size: .74rem; color: var(--accent); letter-spacing: .06em; }
.svc h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 2.3vw, 2.1rem); line-height: 1.05; }
.svc p { color: var(--ink-2); font-size: .98rem; }
.svc .tags { margin-top: auto; padding-top: 6px; }

/* Product cards */
.pcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.pcard { display: flex; flex-direction: column; gap: 12px; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); transition: border-color .3s var(--ease); }
.pcard:hover { border-color: var(--ink); }
.pcard h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 3vw, 2.6rem); line-height: 1; }
.pcard > p:not(.eyebrow) { color: var(--ink-2); }
.pcard .text-link { margin-top: 6px; align-self: flex-start; }
.pcard-visual { position: relative; height: 150px; margin-bottom: 8px; padding: 18px 18px 34px; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden;
  background-color: var(--bg); background-image: radial-gradient(var(--rule-strong) 1px, transparent 1.2px); background-size: 18px 18px; }
.pv-label { position: absolute; left: 18px; bottom: 10px; font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.mini-ramp { display: flex; align-items: flex-end; gap: 4px; height: 100%; }
.mini-ramp i { flex: 1; height: var(--h); background: var(--ink); border-radius: 2px 2px 0 0; transform-origin: bottom; }
.mini-ramp i:last-child { background: var(--accent); }
.js .mini-ramp i { transform: scaleY(0); transition: transform .8s var(--ease) calc(var(--i) * .04s + .2s); }
.js .is-visible .mini-ramp i { transform: scaleY(1); }
.pcard:hover .mini-ramp i { animation: rampPulse 1.4s var(--ease) calc(var(--i) * .05s); }
@keyframes rampPulse { 50% { transform: scaleY(.55); } }
.mini-flow { position: relative; display: flex; align-items: center; gap: 0; height: 100%; }
.mini-flow span { position: relative; z-index: 1; padding: 9px 12px; border: 1px solid var(--ink); border-radius: 6px; background: var(--surface); font-family: var(--sans); font-weight: 600; font-size: .82rem; white-space: nowrap; }
.mini-flow i { position: relative; flex: 1; min-width: 18px; height: 0; border-top: 1px dashed var(--ink-2); }
.mini-flow i::after { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: flowDot 1.8s linear infinite; }
.mini-flow i:nth-of-type(2)::after { animation-delay: .9s; }
@keyframes flowDot { from { left: 0; } to { left: calc(100% - 7px); } }

/* Behind the work */
.btw { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.now { margin-top: 28px; border-top: 1px solid var(--ink); }
.now div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.now dt { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.now dd { font-family: var(--serif); font-size: 1.35rem; line-height: 1.25; }

/* How I work: stepper with a self-drawing line */
.steps { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(18px, 3vw, 36px); }
.steps::before, .steps::after { content: ""; position: absolute; left: 0; right: 0; top: 20px; height: 1px; background: var(--rule-strong); }
.steps::after { height: 2px; top: 19.5px; background: var(--accent); transform-origin: left; }
.js .steps::after { transform: scaleX(0); transition: transform 1.8s var(--ease) .2s; }
.js .steps.is-visible::after { transform: scaleX(1); }
.steps li { position: relative; padding-top: 64px; }
.step-n { position: absolute; top: 0; left: 0; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ink); font-family: var(--mono); font-size: .74rem; }
.js .steps .step-n { transform: scale(.5); opacity: 0; transition: transform .6s var(--ease), opacity .6s var(--ease), background-color .3s, color .3s; transition-delay: calc(var(--i) * .35s + .3s); }
.js .steps.is-visible .step-n { transform: none; opacity: 1; }
.steps li:hover .step-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 2.4vw, 2.1rem); line-height: 1.05; margin-bottom: 10px; }
.steps p { color: var(--ink-2); }

@media (max-width: 1080px) {
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc:nth-child(2) { border-right: 0; padding-right: 0; }
  .svc:nth-child(3) { padding-left: 0; }
  .svc:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 920px) {
  .btw { grid-template-columns: minmax(0, 1fr); }
  .pcards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .steps::before, .steps::after { left: 20px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .steps::after { width: 2px; left: 19.5px; transform-origin: top; }
  .js .steps::after { transform: scaleY(0); }
  .js .steps.is-visible::after { transform: scaleY(1); }
  .steps li { padding: 4px 0 0 64px; }
}
@media (max-width: 560px) {
  .svc-grid { grid-template-columns: minmax(0, 1fr); }
  .svc, .svc:first-child, .svc:nth-child(3) { padding: 26px 0 30px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .svc:last-child { border-bottom: 0; }
  .mini-flow span { padding: 7px 8px; font-size: .72rem; }
  .now div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .steps::after { transform: none; }
  .js .steps .step-n, .js .mini-ramp i { transform: none; opacity: 1; }
}

/* At-work portrait: shown at a crisp size (always downscaled from the 900px source) */
.workshot { width: 100%; max-width: 480px; }
.btw { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); }
.atwork { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: center; }
.atwork-title { font-size: clamp(2.2rem, 4.4vw, 3.6rem); margin: 18px 0 20px; }
@media (max-width: 920px) {
  .btw, .atwork { grid-template-columns: minmax(0, 1fr); }
  .workshot { margin-inline: auto; }
}

/* ==========================================================================
   Websites: project grid, home strip, case pages
   ========================================================================== */
.cstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: clamp(40px, 6vw, 72px); }
.cstats div { padding: 22px 24px 24px 0; border-right: 1px solid var(--rule); }
.cstats div + div { padding-left: 24px; }
.cstats div:last-child { border-right: 0; }
.cstats dt { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cstats dd { font-family: var(--serif); font-size: clamp(2.8rem, 5vw, 4.4rem); line-height: 1; margin-top: 8px; }
.cstats span { display: block; margin-top: 6px; font-size: .86rem; color: var(--muted); }

.cgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 5vw, 64px) clamp(20px, 3vw, 36px); }
.ccard { position: relative; display: flex; flex-direction: column; gap: 10px; }
.ccard-shot { display: block; aspect-ratio: 16 / 10; border: 1px solid var(--rule-strong); border-radius: 8px; overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow); margin-bottom: 12px; }
.ccard-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 1.2s var(--ease); }
.ccard:hover .ccard-shot img, .cstrip-item:hover .ccard-shot img { transform: scale(1.04); }
.ccard h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 2.8vw, 2.5rem); line-height: 1.02; letter-spacing: -0.01em; }
.ccard h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.ccard h3 a:focus-visible { outline: none; }
.ccard:has(h3 a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 6px; }
.ccard .native { display: block; margin-top: 6px; font-family: var(--sans); font-size: 1rem; color: var(--muted); letter-spacing: 0; }
.ccard > p:not(.eyebrow) { color: var(--ink-2); }
.ccard-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.ccard-foot a { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.ccard-foot a:hover { color: var(--accent); }
.ccard-foot svg { width: 13px; height: 13px; }

.cshared { margin-top: clamp(48px, 6vw, 80px); padding: clamp(24px, 3.4vw, 40px); border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
.cshared ul { list-style: none; padding: 0; margin: 18px 0 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 40px; }
.cshared li { position: relative; padding-left: 22px; color: var(--ink-2); }
.cshared li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 1px; background: var(--accent); }
.cshared .muted { font-size: .92rem; }

.cstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 20px; }
.cstrip-item { display: flex; flex-direction: column; gap: 4px; }
.cstrip-item .ccard-shot { box-shadow: none; margin-bottom: 10px; }
.cstrip-item strong { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1.05; }
.cstrip-item span:last-child { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cstrip-item:hover strong { color: var(--accent); }

.native-name { margin-top: 14px; font-size: 1.15rem; color: var(--muted); }
.page-hero .btn-row { margin-top: 28px; }
.live-note { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.live-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.facts dd a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.swatches { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.swatch { border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--surface); }
.swatch i { display: block; height: 64px; border-bottom: 1px solid var(--rule); }
.swatch b { display: block; padding: 8px 10px 0; font-weight: 500; font-size: .86rem; line-height: 1.25; }
.swatch code { display: block; padding: 2px 10px 10px; font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.typepair { margin-top: 14px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); padding: 6px 20px; }
.typepair div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.typepair div:last-child { border-bottom: 0; }
.typepair dt { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.typepair dd { font-family: var(--serif); font-size: 1.45rem; line-height: 1.15; text-align: right; }

.fshot { margin: 0; }
.fshot .shot-browser img { display: block; width: 100%; height: auto; }
.fshot figcaption { display: flex; gap: 10px; margin-top: 14px; font-family: var(--mono); font-size: .74rem; letter-spacing: .03em; color: var(--muted); }
.fshot figcaption b { color: var(--accent); font-weight: 500; flex: none; }

.cnext { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cnext a { display: flex; flex-direction: column; gap: 8px; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); transition: border-color .3s var(--ease), transform .4s var(--ease); }
.cnext a:hover { border-color: var(--ink); transform: translateY(-3px); }
.cnext strong { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 2.6vw, 2.3rem); line-height: 1.05; }
.cnext a > span:last-child { color: var(--muted); font-size: .94rem; }

@media (max-width: 1080px) {
  .cstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cgrid, .cnext, .cshared ul { grid-template-columns: minmax(0, 1fr); }
  .cstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cstats div:nth-child(2) { border-right: 0; }
  .cstats div:nth-child(3) { padding-left: 0; }
  .cstats div:nth-child(-n + 2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 460px) {
  .cstrip { gap: 24px 14px; }
  .cstrip-item strong { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ccard-shot img, .cnext a { transition: none; }
  .ccard:hover .ccard-shot img, .cstrip-item:hover .ccard-shot img, .cnext a:hover { transform: none; }
}
.split.cdesign-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.cnext a:last-child:not(:first-child) { text-align: right; align-items: flex-end; }
@media (max-width: 920px) { .split.cdesign-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .cnext a:last-child:not(:first-child) { text-align: left; align-items: flex-start; } }
.cstats + .cols-3 { margin-top: 8px; }
.ckeywords { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: clamp(36px, 5vw, 56px); padding-top: 22px; border-top: 1px solid var(--rule); }
.ckeywords .eyebrow { flex: none; }
.col-item code, .cshared code { font-family: var(--mono); font-size: .86em; }

/* ==========================================================================
   Cookie choice (analytics.js) and footer legal links
   ========================================================================== */
.footer-legal { display: inline-flex; gap: 16px; align-items: center; }
.link-btn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover, .footer-legal a:hover { color: var(--accent); }
.consent {
  position: fixed; z-index: 80; left: 50%; bottom: 16px; width: min(640px, calc(100% - 32px));
  display: flex; align-items: center; gap: 16px 24px; padding: 16px 18px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 6px; box-shadow: var(--shadow);
  transform: translate(-50%, calc(100% + 24px)); opacity: 0; transition: transform .45s var(--ease), opacity .45s var(--ease);
}
.consent.is-open { transform: translate(-50%, 0); opacity: 1; }
.consent p { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--ink-2); }
.consent p strong { color: var(--ink); }
.consent p a { text-decoration: underline; text-underline-offset: 3px; }
.consent-actions { display: flex; gap: 8px; flex: none; }
.consent .btn { padding: 10px 16px; font-size: .88rem; }
@media (max-width: 560px) {
  .consent { flex-direction: column; align-items: stretch; bottom: 12px; }
  .consent-actions .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .consent { transition: none; } }
@media print { .consent { display: none; } }
