/* ==========================================================================
   PORTFOLIO SITE — SHARED STYLESHEET
   Direction: "render viewport" — the dark canvas of a graphics debugger,
   wireframe overlays, and RGB axis-gizmo conventions (X/Y/Z) borrowed from
   3D tooling (Vulkan / OpenXR). Signature interaction: cards tilt toward
   the cursor like a tiny viewport camera, with a live coordinate readout.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. THEME TOKENS
   Swap colors/fonts here to re-theme the entire site without touching
   layout rules below. Everything downstream reads from these variables.
   -------------------------------------------------------------------------- */
:root {
  /* -- Surfaces -- */
  --void: #0a0e16;              /* page background — "clear color" */
  --void-raised: #10161f;       /* card / panel surface */
  --void-raised-2: #141b26;     /* nested / hover surface */
  --border-subtle: #1e2733;
  --border-strong: #2c3a4d;

  /* -- Text -- */
  --text-primary: #e8edf3;
  --text-secondary: #8a97a8;
  --text-tertiary: #5b6577;

  /* -- Primary accent: wireframe / selection cyan -- */
  --accent: #4fd8d0;
  --accent-dim: rgba(79, 216, 208, 0.14);
  --accent-strong: #7ce8e1;

  /* -- Signature triad: XYZ axis-gizmo convention (used sparingly) -- */
  --axis-x: #ff6b6b; /* red   */
  --axis-y: #6be37a; /* green */
  --axis-z: #6b9bff; /* blue  */

  /* -- Type -- */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  /* -- Spacing scale -- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6.5rem;

  /* -- Shape -- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* -- Layout -- */
  --container-w: 1200px;
  --nav-h: 76px;

  /* -- Motion -- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. BACKGROUND RECIPES
   One shared "viewport grid" recipe driven entirely by custom properties.
   Each page sets its own --bg-* values below to get a unique treatment —
   swap a page's look by editing only its block here.
   -------------------------------------------------------------------------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transform: translate3d(calc(var(--parallax-x, 0) * 1px), calc(var(--parallax-y, 0) * 1px), 0);
  transition: transform 0.6s var(--ease);
  background-color: var(--void);
  background-image:
    linear-gradient(var(--bg-grid-color, transparent) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid-color, transparent) 1px, transparent 1px),
    radial-gradient(circle at var(--bg-glow-pos, 50% 15%), var(--bg-glow-color, transparent), transparent 62%);
  background-size:
    var(--bg-grid-size, 48px) var(--bg-grid-size, 48px),
    var(--bg-grid-size, 48px) var(--bg-grid-size, 48px),
    100% 100%;
}

/* vignette keeps edges quiet so the grid never fights page content */
.bg-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 0%, var(--void) 88%);
}

/* Home — wide, faint grid + top-right glow, like a scene viewport */
.page-home {
  --bg-grid-size: 64px;
  --bg-grid-color: rgba(79, 216, 208, 0.055);
  --bg-glow-color: rgba(79, 216, 208, 0.12);
  --bg-glow-pos: 82% 6%;
}

/* About — tighter grid + a faint vertical "ruler" motif echoing the timelines */
.page-about {
  --bg-grid-size: 36px;
  --bg-grid-color: rgba(107, 155, 255, 0.05);
  --bg-glow-color: rgba(107, 155, 255, 0.1);
  --bg-glow-pos: 12% 0%;
}
.page-about .bg-layer {
  background-image:
    repeating-linear-gradient(90deg, rgba(107, 155, 255, 0.06) 0, rgba(107, 155, 255, 0.06) 1px, transparent 1px, transparent 160px),
    linear-gradient(var(--bg-grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid-color) 1px, transparent 1px),
    radial-gradient(circle at var(--bg-glow-pos), var(--bg-glow-color), transparent 62%);
  background-size: 160px 100%, var(--bg-grid-size) var(--bg-grid-size), var(--bg-grid-size) var(--bg-grid-size), 100% 100%;
}

