/* ============================================
   STREAMING CHUNKS — CRT Terminal Stylesheet
   Syndicate Wars (1996) x Commodore Amiga
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Audiowide&family=VT323&display=swap');

:root {
  --phosphor-bright: #00ff41;
  --phosphor-mid: #33ff66;
  --phosphor-dark: #1a3a1a;
  --bg-black: #0a0a0a;
  --phosphor-dim: #00cc33;
  --phosphor-faint: #1a8a2e;
  --phosphor-overdriven: #ffffff;
  --phosphor-glow: rgba(0, 255, 65, 0.4);
  --scanline-opacity: 0.08;
  --crt-curve: 2px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: var(--bg-black);
  color: var(--phosphor-bright);
  font-family: 'Audiowide', 'Courier New', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.6), 0 0 12px rgba(0, 255, 65, 0.3);
  animation: text-pulse 2s ease-in-out infinite;
}

@keyframes text-pulse {
  0%, 100% { text-shadow: 0 0 4px rgba(0, 255, 65, 0.4), 0 0 8px rgba(0, 255, 65, 0.2); }
  50% { text-shadow: 0 0 8px rgba(0, 255, 65, 0.8), 0 0 16px rgba(0, 255, 65, 0.4), 0 0 24px rgba(0, 255, 65, 0.2); }
}

/* ---- CRT SCREEN CONTAINER ---- */
.crt-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* ---- SCANLINES OVERLAY ---- */
.crt-screen::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, var(--scanline-opacity)) 2px,
    rgba(0, 0, 0, var(--scanline-opacity)) 4px
  );
  pointer-events: none;
  z-index: 1000;
  animation: scanline-drift 8s linear infinite;
}

/* ---- NOISE GRAIN ---- */
.crt-screen::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  animation: grain-shift 0.5s steps(10) infinite;
}

/* ---- BARREL DISTORTION (vignette approximation) ---- */
.crt-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 85%,
    rgba(0, 0, 0, 0.8) 100%
  );
  border-radius: var(--crt-curve);
}

/* ---- CHROMATIC ABERRATION ---- */
.chromatic-text {
  text-shadow:
    -1px 0 rgba(255, 0, 0, 0.15),
    1px 0 rgba(0, 100, 255, 0.15),
    0 0 8px var(--phosphor-glow);
}

/* ---- PHOSPHOR GLOW ---- */
.glow {
  animation: text-pulse 2s ease-in-out infinite;
}

.glow-strong {
  animation: text-pulse-strong 2s ease-in-out infinite;
}

@keyframes text-pulse-strong {
  0%, 100% { text-shadow: 0 0 4px rgba(0, 255, 65, 0.5), 0 0 12px rgba(0, 255, 65, 0.3), 0 0 24px rgba(0, 255, 65, 0.1); }
  50% { text-shadow: 0 0 8px rgba(0, 255, 65, 1), 0 0 20px rgba(0, 255, 65, 0.6), 0 0 40px rgba(0, 255, 65, 0.3); }
}

/* ---- FLICKER ANIMATION ---- */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  3% { opacity: 0.95; }
  6% { opacity: 1; }
  7.5% { opacity: 0.92; }
  9% { opacity: 1; }
  50% { opacity: 0.98; }
  52% { opacity: 1; }
  75% { opacity: 0.97; }
  77% { opacity: 1; }
}

@keyframes scanline-drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -2%); }
  20% { transform: translate(1%, 3%); }
  30% { transform: translate(-3%, 1%); }
  40% { transform: translate(3%, -1%); }
  50% { transform: translate(-1%, 2%); }
  60% { transform: translate(2%, -3%); }
  70% { transform: translate(-2%, 3%); }
  80% { transform: translate(1%, -2%); }
  90% { transform: translate(3%, 1%); }
}

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

@keyframes boot-in {
  0% { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes interlace-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.97; }
}

/* ---- THREE.JS CANVAS ---- */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.42;
  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.4) 30%,
    rgba(0,0,0,0.4) 70%,
    rgba(0,0,0,1) 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.4) 30%,
    rgba(0,0,0,0.4) 70%,
    rgba(0,0,0,1) 100%
  );
}

/* ---- CONTENT LAYER ---- */
.content-layer {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  padding: 2rem;
}

