/* ============================================================
   Cedric Lim — personal site
   Apple-glass aesthetic: aurora gradient + frosted surfaces
   midnight blue + warm copper, light/dark
   ============================================================ */

:root {
  /* light mode */
  --bg: #f4f6fc;
  --bg-soft: #f8f3ee;
  --fg: #0a1226;
  --sub: #5a6480;
  --rule: rgba(15, 26, 60, 0.10);
  --chip: rgba(15, 26, 60, 0.06);
  --accent: #1d3a8a;
  --accent2: #c2845a;
  --accent2-soft: #f0e0cf;
  --good: #3ba360;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-shadow: 0 8px 32px rgba(15, 26, 60, 0.10);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --glass-blur: blur(24px) saturate(160%);

  --shadow: 0 24px 48px -24px rgba(11, 20, 40, 0.18);
  --shadow-sm: 0 8px 16px -8px rgba(11, 20, 40, 0.12);

  --serif-italic: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "Menlo", monospace;
  --max: 1920px;
  --pad: clamp(20px, 5vw, 64px);
  --radius: 24px;
  --radius-sm: 12px;

  /* aurora layers */
  --aurora:
    radial-gradient(at 20% 20%, oklch(82% 0.15 250 / 0.7), transparent 50%),
    radial-gradient(at 80% 30%, oklch(85% 0.13 30 / 0.55), transparent 55%),
    radial-gradient(at 50% 80%, oklch(88% 0.10 200 / 0.6), transparent 55%),
    radial-gradient(at 90% 90%, oklch(82% 0.14 290 / 0.5), transparent 55%),
    linear-gradient(135deg, #f4f6fc 0%, #f8f3ee 100%);
}

[data-theme="dark"] {
  --bg: #060a18;
  --bg-soft: #0c1428;
  --fg: #e9ecf3;
  --sub: #8893ad;
  --rule: rgba(255, 255, 255, 0.08);
  --chip: rgba(255, 255, 255, 0.06);
  --accent: #7ea7e8;
  --accent2: #d49063;
  --accent2-soft: #2a2018;

  --glass-bg: rgba(20, 28, 50, 0.55);
  --glass-bg-strong: rgba(15, 22, 42, 0.72);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  --shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 8px 16px -8px rgba(0, 0, 0, 0.4);

  --aurora:
    radial-gradient(at 20% 20%, oklch(45% 0.18 260 / 0.55), transparent 50%),
    radial-gradient(at 80% 30%, oklch(40% 0.16 30 / 0.45), transparent 55%),
    radial-gradient(at 50% 80%, oklch(40% 0.15 200 / 0.5), transparent 55%),
    radial-gradient(at 90% 90%, oklch(38% 0.16 290 / 0.45), transparent 55%),
    linear-gradient(135deg, #060a18 0%, #0c0a14 100%);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--aurora);
  background-attachment: fixed;
  transition: color 0.25s ease;
}
/* film grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/></svg>");
  z-index: 0;
  opacity: 1;
}
[data-theme="dark"] body::before { opacity: 0.5; }

main { flex: 1; position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  position: relative; z-index: 1;
}

/* ===== GLASS PRIMITIVE ===== */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  pointer-events: none;
}
[data-theme="dark"] .glass::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}

/* ===== HEADER (floating glass pill) ===== */
.site-header {
  position: sticky; top: 16px;
  z-index: 30;
  margin: 16px auto 0;
  max-width: var(--max);
  padding: 0 var(--pad);
}
.site-header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px;
  height: 56px; padding: 0 18px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  max-width: none;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14.5px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, #1d3a8a, #0b1428);
  color: #fff; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.brand-name { font-weight: 500; font-size: 14.5px; }
.brand-status { display: none; }
.site-nav { display: flex; gap: 22px; font-size: 14px; }
.site-nav a {
  color: var(--sub); padding: 4px 0; transition: color 0.15s;
  position: relative;
}
.site-nav a:hover, .site-nav a.active { color: var(--fg); }
.site-nav a.active { font-weight: 500; }
.site-nav a.active::after { display: none; }
.header-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.4);
  display: grid; place-items: center; color: var(--fg);
  transition: background 0.15s, transform 0.15s;
}
[data-theme="dark"] .icon-btn { background: rgba(255, 255, 255, 0.06); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.85); transform: translateY(-1px); }
[data-theme="dark"] .icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