/* Portfolio — dot-grid "blueprint" field, denser since content is dense */
.page-portfolio {
  --bg-grid-size: 26px;
  --bg-glow-color: rgba(255, 107, 107, 0.07);
  --bg-glow-pos: 50% 100%;
}
.page-portfolio .bg-layer {
  background-image:
    radial-gradient(rgba(232, 237, 243, 0.09) 1px, transparent 1px),
    radial-gradient(circle at var(--bg-glow-pos), var(--bg-glow-color), transparent 65%);
  background-size: var(--bg-grid-size) var(--bg-grid-size), 100% 100%;
}

/* Contact — sparse, calm point-cloud; minimal since the page is minimal */
.page-contact {
  --bg-glow-color: rgba(107, 227, 122, 0.09);
  --bg-glow-pos: 50% 40%;
}
.page-contact .bg-layer {
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(232, 237, 243, 0.18) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 80% 15%, rgba(232, 237, 243, 0.14) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 35% 65%, rgba(232, 237, 243, 0.16) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 65% 80%, rgba(232, 237, 243, 0.12) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 92% 55%, rgba(232, 237, 243, 0.15) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 20% 88%, rgba(232, 237, 243, 0.1) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 35%, rgba(232, 237, 243, 0.13) 50%, transparent 51%),
    radial-gradient(circle at var(--bg-glow-pos), var(--bg-glow-color), transparent 65%);
  background-size: 100% 100%;
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: -12px 10px, 8px -8px, -6px -10px, 10px 8px, -8px 6px, 6px -12px, -10px -6px, 0 0; }
}

/* --------------------------------------------------------------------------
   3. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  border-radius: 1px;
}

/* --------------------------------------------------------------------------
   4. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.section {
  padding-block: var(--space-7);
}
.section-head {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: center;
}
.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}
.section-head p {
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   5. NAV BAR
   -------------------------------------------------------------------------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10, 14, 22, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: color 0.2s var(--ease);
}
.nav-logo::before {
  content: '>';
  color: var(--accent);
}
.nav-logo:hover { color: var(--accent-strong); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-links a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding-block: 0.4em;
  transition: color 0.2s var(--ease);
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text-primary); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links .nav-github {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5em 0.9em;
}
.nav-links .nav-github:hover { border-color: var(--accent); }
.nav-links .nav-github svg { width: 15px; height: 15px; }

.nav-toggle {
  display: none;
  width: 36px;
  height: 30px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. BUTTONS / SMALL COMPONENTS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 0.85em 1.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { border-color: var(--accent); background: var(--accent-dim); transform: translateY(-2px); }
.btn-primary { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-strong); }
.btn-primary:hover { background: var(--accent); color: var(--void); }

/* --------------------------------------------------------------------------
   7. IMAGE PLACEHOLDER COMPONENT
   Sized boxes standing in for real images. No decorative photography —
   just a dashed frame, an icon, and the recommended dimensions.
   -------------------------------------------------------------------------- */
.img-placeholder {
  position: relative;
  width: 100%;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--void-raised);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  color: var(--text-tertiary);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}
.img-placeholder svg { width: 15%; min-width: 28px; max-width: 56px; opacity: 0.6; }
.img-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
  padding-inline: var(--space-2);
}
.img-placeholder.ratio-portrait { aspect-ratio: 3 / 4; }
.img-placeholder.ratio-wide { aspect-ratio: 16 / 9; }
.img-placeholder.ratio-standard { aspect-ratio: 4 / 3; }
.img-placeholder.ratio-square { aspect-ratio: 1 / 1; }
.img-placeholder.size-icon { width: 56px; aspect-ratio: 1 / 1; flex-shrink: 0; }
.img-placeholder.size-icon svg { width: 40%; }
.img-placeholder.size-icon span { display: none; }

/* --------------------------------------------------------------------------
   8. VIEWPORT TILT CARD (signature interaction)
   Cards tilt gently toward the cursor and reveal a live coordinate
   readout, echoing a 3D viewport gizmo. JS toggles the transform +
   readout text; CSS handles the glow + transition.
   -------------------------------------------------------------------------- */
