/* ───────── Tokens ───────── */
:root {
  --bg: #0a0a0b;
  --bg-2: #101012;
  --surface: #131316;
  --surface-2: #1a1a1e;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f1f0ec;
  --muted: #94939b;
  --faint: #8b8a93;
  --accent: #c5f547;
  --accent-text: #c5f547;
  --on-accent: #10130a;
  --glow: rgba(197, 245, 71, 0.13);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);

  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r: 20px;
  --r-sm: 12px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f3ee;
  --bg-2: #eceae3;
  --surface: #fbfaf6;
  --surface-2: #ffffff;
  --line: rgba(20, 20, 15, 0.1);
  --line-2: rgba(20, 20, 15, 0.2);
  --text: #15150f;
  --muted: #63625a;
  --faint: #9a998f;
  --accent: #c5f547;
  --accent-text: #456a00;
  --on-accent: #10130a;
  --glow: rgba(150, 200, 30, 0.2);
  --shadow: 0 24px 60px -24px rgba(40, 40, 20, 0.25);
  color-scheme: light;
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
kbd {
  font: 500 12px/1 var(--mono);
  padding: 4px 6px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--muted);
}
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 14px; border-radius: 10px; font-weight: 600;
}
.skip:focus { top: 16px; }

/* Page backdrop: faint grid plus one glow */
.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% -5%, var(--glow), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 72px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 72px 100%;
  -webkit-mask-image: radial-gradient(120% 70% at 50% 0%, #000 30%, transparent 85%);
          mask-image: radial-gradient(120% 70% at 50% 0%, #000 30%, transparent 85%);
  opacity: 0.7;
}

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent-text); transform: scaleX(0); transform-origin: 0 50%; }

/* ───────── Nav ───────── */
.nav {
  position: sticky; top: 14px; z-index: 50;
  width: min(1180px, 100% - 28px); margin: 14px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
          backdrop-filter: blur(18px) saturate(1.4);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-size: 15px; color: var(--muted);
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.is-current { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.kbd-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 14px;
  transition: border-color 0.2s, color 0.2s;
}
.kbd-btn:hover { border-color: var(--line-2); color: var(--text); }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
  transition: border-color 0.2s, color 0.2s, transform 0.3s var(--ease);
}
.icon-btn:hover { border-color: var(--line-2); color: var(--text); }
#themeToggle:active { transform: rotate(40deg) scale(0.92); }
:root[data-theme="dark"] .i-moon, :root[data-theme="light"] .i-sun { display: none; }

/* ───────── Hero ───────── */
.hero { padding: clamp(64px, 11vw, 140px) 0 56px; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; margin-bottom: 32px;
  border: 1px solid var(--line); border-radius: 999px;
  font: 500 12.5px/1.3 var(--mono); color: var(--muted); letter-spacing: 0.01em;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-text); }
.dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--accent-text); animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping { from { transform: scale(0.5); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }

.hero-title {
  font-size: clamp(2.7rem, 8.4vw, 7.2rem);
  line-height: 0.96; letter-spacing: -0.045em; font-weight: 600;
  text-wrap: balance;
}
.hero-title em { color: var(--accent-text); letter-spacing: -0.03em; font-size: 1.04em; }

.hero-foot {
  display: grid; grid-template-columns: minmax(0, 1.15fr) auto; align-items: end; gap: 32px 56px;
  margin-top: clamp(32px, 5vw, 56px);
}
.hero-lede { max-width: 54ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--muted); line-height: 1.55; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15.5px; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.btn svg { transition: transform 0.25s var(--ease); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px var(--glow), 0 0 0 5px var(--glow); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost { border: 1px solid var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn-lg { height: 56px; padding: 0 26px; font-size: 16.5px; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(48px, 7vw, 88px);
  border-top: 1px solid var(--line);
}
.stat { padding: 22px 20px 0 0; display: flex; flex-direction: column-reverse; gap: 6px; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat dt { font: 500 12px/1.45 var(--mono); max-width: 26ch; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat dd { font-size: clamp(2rem, 4.4vw, 3.5rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat dd i { font-style: normal; color: var(--accent-text); margin-left: 2px; }

/* ───────── Marquee ───────── */
.marquee {
  overflow: hidden; padding: 20px 0; margin-top: 24px;
  border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: slide 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font: 400 clamp(1.4rem, 2.6vw, 2rem)/1 var(--serif); font-style: italic; white-space: nowrap; color: var(--muted); }
.marquee b { color: var(--accent-text); font-weight: 400; font-size: 14px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ───────── Sections ───────── */
.section { padding: clamp(80px, 11vw, 150px) 0 0; }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.split { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.eyebrow { display: block; font: 500 12px/1 var(--mono); color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 18px; }
h2 { font-size: clamp(2rem, 5vw, 3.75rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; text-wrap: balance; }
h2 em { color: var(--muted); letter-spacing: -0.025em; }

/* ───────── Cards ───────── */
.card {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 28px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.3s, transform 0.4s var(--ease), background-color 0.4s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 65%);
  transition: opacity 0.35s;
}
.card:hover { border-color: var(--line-2); }
.card:hover::before { opacity: 1; }
.card-label { font: 500 12px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 20px; }
.card-note { color: var(--muted); font-size: 14px; }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.b-bio   { grid-column: span 7; grid-row: span 2; padding: 36px; }
.b-chart { grid-column: span 5; }
.b-now   { grid-column: span 5; }
.b-stack { grid-column: span 4; }
.b-lead  { grid-column: span 4; }
.b-certs { grid-column: span 4; }

.avatar {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 28px;
  border-radius: 18px; background: var(--accent); color: var(--on-accent);
  font: 400 30px/1 var(--serif); font-style: italic;
}
.b-bio .lead { font-size: clamp(1.35rem, 2.3vw, 1.85rem); line-height: 1.22; letter-spacing: -0.025em; font-weight: 500; margin-bottom: 18px; text-wrap: balance; }
.b-bio p:not(.lead) { color: var(--muted); max-width: 58ch; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 500; }
.facts span { display: block; font: 500 12px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.facts time { font-variant-numeric: tabular-nums; }

.b-chart .big { font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; color: var(--muted); }
.b-chart .big strong { color: var(--text); font-weight: 600; }
.b-chart .arrow { color: var(--accent-text); }
.spark { display: block; width: 100%; height: 84px; margin: 18px 0 12px; overflow: visible; }
.js .spark { clip-path: inset(-10px 100% -10px 0); transition: clip-path 1.8s var(--ease) 0.25s; }
.js .b-chart.in .spark { clip-path: inset(-10px 0 -10px 0); }

.now-list li { padding: 11px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 15.5px; }
.now-list li:first-child { border-top: 0; padding-top: 0; }
.now-list li:last-child { padding-bottom: 0; }
.now-list b { color: var(--text); font-weight: 600; margin-right: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13.5px; color: var(--text); background: var(--bg-2);
  transition: border-color 0.2s, color 0.2s;
}
.chips li:hover { border-color: var(--accent-text); color: var(--accent-text); }

.certs li { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--muted); }
.certs li:first-child { border-top: 0; padding-top: 0; }
.certs li:last-child { padding-bottom: 0; }
.certs span { flex: none; min-width: 58px; text-align: center; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font: 500 12px/1 var(--mono); color: var(--text); }

/* ───────── Work ───────── */
.filters { display: inline-flex; padding: 4px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); max-width: 100%; overflow-x: auto; }
.filter { padding: 8px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color 0.2s, background-color 0.2s; }
.filter:hover { color: var(--text); }
.filter.is-active { background: var(--text); color: var(--bg); }

.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.work {
  display: flex; flex-direction: column; text-align: left; width: 100%;
  padding: 0; cursor: pointer; min-height: 100%;
}
.work:hover { transform: translateY(-4px); }
.work.is-wide { grid-column: 1 / -1; }
.work.is-hidden { display: none; }
.work-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 24px 64px 0 28px; font: 500 12px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.tag { display: inline-flex; align-items: center; gap: 8px; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent-text); }
.work-main { padding: 26px 28px 28px; display: grid; gap: 14px; flex: 1; }
.work h3 { font-size: clamp(1.45rem, 2.5vw, 2rem); letter-spacing: -0.03em; line-height: 1.1; font-weight: 600; text-wrap: balance; }
.work p { color: var(--muted); max-width: 60ch; }
.work-metrics { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); margin-top: auto; }
.metric { flex: 1 1 0; min-width: 110px; padding: 18px 28px 22px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric b { display: block; font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.035em; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric span { font-size: 13px; color: var(--muted); }
.work-go {
  position: absolute; right: 16px; top: 12px; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  opacity: 0; transform: translate(-6px, 6px) scale(0.9);
  transition: opacity 0.3s, transform 0.35s var(--ease);
}
.work:hover .work-go, .work:focus-visible .work-go { opacity: 1; transform: none; }
.is-wide .work-main { grid-template-columns: 1.1fr 1fr; align-items: end; gap: 24px 48px; padding-top: 40px; padding-bottom: 40px; }
.is-wide h3 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); }

/* ───────── Timeline ───────── */
.timeline { border-top: 1px solid var(--line); }
.role {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px;
  padding: 36px 0; border-bottom: 1px solid var(--line);
  transition: background-color 0.3s;
}
.role-when { font: 500 13px/1.6 var(--mono); color: var(--muted); letter-spacing: 0.02em; padding-top: 6px; }
.role:first-child .role-when { color: var(--accent-text); }
.role h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -0.03em; font-weight: 600; line-height: 1.2; }
.role h3 span { color: var(--muted); font-weight: 400; }
.role-body > p { margin-top: 10px; color: var(--muted); max-width: 64ch; }
.role-body ul { margin-top: 16px; display: grid; gap: 8px; max-width: 68ch; }
.role-body li { position: relative; padding-left: 22px; font-size: 16px; }
.role-body li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 10px; height: 1px; background: var(--accent-text); }

/* ───────── Playbook ───────── */
.playbook { border-top: 1px solid var(--line); }
.rule { border-bottom: 1px solid var(--line); }
.rule summary {
  display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; align-items: center; gap: 24px;
  padding: 28px 0; cursor: pointer; list-style: none;
}
.rule summary::-webkit-details-marker { display: none; }
.num { font: 500 13px/1 var(--mono); color: var(--muted); }
.rule-title { font-size: clamp(1.25rem, 2.6vw, 2rem); letter-spacing: -0.03em; font-weight: 600; line-height: 1.15; transition: color 0.2s; }
.rule summary:hover .rule-title { color: var(--accent-text); }
.plus { position: relative; width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 50%; transition: transform 0.4s var(--ease), background-color 0.2s; }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); }
.plus::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform 0.4s var(--ease); }
.rule[open] .plus { transform: rotate(180deg); background: var(--accent); color: var(--on-accent); border-color: transparent; }
.rule[open] .plus::after { transform: translate(-50%, -50%) rotate(0deg); }
.rule > p { margin: 0 60px 30px 244px; max-width: 62ch; color: var(--muted); font-size: 1.05rem; }
.rule[open] > p { animation: drop 0.45s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ───────── Quotes ───────── */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.quote { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.quote blockquote { font: 400 clamp(1.3rem, 1.9vw, 1.55rem)/1.28 var(--serif); letter-spacing: -0.005em; text-wrap: pretty; }
.quote blockquote::before { content: "“"; display: block; font-size: 3rem; line-height: 0.6; color: var(--accent-text); margin-bottom: 14px; }
.quote figcaption { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.quote figcaption b { display: block; color: var(--text); font-weight: 600; font-size: 14.5px; }
.q-avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font: 500 12px/1 var(--mono); color: var(--text); }

/* ───────── Awards + writing ───────── */
.awards { display: grid; gap: 18px; }
.awards li { display: flex; gap: 14px; align-items: flex-start; }
.awards li + li { padding-top: 18px; border-top: 1px solid var(--line); }
.award-mark { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 15px; }
.awards b { display: block; font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.03em; font-weight: 600; line-height: 1.15; }
.awards div span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); line-height: 1.4; }
.certs a { border-bottom: 1px solid var(--line-2); }
.certs a:hover { color: var(--text); border-color: var(--accent-text); }

.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post { display: flex; flex-direction: column; gap: 12px; padding-bottom: 64px; }
.post:hover { transform: translateY(-4px); }
.post .card-label { margin-bottom: 8px; }
.post h3 { font: 400 clamp(1.5rem, 2.2vw, 1.8rem)/1.15 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.post p { color: var(--muted); font-size: 15.5px; }
.post-go { position: absolute; left: 28px; bottom: 24px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.post:hover .post-go { background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* ───────── Contact ───────── */
.contact { padding: clamp(80px, 11vw, 150px) 0 0; }
.contact-card {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(48px, 8vw, 104px) clamp(24px, 5vw, 64px);
  border-radius: 32px; border: 1px solid var(--line); background: var(--surface);
}
.contact-card::before {
  content: ""; position: absolute; inset: auto -10% -60% -10%; height: 110%; z-index: 0; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, var(--glow), transparent 70%);
}
.contact-card > * { position: relative; z-index: 1; }
.contact-card h2 { font-size: clamp(2.1rem, 5.6vw, 4.4rem); }
.contact-card h2 em { color: var(--accent-text); }
.contact-card > p { margin: 22px auto 0; color: var(--muted); max-width: 44ch; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin-top: 44px; font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.socials a { padding: 6px 0; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.socials a:hover { color: var(--text); border-color: var(--accent-text); }

.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 36px 0 44px; font: 400 12.5px/1.4 var(--mono); color: var(--muted); }
.footer a:hover { color: var(--text); }

/* ───────── Dialogs ───────── */
dialog { color: var(--text); border: 0; padding: 0; background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog[open] { animation: rise 0.35s var(--ease); }
dialog[open]::backdrop { animation: fade 0.3s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.985); } }
@keyframes fade { from { opacity: 0; } }

.sheet { width: min(860px, 100% - 24px); margin: auto; }
.sheet-inner {
  position: relative; max-height: min(88vh, 900px); overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(28px, 5vw, 56px); border-radius: 28px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.sheet-close { position: sticky; top: 0; float: right; margin: -8px -8px 0 16px; background: var(--surface-2); z-index: 2; }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font: 500 12px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 20px; }
.case-meta .tag { color: var(--accent-text); }
.sheet h2 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); }
.case-summary { margin-top: 16px; font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.case-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 32px 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
.case-metrics .metric { padding: 20px 22px; }
.case-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px 24px; padding-top: 28px; border-top: 1px solid var(--line); }
.case-grid h3 { font: 500 12px/1.6 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; padding-top: 3px; }
.case-grid ul { display: grid; gap: 8px; }
.case-grid li { position: relative; padding-left: 22px; }
.case-grid li::before { content: ""; position: absolute; left: 0; top: 0.78em; width: 10px; height: 1px; background: var(--accent-text); }
.case-grid .chips li { padding-left: 12px; }
.case-grid .chips li::before { display: none; }

.palette { width: min(600px, 100% - 24px); margin: 14vh auto auto; }
.palette-inner { border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 400 16px/1.4 var(--sans); }
.palette-search input::placeholder { color: var(--faint); }
.palette-list { max-height: min(52vh, 380px); overflow-y: auto; padding: 8px; }
.palette-group { padding: 10px 12px 6px; font: 500 12px/1 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; }
.palette-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: 15.5px; }
.palette-item small { font: 400 12px/1 var(--mono); color: var(--faint); }
.palette-item[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent-text); }
.palette-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 15px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; pointer-events: none;
  padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-weight: 600; font-size: 14.5px; white-space: nowrap;
  opacity: 0; transform: translate(-50%, 16px); transition: opacity 0.3s, transform 0.4s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ───────── Reveal ───────── */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .card[data-reveal].in { transition: opacity 0.8s var(--ease), transform 0.4s var(--ease), border-color 0.3s, background-color 0.4s var(--ease); }