@media (max-width: 720px) {
  .site-nav { gap: 14px; font-size: 13px; }
  .header-actions .icon-btn:not(.theme-toggle):not(:last-child) { display: none; }
  .brand-name { display: none; }
}
@media (max-width: 540px) {
  .site-nav a { font-size: 12px; }
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { letter-spacing: -0.025em; font-weight: 500; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.02; }
h2 { font-size: clamp(28px, 3.5vw, 40px); line-height: 1.1; }
h3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; }
.italic-accent {
  font-family: var(--serif-italic);
  font-style: italic;
  color: var(--accent2);
  font-weight: 400;
  letter-spacing: -0.02em;
}
.eyebrow {
  font-family: var(--mono); font-size: 11px; color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 500;
}
.lede { font-size: 17px; color: var(--sub); }

/* ===== HERO ===== */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  padding: 80px 0 56px;
  align-items: end;
}
.hero .status {
  font-family: var(--mono); font-size: 11px; color: var(--sub);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
  padding: 8px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.hero .status .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--good); box-shadow: 0 0 8px var(--good);
}
.hero p { font-size: 17px; color: var(--sub); max-width: 520px; margin: 32px 0 0; }
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 56px 0 48px; }
}

/* now-card — uses glass */
.now-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  position: relative; overflow: hidden;
}
.now-card::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  pointer-events: none;
}
[data-theme="dark"] .now-card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.now-card .eyebrow { margin-bottom: 16px; }
.now-row {
  display: grid; grid-template-columns: 84px 1fr; gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  font-size: 13.5px; line-height: 1.45;
}
.now-row:first-of-type { border-top: none; }
.now-row .label {
  font-family: var(--mono); font-size: 11px;
  color: var(--accent2);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding-top: 1px;
}

/* ===== SECTION HEADERS ===== */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 80px 0 24px;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 {
  font-family: var(--mono); font-size: 12px; color: var(--sub);
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em;
}
.section-head a {
  font-size: 13px; color: var(--fg);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background 0.15s;
}
.section-head a:hover { background: rgba(255, 255, 255, 0.85); }
[data-theme="dark"] .section-head a:hover { background: rgba(255, 255, 255, 0.12); }
.section-head a:hover .arrow { transform: translateX(3px); }
.arrow { transition: transform 0.18s ease; }

