/* ============================================================
   yeshe.dev — dark-first design system
   Theme states: :root (light base) / prefers-color-scheme dark /
   [data-theme="dark"] / [data-theme="light"]
   ============================================================ */

:root {
  /* Light palette (base) */
  --bg: #f4f4f5;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --text: #16181d;
  --text-muted: #5b5e66;
  --text-faint: #8a8d95;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #159a63;
  --accent-soft: rgba(21, 154, 99, 0.12);
  --accent-text: #ffffff;

  /* GradientWaves colors (hex) read by waves.js — on-brand green, not the
     component's default purple/pink. horizon = distant haze, mid = wave body,
     crest = nearest highlight. */
  --wave-horizon: #d2e6db;
  --wave-mid: #45ab7f;
  --wave-crest: #eafff4;
  --wave-brightness: 1.0;
  --wave-opacity: 1.0;

  --radius: 10px;
  --radius-lg: 16px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 1px 2px rgba(20, 20, 25, 0.04), 0 8px 24px rgba(20, 20, 25, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b0d;
    --bg-2: #0f1113;
    --surface: #131518;
    --surface-2: #17191d;
    --text: #f0f1f3;
    --text-muted: #a1a5ad;
    --text-faint: #6b6f78;
    --border: #24262b;
    --border-strong: #33363d;
    --accent: #34d17f;
    --accent-soft: rgba(52, 209, 127, 0.14);
    --accent-text: #04140c;
    --dither-bg: 0.043, 0.043, 0.043;
    --dither-wave: 0.16, 0.16, 0.16;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #0a0b0d;
  --bg-2: #0f1113;
  --surface: #131518;
  --surface-2: #17191d;
  --text: #f0f1f3;
  --text-muted: #a1a5ad;
  --text-faint: #6b6f78;
  --border: #24262b;
  --border-strong: #33363d;
  --accent: #34d17f;
  --accent-soft: rgba(52, 209, 127, 0.14);
  --accent-text: #04140c;
  --wave-horizon: #06100b;
  --wave-mid: #1a9862;
  --wave-crest: #9ff2c9;
  --wave-brightness: 1.0;
  --wave-opacity: 1.0;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: 96px; /* clearance for the fixed bottom nav dock */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

a { color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---- Nav ---- */
.site-nav {
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; gap: 22px; font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--text-muted); transition: color 0.15s var(--ease); }
.nav-links a:hover { color: var(--text); }
@media (max-width: 680px) { .nav-links { display: none; } }

/* ---- Theme switcher (segmented) ---- */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.theme-switch button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.theme-switch svg { width: 15px; height: 15px; display: block; }

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(115% 75% at 50% 54%, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.40) 40%, transparent 74%),
    linear-gradient(to bottom, rgba(0,0,0,0.35), transparent 22%, transparent 80%, var(--bg));
  pointer-events: none;
}
#hyperspeed { z-index: 0; }
#hyperspeed canvas { display: block; width: 100% !important; height: 100% !important; }
.hero .wrap {
  position: relative; z-index: 2; width: 100%; max-width: 1160px;
  padding-top: 40px; padding-bottom: 40px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero .lede {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted);
  max-width: 58ch;
  margin: 8px auto 30px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.btn-ghost:hover { border-color: var(--accent); }

/* ---- Section shell ---- */
section.block { max-width: 1080px; margin: 0 auto; padding: 80px 24px; }
section.block + section.block { border-top: 1px solid var(--border); }
.section-head { margin-bottom: 40px; }
.section-head h2 {
  font-size: clamp(24px, 3.5vw, 34px);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  font-weight: 600;
}
.section-head p { color: var(--text-muted); margin: 0; max-width: 56ch; }

/* ---- Projects: stacked Granola-style rows ---- */
.project-list { display: flex; flex-direction: column; gap: 24px; }
.project-panel {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 36px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.project-panel:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--surface-2); }
.project-panel * { text-decoration: none; }
.project-body { display: flex; flex-direction: column; gap: 12px; }
.panel-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}
.project-panel h3 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em; margin: 0; font-weight: 600; }
.project-panel .panel-desc { color: var(--text-muted); font-size: 15.5px; margin: 0; max-width: 48ch; }
.panel-visual {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(140% 120% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
  min-height: 170px;
  height: 100%;
}
.panel-foot { display: flex; align-items: center; gap: 18px; margin-top: 4px; }
.panel-foot a { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 500; }
.panel-foot .meta { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }

.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); display: inline-block;
  box-shadow: 0 0 0 0 var(--accent-soft);
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: pulse 2.4s var(--ease) infinite; }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 720px) {
  .project-panel { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
  .panel-visual { min-height: 120px; order: -1; }
}


/* ---- Benched list ---- */
.benched-list { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.benched-item { padding: 18px 22px; display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: baseline; }
.benched-item + .benched-item { border-top: 1px solid var(--border); }
.benched-item h4 { margin: 0; font-size: 15px; font-weight: 600; }
.benched-item p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
@media (max-width: 560px) { .benched-item { grid-template-columns: 1fr; gap: 5px; } }

/* ---- Build log ---- */
.log-group { margin-bottom: 36px; }
.log-group:last-child { margin-bottom: 0; }
.log-group h3 {
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 16px; font-weight: 500;
}
.log-entry { display: grid; grid-template-columns: 96px 1fr; gap: 18px; padding: 16px 0; }
.log-entry + .log-entry { border-top: 1px solid var(--border); }
.log-entry time { font-family: var(--mono); font-size: 13px; color: var(--text-faint); padding-top: 2px; }
.log-entry h4 { margin: 0 0 5px; font-size: 15.5px; }
.log-entry p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
@media (max-width: 560px) { .log-entry { grid-template-columns: 1fr; gap: 5px; } }

/* ---- About ---- */
.about p { max-width: 60ch; color: var(--text-muted); font-size: 16.5px; }

/* ---- Footer ---- */
footer.site-footer {
  max-width: 1080px; margin: 0 auto; padding: 40px 24px 96px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-faint); flex-wrap: wrap; gap: 12px;
  border-top: 1px solid var(--border);
}
footer.site-footer a { color: var(--text-faint); text-decoration: none; border-bottom: 1px solid transparent; }
footer.site-footer a:hover { color: var(--text); border-color: var(--border-strong); }

/* ---- Machine view overlay ---- */
.machine-view {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--bg-2);
  overflow-y: auto;
  display: none;
  padding: 88px 24px 120px;
}
.machine-view.open { display: block; }
body.machine-open { overflow: hidden; }
.machine-inner { max-width: 900px; margin: 0 auto; }
.machine-inner .mv-label {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 6px;
}
.machine-inner h2 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
.machine-inner .mv-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 28px; }
.mv-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 16px;
  overflow: hidden;
}
.mv-block-head {
  font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  display: flex; justify-content: space-between; align-items: center;
}
.mv-block pre {
  margin: 0; padding: 16px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.mv-block pre .k { color: var(--accent); }
.copy-btn {
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-muted);
  font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 6px; cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---- Project detail (Granola side-by-side) ---- */
.detail-hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.detail-hero .hero-canvas { opacity: 0.7; }
.detail-hero .wrap { position: relative; z-index: 2; padding-top: 40px; padding-bottom: 64px; }
.detail-hero .back {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 13px;
  color: var(--text-muted); text-decoration: none; margin-bottom: 40px;
}
.detail-hero .back:hover { color: var(--accent); }
.detail-hero .panel-tag { display: flex; margin-bottom: 18px; }
.detail-hero h1 { font-size: clamp(34px, 6vw, 60px); letter-spacing: -0.03em; margin: 0 0 18px; font-weight: 600; }
.detail-hero .lede { font-size: clamp(16px, 2vw, 20px); color: var(--text-muted); max-width: 56ch; margin: 0 0 28px; }
.detail-hero .visit {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-text);
  padding: 11px 20px; border-radius: 999px; text-decoration: none;
  font-size: 14px; font-weight: 600; transition: transform 0.15s var(--ease);
}
.detail-hero .visit:hover { transform: translateY(-1px); }