/* ───────── Responsive ───────── */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .b-bio, .b-chart, .b-now { grid-column: span 12; }
  .b-chart, .b-now { grid-column: span 6; }
  .b-stack, .b-lead { grid-column: span 6; }
  .b-certs { grid-column: span 12; }
  .quotes, .posts { grid-template-columns: 1fr; }
  .role, .rule summary { grid-template-columns: 130px minmax(0, 1fr) auto; }
  .role { grid-template-columns: 130px minmax(0, 1fr); }
  .rule > p { margin-left: 154px; }
  .is-wide .work-main { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { width: min(1180px, 100% - 32px); }
  .kbd-btn kbd { display: none; }
  .hero-foot { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 20px 0; }
  .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat:nth-child(even) { padding-left: 20px; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .b-chart, .b-now, .b-stack, .b-lead { grid-column: span 12; }
  .b-bio { padding: 26px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .work-top, .work-main { padding-inline: 22px; }
  .metric { padding: 16px 22px 20px; }
  .work-go { display: none; }
  .role { grid-template-columns: 1fr; gap: 8px; padding: 28px 0; }
  .rule summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; padding: 22px 0; }
  .rule > p { margin: 0 0 24px 0; }
  .case-metrics { grid-template-columns: 1fr; }
  .case-metrics .metric + .metric { border-left: 0; border-top: 1px solid var(--line); }
  .case-grid { grid-template-columns: 1fr; gap: 8px; }
  .case-grid h3 { margin-top: 14px; }
  .contact-card { border-radius: 24px; }
  .contact-actions .btn { width: 100%; }
  .footer-mid { display: none; }
}
@media (max-width: 420px) {
  .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .marquee-track { animation: none; }
}

/* ═════════ v2: developer / DevOps layer ═════════ */

/* Ambient background */
.bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0.55; }
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, var(--glow), transparent 62%);
  opacity: 0; transition: opacity 0.6s; will-change: transform;
}
.cursor-glow.is-on { opacity: 1; }

