/* ============================================================
   RICHARD INFRASTRUCTURE PORTFOLIO — OPTIMIZED CSS
   ============================================================ */

/* 1. CSS CUSTOM PROPERTIES & RESET — self-hosted fonts (see @font-face below) */

/* Self-hosted Inter & JetBrains Mono — no external font requests */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/inter-800.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jbmono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jbmono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/jbmono-600.woff2') format('woff2');
}

/* ── CSS VARIABLES ─────────────────────────────────────────── */
/* Default = dark. Cyan + magenta accent system. */
:root, html.dark {
  /* Accent colors — use sparingly */
  --accent-cyan: #22d3ee;
  --accent-magenta: #ec4899;
  /* Discipline accents (Systems Engineer portfolio) */
  --accent-rust: #f97316;
  --accent-k8s: #3b82f6;
  --accent-ebpf: #8b5cf6;
  --accent-infra: #10b981;
  
  /* Backgrounds */
  --bg-base: #080c14;
  --bg-surface: #0d1320;
  --bg-elevated: #111d2e;
  
  /* Borders */
  --border: #1a2540;
  --border-subtle: #1a2540;
  --border-active: var(--accent-cyan);
  
  /* Text */
  --text-primary: #f1f5f9;
  --text-body: #94a3b8;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  /* Code blocks */
  --code-bg: #060b11;
  --code-border: #1a2540;
  --code-text: #8fa3bf;
  
  /* Card shadows */
  --card-shadow: none;
  
  /* Legacy / compatibility */
  --cyan-bright: #22d3ee;
  --magenta-bright: #ec4899;
  
  /* Transitions - GPU-composited only, 150ms max */
  --transition-base: 150ms ease;

  /* Breakpoints — use in @media (max-width: var(--bp-*)) */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
}

/* 14. LIGHT MODE OVERRIDES */
html.light {
  --bg-base: #f0f4f8;
  --bg-surface: #ffffff;
  --bg-elevated: #e4ecf4;
  --border: #c8d8e8;
  --border-subtle: #c8d8e8;
  --border-active: var(--accent-cyan);
  --text-primary: #0a1628;
  --text-secondary: #1e3a5f;
  --text-body: #334e68;
  --text-muted: #4a6d8c;
  --accent-cyan: #0369a1;
  --accent-magenta: #86198f;
  --card-shadow: 0 1px 4px rgba(0,0,0,0.08);
  --code-bg: #e8f0f8;
  --code-border: #b8ccde;
  --code-text: #1e3a5f;
}

/* Touch targets: remove 300ms tap delay on iOS/Android */
a, button, [role="button"],
.nav-link, .nav-link-active, .hero-btn,
.filter-tab, .tag-pill, .tag-pill-active,
.po-btn-primary, .po-btn-secondary, .po-close,
.back-to-top, .navbar-mobile-toggle, .theme-toggle-btn,
.project-card-link, .related-project-link {
  touch-action: manipulation;
}
.po-panel,
.navbar-mobile-drawer,
.edocs-code-body {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
html, body {
  overscroll-behavior-y: none;
}

/* Code blocks — always dark, regardless of theme */
html.light .code-block,
html.light .code-header,
html.light .code-body,
html.light .edocs-code-body,
html.light .edocs-diagram-wrap,
html.light .pd-code-container,
html.light .pd-diagram-wrap,
html.light .edocs-code-bar {
  background: #0d1320;
  border-color: var(--border);
}

html.light .code-body pre,
html.light .code-block code,
html.light .edocs-code-body pre {
  color: #adbac7;
}

html.light .code-lang,
html.light .code-label,
html.light .edocs-code-filename {
  color: #636b78;
}

html.light .navbar {
  background: color-mix(in srgb, var(--bg-base) 95%, transparent);
  border-bottom: 1px solid var(--border);
}
html.light .nav-link        { color: var(--text-muted); }
html.light .nav-link:hover  { color: var(--text-primary); }
html.light .nav-link-active { color: var(--text-primary); border-bottom-color: var(--accent-cyan); }

/* Mobile drawer in light mode */
html.light .navbar-mobile-drawer {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
}
html.light .navbar-mobile-drawer a {
  color: var(--text-secondary);
  border-bottom-color: var(--border);
}
html.light .navbar-mobile-drawer a.active {
  color: var(--accent-cyan);
}

/* Shortcuts toggle button */
html.light .shortcuts-toggle-btn {
  color: var(--text-secondary);
  border-color: var(--border);
}
html.light .shortcuts-toggle-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

html.light .shortcuts-modal {
  background: var(--bg-surface);
  border-color: var(--border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}
html.light .shortcuts-modal-title {
  color: var(--text-primary);
}
html.light .shortcuts-key {
  background: color-mix(in srgb, var(--accent-cyan) 12%, transparent);
  color: var(--text-primary);
}
html.light .shortcuts-desc {
  color: var(--text-secondary);
}
html.light .shortcuts-scrim {
  background: rgba(0, 0, 0, 0.3);
}

html.light .project-card {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  box-shadow: var(--card-shadow);
}

html.light .project-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.12);
}

/* ── LIGHT MODE OVERRIDES FOR PROJECT DETAIL PAGES ────────────── */
html.light main {
  background: var(--bg-base);
}

html.light .stat-card,
html.light .challenge-card,
html.light .lesson-item {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-color: var(--border-subtle);
  background: var(--bg-surface);
}

