:root {
  --bg: #0c0e0d;
  --bg-2: #121513;
  --card: #151916;
  --line: #24302a;
  --text: #ece8df;
  --muted: #a4a99f;
  --faint: #6f766d;
  --accent: #5fd4a0;
  --accent-ink: #0a2a1c;
  --gold: #e8b65a;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
  --radius: 18px;
  --max: 1160px;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f3ec;
  --bg-2: #efebe2;
  --card: #fffdf8;
  --line: #ddd7ca;
  --text: #171a18;
  --muted: #555b55;
  --faint: #868b84;
  --accent: #0f7a53;
  --accent-ink: #ffffff;
  --gold: #9a6a12;
  --shadow: 0 30px 60px -34px rgba(40, 35, 20, .35);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f3ec;
    --bg-2: #efebe2;
    --card: #fffdf8;
    --line: #ddd7ca;
    --text: #171a18;
    --muted: #555b55;
    --faint: #868b84;
    --accent: #0f7a53;
    --accent-ink: #ffffff;
    --gold: #9a6a12;
    --shadow: 0 30px 60px -34px rgba(40, 35, 20, .35);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { font-family: var(--serif); font-size: 1.45rem; text-decoration: none; letter-spacing: .01em; white-space: nowrap; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); border-radius: 50%;
  color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid transparent; transition: transform .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { padding: 9px 16px; font-size: .88rem; }
.btn svg { width: 16px; height: 16px; }

/* Hero */
.hero { position: relative; padding: clamp(64px, 11vw, 140px) 0 clamp(56px, 8vw, 96px); }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  pointer-events: none; z-index: -1;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.9rem, 8.4vw, 6.6rem); line-height: .98; letter-spacing: -.02em;
  margin: 22px 0 26px; max-width: 14ch;
}
.hero h1 em { color: var(--accent); }
.hero .lede { font-size: clamp(1.08rem, 2.1vw, 1.3rem); color: var(--muted); max-width: 60ch; margin: 0 0 36px; }
.hero .lede strong { color: var(--text); font-weight: 500; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.proof { border-block: 1px solid var(--line); background: var(--bg-2); }
.proof .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 34px; padding: 24px 0; }
.proof-label { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.proof ul { display: flex; flex-wrap: wrap; gap: 10px 30px; list-style: none; margin: 0; padding: 0; }
.proof li { font-family: var(--serif); font-size: 1.22rem; color: var(--muted); }

/* Sections */
section { scroll-margin-top: 80px; }
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-head { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 48px; }
.kicker { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.04; margin: 0; letter-spacing: -.01em; max-width: 20ch; }
.section-head p { color: var(--muted); margin: 0; max-width: 62ch; }

/* Case studies */
.cases { display: grid; gap: 28px; }
.case {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.case:nth-child(even) .case-visual { order: 2; }
.case-visual {
  position: relative; min-height: 340px; background: var(--bg-2);
  border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.case:nth-child(even) .case-visual { border-right: 0; border-left: 1px solid var(--line); }
.case-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.case-body { padding: clamp(26px, 4vw, 44px); display: flex; flex-direction: column; gap: 18px; }
.case-meta { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.case h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.08; margin: 0; }
.case dl { margin: 0; display: grid; gap: 14px; }
.case dt { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.case dd { margin: 0; color: var(--muted); font-size: .98rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 4px 0 0; padding: 0; }
.chips li { font-size: .78rem; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.case-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: auto; padding-top: 4px; font-size: .9rem; }
.case-links a { color: var(--text); text-underline-offset: 4px; text-decoration-color: var(--accent); }
.private { color: var(--faint); font-size: .86rem; }

/* Diagram visuals */
.diagram { width: 100%; padding: 34px clamp(18px, 3vw, 38px); display: flex; flex-direction: column; gap: 10px; }
.flow { display: flex; flex-direction: column; gap: 10px; }
.node {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); font-size: .9rem;
}
.node b { font-weight: 600; }
.node small { color: var(--faint); font-size: .78rem; text-align: right; }
.node.hot { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.node.guard { border-style: dashed; border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.arrow { height: 16px; width: 2px; background: linear-gradient(var(--line), var(--accent)); margin-left: 26px; border-radius: 2px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; padding: 34px clamp(18px, 3vw, 38px); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 18px; }
.stat strong { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1; color: var(--text); }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: .85rem; }
.stat.wide { grid-column: 1 / -1; }
.stat.accent strong { color: var(--accent); }
.diagram-caption { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }

/* More work */
.more { margin-top: 64px; }
.more h3 { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; margin: 0 0 22px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mini {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.mini h4 { margin: 0; font-size: 1.02rem; font-weight: 600; }
.mini p { margin: 0; color: var(--muted); font-size: .92rem; }
.mini .tag { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.mini a { font-size: .88rem; margin-top: auto; padding-top: 6px; text-underline-offset: 4px; text-decoration-color: var(--accent); }

/* About */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.portrait { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 4 / 5; background: var(--bg-2); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.about-text p { color: var(--muted); margin: 0 0 18px; font-size: 1.04rem; }
.about-text p:first-child { font-family: var(--serif); color: var(--text); font-size: clamp(1.45rem, 2.6vw, 1.9rem); line-height: 1.3; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 30px; }
.fact { border-top: 1px solid var(--line); padding-top: 14px; }
.fact strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 2.1rem; line-height: 1; }
.fact span { color: var(--muted); font-size: .86rem; }

/* Experience */
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.role { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.role time { color: var(--faint); font-size: .92rem; font-variant-numeric: tabular-nums; padding-top: 4px; }
.role h3 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.role .org { color: var(--accent); font-weight: 500; }
.role p { margin: 8px 0 0; color: var(--muted); font-size: .96rem; }
.role ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: .95rem; }
.role li { margin: 4px 0; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.skill h3 { margin: 0 0 12px; font-size: 1rem; font-weight: 600; }
.skill p { margin: 0; color: var(--muted); font-size: .93rem; }
.creds { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.creds ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .93rem; }
.creds li { margin: 6px 0; }

/* Contact */
.contact-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 28px;
  padding: clamp(36px, 7vw, 84px); box-shadow: var(--shadow);
}
.contact-card::after {
  content: ""; position: absolute; right: -160px; bottom: -200px; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 18%, transparent), transparent);
  pointer-events: none;
}
.contact-card h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1; margin: 12px 0 18px; max-width: 16ch; }
.contact-card > p { color: var(--muted); max-width: 56ch; margin: 0 0 32px; }
.contact-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; z-index: 1; }
.contact-item {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 14px;
  border: 1px solid var(--line); text-decoration: none; background: var(--bg-2); transition: border-color .2s, transform .2s;
}
.contact-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-item span { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.contact-item strong { font-weight: 500; font-size: .98rem; overflow-wrap: anywhere; }

.site-footer { padding: 40px 0 56px; color: var(--faint); font-size: .88rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--muted); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 960px) {
  .case, .about { grid-template-columns: 1fr; }
  .case-visual, .case:nth-child(even) .case-visual { order: 0; border: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .case-visual img { height: auto; }
  .more-grid, .skills { grid-template-columns: 1fr 1fr; }
  .portrait { max-width: 420px; }
}
@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 0; font-size: 1.05rem; color: var(--text); }
  .nav-actions .btn-cv { display: none; }
  .more-grid, .skills, .creds, .contact-list { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; gap: 6px; }
  .facts { grid-template-columns: 1fr 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media print {
  .site-header, .hero::before, .contact-card::after { display: none; }
  .reveal { opacity: 1; transform: none; }
}
.tools-label { display: block; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 6px; }

/* Product-manager positioning: track record + process */
.ship { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px; display: flex; flex-direction: column; }
.step::before { counter-increment: step; content: "0" counter(step); font-family: var(--serif); color: var(--accent); font-size: 1.7rem; line-height: 1; margin-bottom: 12px; }
.step h3 { margin: 0 0 8px; font-size: 1.02rem; font-weight: 600; }
.step p { margin: 0; color: var(--muted); font-size: .9rem; }
.step .evidence { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--text); }
.step .evidence::before { content: "Proof: "; color: var(--accent); font-weight: 600; }
@media (max-width: 1100px) { .steps { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px) { .ship { grid-template-columns: repeat(2, 1fr); } .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