/* ===== PROJECT CARDS ===== */
.project-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
@media (max-width: 720px) { .project-grid { grid-template-columns: 1fr; } }
.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2),
              box-shadow 0.3s ease;
  display: block;
  color: inherit;
  position: relative;
}
.project-card::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  pointer-events: none; z-index: 2;
}
[data-theme="dark"] .project-card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.project-card:hover {
  transform: translateY(-6px) scale(1.005);
  box-shadow: 0 30px 60px -20px rgba(15, 26, 60, 0.22);
}
[data-theme="dark"] .project-card:hover {
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}
.project-card .preview {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0f1a2e, #1d3a8a);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  position: relative;
}
.project-card .preview svg { width: 100%; height: 100%; }
.project-card .body { padding: 22px 26px 24px; }
.project-card .meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.project-card .meta .tag {
  font-family: var(--mono); font-size: 10.5px; color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.project-card h3 { font-size: 22px; margin-bottom: 10px; }
.project-card .blurb { color: var(--sub); font-size: 14.5px; line-height: 1.55; margin: 0 0 16px; }
.stack {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.stack span {
  font-family: var(--mono); font-size: 10.5px; color: var(--fg);
  padding: 4px 9px;
  background: var(--chip);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
}

/* ===== LIST ROWS ===== */
.list-row {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  transition: padding 0.15s;
}
.list-row:first-child { border-top: 0; }
.list-row .row-meta {
  font-family: var(--mono); font-size: 11px; color: var(--sub); margin-bottom: 5px;
  display: flex; justify-content: space-between;
}
.list-row .row-title { font-size: 16px; font-weight: 500; margin-bottom: 3px; transition: color 0.15s; }
.list-row .row-excerpt { font-size: 13.5px; color: var(--sub); line-height: 1.5; }
.list-row.link:hover { padding-left: 4px; }
.list-row.link:hover .row-title { color: var(--accent2); }

/* publications */
.pub {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.pub:first-child { border-top: 0; }
.pub-meta {
  display: flex; justify-content: space-between; margin-bottom: 5px;
  font-family: var(--mono); font-size: 11px; color: var(--sub);
}
.pub-meta .status.review { color: var(--accent2); }
.pub-title { font-size: 14px; line-height: 1.45; }
.pub-authors { font-size: 12px; color: var(--sub); margin-top: 4px; font-family: var(--mono); }

/* a glass column wrapper for writing/pubs */
.col-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  padding: 24px 28px;
  position: relative; overflow: hidden;
}
.col-card::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  pointer-events: none;
}
[data-theme="dark"] .col-card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.col-card .col-head {
  font-family: var(--mono); font-size: 11px; color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

/* ===== TWO-COL ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }

/* ===== CV ===== */
.cv-row {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.cv-row:first-of-type { border-top: 0; padding-top: 0; }
.cv-row:last-child { border-bottom: 0; }
.cv-section-label {
  font-family: var(--mono); font-size: 11px; color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.cv-entry {
  padding: 14px 0;
  display: grid; grid-template-columns: 140px 1fr; gap: 20px;
  align-items: baseline;
}
.cv-entry + .cv-entry { border-top: 1px solid var(--rule); }
.cv-entry .years { font-family: var(--mono); font-size: 12px; color: var(--accent2); }
.cv-entry .what { font-size: 15px; font-weight: 500; }
.cv-entry .where { font-size: 13.5px; color: var(--sub); margin-top: 2px; }
@media (max-width: 720px) {
  .cv-row { grid-template-columns: 1fr; gap: 12px; }
  .cv-entry { grid-template-columns: 1fr; gap: 4px; }
}

/* CV wrapper - put each section in its own glass card on cv page */
.cv-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  padding: 32px 36px;
  margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.cv-card::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  pointer-events: none;
}
[data-theme="dark"] .cv-card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}

/* ===== FOOTER CTA ===== */
.footer-cta {
  display: grid; grid-template-columns: 1fr auto;
  gap: 32px;
  padding: 56px 0 32px;
  border-top: 1px solid var(--rule);
  align-items: end;
  margin-top: 80px;
}
.footer-cta h2 { font-size: clamp(24px, 3vw, 36px); max-width: 540px; }
.footer-cta h2 .muted { color: var(--sub); }
.footer-cta .ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: var(--mono); font-size: 13px; color: var(--fg);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s;
}
.btn-pill:hover { background: var(--fg); color: var(--bg); transform: translateY(-1px); }
.colophon {
  font-family: var(--mono); font-size: 11px; color: var(--sub);
  text-align: right; line-height: 1.7;
}
@media (max-width: 720px) {
  .footer-cta { grid-template-columns: 1fr; }
  .colophon { text-align: left; }
}

/* ===== PAGE HEADERS ===== */
.page-head {
  padding: 56px 0 32px;
}
.page-head h1 {
  font-size: clamp(36px, 5vw, 56px);
  max-width: 760px;
}
.page-head .lede { margin-top: 20px; max-width: 640px; }

/* ===== POST ===== */
.post-shell {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  padding: 56px 64px 64px;
  margin: 32px 0 96px;
  position: relative; overflow: hidden;
  max-width: 820px;
}
.post-shell::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  pointer-events: none;
}
[data-theme="dark"] .post-shell::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
@media (max-width: 720px) { .post-shell { padding: 32px 28px; } }

.post {
  max-width: 680px;
  font-size: 17px;
  line-height: 1.7;
}
.post h1 { font-size: clamp(32px, 4.5vw, 44px); margin-bottom: 16px; }
.post .post-meta {
  font-family: var(--mono); font-size: 12px; color: var(--sub);
  margin-bottom: 40px;
  display: flex; gap: 16px; flex-wrap: wrap;
}
.post p { margin: 0 0 22px; }
.post h2 { font-size: 22px; margin: 48px 0 16px; }
.post h3 { font-size: 18px; margin: 32px 0 12px; }
.post code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--chip);
  padding: 2px 6px; border-radius: 4px;
}
.post pre {
  background: rgba(15, 26, 60, 0.06);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.5;
}
[data-theme="dark"] .post pre { background: rgba(255, 255, 255, 0.04); }
.post pre code { background: none; padding: 0; }
.post blockquote {
  border-left: 2px solid var(--accent2);
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  color: var(--sub);
  font-family: var(--serif-italic);
  font-size: 19px;
  line-height: 1.5;
}
.post a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
}
.post a:hover { border-bottom-color: var(--accent); }
.post ul, .post ol { padding-left: 22px; margin: 0 0 22px; }
.post li { margin-bottom: 8px; }