.tilt-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  will-change: transform;
}
.tilt-card:hover,
.tilt-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 18px 40px -20px rgba(79, 216, 208, 0.35), 0 0 0 1px var(--accent-dim);
}
.tilt-readout {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  text-shadow:
    0 0 4px var(--void),
    0 0 8px var(--void),
    0 1px 2px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  pointer-events: none;
  z-index: 2;
}
.tilt-card:hover .tilt-readout,
.tilt-card:focus-within .tilt-readout {
  opacity: 0.85;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .tilt-card, .bg-layer { transition: none !important; transform: none !important; }
  .page-contact .bg-layer { animation: none !important; }
}

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--space-4);
  margin-top: var(--space-6);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--accent); }

/* ============================================================================
   HOME PAGE
   ============================================================================ */
.hero {
  padding-top: calc(var(--nav-h) + var(--space-6));
  padding-bottom: var(--space-6);
}
.hero .container {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.hero-text {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.hero-text h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  letter-spacing: -0.01em;
}
.hero-text p {
  color: var(--text-secondary);
  font-size: 1.08rem;
  max-width: 46ch;
}
.hero-text footer {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-tertiary);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}
.hero-portrait {
  flex: 1 1 40%;
}
.hero-portrait .img-placeholder { max-width: 380px; margin-inline: auto; }

.portrait-photo {
  width: 100%;
  max-width: 380px;
  margin-inline: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.tile-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.project-tile {
  background: var(--void-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.project-tile h3 {
  font-size: 1.05rem;
}
.project-tile p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.project-tile .tile-link {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.project-tile .tile-link::after { content: '→'; transition: transform 0.2s var(--ease); }
.project-tile:hover .tile-link::after { transform: translateX(3px); }

.skill-tile {
  background: var(--void-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  cursor: default;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
}
.skill-tile h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.skill-tile h3::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--axis-z);
  border-radius: 50%;
  flex-shrink: 0;
}
.skill-tile .skill-blurb {
  color: var(--text-secondary);
  font-size: 0.88rem;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s var(--ease), opacity 0.25s var(--ease), margin-top 0.3s var(--ease);
}
.skill-tile .skill-blurb > span { overflow: hidden; }

.skill-tile.is-expanded .skill-blurb {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0.2em;
}

@media (hover: hover) and (pointer: fine) {
  .skill-tile:hover .skill-blurb {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 0.2em;
  }
}

/* ============================================================================
   ABOUT PAGE
   ============================================================================ */
.about-hero {
  padding-top: calc(var(--nav-h) + var(--space-5));
  padding-bottom: var(--space-3);
  text-align: center;
}
.about-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.about-hero p { color: var(--text-secondary); margin-top: var(--space-1); }

.timelines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
}
.timeline-panel {
  background: var(--void-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}
.timeline-panel-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.timeline-panel-header h2 {
  font-size: 1.3rem;
}
.timeline-panel-header .collapse-hint {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}
.timeline-panel-header .collapse-icon { display: none; }

.timeline {
  position: relative;
  padding-top: var(--space-3);
  padding-left: var(--space-4);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--border-strong), var(--border-strong)) ;
  transition: opacity 0.2s var(--ease);
}
.timeline-entry {
  position: relative;
  padding-bottom: var(--space-4);
}
.timeline-entry:last-child { padding-bottom: 0; }
.timeline-entry::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-4) + 1px);
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--void-raised);
  border: 2px solid var(--accent);
  z-index: 1;
}
.timeline-entry-trigger {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}
.timeline-dates {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}
.timeline-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.timeline-title .chevron {
  color: var(--text-tertiary);
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
}
.timeline-entry.is-open .timeline-title .chevron { transform: rotate(90deg); color: var(--accent); }

