/* ============================================================
   jefpacker.ai — style.css
   Two themes: mission (amber) and vapor (synthwave).
   Switch via [data-theme] on <html>. Omitting data-theme = mission.
   ============================================================ */

/* ============================================================
   @font-face — local fonts (no CDN dependency)
   ============================================================ */

@font-face {
  font-family: 'Playfair Display';
  src: url('assets/fonts/playfair-display-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('assets/fonts/playfair-display-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('assets/fonts/ibm-plex-sans-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('assets/fonts/ibm-plex-sans-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ============================================================
   Tokens — mission defaults (content pages need no data-theme)
   ============================================================ */

:root {
  /* theme colors */
  --bg:          #07090d;
  --bg-2:        #0c1117;
  --border:      #2a3340;
  --border-soft: #1a2230;
  --text:        #e8e2d4;
  --muted:       #8a8470;
  --faint:       #4a4538;
  --accent:      #ffb648;
  --accent-2:    #ffb648;

  /* font stacks */
  --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'IBM Plex Sans', system-ui, sans-serif;

  /* legacy aliases — content-page component CSS uses these names unchanged */
  --color-bg:     var(--bg);
  --color-text:   var(--text);
  --color-accent: var(--accent);
  --color-muted:  var(--muted);
  --color-border: var(--border);
  --font-heading: var(--serif);
  --font-body:    var(--sans);
  --font-mono:    var(--mono);

  /* spacing scale (content pages) */
  --font-size-xs:   0.75rem;
  --font-size-sm:   0.875rem;
  --font-size-base: 1rem;
  --font-size-lg:   1.125rem;
  --font-size-xl:   1.5rem;
  --font-size-2xl:  2rem;
  --font-size-3xl:  2.75rem;
  --line-height-tight:  1.2;
  --line-height-normal: 1.6;
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --max-width: 72ch;
  --border-radius: 4px;

  color-scheme: dark;
}

/* ============================================================
   Vapor theme overrides
   ============================================================ */

[data-theme="vapor"] {
  --bg:          #0a0414;
  --bg-2:        #140a26;
  --border:      #3a1f5c;
  --border-soft: #25143d;
  --text:        #e8d9ff;
  --muted:       #8a78b5;
  --faint:       #5a4a85;
  --accent:      #ff2d95;
  --accent-2:    #00f0ff;
}

[data-theme="classic"] {
  --bg:          #111318;
  --bg-2:        #1a1d24;
  --border:      #2a2d35;
  --border-soft: #1e2129;
  --text:        #f0ede6;
  --muted:       #8a8680;
  --faint:       #4a4840;
  --accent:      #c8a96e;
  --accent-2:    #c8a96e;
}

[data-theme="vapor"] body {
  background: radial-gradient(ellipse at 50% 100%, #1a0633 0%, #0a0414 65%);
}

[data-theme="vapor"] body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 240, 255, 0.025) 0, rgba(0, 240, 255, 0.025) 1px,
    transparent 1px, transparent 3px
  );
  mix-blend-mode: screen; z-index: 100;
}

[data-theme="vapor"] body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
  z-index: 99;
}

[data-theme="mission"] body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 182, 72, 0.012) 0, rgba(255, 182, 72, 0.012) 1px,
    transparent 1px, transparent 4px
  );
  z-index: 100;
}

/* ============================================================
   Base reset
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

@media (prefers-reduced-motion: no-preference) {
  a, button { transition: color 0.15s ease, background-color 0.15s ease; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--border-radius);
}

/* ============================================================
   Shared topbar — all pages
   ============================================================ */

.topbar {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 48px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: baseline;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
}

.brand-caret { color: var(--accent); margin-left: 2px; font-weight: 500; }
[data-theme="vapor"] .brand-caret { color: var(--accent-2); text-shadow: 0 0 8px rgba(0,240,255,.5); }

.nav {
  display: flex;
  height: 100%;
  margin-left: auto;
}