.detail-body {
  max-width: 1080px; margin: 0 auto; padding: 72px 24px 96px;
  display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: start;
}
.detail-main h2 {
  font-size: 13px; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-faint); margin: 36px 0 12px; font-weight: 500;
}
.detail-main h2:first-child { margin-top: 0; }
.detail-main p { font-size: 16px; color: var(--text); max-width: 62ch; margin: 0 0 14px; }
.detail-aside { position: sticky; top: 88px; }
.aside-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); padding: 22px; box-shadow: var(--shadow);
}
.aside-card .visual {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(140% 120% at 100% 0%, var(--accent-soft), transparent 55%), var(--surface-2);
  min-height: 150px; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; color: var(--text-faint); margin-bottom: 18px;
}
.aside-card .row { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 0; }
.aside-card .row + .row { border-top: 1px solid var(--border); }
.aside-card .row .lbl { color: var(--text-faint); font-family: var(--mono); font-size: 12px; }
.aside-card .row .val { color: var(--text); text-align: right; }
.aside-card .row .val a { color: var(--accent); text-decoration: none; }
.stack { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 14px 0 0; list-style: none; }
.stack li {
  font-family: var(--mono); font-size: 12px; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; color: var(--text-muted);
}
@media (max-width: 820px) {
  .detail-body { grid-template-columns: 1fr; gap: 40px; }
  .detail-aside { position: static; }
}

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .project-panel { transition: none; }
  .btn, .project-card { transition: none; }
}