/* Window chrome: always dark, in both themes */
.win {
  --w-bg: #0b0c0e; --w-bar: #131418; --w-line: rgba(255, 255, 255, 0.09); --w-text: #d9dbd3; --w-dim: #7c7f88;
  --w-acc: #c5f547; --w-ok: #7ee787; --w-blue: #79c0ff; --w-pink: #ff9bce; --w-amber: #ffc66d;
  background: var(--w-bg); color: var(--w-text);
  border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.3);
  font-family: var(--mono);
}
.win-bar { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 14px; background: var(--w-bar); border-bottom: 1px solid var(--w-line); font-size: 12px; color: var(--w-dim); }
.win-dots { display: inline-flex; gap: 7px; flex: none; }
.win-dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a3c44; }
.win-dots i:nth-child(1) { background: #ff5f57; } .win-dots i:nth-child(2) { background: #febc2e; } .win-dots i:nth-child(3) { background: #28c840; }
.win-title { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-hint { padding: 3px 8px; border: 1px solid var(--w-line); border-radius: 6px; white-space: nowrap; }
.t-prompt { color: var(--w-acc, var(--accent-text)); font-family: var(--mono); font-weight: 500; }
.t-ok { color: var(--w-ok); } .t-dim { color: var(--w-dim); } .t-acc { color: var(--w-acc); } .t-err { color: #ff7b72; } .t-blue { color: var(--w-blue); }

/* Hero v2 */
.hero { padding-top: clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.hero-title { font-size: clamp(2.6rem, 5.9vw, 5.5rem); }
.roles { margin-top: 26px; font: 500 clamp(0.95rem, 1.3vw, 1.1rem)/1.4 var(--mono); color: var(--text); display: flex; align-items: center; gap: 10px; min-height: 1.6em; }
.roles .t-prompt { color: var(--accent-text); }
.caret { display: inline-block; width: 9px; height: 1.15em; margin-left: -6px; background: var(--accent-text); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-copy .hero-lede { margin-top: 20px; }
.hero-copy .hero-cta { margin-top: 30px; }

/* Terminal */
.term { transform: perspective(1400px) rotateY(-5deg) rotateX(2deg); transform-origin: 0 50%; transition: transform 0.7s var(--ease); }
.term:hover, .term:focus-within { transform: perspective(1400px) rotateY(0) rotateX(0); }
.term-body { height: clamp(300px, 34vw, 400px); overflow-y: auto; padding: 16px 18px 18px; font-size: 13.5px; line-height: 1.65; cursor: text; scrollbar-width: thin; scrollbar-color: #2a2c33 transparent; }
.t-line { display: flex; gap: 10px; white-space: pre-wrap; word-break: break-word; }
.t-out { white-space: pre-wrap; word-break: break-word; margin: 0 0 8px; }
.t-out a { color: var(--w-blue); text-decoration: underline; text-underline-offset: 3px; }
.t-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 0; color: var(--w-text); font: inherit; caret-color: var(--w-acc); }

/* Section aside */
.section-aside { max-width: 34ch; color: var(--muted); font-size: 16px; }

/* Tilt on work cards */
.work { transform-style: preserve-3d; will-change: transform; }
.work.is-tilting { transition: border-color 0.3s, background-color 0.4s var(--ease) !important; }

/* Print button styled as link */
.socials button { padding: 6px 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.socials button:hover { color: var(--text); border-color: var(--accent-text); }

@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; }
  .term { transform: none; }
  .hero-title { font-size: clamp(2.7rem, 9vw, 5.5rem); }
}
@media (max-width: 720px) {
  .win-hint { display: none; }
  .scene-code { grid-template-columns: 1fr; }
  .tree { display: none; }
  .editor-status span:nth-child(2) { display: none; }
  .reel-stage { height: 440px; }
  .obs-tiles { grid-template-columns: repeat(2, 1fr); }
  .section-aside { max-width: none; }
  .term-body { height: 300px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .code .tx { max-width: none; }
  .cursor-glow { display: none; }
}

/* Print: a clean one-document résumé view */
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --bg-2: #f6f6f3; --surface: #fff; --surface-2: #f3f3ef; --text: #111; --muted: #444; --faint: #777; --line: #ddd; --line-2: #ccc; --accent-text: #3d6100; --glow: transparent; --shadow: none; color-scheme: light; }
  body { font-size: 11.5pt; }
  .nav, .progress, .backdrop, .bg-canvas, .cursor-glow, .marquee, .term, #ship, .filters, .work-go, .post-go, .toast, dialog, .hero-cta, .roles, .contact-actions, #printBtn, .footer a { display: none !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero { padding: 0 0 24px; } .hero-grid { display: block; }
  .section, .contact { padding-top: 36px; }
  .card, .role, .rule, .contact-card { break-inside: avoid; }
  .work.is-hidden { display: flex !important; }
  .contact-card { border-radius: 16px; padding: 28px; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