/* ---- NAVIGATION ---- */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--phosphor-dark);
  margin-bottom: 2rem;
}

.nav-bar a {
  color: var(--phosphor-mid);
  text-decoration: none;
  font-size: 1.1rem;
  letter-spacing: 2px;
  transition: color 0.2s, text-shadow 0.2s;
  position: relative;
}

.nav-bar a:hover,
.nav-bar a:focus {
  color: var(--phosphor-bright);
  text-shadow: 0 0 8px var(--phosphor-glow);
  outline: none;
}

.nav-bar a:focus-visible {
  outline: 1px solid var(--phosphor-bright);
  outline-offset: 4px;
}

.nav-bar a::before {
  content: '[';
  color: var(--phosphor-dim);
}

.nav-bar a::after {
  content: ']';
  color: var(--phosphor-dim);
}

.nav-bar a.logo-container::before,
.nav-bar a.logo-container::after {
  content: none;
}

.nav-bar a.active {
  color: var(--phosphor-bright);
}

/* ---- LOGO AREA ---- */
.logo-container {
  max-width: 120px;
  flex-shrink: 0;
}

.logo-container svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 8px var(--phosphor-glow));
}

/* ---- HERO TEXT ---- */
.hero-section {
  max-width: 720px;
  margin: 2rem 0;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--phosphor-overdriven);
  margin-bottom: 1rem;
  letter-spacing: 3px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--phosphor-mid);
  margin-bottom: 2rem;
}

/* ---- BLINKING CURSOR ---- */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--phosphor-bright);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
  box-shadow: 0 0 6px var(--phosphor-glow);
}

/* ---- TERMINAL PROMPT ---- */
.prompt {
  color: var(--phosphor-mid);
}

.prompt::before {
  content: '> ';
  color: var(--phosphor-dim);
}

/* ---- TERMINAL FILE LISTING (blog) ---- */
.file-listing {
  font-size: 1rem;
  line-height: 1.8;
}