.nav a {
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  border-left: 1px solid var(--border-soft);
  position: relative;
  transition: color .15s;
  white-space: nowrap;
}

.nav a:last-child { border-right: 1px solid var(--border-soft); }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--accent); }
.nav a.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--accent);
}

/* Theme switch — inside .app .topbar (index only) */
.theme-switch {
  display: flex;
  border: 1px solid var(--border);
  height: 22px;
  opacity: 0.45;
}

.theme-switch:hover { opacity: 1; transition: opacity .2s; }

.theme-switch button,
.theme-switch .theme-classic {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  color: var(--muted);
  border-right: 1px solid var(--border);
  text-decoration: none;
  white-space: nowrap;
}

.theme-switch button:last-child,
.theme-switch .theme-classic { border-right: none; }

.theme-switch button.on {
  background: var(--accent);
  color: var(--bg);
}

[data-theme="vapor"] .theme-switch button.on {
  box-shadow: 0 0 12px rgba(255, 45, 149, 0.6);
}

/* Hamburger — mobile only */
.nav-toggle {
  display: none;
  padding: 8px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  margin-left: auto;
}

/* Skip link */
.skip-link {
  position: absolute; top: -100%; left: 0;
  padding: 0.5rem 1rem;
  background: var(--accent); color: var(--bg);
  font-family: var(--sans); font-size: 0.875rem; font-weight: 600;
  z-index: 999;
}
.skip-link:focus { top: 0; }

/* ============================================================
   App-shell layout — index.html only (requires .app wrapper)
   ============================================================ */

.app {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: 48px 1fr 32px;
  overflow: hidden;
}

.mobile-bio { display: none; }

.main {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  padding: 56px 40px 40px;
  gap: 40px;
}

.canvas-pane {
  position: relative;
  overflow: hidden;
}

#rrt { position: absolute; inset: 0; }
#rrt canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }

.statusbar {
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 16px;
  background: var(--bg);
}

.statusbar .spacer { flex: 1; }
.statusbar-hint { margin-right: 16px; }

/* Identity */
.identity-name {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 6px;
}

[data-theme="vapor"] .identity-name {
  color: var(--accent-2);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

.identity-role {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}

.bio {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  opacity: 0.85;
  max-width: 36ch;
}

.bio p { margin-bottom: 6px; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.bio p:last-child::after,
.mobile-bio::after {
  content: '▌';
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

.bio .prompt, .mobile-bio .prompt {
  display: inline-block;
  color: var(--accent);
  margin-right: 8px;
  opacity: 0.7;
  font-weight: 500;
}

[data-theme="vapor"] .bio .prompt,
[data-theme="vapor"] .mobile-bio .prompt { color: var(--accent-2); }

[data-theme="vapor"] .bio .prompt,
[data-theme="vapor"] .mobile-bio .prompt { display: none; }

[data-theme="vapor"] .bio p:last-child::after,
[data-theme="vapor"] .mobile-bio::after { display: none; }

/* Telemetry widget */
.tele { border-bottom: 1px solid var(--border-soft); padding-bottom: 4px; }

.tele-frame {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  padding: 14px 0 16px;
}

.tele-top, .tele-bot {
  display: flex;
  align-items: center;
  color: var(--faint);
}

.tele-fill {
  flex: 1;
  height: 1px;
  background: var(--border-soft);
  margin: 0 2px;
}

.tele-top b { color: var(--muted); font-weight: 400; letter-spacing: 0.04em; }
[data-theme="vapor"] .tele-top b { color: var(--accent-2); }
[data-theme="mission"] .tele-top b { color: var(--accent); }

.tele-body { padding: 8px 12px 6px; }

.tele-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 3px 0;
  letter-spacing: 0.02em;
}

.tele-k { color: var(--muted); }

.tele-v {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.tele-spark {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 32px;
  margin-top: 10px;
  gap: 1px;
}

.tele-spark span {
  display: inline-block;
  flex: 1;
  background: var(--faint);
  height: 1px;
  transition: height .8s ease, opacity .8s ease;
}

.tele-axis {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--faint);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

/* Links */
.page-nav-links { margin-top: auto; }

.page-nav-links .link-handle {
  color: var(--muted);
  opacity: 0.85;
}
.links { margin-top: 0; display: flex; flex-direction: column; gap: 24px; }
.mobile-copyright { display: none; }
.links-grid { display: flex; flex-direction: column; }

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text);
  transition: color .15s, padding .15s;
}

.link-row:first-child { border-top: 1px solid var(--border-soft); }
.link-row:hover { color: var(--accent); padding-left: 4px; }

.link-key { letter-spacing: 0.04em; font-size: 12px; min-width: 70px; }

.link-handle {
  flex: 1;
  text-align: right;
  color: var(--faint);
  font-size: 11px;
  margin-right: 14px;
  opacity: 0.65;
  transition: opacity .15s, color .15s;
}

.link-row:hover .link-handle { opacity: 1; color: var(--muted); }

.link-arrow {
  color: var(--faint);
  font-size: 12px;
  transition: color .15s, transform .15s;
}

.link-row:hover .link-arrow { color: var(--accent); transform: translateX(3px); }

/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }

.hud-label {
  position: absolute;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-bl { bottom: 48px; left: 16px; }

.hud-corners { position: absolute; inset: 16px; pointer-events: none; }

.hud-corners::before, .hud-corners::after, .corner-tr, .corner-bl {
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  opacity: 0.35;
}

.hud-corners::before { content: ''; top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.hud-corners::after  { content: ''; bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.corner-tr { top: 16px; right: 16px; border-top-width: 1px; border-right-width: 1px; }
.corner-bl { bottom: 16px; left: 16px; border-bottom-width: 1px; border-left-width: 1px; }

/* Canvas overlay page nav — mobile only (hidden by default, shown via media query) */
.canvas-page-nav {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  flex-direction: row;
  justify-content: center;
  gap: 0;
  pointer-events: auto;
  z-index: 6;
}

.canvas-page-nav a {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 14px 20px;
  background: transparent;
  transition: color 0.2s ease;
}

.canvas-page-nav a:hover {
  color: var(--text);
}

/* Nav drawer — mobile overlay (index only) */
.nav-drawer {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nav-drawer[hidden] { display: none; }

.nav-backdrop {
  position: fixed;
  inset: 48px 0 0 0;
  z-index: 199;
  background: transparent;
}
.nav-backdrop[hidden] { display: none; }

.drawer-theme {
  display: flex;
  gap: 6px;
}

.drawer-theme button,
.drawer-theme .theme-classic {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  color: var(--muted);
  border: 1px solid var(--border);
  text-decoration: none;
}

.drawer-theme button.on {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.drawer-nav { display: flex; flex-direction: column; }

.drawer-nav a {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.drawer-nav a.active { color: var(--accent); }
.drawer-nav a:last-child { border-bottom: none; }

/* ============================================================
   Content page layout — experience, portfolio, about
   ============================================================ */

.page-layout {
  width: 100%;
  max-width: calc(var(--max-width) + var(--space-xl) * 2);
  margin-inline: auto;
  padding-inline: var(--space-xl);
  padding-block: var(--space-2xl);
}

.page-layout header { margin-bottom: var(--space-xl); }
.page-layout header h1 { margin-bottom: var(--space-md); }
.page-layout p:not([class]) { margin-bottom: var(--space-md); }
.page-layout section + section { margin-top: var(--space-2xl); }
.page-layout section { display: flow-root; }

.site-footer {
  padding-inline: var(--space-xl);
  padding-block: var(--space-2xl);
  border-top: 1px solid var(--color-border);
}

/* ============================================================
   Typography — content pages (uses legacy aliases)
   ============================================================ */

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }

p { font-family: var(--font-body); font-size: var(--font-size-base); line-height: var(--line-height-normal); }

.mono {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

a.content-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a.content-link:hover { color: var(--color-text); }

/* ============================================================
   Photo layout — about page
   ============================================================ */

.photo-aside-wrap {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-md);
}

.photo-aside { width: 100%; border-radius: var(--border-radius); display: block; }
.photo-aside img { width: 100%; height: auto; display: block; border-radius: inherit; }

.photo-aside-wrap > div { order: 1; flex: 1; min-width: 0; }

@media (min-width: 40rem) {
  .photo-aside-wrap { flex-direction: row; align-items: flex-start; gap: var(--space-xl); }
  .photo-aside { width: 45%; flex-shrink: 0; order: 2; }
  .photo-aside-wrap p { order: 1; }
}

/* ============================================================
   Utilities
   ============================================================ */

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Timeline — experience page
   ============================================================ */

.timeline { position: relative; padding-left: 1.75rem; }

.timeline-line {
  position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
  background-image: linear-gradient(
    to bottom,
    transparent var(--tl-line-start, 0px),
    var(--color-accent) var(--tl-line-start, 0px),
    var(--color-accent) var(--tl-progress, 0px),
    var(--color-border) var(--tl-progress, 0px),
    var(--color-border) var(--tl-line-end, 100%),
    transparent var(--tl-line-end, 100%)
  );
}

.timeline-entry { position: relative; padding-bottom: var(--space-xl); }

.timeline-dot {
  position: absolute;
  left: calc(-1.75rem - 3px);
  top: 0.3em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-border);
}

.timeline-entry.past .timeline-dot { background: var(--color-accent); }

.timeline-entry.current .timeline-dot {
  background: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 3.5px var(--color-accent);
}

.timeline-entry.future .timeline-dot,
.timeline-entry.future .timeline-date,
.timeline-entry.future h3,
.timeline-entry.future p { opacity: 0.7; }

.timeline-date {
  display: block;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  letter-spacing: 0.02em;
}

.timeline-content h3 { margin-bottom: var(--space-sm); }
.timeline-content p { color: var(--color-muted); margin-bottom: var(--space-sm); }
.timeline-content p + p { margin-top: calc(-1 * var(--space-xs)); }

.timeline-content a {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-accent);
  display: inline-block;
  margin-bottom: var(--space-sm);
}

.timeline-content a:hover { color: var(--color-text); }

@media (prefers-reduced-motion: no-preference) {
  .timeline-entry { transition: opacity 0.2s ease; }
  .timeline-dot { transition: background 0.2s ease, box-shadow 0.2s ease; }
}

.timeline-close {
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.timeline-close p {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-style: italic;
  color: var(--color-muted);
  max-width: 36ch;
  margin-inline: auto;
  line-height: var(--line-height-normal);
}

/* ============================================================
   Projects page
   ============================================================ */

.section-label {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-muted);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.card-links { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-xl); }

.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  text-decoration: none;
  border-radius: var(--border-radius);
  white-space: nowrap;
}

.btn:hover { opacity: 0.85; }

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent);
  color: var(--color-bg);
  opacity: 1;
}

