/* ============ Tokens ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f6;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #3a3a3a;
  --muted: #6b6b6b;
  --line: #e7e7e7;
  --line-strong: #d4d4d4;
  --chip: #f2f2f2;
  --invert-bg: #0a0a0a;
  --invert-ink: #fafafa;
  --invert-muted: #a3a3a3;
  --invert-line: #262626;
  --ok: #15803d;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.12);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.04), 0 24px 48px -20px rgba(0,0,0,.22);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-soft: #111111;
  --surface: #141414;
  --ink: #fafafa;
  --ink-2: #d4d4d4;
  --muted: #9a9a9a;
  --line: #232323;
  --line-strong: #333333;
  --chip: #1c1c1c;
  --invert-bg: #fafafa;
  --invert-ink: #0a0a0a;
  --invert-muted: #555555;
  --invert-line: #e5e5e5;
  --ok: #4ade80;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 600; color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--ink); color: var(--bg); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; transition: top .2s; }
.skip:focus { top: 12px; }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* logo swaps with theme */
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

/* ============ Buttons & chips ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background-color .2s, color .2s, border-color .2s, box-shadow .2s;
  touch-action: manipulation;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-strong); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--chip); border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--ink-2); line-height: 1.3;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: var(--chip); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 999px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
.menu-btn { display: none; }

.mobile-menu {
  display: none; position: fixed; inset: 68px 0 auto 0; z-index: 99;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 12px var(--gutter) 20px;
}
.mobile-menu.open { display: block; animation: drop .22s var(--ease); }
.mobile-menu a { display: block; padding: 14px 4px; font-size: 18px; font-weight: 500; border-bottom: 1px solid var(--line); }
.mobile-menu .btn { margin-top: 16px; width: 100%; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ============ Hero ============ */
.hero { position: relative; padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 80px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: .7;
}
.hero-grid { display: grid; grid-template-columns: 1.25fr .95fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
.hero h1 { font-size: clamp(44px, 7.4vw, 88px); font-weight: 700; letter-spacing: -0.045em; line-height: .98; margin: 22px 0 18px; }
.hero h1 .outline { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.hero .role-line { font-family: var(--font-display); font-size: clamp(19px, 2.2vw, 24px); font-weight: 500; letter-spacing: -0.01em; }
.hero .lead { margin-top: 18px; max-width: 58ch; color: var(--ink-2); font-size: 17px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.socials { display: flex; gap: 8px; margin-top: 26px; flex-wrap: wrap; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: border-color .2s, color .2s;
}
.socials a:hover { border-color: var(--ink); color: var(--ink); }
.socials svg { width: 16px; height: 16px; }

/* Profile card (arc.dev style) */
.profile {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow-lg); padding: 24px;
}
.profile-head { display: flex; gap: 16px; align-items: center; }
.avatar {
  width: 72px; height: 72px; flex: none; border-radius: 18px; display: grid; place-items: center;
  background: #0a0a0a; border: 1px solid var(--line-strong); position: relative;
}
.avatar img { width: 48px; height: 48px; }
.avatar .verified {
  position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center; border: 1px solid var(--line);
}
.avatar .verified svg { width: 14px; height: 14px; }
.profile-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.profile-meta { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.profile-meta svg { width: 14px; height: 14px; }
.vetted {
  display: flex; align-items: center; gap: 10px; margin: 20px 0 16px; padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--line); font-size: 14px;
}
.vetted svg { width: 18px; height: 18px; flex: none; }
.vetted span { color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.kpi { background: var(--surface); padding: 14px 16px; }
.kpi strong { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--muted); }
.profile-label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 10px; }
.profile .chips .chip { font-size: 12.5px; }
.profile-foot { display: flex; gap: 10px; margin-top: 20px; }
.profile-foot .btn { flex: 1; }

/* ============ Marquee ============ */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 18px 0; background: var(--bg); }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: scroll 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 48px; }
.marquee-track span::after { content: "✦"; font-size: 12px; color: var(--line-strong); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ============ Sections ============ */
section { padding: clamp(64px, 9vw, 112px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(32px, 4vw, 48px); flex-wrap: wrap; }
.section-head h2 { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -0.035em; margin-top: 14px; max-width: 18ch; }
.section-head p { color: var(--muted); max-width: 44ch; }

/* ============ Stats ============ */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.stat { background: var(--surface); padding: 26px 22px; }
.stat strong { display: block; font-family: var(--font-display); font-size: clamp(32px, 4vw, 44px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }

/* ============ Case studies (bento) ============ */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 14px; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card .tag { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.card h3 { font-size: 22px; letter-spacing: -0.02em; }
.card p { color: var(--ink-2); font-size: 15px; }
.card .metric { font-family: var(--font-display); font-size: clamp(40px, 5vw, 60px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.card .metric.sm { font-size: clamp(36px, 3.6vw, 48px); }
.card .metric small { white-space: nowrap; }
.card .metric small { font-size: .4em; letter-spacing: -0.01em; color: var(--muted); font-weight: 500; margin-left: 6px; }
.card .chips { margin-top: auto; padding-top: 6px; }
.card .chip { font-size: 12px; padding: 4px 10px; }
.card .note { font-size: 12.5px; color: var(--muted); }
.c-1 { grid-column: span 4; grid-row: span 2; }
.c-2, .c-3 { grid-column: span 2; }
.c-4, .c-5, .c-6 { grid-column: span 2; }

.card.dark { background: var(--invert-bg); color: var(--invert-ink); border-color: var(--invert-bg); }
.card.dark p, .card.dark .note { color: var(--invert-muted); }
.card.dark .tag { color: var(--invert-muted); }
.card.dark b { color: var(--invert-ink); }
.card.dark .chip { background: transparent; border-color: var(--invert-line); color: var(--invert-ink); }
.card.dark .metric small { color: var(--invert-muted); }

.compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 6px 0; }
.compare .side { border: 1px solid var(--invert-line); border-radius: var(--radius-sm); padding: 16px; }
.compare .side span { font-size: 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--invert-muted); }
.compare .side strong { display: block; font-family: var(--font-display); font-size: clamp(30px, 4vw, 46px); font-weight: 600; letter-spacing: -0.04em; color: var(--invert-ink); }
.compare .side.after { background: var(--invert-ink); }
.compare .side.after strong { color: var(--invert-bg); }
.compare .side.after span { color: var(--invert-muted); }
.compare svg { width: 22px; height: 22px; opacity: .7; }
.bullets { display: grid; gap: 8px; }
.bullets li { position: relative; padding-left: 18px; font-size: 15px; color: var(--invert-muted); }
.bullets li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 2px; background: var(--invert-ink); }

.errs { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--invert-line); border-radius: var(--radius-sm); }
.errs .row { display: grid; grid-template-columns: 84px 1fr 32px; gap: 12px; align-items: center; font-size: 13px; color: var(--invert-muted); font-variant-numeric: tabular-nums; }
.errs .row b { text-align: right; }
.card.dark .bar { background: var(--invert-line); }
.card.dark .bar i { background: var(--invert-ink); }
.bar { height: 6px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: inherit; width: var(--w); transform-origin: left; }

/* ============ Experience ============ */
.timeline { border-top: 1px solid var(--line); }
.job { border-bottom: 1px solid var(--line); }
.job summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 170px 1fr auto; gap: 24px; align-items: center;
  padding: 26px 4px; transition: background-color .2s;
}
.job summary::-webkit-details-marker { display: none; }
.job summary:hover .job-co { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.job-date { font-family: var(--font-mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.job-co { font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; letter-spacing: -0.02em; }
.job-role { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.job-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.plus { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); display: grid; place-items: center; transition: transform .3s var(--ease), background-color .2s, border-color .2s; }
.plus svg { width: 18px; height: 18px; }
.job[open] .plus { transform: rotate(45deg); background: var(--ink); color: var(--bg); border-color: var(--ink); }
.job-body { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 0 4px 30px; }
.job-body > div { grid-column: 2; max-width: 820px; }
.job-body ul.list { display: grid; gap: 10px; }
.job-body ul.list > li { position: relative; padding-left: 20px; color: var(--ink-2); }
.job-body ul.list > li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 6px; height: 6px; background: var(--ink); border-radius: 2px; }
.job-body ul.sub { margin-top: 10px; display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); }
.job-body ul.sub li { position: relative; padding-left: 16px; font-size: 15px; }
.job-body ul.sub li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.client { margin: 22px 0 10px; font-weight: 600; }
.client span { font-weight: 400; color: var(--muted); }
.meta-row { margin-top: 18px; display: grid; gap: 10px; }
.meta-row .label { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: 13.5px; font-weight: 500; transition: background-color .2s, color .2s, border-color .2s;
}
.links a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.links a svg { width: 13px; height: 13px; }
.links .plain { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--chip); font-size: 13.5px; color: var(--ink-2); }

/* ============ Project feature ============ */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 24px; overflow: hidden;
  background: var(--invert-bg); color: var(--invert-ink);
}
.feature-text { padding: clamp(28px, 4vw, 52px); display: flex; flex-direction: column; gap: 18px; }
.feature-text h3 { font-size: clamp(34px, 4.4vw, 52px); letter-spacing: -0.04em; }
.feature-text .eyebrow { color: var(--invert-muted); }
.feature-text p, .feature-text li { color: var(--invert-muted); }
.feature-text b { color: var(--invert-ink); }
.feature-text .chip { background: transparent; border-color: var(--invert-line); color: var(--invert-ink); font-size: 12.5px; }
.feature-text .btn-primary { background: var(--invert-ink); color: var(--invert-bg); align-self: flex-start; }
.feature-visual { position: relative; border-left: 1px solid var(--invert-line); padding: clamp(24px, 3vw, 40px); display: flex; align-items: center; justify-content: center; min-height: 360px;
  background-image: radial-gradient(var(--invert-line) 1px, transparent 1px); background-size: 18px 18px; }