/* ---- PillNav (fixed bottom dock) ---- */
.pill-nav {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60;
  width: max-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 5px;
  padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  box-shadow: var(--shadow);
}
.pill-divider { width: 1px; height: 22px; background: var(--border); margin: 0 3px; flex: none; }
.pill-mode {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; border: none; cursor: pointer;
  background: transparent; color: var(--text-faint); flex: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.pill-mode:hover { color: var(--text); background: var(--surface-2); }
.pill-mode[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.pill-mode svg { width: 17px; height: 17px; display: block; }
.pill-mode .i-human { display: none; }
.pill-mode[aria-pressed="true"] .i-machine { display: none; }
.pill-mode[aria-pressed="true"] .i-human { display: inline-flex; }
.pill-logo {
  width: 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--border); text-decoration: none;
  transition: transform 0.3s var(--ease);
}
.pill-logo:hover { transform: rotate(-8deg); }
.pill-logo svg { display: block; }
.pill-list { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.pill {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 999px; text-decoration: none;
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  color: var(--text-muted);
}
.pill::before {
  content: ""; position: absolute; left: 50%; bottom: -60%;
  width: 130%; aspect-ratio: 1 / 1; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%) scale(0);
  transform-origin: 50% 100%; transition: transform 0.42s var(--ease); z-index: 0;
}
.pill:hover::before { transform: translateX(-50%) scale(1); }
.pill .pill-label { position: relative; z-index: 1; transition: color 0.25s var(--ease); }
.pill:hover .pill-label { color: var(--accent-text); }
.pill.is-active { color: var(--accent); }
.pill.is-active::before { transform: translateX(-50%) scale(1); }
.pill.is-active .pill-label { color: var(--accent-text); }
@media (max-width: 640px) {
  .pill-nav { bottom: 12px; gap: 2px; padding: 4px; }
  .pill { padding: 8px 11px; font-size: 12.5px; }
  .pill-logo { display: none; }
  .pill-divider { margin: 0 1px; }
  .pill-mode { width: 34px; height: 34px; }
}

/* ---- ParticleText (hero H1) ---- */
.particle-text {
  position: relative; display: block; width: 100%;
  height: clamp(210px, 46vh, 470px);
  margin: 0;
  font-weight: 600; letter-spacing: -0.035em;
  font-size: clamp(56px, 12.5vw, 160px);
  overflow: visible; touch-action: none; isolation: isolate;
}
.particle-text__canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.particle-text__sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- ScrollExpand (project detail media) ---- */
.scroll-expand { position: relative; width: 100%; }
.se-track { position: relative; width: 100%; }
.se-stage { position: sticky; top: 0; width: 100%; overflow: hidden; height: 100vh; --se-title-size: 4rem; }
.se-frame { position: absolute; inset: 0; clip-path: inset(20% 27% 20% 27% round 20px); will-change: clip-path; }
.se-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; transform-origin: center; user-select: none; -webkit-user-drag: none; }
.se-scrim { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0.1) 45%, rgba(0,0,0,0.4)); }
.se-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6%; opacity: 0; will-change: opacity, transform; color: #fff; }
.se-title { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 6%; text-align: center; font-size: var(--se-title-size); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,0.5); pointer-events: none; will-change: opacity, transform; }
.se-hint { position: absolute; left: 0; right: 0; bottom: 96px; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.62); pointer-events: none; }
.se-hint svg { width: 13px; height: 13px; }
@keyframes hintbob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: no-preference) { .se-hint svg { animation: hintbob 1.6s var(--ease) infinite; } }