.file-listing .header-row {
  color: var(--phosphor-dim);
  border-bottom: 1px solid var(--phosphor-dark);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.file-listing .file-row {
  display: grid;
  grid-template-columns: 100px 60px 60px 80px 180px 1fr;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(26, 58, 26, 0.3);
  animation: boot-in 0.3s ease-out both;
}

.file-listing .file-row:nth-child(2) { animation-delay: 0.1s; }
.file-listing .file-row:nth-child(3) { animation-delay: 0.2s; }
.file-listing .file-row:nth-child(4) { animation-delay: 0.3s; }
.file-listing .file-row:nth-child(5) { animation-delay: 0.4s; }
.file-listing .file-row:nth-child(6) { animation-delay: 0.5s; }

.file-listing .file-name {
  color: var(--phosphor-bright);
}

.file-listing .file-name a {
  color: var(--phosphor-bright);
  text-decoration: none;
  transition: text-shadow 0.2s;
}

.file-listing .file-name a:hover {
  text-shadow: 0 0 8px var(--phosphor-glow);
}

.file-listing .file-name a:focus-visible {
  outline: 1px solid var(--phosphor-bright);
  outline-offset: 2px;
}

.file-listing .file-meta {
  color: var(--phosphor-dim);
}

/* ---- ARTICLE CONTENT ---- */
.article-content {
  max-width: 720px;
  margin: 2rem auto;
  padding: 1.5rem;
  border: 1px solid var(--phosphor-dark);
  background: rgba(10, 10, 10, 0.85);
}

.article-content h1 {
  font-size: 2rem;
  color: var(--phosphor-bright);
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.article-content h2 {
  font-size: 1.4rem;
  color: var(--phosphor-mid);
  margin: 1.5rem 0 0.5rem;
}

.article-content p {
  color: var(--phosphor-mid);
  margin-bottom: 1rem;
}

.article-content code {
  background: var(--phosphor-dark);
  padding: 0.1em 0.4em;
  color: var(--phosphor-bright);
}

.article-content a {
  color: var(--phosphor-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content a:focus-visible {
  outline: 1px solid var(--phosphor-bright);
  outline-offset: 2px;
}

/* ---- ABOUT / BIO ---- */
.bio-block {
  max-width: 640px;
  margin: 2rem 0;
  padding: 1.5rem;
  border-left: 2px solid var(--phosphor-dark);
}

.bio-block p {
  color: #ffffff;
  text-shadow: none;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.bio-block .label {
  color: var(--phosphor-dim);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* ---- FOOTER ---- */
.terminal-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--phosphor-dark);
  color: var(--phosphor-dim);
  font-size: 0.9rem;
  animation: flicker 4s infinite;
}

/* ---- STATUS BAR ---- */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.4rem 2rem;
  background: rgba(10, 10, 10, 0.95);
  border-top: 1px solid var(--phosphor-dark);
  color: var(--phosphor-dim);
  font-size: 0.85rem;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  animation: flicker 4s infinite;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .content-layer {
    padding: 1rem;
  }

  .file-listing .file-row {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0.5rem 0;
  }

  .file-listing .file-meta {
    display: none;
  }

  .nav-bar {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .logo-container {
    max-width: 300px;
  }
}

/* ---- BOOT SEQUENCE (index.html only) ---- */
.boot-sequence {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background: var(--bg-black);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  animation: boot-fadeout 0.4s ease-out 1.5s forwards;
}

.boot-sequence .boot-line {
  color: var(--phosphor-bright);
  font-size: 1.1rem;
  opacity: 0;
  animation: boot-line-in 0.2s ease-out forwards;
}

.boot-sequence .boot-line:nth-child(1) { animation-delay: 0s; }
.boot-sequence .boot-line:nth-child(2) { animation-delay: 0.35s; }
.boot-sequence .boot-line:nth-child(3) { animation-delay: 0.7s; }
.boot-sequence .boot-line:nth-child(4) { animation-delay: 1.05s; }

@keyframes boot-line-in {
  0% { opacity: 0; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes boot-fadeout {
  0% { opacity: 1; }
  100% { opacity: 0; pointer-events: none; visibility: hidden; }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  .crt-screen::before,
  .crt-screen::after {
    animation: none;
  }

  .terminal-footer,
  .status-bar {
    animation: none;
  }

  .cursor {
    animation: none;
    opacity: 1;
  }

  .file-listing .file-row {
    animation: none;
  }

  .boot-sequence {
    display: none;
  }

  .glow,
  .glow-strong {
    animation: none;
  }
}

/* ---- SKIP LINK (accessibility) ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--bg-black);
  color: var(--phosphor-bright);
  padding: 0.5rem 1rem;
  z-index: 2000;
  border: 1px solid var(--phosphor-bright);
}

.skip-link:focus {
  top: 0;
}

/* ---- BLOG POST BODY ---- */
.blog-post {
  max-width: 720px;
  margin: 2rem auto;
}

.blog-post h1 {
  font-size: 1.8rem;
  color: var(--phosphor-bright);
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.blog-post h2 {
  font-size: 1.3rem;
  color: var(--phosphor-mid);
  margin: 2rem 0 0.5rem;
}

.blog-post p {
  color: #ffffff;
  text-shadow: none;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.blog-post .meta {
  color: var(--phosphor-dim);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.blog-post code {
  background: var(--phosphor-dark);
  padding: 0.1em 0.4em;
  color: var(--phosphor-bright);
}

.blog-post hr {
  border: none;
  border-top: 1px solid var(--phosphor-dark);
  margin: 2rem 0;
}

.blog-post a {
  color: var(--phosphor-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-post a:focus-visible {
  outline: 1px solid var(--phosphor-bright);
  outline-offset: 2px;
}

.blog-post .hero-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border: 1px solid var(--phosphor-dark);
  margin-bottom: 1.5rem;
  filter: saturate(0.8) brightness(0.9);
}


.amiga-window .amiga-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem;
  background: var(--phosphor-dark);
  border-bottom: 1px solid var(--phosphor-dim);
  font-size: 0.8rem;
  color: var(--phosphor-mid);
}

.amiga-window .amiga-close {
  width: 12px;
  height: 12px;
  border: 1px solid var(--phosphor-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}

.amiga-window .amiga-close:hover {
  border-color: var(--phosphor-bright);
  background: var(--phosphor-dark);
}

.amiga-window .amiga-title {
  flex: 1;
  color: var(--phosphor-mid);
  letter-spacing: 1px;
}

.amiga-window .amiga-depth {
  width: 12px;
  height: 12px;
  border: 1px solid var(--phosphor-dim);
  flex-shrink: 0;
}

.amiga-window .amiga-content {
  padding: 0.8rem;
  max-height: 200px;
  overflow-y: auto;
}

.amiga-window .amiga-content a {
  display: block;
  color: var(--phosphor-mid);
  text-decoration: none;
  padding: 0.2rem 0;
  font-size: 0.85rem;
}

.amiga-window .amiga-content a:hover {
  color: var(--phosphor-bright);
  text-shadow: 0 0 6px var(--phosphor-glow);
}

/* Amiga toggle button */
.amiga-toggle {
  position: fixed;
  bottom: 3.5rem;
  left: 1.5rem;
  z-index: 50;
  background: var(--phosphor-dark);
  border: 1px solid var(--phosphor-dim);
  color: var(--phosphor-mid);
  font-family: 'Audiowide', sans-serif;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.amiga-toggle:hover {
  color: var(--phosphor-bright);
  border-color: var(--phosphor-bright);
}

/* ---- AMIGA WINDOW MINIMIZED STATE ---- */
.amiga-window.minimized .window-content {
  display: none;
}

.amiga-window.minimized {
  max-width: 200px;
}

/* ---- AMIGA WINDOW — FIXED BOTTOM RIGHT ---- */
.amiga-window {
  position: fixed;
  bottom: 3rem;
  right: 1.5rem;
  z-index: 50;
  border: 2px solid var(--phosphor-dim);
  background: rgba(10, 10, 10, 0.95);
  max-width: 280px;
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.15);
}

/* ---- SYNDICATE WARS EASTER EGG OVERLAY ---- */
#syndicate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

#syndicate-overlay.syn-active {
  opacity: 1;
}

.syn-screen {
  width: 90%;
  max-width: 1000px;
  border: 2px solid var(--phosphor-dim);
  background: var(--bg-black);
  font-family: 'Audiowide', sans-serif;
  font-size: 0.8rem;
  color: var(--phosphor-mid);
}

.syn-header {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--phosphor-dark);
  border-bottom: 1px solid var(--phosphor-dim);
  color: var(--phosphor-bright);
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.syn-blink {
  animation: blink 1s step-end infinite;
  color: var(--phosphor-bright);
}

.syn-body {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 1px;
  background: var(--phosphor-dark);
  min-height: 400px;
}

.syn-panel {
  background: var(--bg-black);
  padding: 1rem;
}

.syn-label {
  color: var(--phosphor-dim);
  font-size: 0.7rem;
  margin-bottom: 0.8rem;
  letter-spacing: 1px;
}

.syn-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
}

.syn-stat span:first-child {
  width: 90px;
  color: var(--phosphor-mid);
}

.syn-stat span:last-child {
  width: 25px;
  text-align: right;
  color: var(--phosphor-bright);
}

.syn-bar {
  flex: 1;
  height: 8px;
  background: var(--phosphor-dark);
  border: 1px solid var(--phosphor-dim);
  position: relative;
}

.syn-bar i {
  display: block;
  height: 100%;
  background: var(--phosphor-bright);
  box-shadow: 0 0 4px var(--phosphor-glow);
}

.syn-cyborg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.syn-agent-img {
  max-height: 350px;
  width: auto;
  opacity: 0.8;
  filter: drop-shadow(0 0 8px var(--phosphor-glow));
}

.syn-mods {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.syn-mod {
  position: absolute;
  font-size: 0.6rem;
  color: var(--phosphor-dim);
  white-space: nowrap;
  padding: 0.1rem 0.3rem;
  border-left: 1px solid var(--phosphor-dim);
}

.syn-loadout p {
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
}

.syn-dim {
  color: var(--phosphor-dim);
}

.syn-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 1rem;
  border-top: 1px solid var(--phosphor-dim);
  background: var(--phosphor-dark);
  font-size: 0.65rem;
  color: var(--phosphor-dim);
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .syn-body {
    grid-template-columns: 1fr;
  }
  .syn-cyborg {
    display: none;
  }
}

/* ============================================
   PROJECT PAGES — TOC, Progress, Anchors
   ============================================ */

/* ---- READ PROGRESS BAR ---- */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 1100;
  background: transparent;
}

.read-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--phosphor-bright);
  box-shadow: 0 0 6px var(--phosphor-glow), 0 0 12px var(--phosphor-glow);
  transition: width 0.1s linear;
}

/* ---- PROJECT TOC SIDEBAR ---- */
.project-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.project-toc {
  position: sticky;
  top: 2rem;
  align-self: start;
  border: 2px solid var(--phosphor-dim);
  background: rgba(10, 10, 10, 0.95);
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.1);
}

.project-toc .toc-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem;
  background: var(--phosphor-dark);
  border-bottom: 1px solid var(--phosphor-dim);
  font-size: 0.8rem;
  color: var(--phosphor-mid);
}

.project-toc .toc-close {
  width: 12px;
  height: 12px;
  border: 1px solid var(--phosphor-dim);
  flex-shrink: 0;
}

.project-toc .toc-title {
  flex: 1;
  letter-spacing: 1px;
  color: var(--phosphor-mid);
}

.project-toc .toc-depth {
  width: 12px;
  height: 12px;
  border: 1px solid var(--phosphor-dim);
  flex-shrink: 0;
}

.project-toc .toc-list {
  padding: 0.8rem;
  list-style: none;
}

.project-toc .toc-list li {
  margin-bottom: 0.3rem;
}

.project-toc .toc-list a {
  display: block;
  color: var(--phosphor-dim);
  text-decoration: none;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
}

.project-toc .toc-list a:hover {
  color: var(--phosphor-bright);
  text-shadow: 0 0 6px var(--phosphor-glow);
}

.project-toc .toc-list a:focus-visible {
  outline: 1px solid var(--phosphor-bright);
  outline-offset: 2px;
}

.project-toc .toc-list a.toc-active {
  color: var(--phosphor-bright);
  border-left-color: var(--phosphor-bright);
  text-shadow: 0 0 6px var(--phosphor-glow);
}

/* ---- PROJECT META ROW ---- */
.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--phosphor-dim);
  flex-wrap: wrap;
}

.project-meta .tag {
  border: 1px solid var(--phosphor-dim);
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--phosphor-mid);
}

