:root {
  --accent: #6d4cff;
  --bg: #f5f2ec;
  --bg-2: #ede8df;
  --surface: #fffdf9;
  --surface-2: #f8f5ef;
  --ink: #17171c;
  --ink-2: #3b3a42;
  --muted: #6a6872;
  --line: #e2ddd3;
  --shadow: 0 1px 2px rgba(23, 23, 28, .05), 0 12px 32px -12px rgba(23, 23, 28, .18);
  --shadow-lg: 0 2px 4px rgba(23, 23, 28, .04), 0 30px 70px -20px rgba(23, 23, 28, .28);
  --accent-ink: color-mix(in oklab, var(--accent) 88%, black);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 35%, transparent);
  --code-bg: #15161c;
  --code-ink: #e8e6f0;
  --paper: #ffffff;
  --paper-ink: #1a1a1f;
  --paper-muted: #5c5a63;
  --radius: 18px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f13;
    --bg-2: #14161c;
    --surface: #16181e;
    --surface-2: #1c1f27;
    --ink: #eeece6;
    --ink-2: #cfcdc6;
    --muted: #9a98a2;
    --line: #2a2d37;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
    --accent-ink: color-mix(in oklab, var(--accent) 62%, white);
    --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
    --accent-line: color-mix(in srgb, var(--accent) 50%, transparent);
    --code-bg: #0a0b0e;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e0f13;
  --bg-2: #14161c;
  --surface: #16181e;
  --surface-2: #1c1f27;
  --ink: #eeece6;
  --ink-2: #cfcdc6;
  --muted: #9a98a2;
  --line: #2a2d37;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
  --accent-ink: color-mix(in oklab, var(--accent) 62%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 50%, transparent);
  --code-bg: #0a0b0e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd {
  font-family: var(--mono); font-size: .72em; padding: .15em .45em; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  box-shadow: 0 1px 0 var(--line);
}
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 16px; }

.glow {
  position: fixed; inset: -20vh -10vw auto auto; width: 70vw; height: 70vh; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(20px);
  transition: background .8s var(--ease);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-family: var(--display); font-size: 18px; letter-spacing: .02em;
  position: relative; overflow: hidden;
}
.mark::after { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--accent); transition: background .5s var(--ease); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 600; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; min-width: 38px; padding: 0 10px; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent-line); }
.icon-btn:active { transform: scale(.96); }
.kbd-hint { font-size: 11px; }
.moon { display: none; }
:root[data-theme="dark"] .sun { display: none; }
:root[data-theme="dark"] .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun { display: none; }
  :root:not([data-theme="light"]) .moon { display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px;
  border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: -.005em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .4s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; gap: 8px; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px var(--accent); }
.btn-accent:hover { box-shadow: 0 14px 30px -10px var(--accent); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent-line); }

/* ---------- Hero ---------- */
main { display: block; }
.hero {
  max-width: 1200px; margin: 0 auto; padding: clamp(40px, 8vw, 96px) clamp(16px, 4vw, 40px) 40px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 12px 6px 10px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--ink-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transition: background .4s; }