.back-link {
  font-family: var(--mono); font-size: 12px; color: var(--sub);
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 24px;
}
.back-link:hover { color: var(--accent2); }

/* ===== FILTERS ===== */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 24px 0 32px;
}
.filter-chip {
  font-family: var(--mono); font-size: 11px;
  padding: 7px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border); border-radius: 999px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--sub);
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.filter-chip:hover { color: var(--fg); }
.filter-chip.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ===== WORK LIST + HOVER PREVIEW ===== */
.work-list {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  padding: 8px 32px;
  margin-bottom: 56px;
  position: relative; overflow: hidden;
}
.work-list::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  pointer-events: none;
}
[data-theme="dark"] .work-list::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.work-row {
  display: grid; grid-template-columns: 80px 1fr auto;
  gap: 24px; align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  color: inherit;
}
.work-row:last-child { border-bottom: 0; }
.work-row .year { font-family: var(--mono); font-size: 12px; color: var(--accent2); padding-top: 6px; }
.work-row h3 { font-size: 22px; margin-bottom: 6px; transition: color 0.15s ease; }
.work-row .blurb { color: var(--sub); font-size: 14.5px; max-width: 540px; }
.work-row .stack { margin-top: 12px; }
.work-row .arrow-corner {
  align-self: start; padding-top: 6px; color: var(--sub);
  transition: color 0.15s ease, transform 0.15s ease;
}
.work-row:hover h3 { color: var(--accent2); }
.work-row:hover .arrow-corner { color: var(--accent2); transform: translate(3px, -3px); }

.hover-preview {
  position: fixed;
  width: 240px; height: 144px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
  background: #0f1a2e;
}
.hover-preview.show { opacity: 1; transform: translateY(0) scale(1); }
.hover-preview svg { width: 100%; height: 100%; }

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  padding: 32px 0 64px;
  align-items: start;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.about-portrait {
  aspect-ratio: 4/5;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.3) 0 8px,
      transparent 8px 16px
    ),
    var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--sub);
  position: relative; overflow: hidden;
}
.about-portrait::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  pointer-events: none;
}
.about-grid p { font-size: 16.5px; line-height: 1.7; color: var(--fg); margin: 0 0 18px; }
.about-grid p:last-child { color: var(--sub); }

/* ===== SOCIALS ===== */
.socials {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.social-btn {
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: grid; place-items: center;
  color: var(--fg);
  transition: all 0.15s ease;
}
.social-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.85); }
[data-theme="dark"] .social-btn:hover { background: rgba(255, 255, 255, 0.12); }

/* ===== SITE FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
  margin-top: 56px;
  font-family: var(--mono); font-size: 11px; color: var(--sub);
  position: relative; z-index: 1;
}
.site-footer .wrap {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ===== NOTES / DOCS ===== */
.notes-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 180px;
  gap: 32px;
  padding: 40px 0 96px;
  align-items: start;
  max-width: 2560px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 1100px) {
  .notes-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .notes-shell .notes-onthispage { display: none; }
}
@media (max-width: 720px) {
  .notes-shell { grid-template-columns: 1fr; gap: 24px; }
  .notes-shell .notes-sidebar { position: static; max-height: none; padding: 20px; }
}