.project-card {
  padding-bottom: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--color-border);
}

.project-card:last-child { border-bottom: none; margin-bottom: 0; }

.project-heading {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.project-image {
  width: 100%; height: auto;
  border-radius: var(--border-radius);
  display: block;
  margin-bottom: var(--space-md);
}

.project-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.project-image-grid picture { display: block; min-width: 0; }

.project-image-grid img {
  width: 100%; height: auto;
  border-radius: var(--border-radius);
  display: block;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.project-desc { color: var(--color-text); margin-bottom: var(--space-md); }

.project-detail-heading {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}

.project-detail-body { color: var(--color-muted); margin-bottom: var(--space-sm); }

/* Publications */

.pub-card {
  padding-bottom: var(--space-xl);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.pub-card:last-child { border-bottom: none; margin-bottom: 0; }

.pub-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-base);
  color: var(--color-text);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-normal);
}

.pub-authors {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-muted);
  margin-bottom: var(--space-xs);
  line-height: var(--line-height-normal);
}

.pub-venue {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

/* Patents */

.patent-list { margin-bottom: var(--space-xl); }

.patent-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
}

.patent-row:last-child { border-bottom: none; }

a.patent-row:hover { background-color: color-mix(in srgb, var(--color-accent) 6%, transparent); }
a.patent-row:hover .patent-row-title { color: var(--color-accent); }