/* ScrollExpand used as the project detail hero */
.detail-lead { border-bottom: 1px solid var(--border); }
h1.se-title { margin: 0; font-weight: 600; }
.se-overlay { gap: 18px; }
.se-overlay .panel-tag { color: #d9ffec; }
.se-overlay .se-lede { color: rgba(255,255,255,0.92); font-size: clamp(16px, 2vw, 21px); max-width: 54ch; margin: 0; text-shadow: 0 2px 22px rgba(0,0,0,0.55); }
.se-overlay .visit { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-text); padding: 12px 22px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600; }
.se-overlay .visit:hover { transform: translateY(-1px); }

/* Back button in the bottom dock (project pages) */
.pill-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; flex: none;
  color: var(--text-muted); text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.pill-back:hover { color: var(--text); background: var(--surface-2); }
.pill-back svg { width: 18px; height: 18px; display: block; }

/* Interactive changelog */
.changelog { border-top: 1px solid var(--border); }
.cl-item { border-bottom: 1px solid var(--border); }
.cl-item > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  padding: 24px 4px; color: var(--text);
  transition: color 0.2s var(--ease);
}
.cl-item > summary::-webkit-details-marker { display: none; }
.cl-item > summary:hover { color: var(--accent); }
.cl-num { font-family: var(--mono); font-size: 12px; color: var(--text-faint); min-width: 2.4em; }
.cl-title { font-size: clamp(17px, 2.2vw, 22px); font-weight: 600; letter-spacing: -0.01em; flex: 1; line-height: 1.25; }
.cl-tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.cl-plus { color: var(--text-faint); font-size: 22px; line-height: 1; transition: transform 0.28s var(--ease), color 0.2s var(--ease); }
.cl-item[open] .cl-plus { transform: rotate(45deg); color: var(--accent); }
.cl-item[open] > summary { color: var(--text); }
.cl-body { padding: 0 4px 26px calc(2.4em + 16px); }
.cl-body p { color: var(--text-muted); font-size: 15.5px; margin: 0 0 12px; max-width: 72ch; }
.cl-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.cl-meta span { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 6px; padding: 3px 9px; }