.notes-sidebar {
  position: sticky; top: 88px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 13.5px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  padding: 24px;
}
.notes-sidebar .doc-title {
  font-family: var(--mono); font-size: 11px; color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.12em;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.notes-sidebar ol { list-style: none; margin: 0; padding: 0; counter-reset: sec; }
.notes-sidebar li.l1 { counter-increment: sec; margin-top: 14px; }
.notes-sidebar li.l1:first-child { margin-top: 0; }
.notes-sidebar li.l1 > a {
  font-weight: 500; color: var(--fg); display: block; padding: 4px 0;
}
.notes-sidebar li.l1 > a::before {
  content: counter(sec) ". ";
  font-family: var(--mono); color: var(--sub); font-weight: 400;
}
.notes-sidebar ol ol { padding-left: 14px; margin-top: 4px; counter-reset: sub; }
.notes-sidebar li.l2 { counter-increment: sub; }
.notes-sidebar li.l2 > a {
  font-size: 13px; color: var(--sub); display: block; padding: 3px 0;
  border-left: 2px solid transparent; padding-left: 10px; margin-left: -10px;
}
.notes-sidebar li.l2 > a::before {
  content: counter(sub, lower-alpha) ". ";
  font-family: var(--mono);
}
.notes-sidebar a:hover { color: var(--accent2); }
.notes-sidebar a.active {
  color: var(--accent2); border-left-color: var(--accent2) !important;
}

.notes-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  padding: 48px 56px;
  font-size: 16px;
  line-height: 1.7;
  position: relative; overflow: hidden;
  max-width: none;
}
.notes-content::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  pointer-events: none;
}
[data-theme="dark"] .notes-content::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
@media (max-width: 720px) { .notes-content { padding: 28px 24px; } }
.notes-content h1 {
  font-size: clamp(32px, 4.5vw, 44px);
  margin: 0 0 8px;
  letter-spacing: -0.025em;
}
.notes-content .doc-meta {
  font-family: var(--mono); font-size: 12px; color: var(--sub);
  margin-bottom: 32px;
  display: flex; gap: 16px; flex-wrap: wrap;
}
.notes-content h2 {
  font-size: 26px; margin: 56px 0 16px; padding-top: 20px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 96px;
}
.notes-content h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 32px; }
.notes-content h3 {
  font-size: 19px; margin: 36px 0 12px;
  scroll-margin-top: 96px;
  color: var(--fg);
}
.notes-content p { margin: 0 0 16px; }
.notes-content code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--chip); padding: 2px 6px; border-radius: 4px;
}
.notes-content pre {
  background: rgba(15, 26, 60, 0.06);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.55;
  margin: 0 0 20px;
}
[data-theme="dark"] .notes-content pre { background: rgba(255, 255, 255, 0.04); }
.notes-content pre code { background: none; padding: 0; font-size: inherit; }
.notes-content blockquote {
  border-left: 2px solid var(--accent2);
  padding: 4px 0 4px 18px;
  margin: 20px 0;
  color: var(--sub);
}
.notes-content ul, .notes-content ol { padding-left: 22px; margin: 0 0 16px; }
.notes-content li { margin-bottom: 6px; }
.notes-content a { color: var(--accent); border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.notes-content a:hover { border-bottom-color: var(--accent); }
.notes-content table {
  border-collapse: collapse; margin: 0 0 20px; width: 100%; font-size: 14px;
}
.notes-content th, .notes-content td {
  border: 1px solid var(--rule); padding: 8px 12px; text-align: left;
}
.notes-content th { background: var(--chip); font-weight: 500; }
.notes-content hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
.notes-content .katex-display { margin: 20px 0; overflow-x: auto; overflow-y: hidden; }
.notes-content .katex { color: var(--fg); }

.notes-onthispage {
  position: sticky; top: 88px;
  font-size: 12px; color: var(--sub);
  padding: 20px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.notes-onthispage .label {
  font-family: var(--mono); font-size: 11px; color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px;
}
.notes-onthispage a {
  display: block; padding: 3px 0; color: var(--sub);
  border-left: 2px solid transparent; padding-left: 8px; margin-left: -8px;
}
.notes-onthispage a.h3 { padding-left: 18px; }
.notes-onthispage a.active { color: var(--accent2); border-left-color: var(--accent2); }

.notes-loading {
  font-family: var(--mono); font-size: 12px; color: var(--sub);
  padding: 24px 0;
}

/* email click-to-copy */
.email-link {
  font: inherit; color: var(--accent2); cursor: pointer;
  background: none; border: 0; padding: 0;
  border-bottom: 1px dashed color-mix(in oklab, var(--accent2) 60%, transparent);
  transition: color 0.15s ease, border-color 0.15s ease;
  text-transform: none; letter-spacing: 0;
  font-family: var(--mono); font-size: inherit;
}
.email-link:hover { color: var(--fg); border-bottom-color: var(--fg); }

.copy-toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--fg); color: var(--bg);
  font-family: var(--mono); font-size: 12px;
  padding: 10px 16px; border-radius: 999px;
  opacity: 0; transition: all 0.25s ease;
  pointer-events: none; z-index: 100;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