.patent-row-title {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  flex: 1;
}

.patent-row-meta { display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0; }

.patent-row-year {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-muted);
}

.patent-row-link {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-accent);
  white-space: nowrap;
}

details.patent-list-more { border-bottom: none; }

details.patent-list-more > summary.patent-row {
  cursor: pointer;
  list-style: none;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  justify-content: flex-start;
  border-bottom: none;
}

details.patent-list-more > summary.patent-row::-webkit-details-marker { display: none; }
details.patent-list-more > summary.patent-row::marker { display: none; content: ''; }
details.patent-list-more[open] > summary.patent-row { display: none; }

button.patent-row {
  background: none; border: none;
  border-bottom: 1px solid var(--color-border);
  width: 100%; text-align: left; cursor: pointer;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  justify-content: flex-start;
}

.patents-footer { margin-top: var(--space-lg); margin-bottom: var(--space-2xl); }

/* ============================================================
   Mobile — app-shell (max-width: 820px)
   ============================================================ */

@media (max-width: 820px) {
  /* Switch app from grid to flex so display:contents on .main works */
  .app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  .app .topbar { flex-shrink: 0; }

  .mobile-bio {
    display: block;
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text);
    opacity: 0.85;
    border-bottom: 1px solid var(--border);
    line-height: 1.6;
  }

  .main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    order: 3;
  }

  .canvas-pane { order: 1; flex: 1; min-height: 0; position: relative; width: 100%; }
  .sidebar { order: 2; flex-shrink: 0; border-right: 0; border-bottom: 1px solid var(--border); padding: 16px 20px; gap: 16px; }

  .link-handle { display: none; }
  .link-arrow { display: none; }

  .links {
    gap: 0;
    flex-direction: row;
    align-items: center;
    border-top: 1px solid var(--border-soft);
    padding: 0;
    margin-top: 0;
  }

  .links-grid {
    flex-direction: row;
    flex: none;
  }

  .link-row {
    flex: none;
    justify-content: center;
    padding: 10px 14px;
    border-bottom: none;
    border-right: 1px solid var(--border-soft);
  }

  .link-row:first-child { border-top: none; }
  .link-row:last-child { border-right: 1px solid var(--border-soft); }

  .link-key {
    font-size: 0;
    min-width: unset;
    letter-spacing: 0;
  }

  .link-key::before {
    content: attr(data-short);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-copyright {
    display: block;
    font-size: 9px;
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 0 16px;
    white-space: nowrap;
    margin-left: auto;
  }

  /* Hide desktop-only elements */
  .identity { display: none; }
  .statusbar { display: none; }

  /* Telemetry condensed */
  .tele { border-bottom: none; padding-bottom: 0; }
  .tele-frame { padding: 8px 0; }
  .tele-body { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px; }
  .tele-spark { height: 20px; margin-top: 6px; }

  /* Nav hidden, drawer handles it */
  .app .topbar .nav { display: none; }
  .nav-toggle { display: block; }
  .app .topbar .theme-switch { display: none; }

  .canvas-page-nav {
    display: flex;
  }

  .page-nav-links {
    display: none;
  }

  .classic-hero {
    padding: var(--space-sm);
    gap: var(--space-sm);
  }
}

/* ============================================================
   Mobile — content page nav (max-width: 820px)
   ============================================================ */