.timeline-icon {
  width: 56px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.timeline-detail {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s var(--ease), opacity 0.25s var(--ease), margin-top 0.3s var(--ease);
}
.timeline-entry.is-open .timeline-detail {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: var(--space-2);
}
.timeline-detail > div { overflow: hidden; }
.timeline-detail-inner {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--void-raised-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  align-items: flex-start;
}
.timeline-detail-inner h4 { font-size: 0.95rem; margin-bottom: 0.4em; }
.timeline-detail-inner p { font-size: 0.85rem; color: var(--text-secondary); }

/* ============================================================================
   PORTFOLIO PAGE
   ============================================================================ */
.portfolio-hero {
  padding-top: calc(var(--nav-h) + var(--space-5));
  padding-bottom: var(--space-3);
  text-align: center;
}
.portfolio-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.portfolio-hero p { color: var(--text-secondary); margin-top: var(--space-1); }

.category {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--void-raised);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.category-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  cursor: pointer;
}
.category-header-left {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.category-header h2 { font-size: 1.25rem; }
.category-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.category-header .chevron {
  color: var(--text-tertiary);
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
}
.category.is-open .category-header .chevron { transform: rotate(90deg); color: var(--accent); }

.category-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.category.is-open .category-body { grid-template-rows: 1fr; }
.category-body > div { overflow: hidden; }
.category-list {
  border-top: 1px solid var(--border-subtle);
}

.project-entry {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: calc(var(--nav-h) + var(--space-2));
  align-items: flex-start;
}
.project-entry:last-child { border-bottom: none; }
.project-entry .img-placeholder { flex: 0 0 240px; }
.project-entry .entry-image {
  width: 100%;
  flex: 0 0 240px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}
.project-entry-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  min-width: 0;
}
.project-entry-body h3 { font-size: 1.15rem; }
.project-entry-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  word-break: break-word;
}
.project-entry-body p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 0.3em;
}

/* ============================================================================
   CONTACT PAGE
   ============================================================================ */
.contact-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--nav-h);
}
.contact-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}
.contact-hero > p {
  color: var(--text-secondary);
  margin-top: var(--space-1);
  max-width: 46ch;
}
.contact-card {
  margin-top: var(--space-5);
  margin-inline: auto;
  width: min(90vw, 460px);
  background: var(--void-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.contact-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  transition: transform 0.2s var(--ease);
}
.contact-card > .contact-row:last-child { border-bottom: none; padding-bottom: 0; }
.contact-row:hover { transform: translateX(4px); }
.contact-row .icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.contact-row .icon svg { width: 18px; height: 18px; }
.contact-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  text-align: left;
  min-width: 0;
}
.contact-row-text .label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.contact-row-text a, .contact-row-text span.value {
  font-size: 0.98rem;
  word-break: break-word;
}
.contact-row-text a:hover { color: var(--accent); }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 14, 22, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }
  .nav-links.is-open { max-height: 60vh; }
  .nav-links a {
    padding: var(--space-2) clamp(1.25rem, 4vw, 3rem);
    border-bottom: 1px solid var(--border-subtle);
  }
  .nav-links .nav-github { border: none; border-radius: 0; }
  .nav-toggle { display: flex; }

  .hero .container { flex-direction: column-reverse; gap: var(--space-4); }
  .hero-text, .hero-portrait { flex: 1 1 auto; width: 100%; }
  .hero-text { text-align: left; }
  
  .hero-portrait .img-placeholder,
  .hero-portrait .portrait-photo {
    width: auto;
    height: 34vh;
    max-height: 320px;
    max-width: 100%;
    margin-inline: auto;
  }
  
  .hero { padding-top: calc(var(--nav-h) + var(--space-3)); }

  .timelines { grid-template-columns: 1fr; gap: var(--space-3); }

  .timeline-panel[data-collapsible] .timeline-panel-header {
    cursor: pointer;
  }
  .timeline-panel-header .collapse-hint,
  .timeline-panel-header .collapse-icon { display: inline-flex; }
  .timeline-panel-header .collapse-icon {
    transition: transform 0.25s var(--ease);
  }
  .timeline-panel.is-open .timeline-panel-header .collapse-icon {
    transform: rotate(90deg);
  }
  .timeline-panel > div:not(.timeline-panel-header) {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s var(--ease);
  }
  .timeline-panel > div:not(.timeline-panel-header) > .timeline { overflow: hidden; }
  .timeline-panel.is-open > div:not(.timeline-panel-header) {
    grid-template-rows: 1fr;
  }
  .timeline-panel.is-open .timeline-panel-header .collapse-hint { opacity: 0; }
  
  .timeline-panel:not(.is-open) .timeline::before {
    opacity: 0;
  }

  .project-entry { flex-direction: column; }
  .project-entry .img-placeholder { flex: none; width: 100%; }
}

@media (max-width: 600px) {
  .container { padding-inline: 1.25rem; }
  .section { padding-block: var(--space-6); }
  .tile-grid { grid-template-columns: 1fr; }
}