h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(56px, 9vw, 112px);
  line-height: .92; letter-spacing: -.02em; margin: 0;
}
.hero-headline {
  font-family: var(--display); font-style: italic; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.15;
  margin: 14px 0 18px; color: var(--accent-ink); min-height: 1.2em;
  transition: color .4s var(--ease);
}
.hero-headline.swap { animation: rise .55s var(--ease); }
.hero-copy, .query-card { min-width: 0; }
.hero-sub { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.chips { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px;
}
.chip.sql { font-family: var(--mono); font-weight: 600; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.sql::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); transition: background .4s; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* Query card */
.query-card {
  margin: 0; border-radius: 22px; background: var(--code-bg); color: var(--code-ink);
  box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid rgba(255, 255, 255, .06);
  transform: perspective(1400px) rotateY(-4deg) rotateX(2deg);
  transition: transform .6s var(--ease);
}
.query-card:hover { transform: perspective(1400px) rotateY(0) rotateX(0); }
.qc-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); font-family: var(--mono); font-size: 12px; color: #9a98ac; }
.qc-dots { display: flex; gap: 6px; }
.qc-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3b47; }
.qc-dots i:first-child { background: var(--accent); }
.qc-badge { margin-left: auto; padding: 2px 8px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 600; transition: background .4s; }
.qc-code { margin: 0; padding: 18px 20px 6px; font-family: var(--mono); font-size: 13px; line-height: 1.7; white-space: pre; overflow-x: auto; }
.qc-code .k { color: #9d8cff; font-weight: 600; }
.qc-code .s { color: #f5c46a; }
.qc-result { margin: 10px 14px 0; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; overflow: hidden; }
.qc-row { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: baseline; padding: 11px 14px; border-top: 1px solid rgba(255, 255, 255, .06); opacity: 0; animation: rise .5s var(--ease) forwards; }
.qc-row:first-child { border-top: 0; }
.qc-row b { font-family: var(--display); font-size: 30px; line-height: 1; font-weight: 400; color: #fff; }
.qc-row span { font-size: 13.5px; color: #c6c4d3; line-height: 1.4; }
.qc-foot { padding: 12px 18px 16px; font-family: var(--mono); font-size: 11.5px; color: #7d7b8f; }

/* ---------- Section heads ---------- */
.section-head { max-width: 760px; margin: 0 auto 28px; text-align: center; padding: 0 16px; }
.kicker { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
h2 { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 5vw, 56px); line-height: 1.02; letter-spacing: -.015em; margin: 0 0 12px; }
.lede { color: var(--muted); margin: 0; font-size: 16.5px; }

/* ---------- Revolving carousel ---------- */
.versions { padding: clamp(40px, 7vw, 80px) 0 24px; overflow: hidden; }
.carousel { position: relative; max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; }
.stage { position: relative; width: min(100%, 860px); height: 330px; perspective: 1300px; perspective-origin: 50% 40%; }
.ring { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.card3d {
  position: absolute; left: calc(var(--w) / -2); top: -140px; width: var(--w); height: 280px;
  padding: 22px; border-radius: 22px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .8s var(--ease), opacity .6s var(--ease), filter .6s var(--ease), border-color .3s, box-shadow .3s;
  overflow: hidden;
}
.card3d::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 110px; z-index: 0;
  background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 35%, transparent));
  opacity: .14; transition: opacity .4s;
}
.card3d > * { position: relative; z-index: 1; }
.card3d .num { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.card3d .num i { width: 34px; height: 34px; border-radius: 10px; background: var(--c); display: grid; place-items: center; color: #fff; font-style: normal; }
.card3d .num i svg { width: 18px; height: 18px; }
.card3d h3 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.02; margin: 18px 0 0; letter-spacing: -.01em; }
.card3d p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.card3d .go { margin-top: auto; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.card3d.active { border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 30px 60px -24px color-mix(in srgb, var(--c) 60%, transparent); }
.card3d.active::before { opacity: .28; }
.card3d.active .go { color: var(--ink); }
.ring-nav {
  z-index: 5; flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center;
  transition: transform .2s var(--ease), border-color .2s;
}
.ring-nav:hover { border-color: var(--accent-line); transform: scale(1.06); }

.tab-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; padding: 0 16px; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.tab {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font-weight: 700; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px;
  transition: background .3s var(--ease), color .3s;
}
.tab::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tab:hover:not([aria-selected="true"]) { color: var(--ink); }
.autoplay {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.ap-icon { width: 10px; height: 10px; position: relative; }
.autoplay[aria-pressed="true"] .ap-icon { border-left: 3px solid currentColor; border-right: 3px solid currentColor; width: 9px; }
.autoplay[aria-pressed="false"] .ap-icon { width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 9px; border-color: transparent transparent transparent currentColor; }

/* ---------- Resume ---------- */
.resume-wrap {
  max-width: 1200px; margin: 0 auto; padding: 48px clamp(16px, 4vw, 40px) 40px;
  display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start;
}
.toolbox { position: sticky; top: 84px; display: grid; gap: 14px; }
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tool-title { display: block; margin: 0 0 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.now-viewing { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); transition: background .4s; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 8px; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.find { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.find:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.find svg { color: var(--muted); }
.find input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); }
.find-count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.quick-terms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.qt { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.qt:hover, .qt.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.actions { display: grid; gap: 4px; }
.act {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px; border-radius: 10px;
  border: 0; background: transparent; text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left;
  transition: background .2s;
}
.act:hover { background: var(--surface-2); }
.act svg { color: var(--muted); }
.act.primary { background: var(--accent); color: #fff; margin-bottom: 4px; padding: 12px; }
.act.primary svg { color: #fff; }
.act.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.shortcut-hint { margin: 2px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

.paper {
  position: relative; background: var(--paper); color: var(--paper-ink); border-radius: 6px;
  padding: clamp(24px, 5vw, 60px) clamp(20px, 5vw, 64px); box-shadow: var(--shadow-lg);
  font-size: 14.5px; line-height: 1.5; min-height: 600px; color-scheme: light;
  border-top: 5px solid var(--accent); transition: border-color .5s var(--ease);
}
.paper.swap > * { animation: rise .5s var(--ease) both; }
.paper.swap > *:nth-child(2) { animation-delay: .04s; }
.paper.swap > *:nth-child(3) { animation-delay: .08s; }
.paper.swap > *:nth-child(n+4) { animation-delay: .12s; }
.paper-loading { color: var(--paper-muted); }
.p-head { text-align: center; padding-bottom: 6px; }
.p-name { font-family: var(--display); font-size: clamp(36px, 5vw, 48px); line-height: 1; margin: 0 0 8px; font-weight: 400; }
.p-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 13.5px; color: var(--paper-muted); }
.p-contact a { color: var(--paper-ink); text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); text-underline-offset: 3px; }
.reveal { border: 1px dashed #c9c5bc; background: transparent; border-radius: 6px; padding: 0 6px; font-size: 13px; color: var(--paper-muted); cursor: pointer; }
.p-tag {
  display: inline-flex; align-items: center; gap: 8px; margin: 16px auto 0; padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, white); color: color-mix(in oklab, var(--accent) 80%, black);
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.p-sec { margin-top: 22px; }
.p-sec h3 {
  margin: 0 0 10px; padding-bottom: 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  border-bottom: 1.5px solid var(--accent); color: var(--paper-ink); transition: border-color .5s;
}
.p-summary { margin: 0; font-size: 15px; color: #2b2a30; }
.p-entry { margin-bottom: 14px; }
.p-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.p-org { font-weight: 800; }
.p-loc { color: var(--paper-muted); font-weight: 500; }
.p-date { font-size: 13px; color: var(--paper-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-role { font-style: italic; color: #3a3940; margin: 2px 0 4px; }
.p-role .p-date { font-style: normal; }
.p-bullets { margin: 4px 0 6px; padding-left: 18px; }
.p-bullets li { margin: 3px 0; padding-left: 2px; }
.p-bullets li::marker { color: var(--accent); }
.hl { font-weight: 700; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 22%, transparent) 62%); padding: 0 1px; }
mark.find-hit { background: #ffe066; color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px #f2c94c; }
mark.find-hit.current { background: #ffb547; }
.p-skills { display: grid; gap: 6px; }
.p-skill-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; }
.p-skill-row dt { font-weight: 800; font-size: 13.5px; }
.p-skill-row dd { margin: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.sk { font-size: 13px; padding: 1px 8px; border-radius: 6px; background: #f3f1ec; color: #3b3a42; }
.sk.feat { background: color-mix(in srgb, var(--accent) 14%, white); color: color-mix(in oklab, var(--accent) 75%, black); font-weight: 700; }
.sk.sql { background: #17171c; color: #fff; font-family: var(--mono); font-size: 12px; }
.p-elig { margin: 10px 0 0; font-size: 13.5px; color: var(--paper-muted); }

/* 30-second scan */
.paper.quick .p-bullets li:not(.top),
.paper.quick .p-edu-notes,
.paper.quick .p-skill-row.minor { display: none; }
.paper.quick .p-bullets li.top { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 6px; }
.quick-note { display: none; margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; font-size: 13px; background: #f6f4ef; color: var(--paper-muted); }
.paper.quick .quick-note { display: block; }

/* ---------- Specialty ---------- */
.specialty { padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 40px) 24px; }
.spec-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.spec {
  position: relative; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden; transition: transform .35s var(--ease), border-color .3s;
}
.spec:hover { transform: translateY(-4px); border-color: var(--accent-line); }
.spec .tagline { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); margin: 0 0 14px; }
.spec h3 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; margin: 0 0 14px; }
.spec ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.spec li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.spec li::before { content: ""; width: 8px; height: 8px; margin-top: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.spec.code { background: var(--code-bg); color: var(--code-ink); border-color: transparent; }
.spec.code h3 { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.spec.code li { color: #c6c4d3; }
.spec.code .tagline { color: #f5c46a; }

/* ---------- Contact ---------- */
.contact { padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 40px); }
.contact-card {
  max-width: 1200px; margin: 0 auto; padding: clamp(28px, 5vw, 56px); border-radius: 28px;
  background: var(--ink); color: var(--bg); display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
  position: relative; overflow: hidden;
}
.contact-card::after {
  content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -160px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 70%, transparent), transparent); opacity: .55; pointer-events: none;
}
.contact-card .kicker { color: color-mix(in oklab, var(--accent) 50%, white); }
.contact-card .lede { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.contact-list { display: grid; gap: 10px; position: relative; z-index: 1; }
.c-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; text-decoration: none;
  background: color-mix(in srgb, var(--bg) 8%, transparent); border: 1px solid color-mix(in srgb, var(--bg) 14%, transparent);
  transition: background .2s, transform .2s var(--ease); cursor: pointer; text-align: left; width: 100%; color: inherit;
}
.c-item:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); transform: translateX(3px); }
.c-item svg { width: 20px; height: 20px; color: color-mix(in oklab, var(--accent) 45%, white); }
.c-item small { display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .6; font-weight: 700; }
.c-item span { font-weight: 600; word-break: break-word; }
.c-item .hint { margin-left: auto; font-size: 12px; opacity: .55; white-space: nowrap; }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; max-width: 1200px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 40px) 40px; color: var(--muted); font-size: 14px; }
.footer p { margin: 0; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(10, 10, 14, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: start center; padding: 12vh 16px 16px; animation: fade .2s ease; }
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.palette, .sheet { width: min(600px, 100%); border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; animation: rise .25s var(--ease); }
.pal-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.pal-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.pal-group { padding: 10px 10px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14.5px; }
.pal-item .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--muted); }
.pal-item kbd { margin-left: auto; }
.pal-item[aria-selected="true"] { background: var(--accent-soft); color: var(--ink); }
.pal-empty { padding: 20px; text-align: center; color: var(--muted); }
.sheet { padding: 8px 20px 20px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h3 { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 10px 0; }
.sc-list { margin: 0; display: grid; gap: 2px; }
.sc-list div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: center; }
.sc-list dt { display: flex; gap: 4px; align-items: center; }
.sc-list dd { margin: 0; color: var(--ink-2); font-size: 14.5px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 140%);
  padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-lg); transition: transform .4s var(--ease), opacity .3s, visibility .4s; max-width: calc(100% - 32px);
  opacity: 0; visibility: hidden;
  display: flex; align-items: center; gap: 10px;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.noscript { text-align: center; padding: 20px; }

/* ---------- Contact form ---------- */
.contact-sheet { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.overlay#contactDialog { padding-top: 6vh; }
#contactForm { display: grid; gap: 14px; padding-bottom: 6px; }
.cf-intro { margin: 0; color: var(--muted); font-size: 14.5px; }
.cf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
#contactForm label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
#contactForm input, #contactForm select, #contactForm textarea {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%;
}
#contactForm textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
#contactForm input:focus, #contactForm select:focus, #contactForm textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
#contactForm [aria-invalid="true"] { border-color: #d23b3b; }
.req { color: #d23b3b; }
.opt { font-weight: 500; color: var(--muted); }
.field-error, .form-error { color: #d23b3b; font-size: 12.5px; font-weight: 600; min-height: 0; margin: 0; }
.form-error:empty, .field-error:empty { display: none; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-send { justify-content: center; width: 100%; }
.cf-done { text-align: center; padding: 18px 0 10px; }
.cf-done h4 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 12px 0 6px; }
.cf-done p { color: var(--muted); margin: 0 0 20px; }
.cf-check { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; animation: rise .5s var(--ease); }
.cf-check svg { width: 28px; height: 28px; stroke-width: 2.5; }
.contact-act { border: 1px solid var(--line); margin-bottom: 4px; }
.reveal { color: var(--paper-ink); font-weight: 600; }
.reveal:hover { border-color: var(--accent); }
@media (max-width: 720px) {
  .cf-grid { grid-template-columns: 1fr; }
  .topbar .btn-ghost.btn-sm span { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .query-card { transform: none; }
  .resume-wrap { grid-template-columns: minmax(0, 1fr); }
  .toolbox { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbox .actions { grid-row: span 2; }
  .shortcut-hint { display: none; }
  .spec-grid { grid-template-columns: 1fr; }
  .contact-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .top-actions { margin-left: auto; }
  .kbd-hint { display: none; }
  .brand-name { display: none; }
  .stage { height: 300px; perspective: 900px; }
  .card3d { height: 250px; top: -125px; padding: 18px; }
  .card3d h3 { font-size: 26px; }
  .ring-nav { position: absolute; bottom: -6px; width: 42px; height: 42px; }
  .ring-nav.prev { left: calc(50% - 56px); }
  .ring-nav.next { right: calc(50% - 56px); }
  .carousel { padding-bottom: 50px; }
  .toolbox { grid-template-columns: minmax(0, 1fr); }
  .toolbox .actions { grid-row: auto; }
  .p-skill-row { grid-template-columns: 1fr; gap: 4px; }
  .paper { font-size: 14px; }
  .p-date { white-space: normal; }
  .qc-code { font-size: 11.5px; }
  .qc-row { grid-template-columns: 64px 1fr; }
  .qc-row b { font-size: 24px; }
  .sc-list div { grid-template-columns: 110px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Print: only the resume ---------- */
@media print {
  @page { size: letter; margin: .45in; }
  body { background: #fff; color: #000; }
  .topbar, .hero, .versions, .toolbox, .specialty, .contact, .footer, .glow, .toast, .overlay, .skip, .quick-note { display: none !important; }
  .resume-wrap { display: block; padding: 0; max-width: none; }
  .paper { box-shadow: none; padding: 0; border: 0; min-height: 0; font-size: 10.5pt; }
  .paper.quick .p-bullets li, .paper.quick .p-edu-notes, .paper.quick .p-skill-row.minor { display: list-item; }
  .paper.quick .p-skill-row.minor { display: grid; }
  .paper.quick .p-edu-notes { display: block; }
  .p-tag, .reveal { display: none; }
  .hl { background: none; }
  mark.find-hit { background: none; box-shadow: none; }
  .p-entry { break-inside: avoid; }
}