@media (max-width: 820px) {
  .nav { display: none; }

  /* Topbar expands in-flow when nav opens — pushes content down, not overlay */
  .topbar:has(.nav.is-open) {
    flex-wrap: wrap;
    height: auto;
    align-items: flex-start;
  }

  /* Keep brand and toggle row at 48px when topbar expands */
  .topbar:has(.nav.is-open) .brand,
  .topbar:has(.nav.is-open) .nav-toggle {
    height: 48px;
    display: flex;
    align-items: center;
  }

  .nav.is-open {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--bg);
    border-top: 1px solid var(--border-soft);
  }

  .nav.is-open a {
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    padding: 14px 20px;
  }

  .nav.is-open a::after { display: none; }

  .nav-toggle { display: block; }

  .page-layout {
    padding-inline: var(--space-md);
    padding-block: var(--space-xl);
  }
}

/* ============================================================
   Vapor sidebar — hidden unless vapor theme active
   ============================================================ */

.tele-vapor { display: none; }
[data-theme="vapor"] .tele-vapor { display: block; }
[data-theme="vapor"] .tele:not(.tele-vapor) { display: none; }

/* ============================================================
   Classic theme overlay — full-screen canvas + hero overlay
   ============================================================ */

/* Hidden by default on all themes */
.classic-overlay { display: none; }

/* Classic theme: collapse sidebar column and statusbar row (desktop grid only — mobile uses flex) */
@media (min-width: 821px) {
  [data-theme="classic"] .app { grid-template-rows: 48px 1fr; }
  [data-theme="classic"] .main { grid-template-columns: 1fr; }
}

/* Classic theme: hide sidebar-era elements */
[data-theme="classic"] .sidebar,
[data-theme="classic"] .mobile-bio,
[data-theme="classic"] .hud,
[data-theme="classic"] .canvas-page-nav,
[data-theme="classic"] .statusbar { display: none; }

/* Classic theme: show overlay */
[data-theme="classic"] .classic-overlay {
  display: flex;
  flex-direction: column;
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  padding-inline: var(--space-xl);
  padding-block: var(--space-2xl);
}

.classic-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  flex-shrink: 0;
  pointer-events: none;
  align-self: flex-start;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(2px);
  border: 1px solid var(--border);
  padding: var(--space-md);
  border-radius: var(--border-radius);
}

.classic-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  pointer-events: auto;
}

.classic-tagline {
  font-family: var(--sans);
  font-size: clamp(0.75rem, 1.5vw, 0.9375rem);
  color: var(--muted);
  max-width: 40ch;
  line-height: 1.6;
  pointer-events: auto;
}

.classic-socials {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  pointer-events: none;
}

.classic-social-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  pointer-events: auto;
  transition: color 0.15s ease;
}

.classic-social-link:hover { color: var(--text); }
.classic-social-link svg { width: 24px; height: 24px; fill: currentColor; }

@media (max-width: 820px) {
  [data-theme="classic"] .classic-overlay {
    padding-block-start: var(--space-md);
    padding-block-end: var(--space-lg);
    padding-inline: var(--space-md);
  }

  [data-theme="classic"] .classic-hero {
    max-width: 75%;
  }
}

/* Vapor bars */
.vapor-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 10px;
}
.vapor-bar-label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  min-width: 28px;
}
.vapor-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border-soft);
  border-radius: 2px;
  overflow: hidden;
}
.vapor-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  box-shadow: 0 0 6px var(--accent);
  transition: width 0.3s linear;
}
.vapor-bar-fill-2 {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 6px var(--accent-2);
}

/* Glitch text */
.vapor-glitch {
  position: relative;
  color: var(--accent-2);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-top: 8px;
  margin-bottom: 4px;
  text-shadow: 0 0 8px var(--accent-2);
}
.vapor-glitch::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 1px;
  color: var(--accent);
  opacity: 0.5;
  clip-path: inset(30% 0 50% 0);
}

/* ASCII texture */
.vapor-ascii {
  font-size: 9px;
  color: var(--faint);
  letter-spacing: 0.05em;
}

/* Desktop: 1024px+ */
@media (min-width: 64rem) {
  h1 { font-size: var(--font-size-3xl); }

  .page-layout {
    padding-inline: var(--space-2xl);
    padding-block: var(--space-2xl);
  }
}