.arch { width: 100%; max-width: 440px; display: grid; gap: 12px; }
.arch-row { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 10px; }
.node {
  border: 1px solid var(--invert-line); border-radius: 12px; padding: 12px; background: var(--invert-bg);
  font-size: 13px; color: var(--invert-ink); text-align: center;
}
.node small { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--invert-muted); margin-top: 2px; letter-spacing: .02em; }
.node.hi { background: var(--invert-ink); color: var(--invert-bg); border-color: var(--invert-ink); }
.node.hi small { color: var(--invert-muted); }
.arch-line { height: 18px; display: flex; justify-content: center; }
.arch-line::before { content: ""; width: 1px; background: repeating-linear-gradient(to bottom, var(--invert-muted) 0 3px, transparent 3px 6px); }

/* ============ Skills ============ */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skill {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface);
  transition: border-color .25s, box-shadow .25s;
}
.skill:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.skill-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: var(--bg); display: grid; place-items: center; margin-bottom: 16px; }
.skill-ico svg { width: 20px; height: 20px; }
.skill h3 { font-size: 17px; margin-bottom: 12px; letter-spacing: -0.01em; }
.skill .chip { font-size: 12.5px; padding: 4px 10px; }
.skill.wide { grid-column: span 2; }

/* focus areas */
.focus { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.focus .chip { font-size: 14px; padding: 8px 14px; background: var(--surface); }

/* ============ Products ============ */
.side-projects { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.card.side .list { display: grid; gap: 8px; }
.card.side .list li { position: relative; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.card.side .list li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; background: var(--ink); border-radius: 2px; }
.card.side .chips { margin-top: auto; }
.products { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.product {
  box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line);
  background: var(--surface); padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; min-height: 112px;
  transition: background-color .25s, color .25s;
}
a.product:hover { background: var(--ink); color: var(--bg); }
a.product:hover .p-meta { color: var(--invert-muted); }
.p-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.p-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; word-break: break-word; }
.p-top svg { width: 16px; height: 16px; flex: none; margin-top: 4px; transition: transform .25s var(--ease); }
a.product:hover .p-top svg { transform: translate(2px, -2px); }
.p-meta { font-size: 13px; color: var(--muted); margin-top: auto; }
.p-stores { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.p-stores a {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: 12.5px; font-weight: 500; transition: background-color .2s, color .2s, border-color .2s;
}
.p-stores a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.p-stores svg { width: 12px; height: 12px; }

/* ============ Contact ============ */
.contact { padding-bottom: 40px; }
.cta {
  position: relative; overflow: hidden; border-radius: 28px; background: var(--invert-bg); color: var(--invert-ink);
  padding: clamp(36px, 6vw, 80px);
}
.cta::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 380px; height: 380px; opacity: .07;
  background: var(--cta-logo) center / contain no-repeat;
}
.cta .eyebrow { color: var(--invert-muted); }
.cta h2 { font-size: clamp(38px, 6vw, 76px); letter-spacing: -0.045em; line-height: 1; margin: 18px 0 20px; max-width: 14ch; }
.cta p { color: var(--invert-muted); max-width: 52ch; font-size: 17px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; position: relative; z-index: 1; }
.cta .btn-primary { background: var(--invert-ink); color: var(--invert-bg); }
.cta .btn-ghost { background: transparent; color: var(--invert-ink); border-color: var(--invert-line); }
.cta .btn-ghost:hover { border-color: var(--invert-ink); }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 44px; background: var(--invert-line); border: 1px solid var(--invert-line); border-radius: var(--radius); overflow: hidden; position: relative; z-index: 1; }
.contact-item { background: var(--invert-bg); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; transition: background-color .2s; min-width: 0; }
a.contact-item:hover { background: color-mix(in srgb, var(--invert-ink) 8%, var(--invert-bg)); }
.contact-item span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--invert-muted); }
.contact-item strong { color: var(--invert-ink); font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn { position: relative; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: opacity .2s, transform .25s var(--ease); box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Footer ============ */
footer { padding: 28px 0 40px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.foot .brand { color: var(--ink); font-size: 15px; }
.foot .brand img { width: 26px; height: 26px; }
.to-top { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.to-top:hover { color: var(--ink); }
.to-top svg { width: 16px; height: 16px; }

/* ============ Reveal ============ */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .bar i { transform: scaleX(0); transition: transform 1.1s var(--ease) .2s; }
.js .in .bar i, .js .bar.in i { transform: scaleX(1); }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .menu-btn { display: inline-grid; }
  .hero-grid { grid-template-columns: 1fr; }
  .profile { max-width: 560px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .c-1 { grid-column: span 2; grid-row: auto; }
  .c-2, .c-3, .c-4, .c-5, .c-6 { grid-column: span 1; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .products { grid-template-columns: repeat(3, 1fr); }
  .feature { grid-template-columns: 1fr; }
  .side-projects { grid-template-columns: 1fr; }
  .feature-visual { border-left: 0; border-top: 1px solid var(--invert-line); }
}
@media (max-width: 720px) {
  .nav-hire { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:last-child { grid-column: span 2; }
  .bento { grid-template-columns: 1fr; }
  .c-1, .c-2, .c-3, .c-4, .c-5, .c-6 { grid-column: auto; }
  .compare { grid-template-columns: 1fr; }
  .compare svg { transform: rotate(90deg); margin: 0 auto; }
  .job summary { grid-template-columns: 1fr auto; gap: 6px 16px; padding: 22px 0; }
  .job-date { grid-column: 1; grid-row: 1; }
  .job summary > div:nth-child(2) { grid-column: 1; grid-row: 2; }
  .plus { grid-column: 2; grid-row: 1 / span 2; }
  .job-body { grid-template-columns: 1fr; padding: 0 0 26px; }
  .job-body > div { grid-column: 1; }
  .skills { grid-template-columns: 1fr; }
  .skill.wide { grid-column: auto; }
  .products { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .profile-foot { flex-direction: column; }
  .hero-cta .btn { flex: 1 1 auto; }
  .arch-row { --n: 2 !important; }
}
@media (max-width: 380px) {
  .products { grid-template-columns: 1fr; }
  .kpi strong { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .bar i { transform: none; }
  .marquee-track { animation: none; }
}

@media print {
  .nav, .mobile-menu, .marquee, .toast, .theme-toggle { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .job-body { display: grid !important; }
}