/* Code blocks — light theme */
html.light .code-block {
  background: #f8fafc;
  border-color: var(--text-primary);
}
html.light .code-header {
  background: #f1f5f9;
  border-bottom-color: var(--text-primary);
}
html.light .code-body {
  background: #f8fafc;
  color: #1e293b;
}
html.light .code-block pre,
html.light .code-block code {
  color: #1e293b;
}
html.light .code-lang  { color: var(--text-muted); }
html.light .code-label { color: #0369a1; }
html.light .cb-copy    { color: var(--text-muted); }
html.light .cb-copy:hover { color: #1e293b; }
html.light .cb-copy.copied { color: #166534; }

/* Token colours — light theme */
html.light .tok-kw    { color: #7c3aed; }
html.light .tok-str   { color: #166534; }
html.light .tok-cmt   { color: var(--text-muted); }
html.light .tok-num   { color: #dc2626; }
html.light .tok-fn    { color: #0369a1; }
html.light .tok-ty    { color: #0f766e; }
html.light .tok-op    { color: #1e293b; }
html.light .tok-var   { color: #b45309; }
html.light .tok-attr  { color: #be185d; }
html.light .tok-const { color: #b45309; }
html.light .tok-param { color: #b45309; }
html.light .tok-yk    { color: #0369a1; }
html.light .tok-yv    { color: #166534; }

/* Timeline */
html.light .timeline-item {
  border-color: var(--border-subtle);
  background: var(--bg-surface);
}

html.light .timeline-grid {
  border-color: var(--border-subtle);
}

html.light .timeline-date,
html.light .timeline-date-cell {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-right-color: var(--border-subtle);
}

html.light .timeline-title {
  color: var(--text-primary);
}

html.light .timeline-body {
  color: var(--text-secondary);
}

/* Engineering deep-dive cards */
html.light .deep-dive-card {
  background: var(--bg-surface);
  border-left-color: var(--accent-cyan);
}

html.light .deep-dive-title {
  color: var(--text-primary);
}

/* Related projects sidebar */
html.light .related-project-link {
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

/* Optional generic page wrapper for consistent padding */
.page-container {
  padding: 0 32px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .page-container { padding: 0 20px; }
}
@media (max-width: 480px) {
  .page-container { padding: 0 16px; }
}

/* 15. RESPONSIVE / MEDIA QUERIES */
/* ── GLOBAL MOBILE / TOUCH (no media query) ─────────────────── */
/* Prevent iOS zoom on input focus (font < 16px triggers zoom) */
input, textarea, select {
  font-size: 16px !important;
}

/* Remove iOS tap highlight */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Smooth momentum scrolling on iOS */
html {
  -webkit-overflow-scrolling: touch;
}

/* Buttons and nav/CTA links: minimum 44px tap target */
button:not(.theme-toggle-btn):not(.shortcuts-toggle-btn),
.nav-link, .nav-link-active,
.hero-btn, .contact-value-btn, .tag-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Inline text links: do not force block / min-height */
p a, li a, .writeup-detail-content a:not([class*="hero"]),
.writeup-body a {
  min-height: unset;
  display: inline;
}


body {
  padding-bottom: env(safe-area-inset-bottom);
}

html.light .related-project-link:hover {
  color: var(--text-primary);
}

html.light .cert-row {
  border-bottom-color: var(--border-subtle);
}

html.light .reading-progress-bar {
  background: var(--border-subtle);
}

html.light .back-to-top {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-muted);
  box-shadow: var(--card-shadow);
}

html.light .theme-toggle-btn {
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

html.light .filter-tab {
  color: var(--text-muted);
  border-color: var(--text-primary);
}
html.light .filter-tab-active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
}

html.light .category-desc {
  color: var(--text-muted);
}

html.light .project-card-article {
  background: #ffffff;
  border-color: var(--text-primary);
}
html.light .project-card-article:hover {
  border-color: var(--card-accent, var(--accent-cyan));
}

html.light .terminal-glow {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

html.light .terminal-line {
  color: var(--accent-cyan);
}
html.light .terminal-line .terminal-prompt {
  color: #7c3aed;
}
html.light .terminal-line .terminal-output {
  color: #1e293b;
}

/* 2. TYPOGRAPHY */
/* 3. LAYOUT PRIMITIVES */
/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}


/* Remove outline for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}

/* ── ACCESSIBILITY UTILITIES ───────────────────────────────────── */

/* Skip to main content — visible on focus */
.skip-to-content {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}
.skip-to-content:focus {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  padding: 8px 16px;
  margin: 0;
  background: var(--accent-cyan);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast focus ring — works on both light and dark */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Ensure sufficient color contrast on all text */
/* Audit and replace any text-slate-600 on dark backgrounds 
   with text-slate-400 minimum (4.5:1 contrast ratio on #030712) */

/* Touch targets — minimum 44x44px for all interactive elements */
button, a, [role="button"], input {
  min-height: 44px;
  min-width: 44px;
}

/* Exception for inline text links — they can be smaller */
p a, li a { 
  min-height: unset; 
  min-width: unset; 
}

/* Keyboard navigation indicator for cards */
.project-card:focus-within {
  border-color: var(--accent-cyan);
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Ensure form inputs (terminal) have visible focus */
input:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 0;
  border-radius: 2px;
}

/* High contrast mode support */
@media (forced-colors: active) {
  .status-dot { 
    forced-color-adjust: none; 
    background: Highlight; 
  }
}

html { 
  scroll-behavior: smooth;
  /* Reserve scrollbar gutter so the viewport width never changes when a
     page scrollbar appears or disappears — prevents the fixed navbar
     links from shifting horizontally between pages. */
  scrollbar-gutter: stable;
}

body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-color: #0a0f1a; /* belt-and-suspenders: no white flash before --bg-base loads */
  background: var(--bg-base);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ── LAYOUT UTILITIES (Tailwind-compatible; CDN removed for CSP) ── */
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.max-w-5xl { max-width: 64rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-xl { max-width: 36rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-0 { gap: 0; }
.gap-12 { gap: 3rem; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { flex-direction: column; }
.inline-flex { display: inline-flex; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.space-y-0 > * + * { margin-top: 0; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-24 > * + * { margin-top: 6rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-12 { padding-top: 3rem; }
.pt-16 { padding-top: 4rem; }
.pt-24 { padding-top: 6rem; }
.pt-28 { padding-top: calc(56px + env(safe-area-inset-top, 0px)); }
.pb-4 { padding-bottom: 1rem; }
.pb-8 { padding-bottom: 2rem; }
.pb-12 { padding-bottom: 3rem; }
.pl-6 { padding-left: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-auto { margin-top: auto; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }
.border-l-2 { border-left-width: 2px; border-left-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.h-px { height: 1px; }
.w-2 { width: 0.5rem; }
.w-3 { width: 0.75rem; }
.w-5 { width: 1.25rem; }
.w-8 { width: 2rem; }
.w-20 { width: 5rem; }
.h-8 { height: 2rem; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-50 { z-index: 50; }
.block { display: block; }
.inline-block { display: inline-block; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overflow-hidden { overflow: hidden; }
.last\:border-0:last-child { border: 0; }
.last\:border-r-0:last-child { border-right-width: 0; }
.last\:pb-0:last-child { padding-bottom: 0; }
.hidden { display: none; }
.relative { position: relative; }
.group { /* Tailwind group marker */ }

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-\[60\%_40\%\] { grid-template-columns: 60% 40%; }
}

@media (min-width: 640px) {
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 4. NAVBAR & BANNER */
/* Availability banner removed; keep keyframes for other UI usage */
@keyframes banner-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Writing page tag filter pills */
.tag-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.tag-pill {
  display: inline-block;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  background: transparent;
  margin: 2px;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.tag-pill:hover {
  border-color: var(--text-muted);
}
.tag-pill-active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.08);
}

/* 7. WRITING & WRITEUP DETAIL */
/* ── QA: Writeup card link (entire card tappable) ─────────────────── */
.writeup-card-link {
  color: inherit;
  display: block;
}
.writeup-card-link:hover {
  border-color: var(--accent-cyan);
}

.writeup-card-main {
  text-decoration: none;
  color: inherit;
  display: block;
}

.writeup-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: Inter, Geist, "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 140ms ease;
}

.writeup-pdf-link:hover {
  color: var(--accent-cyan);
}

.writeup-pdf-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.core-essay-card {
  border-left: 2px solid color-mix(in srgb, var(--accent-cyan) 70%, transparent);
  padding-left: 14px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-cyan) 14%, transparent),
              0 0 18px color-mix(in srgb, var(--accent-cyan) 12%, transparent);
  border-radius: 8px;
}

.core-essay-title {
  font-weight: 800;
}

.core-essay-badge {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: color-mix(in srgb, var(--accent-cyan) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-cyan) 22%, transparent);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1;
}

/* Writing page search input */
.writing-search-input {
  width: 100%;
  margin-top: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}
.writing-search-input::placeholder {
  color: var(--text-muted);
}
.writing-search-input:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

/* Writeup detail: TOC + article grid (desktop) */
.writeup-detail-layout {
  display: block;
  max-width: 64rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}
@media (min-width: 1024px) {
  .writeup-detail-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 64px;
  }
}
.writeup-toc {
  display: none;
  position: sticky;
  top: 80px;
  padding-top: 0.5rem;
}
@media (min-width: 1024px) {
  .writeup-toc {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
}
.writeup-toc-link {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.writeup-toc-link:hover {
  color: var(--text-secondary);
}
.writeup-toc-link-active {
  color: var(--accent-cyan);
}
.writeup-toc-progress {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  text-align: center;
  margin-top: auto;
  padding-top: 0.75rem;
  margin-bottom: 0;
}
.writeup-detail-content {
  min-width: 0;
}
.writeup-detail-content p {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 9. CONTACT & ONE-PAGER */
/* One-pager — recruiter 90-second summary */
.one-pager {
  font-size: 14px;
  line-height: 1.7;
  padding-top: 56px;
}
.one-pager-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}
.one-pager-section {
  margin-bottom: 2rem;
}
.one-pager-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}
.one-pager-title {
  font-size: 14px;
  color: var(--accent-cyan);
  margin: 0 0 8px 0;
  font-family: 'JetBrains Mono', monospace;
}
.one-pager-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}
.one-pager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.one-pager-sentence {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
  font-style: italic;
}
.one-pager-h2 {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  margin: 0 0 12px 0;
}
.one-pager-project-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}
.one-pager-dot {
  font-size: 14px;
  flex-shrink: 0;
}
.one-pager-project-body {
  flex: 1;
  min-width: 0;
}
.one-pager-project-title {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 2px;
}
.one-pager-project-outcome {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.one-pager-project-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.one-pager-pill {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}
.one-pager-three-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .one-pager-three-col {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
.one-pager-col {
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.one-pager-col-label {
  display: block;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}
.one-pager-certs {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.one-pager-edu-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.one-pager-edu-row {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.one-pager-edu-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-right: 6px;
}

.one-pager-edu-focus {
  margin-top: 2px;
}

.one-pager-edu-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.one-pager-edu-list li::marker {
  color: var(--accent-cyan);
}

.one-pager-edu-accent {
  color: var(--accent-cyan);
  font-weight: 600;
}

.one-pager-edu-summary {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.85;
}

.one-pager-edu-divider {
  margin: 18px 0 14px;
  border-top: 1px solid var(--border-subtle);
}

.one-pager-edu-list-certs .one-pager-edu-label {
  color: var(--accent-cyan);
}
@media print {
  .one-pager { font-size: 11px; line-height: 1.5; }
}

/* Contact page — enterprise layout (header band, two columns, footer band) */
/* Full-page top offset: navbar so content is not hidden */
.contact-page,
.about-page,
.writing-page-container,
.resume-container {
  padding-top: 56px;
}

.contact-page {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}

.contact-header {
  border-bottom: 1px solid var(--border-subtle);
  padding: 40px 0 56px;
}

.contact-header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 32px;
}

.contact-header-label {
  font-size: 11px;
  font-family: monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.contact-heading {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin: 0 0 16px;
}

.contact-subtext {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0;
  font-family: monospace;
}

.contact-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 32px 64px;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 48px;
  flex: 1;
}

.contact-left,
.contact-right {
  align-self: start;
}

.contact-divider {
  background: var(--border-subtle);
  width: 1px;
  align-self: stretch;
}

.contact-section-label {
  font-size: 10px;
  font-family: monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.contact-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0 16px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.contact-row:first-of-type {
  padding-top: 0;
}

.contact-row:last-of-type {
  border-bottom: none;
}

.contact-row-glyph {
  font-size: 14px;
  color: var(--text-muted);
  padding-top: 14px;
  font-family: monospace;
  text-align: center;
}

.contact-row-glyph.contact-glyph-in,
.contact-row-glyph.contact-glyph-gh {
  font-weight: 700;
  font-size: 12px;
}

.contact-row-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
}

.contact-row-label {
  font-size: 10px;
  font-family: monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-row-value {
  font-size: 14px;
  color: var(--accent-cyan);
  font-family: monospace;
  text-decoration: none;
  word-break: break-all;
}

.contact-row-value:hover {
  text-decoration: underline;
}

.contact-copy-btn {
  margin-top: 6px;
  font-size: 11px;
  font-family: monospace;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  padding: 4px 10px;
  cursor: pointer;
  width: fit-content;
  transition: border-color 120ms, color 120ms;
}

.contact-copy-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.contact-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 6px;
  animation: banner-pulse 2s infinite;
  vertical-align: middle;
}

.contact-want-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
}

.contact-want-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.contact-want-item:first-child {
  padding-top: 0;
}

.contact-want-item:last-child {
  border-bottom: none;
}

.contact-want-arrow {
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 12px;
  padding-top: 1px;
}

.contact-action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.contact-action-buttons a {
  padding: 10px 20px;
  font-size: 13px;
  font-family: monospace;
  border-radius: 6px;
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.contact-footer-band {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 32px;
  text-align: center;
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  background: var(--bg-surface);
}

@media (max-width: 768px) {
  .contact-header {
    padding: 40px 0 32px;
  }

  .contact-header-inner {
    padding: 0 20px;
  }

  .contact-body {
    grid-template-columns: 1fr;
    padding: 32px 20px;
    gap: 40px 0;
  }

  .contact-divider {
    width: 100%;
    height: 1px;
    align-self: auto;
  }

  .contact-footer-band {
    padding: 16px 20px;
    text-align: left;
  }

  .contact-action-buttons {
    flex-direction: column;
  }

  .contact-action-buttons a {
    width: 100%;
    justify-content: center;
  }
}

/* One-pager + legacy contact list (contact-wish-list still used there) */
.contact-wish-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}
.contact-wish-list li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding-left: 0;
}
.contact-arrow {
  color: var(--accent-cyan);
  margin-right: 0.5rem;
}

/* Resume Background timeline */
.resume-timeline {
  border-left: 1px solid var(--border);
  margin-left: 0;
  padding-left: 24px;
}
.resume-timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  align-items: start;
}

/* Dot-style timeline items (used by Professional Experience) */
.resume-timeline-dot-item {
  position: relative;
  padding-bottom: 1.5rem;
}
.resume-timeline-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  margin-left: -36px;
  float: left;
  margin-top: 4px;
}
.resume-date {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
  padding: 0;
  line-height: 1.35;
  align-self: start;
}

.resume-institution {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  padding: 0;
  line-height: 1.3;
}

.resume-degree {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 600;
  color: var(--accent-cyan);
  margin: 6px 0 0 0;
  padding: 0;
  line-height: 1.3;
}

.resume-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 0 0;
  padding: 0;
  line-height: 1.35;
}

.resume-desc {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 10px 0 0 0;
  padding: 0;
  font-size: 14px;
}
.resume-timeline-year {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  display: block;
  margin-bottom: 2px;
}
.resume-timeline-label {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}
.resume-timeline-detail {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ── NAVBAR ────────────────────────────────────────────────── */
.navbar {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  background: rgba(8, 12, 20, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 1000;
  transition: background-color 0.2s ease, border-color 0.15s ease;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

/* Nav link base state */
.nav-link {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text-body);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text-primary); }

/* Nav link active state — cyan underline only */
.nav-link-active {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid var(--accent-cyan);
  transition: color 0.2s;
  white-space: nowrap;
}

/* ── THEME TOGGLE ───────────────────────────────────────────── */
.theme-toggle-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  transition: background-color 0.2s ease, border-color 0.15s ease, color 0.15s ease;
  min-height: unset;
  min-width: unset;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-cyan);
}

/* Theme toggle SVG icons */
.theme-icon {
  display: block;
  color: var(--text-secondary);
  transition: color 150ms ease, opacity 150ms ease, transform 150ms ease;
}
.theme-icon-hidden {
  display: none;
}
.theme-toggle-btn:hover .theme-icon {
  color: var(--accent-cyan);
  transform: rotate(15deg);
}
.theme-toggle-btn:hover .theme-icon-moon {
  transform: rotate(-15deg);
}

/* About page — tech stack cards hover */
.about-card {
  transition: border-color 0.2s ease;
}
.about-card:hover {
  border-color: var(--accent-cyan);
}

.theme-toggle-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-surface);
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 8px;
  pointer-events: none;
  z-index: -1;
}
.theme-toggle-btn:hover::before {
  opacity: 1;
}
.shortcuts-toggle-btn {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
.palette-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.shortcuts-toggle-btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

/* Keyboard shortcuts modal */
.shortcuts-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 199;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.palette-scrim {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 260;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 96px 16px 16px;
}
.palette-modal {
  width: min(780px, 100%);
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.palette-header {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}
.palette-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  min-height: 40px;
}
.palette-input::placeholder {
  color: var(--text-muted);
}
.palette-results {
  max-height: 55vh;
  overflow-y: auto;
}
.palette-row {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.palette-row:last-child {
  border-bottom: none;
}
.palette-row-active {
  background: rgba(34, 211, 238, 0.08);
}
.palette-icon {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.palette-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.palette-title {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.palette-detail {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.palette-enter {
  font-size: 12px;
  color: var(--accent-cyan);
  opacity: 0;
}
.palette-row-active .palette-enter {
  opacity: 1;
}
.palette-empty {
  margin: 0;
  padding: 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.shortcuts-modal {
  max-width: 480px;
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  z-index: 200;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.shortcuts-modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
}
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}
.shortcuts-table td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  vertical-align: top;
}
.shortcuts-key {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  background: rgba(34, 211, 238, 0.15);
  padding: 4px 8px !important;
  border-radius: 4px;
  white-space: nowrap;
  width: 1%;
}
.shortcuts-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Project detail: Copy link button */
.pd-copy-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}
.pd-copy-link-btn:hover {
  color: var(--accent-cyan);
}

/* 11. UTILITY COMPONENTS */
/* ── BACK TO TOP ────────────────────────────────────────────── */
.back-to-top-wrap {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease, pointer-events 0s linear 300ms;
}
.back-to-top-wrap.btt-visible {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 300ms ease;
}
.back-to-top-ring {
  position: absolute;
  inset: 0;
  width: 40px;
  height: 40px;
  pointer-events: none;
}
.back-to-top {
  position: absolute;
  inset: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: unset;
  min-width: unset;
}
.back-to-top-glyph {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.back-to-top:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Skeleton loading (project detail 404 / loading) */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton-bar {
  background: linear-gradient(
    90deg,
    var(--border-subtle) 0%,
    var(--bg-surface) 50%,
    var(--border-subtle) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  height: 1rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.skeleton-block {
  background: linear-gradient(
    90deg,
    var(--border-subtle) 0%,
    var(--bg-surface) 50%,
    var(--border-subtle) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  height: 12rem;
  border-radius: 8px;
}
@media (prefers-color-scheme: light) {
  .skeleton-bar,
  .skeleton-block {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
  }
}
.skeleton-title-area {
  margin-bottom: 1rem;
}

/* Related projects row (project detail) */
.related-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.related-project-mini-card {
  display: block;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.related-project-mini-card:hover {
  border-left-color: var(--accent-cyan);
  color: var(--text-primary);
}
.related-project-mini-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.related-project-mini-label {
  display: block;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.related-project-mini-cta {
  font-size: 12px;
  color: var(--accent-cyan);
}

/* ── READING PROGRESS BAR ──────────────────────────────────── */
.reading-progress-bar {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-subtle);
  z-index: 100;
}

.reading-progress-fill {
  height: 100%;
  background: var(--accent-cyan);
  transition: width 0.1s linear;
  will-change: width;
}

/* ── PAGE TRANSITIONS ──────────────────────────────────────── */
.page-enter {
  animation: pageEnter 150ms ease forwards;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(6px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* ── PREFERS REDUCED MOTION ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes pageEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── TERMINAL ───────────────────────────────────────────────── */
.terminal-line {
  animation: terminalReveal 150ms ease forwards;
  opacity: 0;
}

@keyframes terminalReveal {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cursor-blink {
  animation: cursorBlink 1s step-end infinite;
}

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

/* ── SECTION LABELS ─────────────────────────────────────────── */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

/* ── CODE SNIPPET ───────────────────────────────────────────── */
/* 12. CODE BLOCKS & SYNTAX HIGHLIGHTING */
/* ── CODE BLOCK — Claude scheme ─────────────────────────────── */
.code-block {
  position: relative;
  background: #1a1f2e;
  border: 1px solid #2a3347;
  border-radius: 8px;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s;
}
.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color 120ms ease;
}
.code-copy-btn:hover {
  color: var(--accent-cyan);
}
@media (max-width: 768px) {
  .code-block {
    display: flex;
    flex-direction: column;
  }
  .code-copy-btn {
    position: static;
    display: block;
    margin-left: auto;
    margin-bottom: 8px;
    width: fit-content;
  }
}
.code-header {
  background: #141824;
  border-bottom: 1px solid #2a3347;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.code-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.code-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: #636b78;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.code-sep {
  color: #2a3347;
  font-size: 10px;
  flex-shrink: 0;
}
.code-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #76b3fa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-copy {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #636b78;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cb-copy:hover  { color: #adbac7; background: rgba(255,255,255,0.05); }
.cb-copy.copied { color: #7ec8a4; }
.code-body {
  padding: 16px 20px;
  background: #1a1f2e;
  overflow-x: auto;
}
.code-body pre {
  margin: 0;
  padding: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(11px, 1.5vw, 13px);
  line-height: 1.7;
  color: #adbac7;
  white-space: pre;
  overflow-x: auto;
  background: none;
}

/* ── Token colours — dark theme (default) ───────────────────── */
.tok-kw    { color: #cf8dfc; }
.tok-str   { color: #7ec8a4; }
.tok-cmt   { color: #636b78; font-style: italic; }
.tok-num   { color: #e5a96d; }
.tok-fn    { color: #76b3fa; }
.tok-ty    { color: #e8912d; }
.tok-op    { color: #adbac7; }
.tok-var   { color: #adbac7; }
.tok-attr  { color: #636b78; font-style: italic; }
.tok-const { color: #e5a96d; }
.tok-param { color: #e5a96d; }
.tok-yk    { color: #76b3fa; }
.tok-yv    { color: #7ec8a4; }

/* ── ARCHITECTURE SVG DIAGRAM ───────────────────────────────── */
.arch-diagram {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  background: var(--bg-surface);
  padding: 1.875rem;
}

/* ── TIMELINE ───────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.625rem;
  top: 0; 
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.875rem;
  top: 0.4375rem;
  width: 10px; 
  height: 10px;
  border-radius: 50%;
  background: var(--cyan-bright);
  border: 1px solid var(--border-subtle);
}

.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: var(--cyan-bright);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.3125rem;
}

.timeline-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4375rem;
}

.timeline-body {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ── BEFORE/AFTER COMPARISON ────────────────────────────────── */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.comparison-before {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  padding: 1.5625rem;
}

.comparison-after {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  padding: 1.5625rem;
}

.comparison-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── CERTIFICATIONS ─────────────────────────────────────────── */
.cert-badge {
  display: flex;
  align-items: center;
  gap: 0.9375rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  padding: 1.25rem;
  transition: border-color 150ms ease;
}

.cert-badge:hover {
  border-color: var(--border-active);
}

.cert-icon {
  width: 50px; 
  height: 50px;
  border-radius: 0.5rem;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ── METRIC CARD ────────────────────────────────────────────── */
.metric-card {
  opacity: 1;
  transform: none;
}

/* ── PROJECT CARD ───────────────────────────────────────────── */
.project-card-enter {
  opacity: 1;
  transform: none;
}

/* ── CONTENT VISIBILITY ──────────────────────────────────────── */
/* Content-visibility for below-fold sections */
.project-grid {
  content-visibility: auto;
  contain-intrinsic-size: 0 800px;
}

.certifications-section {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

/* 5. HOME PAGE & PROJECT CARDS */
/* ── PROJECT CARDS ───────────────────────────────────────────── */
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  transition: background-color 0.2s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s;
  contain: layout style;
}
.project-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* Line clamp for descriptions */
.project-card-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── HOME PAGE REDESIGN (enterprise / Linear-style) ───────────── */
.home-main { background: var(--bg-base); }
.home-page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
}
.hero-section { padding: 80px 0; }
.projects-section + .certifications-section { margin-top: 80px; }
.certifications-section + .home-footer { margin-top: 80px; }

/* Hero */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 60% 40%; }
}
.hero-left { }
.hero-name {
  font-size: clamp(24px, 7.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  word-break: break-word;
  overflow-wrap: break-word;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.hero-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 8px 0 0 0;
  font-family: 'JetBrains Mono', monospace;
}
.hero-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
  max-width: 520px;
  margin: 1.5rem 0 0 0;
}
.hero-meta {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  margin: 1rem 0 0 0;
}
.hero-meta-sep { color: var(--border); padding: 0 0.25rem; }
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  font-family: 'JetBrains Mono', monospace;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.hero-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}
.hero-stats {
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hero-stat {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 1rem 1.25rem;
}
.hero-stat:last-child { border-bottom: 1px solid var(--border); }
.hero-stat-label {
  display: block;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.hero-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Projects header */
.projects-header { margin-bottom: 0; }
.projects-eyebrow {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
  margin: 0 0 8px 0;
}
.projects-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 24px 0;
}

/* Filter tabs — single row, no wrap */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 48px;
  overflow-x: auto;
}
.filter-tab {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.filter-tab:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}
.filter-tab-active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: var(--bg-surface);
  border-bottom: 2px solid var(--accent-cyan);
}
.filter-tab-sep {
  color: var(--border);
  font-size: 9px;
  padding: 0 2px;
  user-select: none;
  flex-shrink: 0;
}
.filter-tab-count {
  display: inline-block;
  font-size: 10px;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}
html.light .filter-tab-count {
  background: rgba(0, 0, 0, 0.06);
}

/* Category sections */
.category-section { margin-bottom: 3rem; }
.category-section-hidden { display: none !important; }
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.category-name {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin: 0 0 0.25rem 0;
}
.category-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.category-count {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Project cards grid */
.project-cards-grid {
  display: grid;
  gap: 1.5rem;
}
.project-cards-grid-double {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .project-cards-grid-double { grid-template-columns: repeat(2, 1fr); }
}
.project-cards-grid-single {
  grid-template-columns: 1fr;
  max-width: 42rem;
}

/* Project card (home page) */
.project-card-link { display: block; text-decoration: none; color: inherit; }
.project-card-article {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
  position: relative;
}
.project-card-article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--accent-cyan)), transparent);
  opacity: 0;
  transition: opacity 150ms ease;
  border-radius: 8px 8px 0 0;
  pointer-events: none;
}
.project-card-article:hover {
  border-color: var(--card-accent, color-mix(in srgb, var(--accent-cyan) 13%, transparent));
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.project-card-article:hover::before {
  opacity: 1;
}
.project-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.project-card-status-chip {
  position: static;
  flex-shrink: 0;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 2px;
  pointer-events: none;
}
.project-card-article:focus-within {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
.project-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}
.project-card-subtitle {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  margin: 0 0 12px 0;
}
.project-card-article .project-card-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 0 0 1rem 0;
}
.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.project-card-tag {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.project-card-cta {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  text-decoration: none;
  margin-top: auto;
  padding-top: 1rem;
  display: inline-block;
  transition: text-decoration 0.2s, transform 150ms ease;
}
.project-card-article:hover .project-card-cta {
  text-decoration: underline;
  transform: translateX(4px);
}
@media (prefers-reduced-motion: reduce) {
  .project-card-article,
  .project-card-article::before,
  .project-card-cta {
    transition: none;
    transform: none;
  }
  .project-card-article:hover .project-card-cta {
    transform: none;
  }
}

/* Certifications (home page) */
.home-page-wrap .certifications-section {
  border-top: 1px solid var(--border);
  padding-top: 3rem;
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}
.cert-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.cert-section-name {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin: 0;
}
.cert-section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.cert-list { }
.home-page-wrap .certifications-section .cert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.cert-name {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cert-issuer {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 1rem;
  flex-shrink: 0;
}
.cert-status {
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.cert-status-pursuing {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid #3b82f6;
  color: #3b82f6;
}
.cert-status-studying {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid #8b5cf6;
  color: #8b5cf6;
}
.cert-status-interested,
.cert-status-completed {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  color: #10b981;
}
.cert-status-default {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Home footer */
.home-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.home-footer-left {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.home-footer-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.home-footer-link {
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  transition: color 0.2s;
}
.home-footer-link:hover {
  color: var(--accent-cyan);
}
.home-footer-sep {
  color: var(--border);
  user-select: none;
}
.telemetry-status-link {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
}
.telemetry-status-link:hover {
  color: var(--accent-cyan);
}

/* Telemetry dashboard */
.telemetry-page {
  background: var(--bg-base);
}
.telemetry-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 64px;
}
.telemetry-head {
  margin-bottom: 24px;
}
.telemetry-kicker {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin: 0 0 10px;
}
.telemetry-title {
  margin: 0 0 10px;
}
.telemetry-subtitle {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 780px;
}
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.telemetry-card,
.telemetry-logs {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
}
.telemetry-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.telemetry-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}
.telemetry-label {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.telemetry-state {
  margin-left: auto;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: #22c55e;
  letter-spacing: 0.06em;
}
.telemetry-value {
  font-size: 20px;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.telemetry-meta {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.telemetry-ua {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.telemetry-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.telemetry-list li {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 8px;
}
.telemetry-terminal {
  margin: 0;
  min-height: 220px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #0b1320;
  color: #b6c8dc;
  font-size: 12px;
  line-height: 1.6;
  font-family: 'JetBrains Mono', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 6. PROJECT DETAIL PAGE */
/* ── PROJECT DETAIL PAGES (Docs & Demo) ───────────────────────── */
.pd-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 48px;
}
.pd-breadcrumb {
  padding-top: 80px;
  margin-bottom: 40px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pd-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.pd-breadcrumb a:hover { color: var(--accent-cyan); }
.pd-back {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.pd-back:hover { color: var(--accent-cyan); }

/* Project header block */
.pd-header {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.pd-header-cat {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  margin: 0 0 8px 0;
}
.pd-header-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  line-height: 1.2;
}
.pd-header-subtitle {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}
.pd-header-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pd-pill {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Section label (cyan + line) — same as About */
.pd-section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.pd-section-label span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  white-space: nowrap;
}
.pd-section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Architecture diagram */
.pd-diagram-wrap {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 48px;
}
.pd-diagram-wrap [inner_html] { max-width: 100%; }
.pd-diagram-inner { text-align: center; max-width: 100%; overflow-x: auto; }

/* Prose / overview */
.pd-prose {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.9;
  max-width: 680px;
  margin: 0 0 48px 0;
}

/* Solution sections (numbered breakdown) */
.pd-solution-item {
  border-left: 2px solid var(--border);
  padding-left: 24px;
  margin-bottom: 32px;
  transition: border-color 0.2s;
}
.pd-solution-item:hover { border-left-color: var(--accent-cyan); }
.pd-solution-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px 0;
}
.pd-solution-body {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
  margin: 0;
}

/* Code block (project detail style) */
.pd-code-wrap {
  margin-bottom: 48px;
}
.pd-code-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.pd-code-filename {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}
.pd-code-lang {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid var(--accent-cyan);
  border-radius: 3px;
  padding: 3px 10px;
}
.pd-code-container {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px 28px;
  overflow-x: auto;
}
.pd-code-container .code-header {
  display: none;
}
.pd-code-container .code-body,
.pd-code-container pre {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  margin: 0;
  background: none;
}

/* Outcomes list */
.pd-outcomes-list { margin-bottom: 48px; }
.pd-outcome-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pd-outcome-bullet {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-cyan);
  margin-top: 7px;
  flex-shrink: 0;
}
.pd-outcome-text {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

/* Before/After */
.pd-ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 48px;
}
.pd-ba-col {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
}
.pd-ba-col-header {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.pd-ba-before { color: var(--text-muted); }
.pd-ba-after { color: var(--accent-cyan); }
.pd-ba-col p { color: var(--text-muted); font-size: 13px; line-height: 1.8; margin: 0; }

/* Timeline */
.pd-timeline { margin-bottom: 48px; }
.pd-timeline-list { position: relative; padding-left: 20px; }
.pd-timeline-item:last-child { padding-bottom: 0; }
.pd-timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--accent-cyan);
}
.pd-timeline-line {
  position: absolute;
  left: -17px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.pd-timeline-item:last-child .pd-timeline-line { display: none; }
.pd-timeline-phase { color: var(--text-primary); font-size: 13px; font-weight: 600; margin: 0 0 4px 0; }
.pd-timeline-desc { color: var(--text-muted); font-size: 12px; margin: 0; line-height: 1.6; }

/* Challenge / deep-dive cards */
.pd-challenge-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 12px;
}
/* Footer nav */
.pd-footer-nav {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  margin-top: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.pd-footer-left .pd-back { display: inline-block; }
.pd-footer-center { display: flex; align-items: center; gap: 0.75rem; }
.pd-footer-right { }
.pd-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--accent-cyan);
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  font-family: 'JetBrains Mono', monospace;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.pd-footer-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ── PROJECT DETAIL (Case study) — single-column layout ────────── */
.pd-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 32px 96px;
}
@media (max-width: 768px) {
  .pd-container { padding: 24px 16px 64px; }
}

.pd-breadcrumb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  font-size: 12px;
  font-family: monospace;
  color: var(--text-muted);
}

.pd-breadcrumb-row a {
  color: var(--text-muted) !important;
  text-decoration: none;
  transition: color 0.2s;
}
.pd-breadcrumb-row a:hover {
  color: var(--accent-cyan) !important;
}

.pd-container .pd-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
}
.pd-category-label {
  font-size: 11px;
  font-family: monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.pd-title {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--text-primary);
}
.pd-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  font-family: monospace;
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 640px;
}
.pd-tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pd-tech-pills span {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted);
}

.pd-section {
  margin-bottom: 32px;
}
.pd-section:last-of-type { margin-bottom: 0; }
.pd-section-heading {
  font-size: 11px;
  font-family: monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.pd-body-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0;
}
.pd-body-text + .pd-body-text { margin-top: 12px; }

.pd-stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 24px 0;
  align-items: stretch;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.pd-stat-item {
  flex: 1;
  min-width: 140px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* aligns value + label */
  height: 100%;
}
.pd-stat-value {
  font-size: 20px;
  font-weight: 700;
  font-family: monospace;
  color: var(--text-primary) !important; /* overrides any inline style color */
  display: block;
  line-height: 1.2;
}
.pd-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  letter-spacing: 1.1px;
  margin-top: 0;
  display: block;
}
@media (max-width: 768px) {
  .pd-stat-item {
    flex: 1 1 50%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.pd-container .pd-diagram-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 32px 24px;
  overflow-x: auto;
  margin-bottom: 0;
}
.pd-container .pd-diagram-wrap [inner_html] { max-width: 100%; }

.pd-challenge {
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 16px;
}
.pd-challenge:last-child { margin-bottom: 0; }
.pd-challenge-title {
  font-size: 13px;
  font-weight: 600;
  font-family: monospace;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.pd-challenge-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}
.pd-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.pd-timeline-item:last-child { border-bottom: none; }

.pd-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pd-timeline-week {
  font-size: 11px;
  font-family: monospace;
  color: var(--accent-cyan);
  padding-top: 2px;
  white-space: nowrap;
}
.pd-timeline-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.pd-before-after {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 0;
}
.pd-before, .pd-after {
  padding: 16px 20px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.pd-before {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid var(--border);
}
.pd-after {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid var(--border);
}
.pd-before-label, .pd-after-label {
  font-size: 10px;
  font-family: monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.pd-before-label { color: rgba(239, 68, 68, 0.7); }
.pd-after-label { color: rgba(16, 185, 129, 0.7); }
@media (max-width: 768px) {
  .pd-before-after { flex-direction: column; }
}

.pd-lessons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pd-lesson-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.pd-lesson-num {
  font-family: monospace;
  font-size: 11px;
  color: var(--accent-cyan);
  padding-top: 2px;
}

.pd-container .related-projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pd-container .related-project-mini-card {
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--rp-accent, var(--accent-cyan));
  border-radius: 0 6px 6px 0;
  text-decoration: none;
  display: block;
  transition: border-color 150ms;
  color: var(--text-secondary);
}
.pd-container .related-project-mini-card:hover {
  border-color: var(--rp-accent, var(--accent-cyan));
  color: var(--text-primary);
}
@media (max-width: 768px) {
  .pd-container .related-projects-grid { grid-template-columns: 1fr; }
}

/* ── ENTERPRISE DOCS (ProjectDocsPage) ─────────────────────────── */
.edocs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 48px;
}
.edocs-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
}
.edocs-sidebar-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px 0;
}
.edocs-sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 16px 0;
}
.edocs-nav-link {
  display: block;
  padding: 6px 0;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  text-decoration: none;
  cursor: pointer;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -10px;
  transition: color 0.2s, border-color 0.2s;
}
.edocs-nav-link:hover {
  color: var(--accent-cyan);
}
.edocs-nav-link-active {
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
}
.edocs-main { min-width: 0; }
.edocs-breadcrumb {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.edocs-breadcrumb-sep { color: var(--border); user-select: none; }
.edocs-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.edocs-breadcrumb a:hover { color: var(--accent-cyan); }
.edocs-page-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 8px 0 0 0;
  line-height: 1.2;
}
.edocs-page-subtitle {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  margin: 0 0 16px 0;
}
.edocs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.edocs-pill {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.edocs-header-divider {
  height: 2px;
  background: var(--border);
  margin: 32px 0;
}
.edocs-sec-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.edocs-sec-label span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  white-space: nowrap;
}
.edocs-sec-line { flex: 1; height: 1px; background: var(--border); }
.edocs-diagram-wrap {
  background: #050810;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 40px;
  margin-bottom: 48px;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
}
.edocs-diagram-inner { text-align: center; max-width: 100%; overflow-x: auto; }
.edocs-prose {
  max-width: 640px;
  margin: 0 0 48px 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.9;
}
.edocs-prose p { margin: 0 0 1em 0; color: var(--text-muted); }
.edocs-prose p::first-line { color: var(--text-primary); }
.edocs-solution-block {
  position: relative;
  margin-bottom: 32px;
  padding-right: 20px;
}
.edocs-solution-num {
  position: absolute;
  font-size: 120px;
  color: #0d1320;
  font-weight: 900;
  right: -20px;
  top: -20px;
  line-height: 1;
  pointer-events: none;
}
.edocs-solution-title {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
}
.edocs-solution-body {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.9;
  margin: 0;
}
.edocs-code-block {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 48px;
}
.edocs-code-bar {
  background: #050810;
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.edocs-code-filename {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}
.edocs-code-lang {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
}
.edocs-code-body {
  background: #050810;
  padding: 24px;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  overflow-x: auto;
}
.edocs-code-body .code-header { display: none; }
.edocs-code-body pre { margin: 0; background: none; font-size: inherit; line-height: inherit; color: inherit; }
.edocs-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 48px;
}
.edocs-stat-cell {
  background: var(--bg-base);
  padding: 24px;
  text-align: center;
}
.edocs-stat-value {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.edocs-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-top: 6px;
}
.edocs-timeline {
  border-left: 1px solid var(--border);
  margin-left: 8px;
  padding-left: 28px;
  margin-bottom: 48px;
}
.edocs-timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.edocs-timeline-item:last-child { padding-bottom: 0; }
.edocs-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  margin-left: -36px;
  float: left;
  margin-top: 4px;
}
.edocs-timeline-phase {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 2px 0;
}
.edocs-timeline-meta {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  margin: 0 0 4px 0;
}
.edocs-timeline-desc {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
  line-height: 1.6;
}
.edocs-deep-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.edocs-deep-item:last-child { border-bottom: none; }
.edocs-deep-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.edocs-deep-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.edocs-deep-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 10px;
  transition: transform 0.2s;
}
.edocs-deep-open .edocs-deep-arrow { transform: rotate(90deg); }
.edocs-deep-body {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.8;
  margin: 12px 0 0 0;
  padding-top: 12px;
  border-top: 1px solid #0d1320;
}
.edocs-footer {
  background: #050810;
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 32px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  align-items: center;
}
.edocs-footer-left { display: flex; align-items: center; }
.edocs-footer-center { display: flex; align-items: center; justify-content: center; gap: 12px; }
.edocs-footer-right { display: flex; align-items: center; justify-content: flex-end; }
.edocs-footer-link {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.edocs-footer-link:hover { color: var(--accent-cyan); }
.edocs-footer-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 20px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.edocs-footer-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ── CERTIFICATIONS ──────────────────────────────────────────── */
.cert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
  text-align: center;
}

footer a {
  color: var(--text-muted);
  transition: color 0.15s;
}

footer a:hover {
  color: var(--text-primary);
}

/* 8. RESUME PAGE */
/* ── RESUME PRINT ───────────────────────────────────────────── */
@media print {
  .navbar,
  .back-to-top-wrap,
  .reading-progress-bar,
  .home-footer,
  .one-pager-print-btn,
  .theme-toggle-btn,
  .resume-header-actions,
  .resume-header-actions button,
  .telemetry-status-link,
  footer {
    display: none !important;
  }

  html,
  body,
  main,
  .resume-container,
  .max-w-3xl,
  .max-w-4xl,
  .max-w-5xl,
  .max-w-2xl {
    background: #fff !important;
    color: #000 !important;
  }

  body {
    font-size: 10.5pt !important;
    font-family: Inter, Arial, Helvetica, sans-serif !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  main,
  .resume-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  h1, h2, h3, h4 {
    color: #000 !important;
    font-weight: 700 !important;
    font-family: Inter, Arial, Helvetica, sans-serif !important;
  }
  h1 { font-size: 20pt !important; margin: 0 0 2pt !important; }
  h2 { font-size: 10pt !important; letter-spacing: 0.06em !important; }
  h3 { font-size: 10.5pt !important; }

  p, li, span, div {
    color: #111 !important;
    font-size: 9.6pt !important;
  }

  code, .font-mono, pre, .resume-date, .resume-meta, .resume-timeline-year {
    font-family: "JetBrains Mono", ui-monospace, monospace !important;
  }

  a {
    color: #000 !important;
    text-decoration: none !important;
  }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8.5pt;
  }
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 8.5pt;
  }
  a[href^="#"]::after,
  a[href^="javascript:"]::after { content: none !important; }
  .navbar a::after { content: none !important; }

  .resume-header {
    margin: 0 0 8pt !important;
  }
  .resume-header > a {
    display: none !important;
  }

  /* Grid-to-page conversion for clean print flow */
  .resume-timeline {
    display: block !important;
    border-left: none !important;
    padding-left: 0 !important;
  }
  .resume-timeline-item {
    display: block !important;
    margin: 0 0 8pt !important;
    gap: 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .resume-date {
    margin: 0 0 2pt !important;
    font-size: 8.5pt !important;
    color: #444 !important;
  }
  .resume-institution,
  .resume-degree,
  .resume-meta,
  .resume-desc {
    margin-bottom: 2pt !important;
  }

  /* Keep entries intact */
  .resume-timeline-dot-item,
  .resume-project-card,
  .pb-8,
  .project-card-article,
  .resume-skills-grid > div {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Technical Mastery Matrix readability in print */
  .resume-skills-grid {
    display: block !important;
  }
  .resume-skills-grid,
  .resume-skills-grid > div,
  .resume-skills-grid span,
  .resume-skill-pills,
  .resume-skill-pill {
    font-size: 9.5pt !important;
    line-height: 1.2 !important;
  }
  .resume-skills-grid > div {
    margin-bottom: 3pt !important;
  }
  .resume-skill-pills {
    gap: 4pt !important;
  }

  /* Vertical rhythm compression for single-page print */
  .space-y-4 > * + * {
    margin-top: 4pt !important;
  }
  .space-y-8 > * + * {
    margin-top: 6pt !important;
  }
  .resume-project-card {
    padding-bottom: 4pt !important;
    margin-bottom: 4pt !important;
  }
  .resume-timeline-dot-item {
    margin-bottom: 3pt !important;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  @page {
    margin: 0.4in;
  }
}

/* ── MOBILE RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-title { 
    font-size: 3rem !important; 
  }
  .writeup-detail-layout {
    grid-template-columns: 1fr;
  }
  .writeup-toc {
    display: none;
  }

  .telemetry-bar {
    flex-direction: column;
    gap: 0.9375rem;
    align-items: flex-start !important;
  }

  .telemetry-secure-link { 
    display: none; 
  }

  .project-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .comparison-grid {
    grid-template-columns: 1fr !important;
  }

  .detail-header h1 {
    font-size: 2.5rem !important;
  }
}

@media (max-width: 480px) {
  .hero-title { 
    font-size: 2.25rem !important; 
  }
  .stat-grid { 
    grid-template-columns: 1fr !important; 
  }
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { 
  width: 8px; 
}

::-webkit-scrollbar-track { 
  background: var(--bg-base); 
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
  /* Removed background-color transition - causes layout recalculation */
}

::-webkit-scrollbar-thumb:hover { 
  background: var(--border-active); 
}

/* ── SELECTION ──────────────────────────────────────────────── */
::selection {
  background: color-mix(in srgb, var(--accent-cyan) 20%, transparent);
  color: var(--text-primary);
}

/* ── RELATED SKILLS SIDEBAR ─────────────────────────────────── */
.skills-sidebar {
  position: sticky;
  top: 100px;
  align-self: flex-start;
}

/* ── UTILITY ────────────────────────────────────────────────── */
.font-mono { 
  font-family: 'JetBrains Mono', monospace; 
}

.divider-emerald {
  height: 1px;
  background: var(--border-subtle);
}

/* 13. ANIMATIONS & KEYFRAMES */
/* ── ANIMATIONS ──────────────────────────────────────────────── */
.animate-fade-in {
  animation: fadeInText 0.15s ease-out forwards;
}

@keyframes fadeInText {
  from { 
    opacity: 0; 
    transform: translateY(-2px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* ── DOCS & DEMO PAGE — ENTERPRISE LAYOUT ──────────────────── */

/* Sidebar TOC link — hover adds left border accent */
.docs-toc-link:hover {
  border-left: 2px solid var(--accent-cyan);
  margin-left: -1px;
  padding-left: calc(1rem - 1px);
}

/* Section divider ruler — number + horizontal line */
.section-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.section-rule-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  flex-shrink: 0;
}
.section-rule-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Prerequisite tech badge */
.prereq-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s ease;
}
.prereq-badge:hover {
  border-color: var(--accent-cyan);
}

/* Lesson callout card */
.lesson-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s ease;
}
.lesson-card:hover {
  border-color: var(--accent-cyan);
}

/* Demo step connector */
.step-connector {
  position: absolute;
  left: 0.875rem;   /* center of the 7px circle */
  top: 1.75rem;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
}

/* Demo terminal card — always dark regardless of theme */
.demo-terminal {
  background: #060b12;
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* Light mode: keep terminal dark for authenticity */
html.light .demo-terminal {
  background: var(--bg-base);
  border-color: #cbd5e1;
}

/* Light mode: docs page TOC sidebar */
html.light aside nav ul {
  border-left-color: var(--border-subtle);
}
html.light aside nav ul a {
  color: var(--text-secondary);
}
html.light aside nav ul a:hover {
  color: var(--accent-cyan);
}

/* Light mode: outcome metric cards on docs/demo */
html.light .p-6.rounded-xl {
  background: #ffffff;
  border-color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
html.light .p-6.rounded-xl:hover {
  border-color: var(--accent-cyan);
}

/* Light mode: before/after table */
html.light .rounded-xl.border .grid .bg-\[var\(--bg-elevated\)\] {
  background: #f1f5f9;
}
html.light .rounded-xl.border .grid .bg-\[var\(--bg-surface\)\] {
  background: #ffffff;
}

/* Light mode: lesson callout cards */
html.light .lesson-card {
  background: #ffffff;
  border-color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Smooth scroll on the whole document */
html {
  scroll-behavior: smooth;
}

/* Generous scroll offset for fixed navbar */
[id] {
  scroll-margin-top: 5rem;
}

/* Focus ring for TOC links */
aside a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Tabular numbers for section counters */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE OPTIMIZATION — breakpoints: 480px, 768px, 1024px
   ═══════════════════════════════════════════════════════════════ */

/* ── QA: Navbar drawer scrim ────────────────────────────────────── */
.navbar-drawer-scrim {
  display: none;
}
@media (max-width: 768px) {
  .navbar-drawer-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 97;
    background: rgba(0, 0, 0, 0.4);
  }
}

/* ── 1. NAVBAR (max-width: 768px) ───────────────────────────────── */
@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
    height: 52px;
    justify-content: space-between;
  }
  .navbar-links {
    display: none !important;
  }
  .navbar-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
  }
  .navbar-mobile-drawer {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(8, 12, 20, 0.98);
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 0 max(16px, env(safe-area-inset-bottom));
    z-index: 150;
  }
  .navbar-mobile-drawer.nav-open {
    display: flex;
    flex-direction: column;
  }
  .navbar-mobile-drawer a {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    min-height: 44px;
    font-size: 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 120ms ease, color 120ms ease;
    touch-action: manipulation;
  }
  .navbar-mobile-drawer a:last-child {
    border-bottom: none;
  }
  .navbar-mobile-drawer a.active,
  .navbar-mobile-drawer a:active {
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.06);
  }
}
@media (min-width: 769px) {
  .navbar-mobile-toggle { display: none; }
  .navbar-mobile-drawer { display: none !important; }
}

/* ── 2. BANNER (max-width: 480px) ───────────────────────────────── */
@media (max-width: 480px) {
  /* Availability banner removed */
}

/* ── QA: Terminal overflow on mobile ────────────────────────────── */
@media (max-width: 768px) {
  .terminal-glow {
    margin: 0 -4px;
    border-radius: 6px;
    font-size: 11px;
  }
  .terminal-glow pre,
  .terminal-line,
  .terminal-output {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  .terminal-input-row {
    flex-wrap: wrap;
  }
}

/* ── 3. HOME HERO (max-width: 768px) ─────────────────────────────── */
@media (max-width: 768px) {
  .hero-section,
  .hero-container,
  section[class*="hero"] {
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 80px;
  }
  .hero-section {
    padding-bottom: 40px;
    text-align: left;
  }
  .hero-name {
    font-size: clamp(26px, 8vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .hero-title {
    font-size: 14px;
    letter-spacing: 1px;
  }
  .hero-body,
  .hero-description {
    font-size: 14px;
    line-height: 1.7;
  }
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 32px;
    border-left: none;
    padding-left: 0;
  }
  .hero-stat {
    padding: 12px;
  }
  .hero-actions,
  .hero-buttons {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .hero-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    min-height: 44px;
    touch-action: manipulation;
  }
}

/* ── 4. FILTER TABS + PROJECT GRID (max-width: 768px) ────────────── */
@media (max-width: 768px) {
  .filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 4px;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 11px;
    min-height: 36px;
  }
  .project-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 20px;
  }
  .project-card-article {
    padding: 24px;
  }
}

/* ── 5. PROJECT DETAIL (max-width: 768px) ───────────────────────── */
@media (max-width: 768px) {
  .pd-container {
    padding: 24px 20px 64px;
  }
  .pd-stat-bar {
    flex-direction: column;
  }
  .pd-stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 16px;
  }
  .pd-stat-item:last-child { border-bottom: none; }
  .pd-before-after {
    grid-template-columns: 1fr;
  }
  .pd-timeline-item {
    grid-template-columns: 60px 1fr;
    gap: 12px;
  }
  .code-block pre,
  .pd-container .code-block pre {
    font-size: 12px;
    overflow-x: auto;
    white-space: pre;
    -webkit-overflow-scrolling: touch;
  }
  .pd-diagram-wrap {
    padding: 16px 12px;
    overflow-x: auto;
  }
  .pd-diagram-wrap svg {
    min-width: 480px;
  }
  .pd-container .related-projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 6. WRITING PAGE (max-width: 768px) ─────────────────────────── */
@media (max-width: 768px) {
  .writing-page-container {
    padding: 24px 20px;
  }
  .writing-page-container > section h1 {
    font-size: clamp(24px, 7vw, 32px);
  }
  .writing-page-container > section > p:last-child {
    line-height: 1.6;
    margin-bottom: 24px;
  }
  .writing-search-input {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    margin-top: 1rem;
    margin-left: 0;
    margin-right: 0;
  }
  .tag-pills-row {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0 12px;
    gap: 10px;
  }
  .tag-pills-row::-webkit-scrollbar { display: none; }
  .tag-pill {
    white-space: nowrap;
    min-height: 44px;
    padding: 6px 12px;
  }
  .writeup-card {
    padding: 20px 0;
  }
  .writeup-card + .writeup-card {
    margin-top: 32px;
  }
  .writeup-card > div:first-child {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .writeup-card-tags {
    flex-wrap: wrap;
    gap: 4px;
  }
}

/* ── 7. WRITEUP DETAIL (1024px: hide TOC; 768px: content) ───────── */
@media (max-width: 1024px) {
  .writeup-detail-layout {
    grid-template-columns: 1fr;
  }
  .writeup-toc {
    display: none;
  }
}
@media (max-width: 768px) {
  .writeup-detail-content {
    padding: 0 20px;
  }
  .writeup-detail-header {
    padding: 32px 20px 24px;
  }
  .writeup-title {
    font-size: clamp(22px, 6vw, 32px);
  }
  .writeup-subtitle {
    font-size: 14px;
  }
  .writeup-meta-row {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
  }
  .writeup-section-heading {
    font-size: 16px;
  }
  .writeup-detail-content .space-y-5 p,
  .writeup-body p {
    font-size: 14px;
    line-height: 1.75;
  }
  .writeup-detail-content .code-block,
  .writeup-detail-layout .code-block {
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* ── 8. RESUME PAGE (max-width: 768px) ─────────────────────────── */
@media (max-width: 768px) {
  .resume-container {
    padding: 24px 20px 64px;
  }
  .resume-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  .resume-header-actions {
    width: 100%;
  }
  .resume-header-actions button,
  .resume-header-actions a {
    width: 100%;
    min-height: 44px;
    text-align: center;
  }
  .resume-skills-grid {
    grid-template-columns: 1fr;
  }
  .resume-skill-pills {
    gap: 4px;
  }
  .resume-skill-pill {
    font-size: 11px;
    padding: 3px 8px;
  }
  .resume-project-card {
    padding: 16px;
  }
  .resume-timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .resume-timeline-year {
    font-size: 11px;
  }
  .certs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* ── QA: Resume skill pills overflow (max-width: 480px) ──────────── */
@media (max-width: 480px) {
  .resume-skill-pill {
    font-size: 10px;
    padding: 2px 6px;
    word-break: break-word;
    max-width: 100%;
  }
  .resume-skill-pills {
    gap: 4px;
  }
}

/* ── 9. CONTACT PAGE (max-width: 768px) ────────────────────────── */
@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 32px 20px 64px;
  }
  .contact-row {
    min-height: 44px;
    padding: 12px 0;
  }
  .contact-copy-btn,
  .contact-value-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
  }
  .contact-wish-list {
    gap: 10px;
  }
  .contact-action-buttons,
  .contact-buttons {
    flex-direction: column;
    gap: 10px;
  }
  .contact-action-buttons a,
  .contact-action-buttons button,
  .contact-buttons a,
  .contact-buttons button {
    width: 100%;
    min-height: 44px;
    text-align: center;
  }
}

/* ── QA: Contact row glyph alignment (max-width: 480px) ──────────── */
@media (max-width: 480px) {
  .contact-row {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
  }
  .contact-row-glyph {
    padding-top: 2px;
  }
  .contact-row-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .contact-row-value {
    word-break: break-all;
  }
}

/* ── 10. ONE-PAGER (max-width: 768px) ───────────────────────────── */
@media (max-width: 768px) {
  .one-pager {
    padding: 32px 20px 64px;
  }
  .one-pager-name {
    font-size: clamp(24px, 7vw, 36px);
  }
  .one-pager-tech-grid,
  .one-pager-three-col {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .one-pager-project-row {
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
  }
  .one-pager-action-row,
  .one-pager-actions {
    flex-direction: column;
    gap: 10px;
  }
  .one-pager-action-row a,
  .one-pager-action-row button,
  .one-pager-actions a,
  .one-pager-actions button {
    width: 100%;
    min-height: 44px;
    text-align: center;
  }
  .one-pager-print-btn {
    width: 100%;
    min-height: 44px;
  }
  .one-pager-project-row {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 0 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .one-pager-project-dot {
    padding-top: 3px;
  }
  .one-pager-project-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .one-pager-project-title {
    font-size: 14px;
    font-weight: 600;
  }
  .one-pager-project-outcome {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
  }
  .one-pager-project-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
  }
}

/* ── 11b. PROJECT DEMO PAGE (Video Placeholder) ──────────────────── */
.pd-demo-video-placeholder {
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 18px;
}

.pd-demo-video-box {
  height: 220px;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(34, 211, 238, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid rgba(59, 130, 246, 0.20);
}

.video-placeholder {
  border: 1px dashed var(--border-subtle);
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 20px 16px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-align: center;
}

/* ── 12. 404 + ERROR BOUNDARY (max-width: 768px) ────────────────── */
@media (max-width: 768px) {
  .not-found-container {
    padding: 60px 20px;
    text-align: left;
  }
  .not-found-code {
    font-size: clamp(48px, 15vw, 96px);
  }
  .not-found-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .not-found-actions a,
  .not-found-actions button {
    width: 100%;
    min-height: 44px;
    text-align: center;
  }
}

/* ── QA: Shortcut modal width (max-width: 480px) ─────────────────── */
@media (max-width: 480px) {
  .shortcuts-modal {
    max-width: calc(100vw - 32px);
    margin: 0 16px;
    padding: 20px 16px;
  }
  .shortcuts-modal td {
    padding: 8px 6px;
    font-size: 11px;
  }
  .shortcuts-key {
    font-size: 9px;
    padding: 2px 4px;
  }
}

/* ── QA: Diagram zoom modal full-screen on mobile ────────────────── */
@media (max-width: 768px) {
  .diagram-zoom-modal-inner {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
    overflow: auto;
  }
  .diagram-zoom-modal-inner svg {
    width: auto;
    height: auto;
    min-width: 480px;
    display: block;
  }
  .diagram-zoom-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 210;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* ── QA: Footer stack on mobile (max-width: 480px) ───────────────── */
@media (max-width: 480px) {
  .home-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 24px 20px;
    font-size: 11px;
  }
  .home-footer-links {
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .telemetry-wrap {
    padding: 0 20px 40px;
  }
  .telemetry-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 13. BACK-TO-TOP (max-width: 768px) ─────────────────────────── */
@media (max-width: 768px) {
  .back-to-top-wrap {
    bottom: 20px;
    right: 16px;
  }
}

/* ── QA FIX 14: General text-overflow (max-width: 768px) ────────── */
@media (max-width: 768px) {
  .pd-breadcrumb-row {
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
  }
  .pd-category-label,
  .category-name {
    font-size: 10px;
  }
  .font-mono, [class*="mono"],
  code {
    max-width: 100%;
    overflow-wrap: break-word;
  }
  pre {
    max-width: 100%;
    overflow-wrap: break-word;
  }
  .code-block pre {
    overflow-wrap: normal;
    white-space: pre;
  }
}

/* ============================================================
   CASE STUDY COMPONENTS
   ============================================================ */

/* ── Stat bar (metrics row) ─────────────────────────────── */
.pd-stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 24px 0;
  align-items: stretch;
}

.pd-stat-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: space-between; /* aligns value + label */
  height: 100%;
}

.pd-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text-primary) !important; /* overrides any inline style color */
}

.pd-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ── Challenge blocks ───────────────────────────────────── */
.pd-challenges {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pd-challenge {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  margin-top: 12px;
}

.pd-challenge:first-child {
  margin-top: 0;
}

.pd-challenge-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

.pd-challenge-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.pd-challenge-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: #22d3ee;
}

/* ── Lessons learned ────────────────────────────────────── */
.pd-lessons {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pd-lesson-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.pd-lesson-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #22d3ee;
  letter-spacing: 0.1em;
  padding-top: 2px;
  flex-shrink: 0;
  width: 24px;
}

.pd-lesson-item p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
}

.pd-lesson-item p code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: #22d3ee;
}

/* ── Before / After ─────────────────────────────────────── */
.pd-before-after {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-top: 0;
}

.pd-before,
.pd-after {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 18px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  height: 100%;
}

.pd-before-label,
.pd-after-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.pd-before-label { color: var(--text-muted); }
.pd-after-label  { color: #22d3ee; }

@media (max-width: 640px) {
  .pd-before-after { flex-direction: column; }
}

/* Resume mobile polish: keep desktop unchanged */
@media (max-width: 768px) {
  .resume-container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .resume-container header h1 {
    font-size: clamp(24px, 8vw, 42px) !important;
    line-height: 1.08;
  }

  .resume-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .resume-header > a {
    align-self: flex-start;
  }

  .resume-header-actions {
    width: 100%;
  }

  .resume-header-actions button {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* Contact row in resume header: stack cleanly */
  .resume-container header > div[style*="white-space:nowrap"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: flex-start !important;
    white-space: normal !important;
  }

  /* Hide separator dots on mobile */
  .resume-container header > div[style*="white-space:nowrap"] span[style*="padding:0 10px"] {
    display: none !important;
  }

  /* Timeline: convert grid to stacked doc flow */
  .resume-timeline-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }

  .resume-date {
    order: -1;
    margin: 0 !important;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.4;
  }

  .resume-institution,
  .resume-degree,
  .resume-meta,
  .resume-desc,
  .resume-timeline-label,
  .resume-timeline-detail,
  .resume-container h2,
  .resume-container h3 {
    line-height: 1.4;
  }
}

/* ── Timeline ───────────────────────────────────────────── */
.pd-timeline {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  margin-left: 8px;
  padding-left: 24px;
}

.pd-timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.pd-timeline-item:last-child { padding-bottom: 0; }

.pd-timeline-item::before {
  content: '';
  position: absolute;
  left: -29px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  border: 2px solid var(--bg-base);
}

.pd-timeline-week {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #22d3ee;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.pd-timeline-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0;
}

/* ── Inline code block (case study) ────────────────────── */
/* Always dark regardless of theme */
.pd-code-container {
  background: #0d1320;
  border: 1px solid #1a2540;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
}

.pd-code-bar {
  background: #111827;
  border-bottom: 1px solid #1a2540;
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #636b78;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pd-code-body {
  padding: 16px;
  overflow-x: auto;
}

.pd-code-body pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.7;
  color: #adbac7;
  white-space: pre;
}

.pd-code-body code {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
}

/* Light mode: code blocks stay dark */
html.light .pd-code-container { background: #0d1320; border-color: #1a2540; }
html.light .pd-code-bar       { background: #111827; border-color: #1a2540; color: #636b78; }
html.light .pd-code-body pre  { color: #adbac7; }

/* ============================================================
   PROJECT CARD OVERLAY  (po-)
   ============================================================ */

.po-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  animation: po-scrim-in 180ms ease forwards;
}

@keyframes po-scrim-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.po-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 201;
  display: flex;
  flex-direction: column;
  animation: po-panel-in 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 32px 64px rgba(0, 0, 0, 0.5),
    0 8px 24px rgba(0, 0, 0, 0.3);
}

@keyframes po-panel-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 16px)) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Accent bar */
.po-accent-bar {
  height: 3px;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

/* Header */
.po-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 0;
}

.po-header-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.po-category-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.po-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

.po-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.po-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  margin-top: 2px;
}

.po-close:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-base);
}

/* Divider */
.po-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 22px 0;
  flex-shrink: 0;
}

/* Description */
.po-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding: 16px 22px 0;
  margin: 0;
}

/* Metric strip */
.po-metric-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 22px 0;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 6px;
  border-left: 3px solid #22d3ee;
}

.po-metric-icon {
  font-size: 11px;
  color: #22d3ee;
  flex-shrink: 0;
}

.po-metric-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #22d3ee;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Tech pills */
.po-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 22px 0;
}

.po-tech-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-secondary);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  letter-spacing: 0.04em;
}

/* Actions */
.po-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 22px 0;
  flex-wrap: wrap;
}

.po-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #080c14;
  background: var(--po-accent, #22d3ee);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 18px;
  text-decoration: none;
  transition: opacity 150ms ease, transform 150ms ease;
  cursor: pointer;
}

.po-btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  color: #080c14;
  text-decoration: none;
}

.po-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--accent-cyan);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 9px 16px;
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
  cursor: pointer;
}

.po-btn-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: var(--bg-base);
  text-decoration: none;
}

/* Keyboard hint */
.po-kbd-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 22px 18px;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.po-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--text-secondary);
  opacity: 1;
}

.po-kbd-sep {
  opacity: 0.4;
}

/* Light mode */
html.light .po-panel {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.14),
    0 8px 24px rgba(0, 0, 0, 0.08);
}

html.light .po-scrim {
  background: rgba(0, 0, 0, 0.3);
}

/* Mobile — bottom sheet */
@media (max-width: 600px) {
  .po-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
    animation: po-slide-up 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes po-slide-up {
    from { transform: translateY(100%); opacity: 0.6; }
    to   { transform: translateY(0);   opacity: 1; }
  }

  .po-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .po-btn-primary,
  .po-btn-secondary {
    justify-content: center;
    padding: 12px 18px;
  }
}

/* ============================================================
   WRITEUP DETAIL PAGE  (wu-)
   ============================================================ */

.wu-main {
  min-height: 100vh;
  padding-top: 64px;
  padding-bottom: 96px;
}

/* Shared container — 680px reading width, centered */
.wu-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header band ──────────────────────────────────────────── */
.wu-header-band {
  padding: 48px 0 56px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}

/* Breadcrumb */
.wu-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  margin-bottom: 32px;
}

.wu-breadcrumb-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 120ms ease;
}

.wu-breadcrumb-link:hover {
  color: var(--text-secondary);
}

.wu-breadcrumb-sep {
  color: var(--border);
}

.wu-breadcrumb-current {
  color: #22d3ee;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Meta row */
.wu-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.wu-meta-item {
  font-family: Inter, Geist, "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-variant: all-small-caps;
  text-transform: lowercase;
}

.wu-meta-dot {
  color: var(--border);
  font-size: 11px;
}

/* Title */
.wu-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

/* Summary */
.wu-summary {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.9;
  margin: 0 0 26px;
  max-width: 640px;
}

/* Tags */
.wu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.wu-tag {
  font-family: Inter, Geist, "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wu-tag:not(:last-child)::after {
  content: " · ";
  color: var(--border);
}

/* ── Article body band ─────────────────────────────────────── */
.wu-body-band {
  padding-bottom: 32px;
}

.wu-loading {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 64px 0;
}

.wu-error {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #f87171;
  text-align: center;
  padding: 64px 0;
}

/* ── Prose typography ──────────────────────────────────────── */
.wu-prose {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-secondary);
}

.wu-prose p,
.wu-prose .pd-body-text {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 0 0 20px;
  max-width: 65ch;
}

.wu-prose h2,
.wu-prose .pd-section-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  line-height: 1.25;
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-family: Inter, Geist, "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  text-transform: uppercase;
}

.wu-prose h3,
.wu-prose .pd-challenge-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: Inter, Geist, "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  margin: 32px 0 10px;
}

.wu-prose code,
.wu-prose .pd-challenge-body code,
.wu-prose .pd-lesson-item p code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #22d3ee;
  background: color-mix(in srgb, #22d3ee 8%, var(--bg-base));
  border: 1px solid color-mix(in srgb, #22d3ee 20%, transparent);
  border-radius: 3px;
  padding: 2px 6px;
}

.wu-prose .pd-challenge {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid #22d3ee;
  border-radius: 6px;
  padding: 20px 24px;
  margin: 24px 0;
}

.wu-prose .pd-challenge-title {
  margin-top: 0;
  color: var(--text-primary);
}

.wu-prose .pd-challenge-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
  margin: 0;
}

.wu-prose .pd-lessons {
  margin: 24px 0;
}

.wu-prose .pd-lesson-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.wu-prose .pd-lesson-item:last-child {
  border-bottom: none;
}

.wu-prose .pd-lesson-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #22d3ee;
  padding-top: 2px;
  flex-shrink: 0;
  width: 24px;
}

.wu-prose .pd-lesson-item p {
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
  max-width: none;
}

.wu-prose .pd-stat-bar {
  margin: 24px 0;
}

.wu-prose .pd-section {
  margin-top: 48px;
}

.wu-prose .manifesto-track-label {
  font-family: Inter, Geist, "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.wu-prose .manifesto-horizon {
  border: 0;
  border-top: 1px solid color-mix(in srgb, #22d3ee 24%, var(--border));
  margin: 40px 0 8px;
}

.wu-prose .manifesto-essay {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.wu-prose .manifesto-essay-wide {
  max-width: 680px;
}

.wu-prose .manifesto-essay p {
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.6;
  max-width: 70ch;
  text-align: left;
  hyphens: none;
}

.wu-prose .manifesto-subheading {
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-primary);
  margin: 30px 0 12px;
}

.wu-prose .manifesto-signature {
  font-style: italic;
  color: var(--text-primary);
  text-shadow: 0 0 12px color-mix(in srgb, #22d3ee 16%, transparent);
}

.wu-prose .manifesto-journal-head {
  text-align: center;
  margin-bottom: 24px;
}

.wu-prose .manifesto-journal-title {
  margin: 0 0 8px;
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.2;
  color: var(--text-primary);
  font-weight: 700;
}

.wu-prose .manifesto-journal-meta {
  margin: 0;
  font-family: Inter, Geist, "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
  text-align: center;
}

.wu-prose .manifesto-action-bar {
  display: none;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.wu-prose .manifesto-inline-btn {
  margin: 0;
}

.wu-prose .manifesto-pull-quote {
  margin: 30px auto;
  max-width: 70ch;
  border: 0;
  padding: 4px 0 4px 14px;
}

.wu-prose .manifesto-pull-quote p {
  margin: 0;
  text-align: left;
  font-style: italic;
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.6;
  color: var(--text-primary);
}

.wu-prose .manifesto-seal {
  margin-top: 30px;
  text-align: left;
  font-family: Inter, Geist, "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-muted);
  text-transform: none;
}

.wu-prose .narrative-bridge {
  position: relative;
  margin: 36px 0 26px;
  border-top: 1px solid color-mix(in srgb, #22d3ee 18%, var(--border));
  padding-top: 12px;
}

.wu-prose .narrative-bridge-label {
  font-family: Inter, Geist, "SF Pro Text", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wu-prose .builder-philosophy .pd-body-text {
  margin-bottom: 26px;
}

.wu-prose .architect-signature {
  font-weight: 700;
  color: color-mix(in srgb, #22d3ee 68%, var(--text-primary));
}

/* ── Footer nav ─────────────────────────────────────────── */
.wu-footer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.wu-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 150ms ease;
}

.wu-footer-link:hover {
  color: var(--text-primary);
}

html.light .wu-header-band {
  border-bottom-color: var(--border);
}

html.light .wu-prose .pd-challenge {
  background: var(--bg-surface);
}

@media (max-width: 640px) {
  .wu-header-band {
    padding: 32px 0 40px;
    margin-bottom: 40px;
  }

  .wu-title {
    font-size: 28px;
  }

  .wu-breadcrumb-current {
    max-width: 160px;
  }

  .wu-footer-nav {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* Emergency Slate Overrides: reduce motion + stabilize layout */
.contact-status-dot,
.skeleton-bar,
.skeleton-block {
  animation: none !important;
}

.pd-stat-bar {
  display: flex !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}

.pd-before-after {
  display: flex !important;
  align-items: stretch !important;
  gap: 16px !important;
}

/* ── Enterprise Mobile UX (max-width: 768px) ───────────────────── */
@media (max-width: 768px) {
  /* Safe areas */
  body {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    padding-left: env(safe-area-inset-left, 0px) !important;
    padding-right: env(safe-area-inset-right, 0px) !important;
  }
  .navbar {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    padding-left: max(16px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(16px, env(safe-area-inset-right, 0px)) !important;
    height: calc(56px + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Touch targets (44x44 minimum) */
  .nav-link,
  .nav-link-active,
  button,
  .hero-btn,
  .filter-tab,
  .tag-pill,
  .tag-pill-active,
  .navbar-mobile-drawer a,
  .project-card-link,
  .project-card-tag,
  .related-project-link,
  .po-btn-primary,
  .po-btn-secondary {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .nav-link,
  .nav-link-active,
  button,
  .navbar-mobile-drawer a,
  .hero-btn,
  .filter-tab,
  .po-btn-primary,
  .po-btn-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* iOS zoom prevention: keep inputs at 16px */
  input,
  textarea {
    font-size: 16px !important;
  }
  #terminal-input {
    font-size: 16px !important;
  }

  /* Typography: keep hero heading from awkward wraps */
  .hero-name {
    font-size: clamp(26px, 8vw, 44px) !important;
  }
  h1:not(.hero-name) {
    font-size: clamp(26px, 7vw, 52px) !important;
    line-height: 1.1 !important;
  }

  /* Responsive stacking */
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .project-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .project-cards-grid-double {
    grid-template-columns: 1fr;
  }
  .pd-container .related-projects-grid,
  .related-projects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Outcome / stat bars: single column list */
  .pd-stat-bar {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
  }
  .pd-stat-item {
    border-right: none !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }
  .pd-stat-item:last-child {
    border-bottom: none !important;
  }

  /* Performance: no backdrop-filter on mobile (avoids GPU jank on scroll) */
  .po-scrim {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(0, 0, 0, 0.82);
  }
  .navbar-mobile-drawer {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(8, 12, 20, 0.98) !important;
    top: calc(52px + env(safe-area-inset-top, 0px)) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }

  /* Terminal component fix */
  .terminal-glow {
    padding: 1rem !important; /* p-4 on mobile */
  }
  .terminal-glow pre,
  .terminal-line,
  .terminal-output {
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    overflow-x: hidden !important;
  }

  /* Resume: Background timeline stacking (date above institution) */
  .resume-timeline {
    border-left: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
  .resume-timeline-item {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .resume-date {
    text-align: left !important;
    margin: 0 !important;
  }

  /* Docs code blocks: iOS horizontal momentum scroll */
  .edocs-code-body {
    -webkit-overflow-scrolling: touch !important;
  }
}