/* ---- SECTION ANCHORS ---- */
.section-anchor {
  color: var(--phosphor-dim);
  text-decoration: none;
  margin-left: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.9em;
}

.blog-post h2:hover .section-anchor,
.section-anchor:focus {
  opacity: 1;
}

.section-anchor:focus-visible {
  outline: 1px solid var(--phosphor-bright);
  outline-offset: 2px;
}

/* ---- PROJECT LISTING (drawer style) ---- */
.project-listing {
  max-width: 720px;
}

.project-listing .project-entry {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(26, 58, 26, 0.4);
  animation: boot-in 0.3s ease-out both;
}

.project-listing .project-entry:nth-child(1) { animation-delay: 0.1s; }
.project-listing .project-entry:nth-child(2) { animation-delay: 0.2s; }
.project-listing .project-entry:nth-child(3) { animation-delay: 0.3s; }
.project-listing .project-entry:nth-child(4) { animation-delay: 0.4s; }

.project-listing .project-entry-tag {
  font-size: 0.75rem;
  color: var(--phosphor-dim);
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
}

.project-listing .project-entry-title {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.project-listing .project-entry-title a {
  color: var(--phosphor-bright);
  text-decoration: none;
  transition: text-shadow 0.2s;
}

.project-listing .project-entry-title a:hover {
  text-shadow: 0 0 8px var(--phosphor-glow);
}

.project-listing .project-entry-title a:focus-visible {
  outline: 1px solid var(--phosphor-bright);
  outline-offset: 2px;
}

.project-listing .project-entry-hook {
  color: #ffffff;
  text-shadow: none;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.project-listing .project-entry-meta {
  font-size: 0.8rem;
  color: var(--phosphor-dim);
}

/* ---- RESPONSIVE: TOC collapses on mobile ---- */
@media (max-width: 768px) {
  .project-layout {
    grid-template-columns: 1fr;
  }

  .project-toc {
    position: static;
    max-height: none;
    margin-bottom: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .read-progress-fill {
    transition: none;
  }

  .project-listing .project-entry {
    animation: none;
  }
}