/* About links */
.about-links { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 22px; }
.about-links a { color: var(--accent); text-decoration: none; font-size: 14.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; border-bottom: 1px solid transparent; padding-bottom: 2px; }
.about-links a:hover { border-color: var(--accent); }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .hero { min-height: 100vh; min-height: 100dvh; }
  .hero .wrap { padding-top: 20px; }
  .hero-eyebrow { margin-bottom: 12px; font-size: 11px; }
  .particle-text { height: clamp(180px, 38vh, 320px); font-size: clamp(46px, 17vw, 100px); margin: 0; }
  .hero .lede { font-size: 15.5px; margin-bottom: 24px; }
  .hero-cta { gap: 10px; }
  .btn { padding: 11px 18px; }
  section.block { padding: 56px 20px; }
  .section-head { margin-bottom: 28px; }
  .detail-body { padding: 48px 20px 64px; }
  .se-stage { height: 82vh; }
  .cl-body { padding-left: 4px; }
  .cl-title { font-size: 16.5px; }
  .cl-num { min-width: 1.9em; }
}

/* ---- DepthCarousel (projects) ---- */
.depth-carousel {
  position: relative; width: 100%; height: 470px;
  display: flex; align-items: center; justify-content: center;
  perspective: 1400px; perspective-origin: 50% 50%;
  touch-action: pan-y; outline: none; user-select: none; -webkit-user-select: none;
  margin-top: 8px;
}
.depth-carousel.dc-ready { cursor: grab; }
.depth-carousel.dc-ready:active { cursor: grabbing; }
.dc-stage { position: absolute; inset: 0; transform-style: preserve-3d; }
.dc-card {
  position: absolute; top: 50%; left: 50%;
  width: 300px; height: 380px; border-radius: 16px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
  text-decoration: none; color: #fff;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.65), 0 8px 20px -10px rgba(0,0,0,0.5);
  will-change: transform, opacity, filter; transform: translate(-50%,-50%);
}
.dc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.dc-tint { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: #05060a; }
.dc-cardlabel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px;
  display: flex; flex-direction: column; gap: 7px;
  background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0.15) 70%, transparent);
}
.dc-cardtag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.dc-cardname { font-size: 23px; font-weight: 600; letter-spacing: -0.01em; }
.dc-cardgo { font-size: 12.5px; color: rgba(255,255,255,0.72); margin-top: 2px; }
.dc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.dc-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3000;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text); cursor: pointer; transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.dc-arrow:hover { border-color: var(--accent); color: var(--accent); }
.dc-arrow--prev { left: 6px; } .dc-arrow--next { right: 6px; }
.dc-dots { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; gap: 8px; }
.dc-dot { width: 7px; height: 7px; border: none; border-radius: 999px; background: var(--border-strong); cursor: pointer; padding: 0; transition: width 0.25s var(--ease), background 0.25s var(--ease); }
.dc-dot.is-active { width: 20px; background: var(--accent); }

/* no-JS / pre-init fallback: clean responsive grid */
.depth-carousel:not(.dc-ready) {
  height: auto; display: grid; gap: 16px; perspective: none;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.depth-carousel:not(.dc-ready) .dc-stage { position: static; display: contents; }
.depth-carousel:not(.dc-ready) .dc-card { position: static; transform: none; width: auto; height: 260px; }
.depth-carousel:not(.dc-ready) .dc-arrow,
.depth-carousel:not(.dc-ready) .dc-dots { display: none; }

@media (max-width: 640px) {
  .depth-carousel { height: 420px; }
  .dc-arrow { width: 38px; height: 38px; }
}

.dc-hint { text-align: center; font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin: 44px 0 0; }
@media (max-width: 640px) { .dc-hint { margin-top: 28px; } }

/* ---- Specular buttons (CTAs + visit; not nav) ---- */
@property --sb-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.btn, .detail-hero .visit, .se-overlay .visit {
  position: relative; isolation: isolate; overflow: visible;
}
.btn::after, .visit::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--sb-a),
    transparent 0deg, transparent 60deg,
    rgba(255,255,255,0.9) 90deg, transparent 120deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.5; pointer-events: none;
  animation: sbsweep 3.8s linear infinite;
}
.btn:hover::after, .visit:hover::after { opacity: 1; }
@keyframes sbsweep { to { --sb-a: 360deg; } }
@media (prefers-reduced-motion: reduce) { .btn::after, .visit::after { animation: none; opacity: 0.4; } }
