/* ============================================================
   LOOP FARMSTEAD — VaultBBS Terminal Stylesheet
   Phosphor green on void black. BBS aesthetic since 1983.
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --void: #050505;
  --void-light: #0a0a0a;
  --void-mid: #111111;
  --phosphor: #00ff41;
  --phosphor-dim: #00aa2a;
  --phosphor-dark: #004d14;
  --amber: #ffb000;
  --amber-dim: #cc8d00;
  --red: #ff2040;
  --white: #e0e0e0;
  --white-dim: #888888;
  --gray: #333333;
  --gray-light: #555555;
  --mono: 'Courier New', 'Lucida Console', monospace;
  --glow: 0 0 8px rgba(0, 255, 65, 0.6), 0 0 16px rgba(0, 255, 65, 0.3);
  --glow-amber: 0 0 8px rgba(255, 176, 0, 0.6), 0 0 16px rgba(255, 176, 0, 0.3);
  --glow-subtle: 0 0 4px rgba(0, 255, 65, 0.4);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--void);
  color: var(--phosphor);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* --- Scanline Overlay --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0.15) 1px,
    rgba(0, 0, 0, 0.15) 2px
  );
}

/* --- CRT Flicker Animation --- */
@keyframes crt-flicker {
  0%   { opacity: 1; }
  3%   { opacity: 0.97; }
  6%   { opacity: 1; }
  7.5% { opacity: 0.98; }
  9%   { opacity: 1; }
  50%  { opacity: 1; }
  52%  { opacity: 0.98; }
  53%  { opacity: 1; }
  100% { opacity: 1; }
}

body {
  animation: crt-flicker 8s infinite;
}

/* --- CRT Curvature Effect (subtle vignette) --- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 60%,
    rgba(0, 0, 0, 0.3) 100%
  );
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--phosphor);
  font-family: var(--mono);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h1 {
  font-size: 1.5rem;
  text-shadow: var(--glow);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.25rem;
  text-shadow: var(--glow);
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.1rem;
  text-shadow: var(--glow-subtle);
  margin-bottom: 0.4rem;
}

p {
  margin-bottom: 0.75rem;
}

/* --- Links --- */
a {
  color: var(--phosphor);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.15s ease;
}

a:hover, a:focus {
  color: var(--phosphor);
  text-shadow: var(--glow);
  border-bottom-color: var(--phosphor);
  outline: none;
}

a:visited {
  color: var(--phosphor-dim);
}

a:visited:hover {
  color: var(--phosphor);
  text-shadow: var(--glow);
}

/* --- Amber accent links --- */
a.amber {
  color: var(--amber);
}

a.amber:hover, a.amber:focus {
  color: var(--amber);
  text-shadow: var(--glow-amber);
  border-bottom-color: var(--amber);
}

a.amber:visited {
  color: var(--amber-dim);
}

/* --- Layout --- */
.container {
  max-width: 80ch;
  margin: 0 auto;
  padding: 1rem;
}

/* --- Boot Sequence --- */
#boot-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#boot-sequence {
  width: 100%;
}

.boot-line {
  opacity: 0;
  white-space: pre-wrap;
  overflow: hidden;
}

.boot-line.visible {
  opacity: 1;
}

.boot-line.typing {
  opacity: 1;
}

.boot-line .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--phosphor);
  vertical-align: text-bottom;
  animation: blink-cursor 0.8s step-end infinite;
}

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

/* --- Main Content (hidden during boot) --- */
#main-content {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#main-content.active {
  display: block;
  opacity: 1;
}

/* --- Banner --- */
.banner {
  border-bottom: 1px solid var(--phosphor-dark);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.banner h1 {
  font-size: 1.5rem;
  margin-bottom: 0;
  letter-spacing: 0.1em;
}

.banner .subtitle {
  color: var(--phosphor-dim);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

/* --- BBS Menu --- */
.menu {
  border-top: 1px solid var(--phosphor-dark);
  border-bottom: 1px solid var(--phosphor-dark);
  padding: 0.75rem 0;
  margin: 1rem 0;
}

.menu-title {
  color: var(--amber);
  text-shadow: var(--glow-amber);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.menu-item {
  display: block;
  padding: 0.2rem 0;
  color: var(--phosphor);
  text-decoration: none;
  border-bottom: none;
  line-height: 1.8;
  cursor: pointer;
  transition: all 0.1s ease;
}

.menu-item:hover {
  text-shadow: var(--glow);
  background: var(--void-light);
  padding-left: 0.5rem;
}

.menu-item .menu-num {
  color: var(--amber);
  margin-right: 0.5em;
  min-width: 2em;
  display: inline-block;
  text-shadow: var(--glow-amber);
}

.menu-item .menu-label {
  color: var(--phosphor);
}

/* --- Section Styling --- */
.section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--gray);
}

.section:last-child {
  border-bottom: none;
}

.section-header {
  color: var(--amber);
  text-shadow: var(--glow-amber);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--phosphor-dark);
}

.section-header::before {
  content: '▸ ';
  color: var(--phosphor-dim);
}

/* --- Directory Listings (for Readings, Library) --- */
.dir-listing {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dir-listing li {
  padding: 0.15rem 0;
  padding-left: 1em;
  border-bottom: 1px solid var(--void-light);
}

.dir-listing li:last-child {
  border-bottom: none;
}

.dir-listing .dir-code {
  color: var(--amber);
  margin-right: 0.5em;
}

.dir-listing .dir-name {
  color: var(--white);
}

.dir-listing .dir-desc {
  color: var(--white-dim);
  font-size: 0.85rem;
  margin-left: 0.5em;
}

.dir-listing a {
  color: var(--phosphor);
}

.dir-listing a:hover {
  text-shadow: var(--glow);
}

/* --- File Listing (Library) --- */
.file-listing {
  list-style: none;
  padding: 0;
  margin: 0;
}

.file-listing li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--void-light);
  font-size: 0.95rem;
}

.file-listing li:last-child {
  border-bottom: none;
}

.file-listing .file-size {
  color: var(--white-dim);
  font-size: 0.8rem;
  margin-left: 0.5em;
}

/* --- Sysop Note (Support section) --- */
.sysop-note {
  background: var(--void-light);
  border: 1px solid var(--phosphor-dark);
  border-left: 3px solid var(--amber);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}

.sysop-note .sysop-header {
  color: var(--amber);
  text-shadow: var(--glow-amber);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.sysop-note p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.tier-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.tier-list li {
  padding: 0.3rem 0;
}

.tier-list .tier-amount {
  color: var(--amber);
  font-weight: bold;
  display: inline-block;
  min-width: 5em;
}

.tier-list a {
  color: var(--phosphor);
  border-bottom: 1px dotted var(--phosphor-dark);
}

.tier-list a:hover {
  border-bottom-color: var(--phosphor);
  text-shadow: var(--glow);
}

/* --- Field Notes (About the Land) --- */
.field-notes {
  background: var(--void-light);
  border: 1px solid var(--gray);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}

.field-notes .note-label {
  color: var(--white-dim);
  font-size: 0.85rem;
}

.field-notes .note-value {
  color: var(--phosphor);
}

.field-notes .note-value.amber {
  color: var(--amber);
}

/* --- Guide Links --- */
.guide-links {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.guide-links li {
  padding: 0.2rem 0;
  padding-left: 1.5em;
  text-indent: -1.5em;
}

.guide-links li::before {
  content: '→ ';
  color: var(--phosphor-dim);
}

.guide-links a {
  color: var(--phosphor);
}

.guide-links a:hover {
  text-shadow: var(--glow);
}

/* --- Coming Online Notice --- */
.coming-online {
  color: var(--amber);
  text-shadow: var(--glow-amber);
  animation: blink-slow 2s ease-in-out infinite;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--phosphor-dark);
  margin: 1rem 0;
}

.divider-double {
  border: none;
  border-top: 2px solid var(--phosphor-dark);
  border-bottom: 1px solid var(--phosphor-dark);
  margin: 1rem 0;
  height: 3px;
}

/* --- Status Bar --- */
.status-bar {
  font-size: 0.8rem;
  color: var(--white-dim);
  border-top: 1px solid var(--gray);
  padding-top: 0.5rem;
  margin-top: 2rem;
}

.status-bar .status-line {
  margin-bottom: 0.1rem;
}

.status-bar .sysop {
  color: var(--phosphor-dim);
}

.status-bar .location {
  color: var(--amber-dim);
}

/* --- Block Elements --- */
pre {
  font-family: var(--mono);
  color: var(--phosphor);
  background: var(--void-light);
  border: 1px solid var(--gray);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

code {
  font-family: var(--mono);
  color: var(--phosphor);
  background: var(--void-light);
  padding: 0.1em 0.3em;
  font-size: 0.9em;
}

blockquote {
  border-left: 3px solid var(--phosphor-dark);
  padding-left: 1rem;
  margin: 0.75rem 0;
  color: var(--white-dim);
  font-style: normal;
}

/* --- Selection --- */
::selection {
  background: var(--phosphor-dark);
  color: var(--phosphor);
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--phosphor-dark);
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--phosphor-dim);
}

/* --- Global Touch Feedback --- */
a:active,
.menu-item:active,
.btn:active,
button:active,
.welcome-close:active,
.welcome-enter:active {
  background: rgba(0, 255, 65, 0.12) !important;
  text-shadow: var(--glow);
  transition: background 0.05s, text-shadow 0.05s;
}

a, button, .menu-item, .btn {
  -webkit-tap-highlight-color: rgba(0, 255, 65, 0.25);
  touch-action: manipulation;
}

/* --- Responsive: Mobile Terminal --- */
@media (max-width: 600px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0.75rem;
  }

  h1 {
    font-size: 1.25rem;
  }

  .banner h1 {
    font-size: 1.25rem;
  }

  /* Make all interactive elements block-level with 44px touch targets */
  .menu-item {
    display: block;
    padding: 0.6rem 0.5rem;
    font-size: 1.05rem;
    min-height: 44px;
    line-height: 1.4;
    -webkit-tap-highlight-color: var(--phosphor-dark);
    cursor: pointer;
    touch-action: manipulation;
  }

  .menu-item:hover,
  .menu-item:active {
    background: var(--void-mid);
    padding-left: 0.75rem;
  }

  .tier-list li {
    padding: 0.4rem 0;
  }

  .section {
    padding: 1rem 0;
  }

  /* Make ALL links block-level with 44px touch targets */
  .guide-links a,
  .dir-listing a,
  .file-listing a,
  .tier-list a,
  .support-cta a,
  .banner a,
  nav a,
  .section a,
  a[href] {
    display: block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 0.25rem;
    -webkit-tap-highlight-color: rgba(0, 255, 65, 0.3);
    touch-action: manipulation;
    cursor: pointer;
  }

  /* Donation/support links: ensure tappable */
  .support-cta a,
  .support-cta .btn {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 1rem;
    text-align: center;
  }

  /* Tier list links inline but still tappable */
  .tier-list a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
  }

  /* Boot screen: allow tap to skip, make entire area tappable */
  #boot-screen {
    cursor: pointer;
    touch-action: manipulation;
  }

  /* Welcome popup: larger close button */
  .welcome-close {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 16px;
    font-size: 1.1rem;
    touch-action: manipulation;
  }

  .welcome-enter {
    min-height: 44px;
    padding: 12px 32px;
    font-size: 1rem;
    touch-action: manipulation;
  }

  /* Welcome overlay: tap backdrop to dismiss */
  .welcome-overlay {
    touch-action: manipulation;
  }

  /* Prevent horizontal overflow */
  .container, main, section {
    max-width: 100vw;
    overflow-x: hidden;
  }

  pre, code {
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* Prevent text zoom on tap in iOS */
  body {
    -webkit-text-size-adjust: 100%;
  }
}

/* --- Responsive: Wide screens --- */
@media (min-width: 1200px) {
  html {
    font-size: 17px;
  }
}

/* --- Welcome Popup --- */

.welcome-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 5, 5, 0.92);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.welcome-overlay.hidden {
  display: none;
}

.welcome-overlay.visible {
  opacity: 1;
}

.welcome-overlay.hiding {
  opacity: 0;
}

.welcome-popup {
  background: var(--void-light);
  border: 1px solid var(--phosphor-dark);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.15), 0 0 80px rgba(0, 255, 65, 0.05);
  animation: welcomeFadeIn 0.5s ease;
}

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

.welcome-popup::-webkit-scrollbar { width: 6px; }
.welcome-popup::-webkit-scrollbar-track { background: var(--void); }
.welcome-popup::-webkit-scrollbar-thumb { background: var(--phosphor-dark); }
.welcome-popup::-webkit-scrollbar-thumb:hover { background: var(--phosphor); }

.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--phosphor-dark);
}

.welcome-title {
  color: var(--phosphor);
  font-size: 1.1rem;
  text-shadow: var(--glow);
  letter-spacing: 0.2em;
  margin: 0;
}

.welcome-close {
  background: none;
  border: 1px solid var(--phosphor-dark);
  color: var(--phosphor-dark);
  font-family: var(--mono);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}

.welcome-close:hover {
  color: var(--red);
  border-color: var(--red);
}

.welcome-body {
  padding: 20px;
}

.welcome-intro {
  color: var(--white);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.welcome-principles {
  margin-top: 1.5rem;
  border-top: 1px solid var(--phosphor-dark);
  padding-top: 1rem;
}

.welcome-principle {
  margin-bottom: 1.2rem;
  padding-left: 12px;
  border-left: 2px solid var(--phosphor-dark);
}

.welcome-principle h3 {
  color: var(--amber);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
  text-shadow: var(--glow-amber);
  font-weight: normal;
}

.welcome-principle p {
  color: var(--white-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

.welcome-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--phosphor-dark);
  text-align: center;
}

.welcome-enter {
  background: var(--phosphor);
  color: var(--void);
  border: none;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: bold;
  padding: 10px 24px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: box-shadow 0.15s;
}

.welcome-enter:hover {
  box-shadow: var(--glow);
}

/* --- Responsive: Welcome popup --- */

@media (max-width: 600px) {
  .welcome-popup {
    max-height: 90vh;
    margin: 0.5rem;
  }

  .welcome-body {
    padding: 16px;
  }

  .welcome-intro {
    font-size: 0.9rem;
  }

  .welcome-principle h3 {
    font-size: 0.78rem;
  }

  .welcome-principle p {
    font-size: 0.82rem;
  }
}

/* --- Print --- */
@media print {
  body::before,
  body::after {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    animation: none;
  }

  a {
    color: #000;
    text-shadow: none;
  }
}
/* ============================================================
   MOBILE RESPONSIVE FIXES — added for touch targets & mobile UX
   ============================================================ */

@media (max-width: 600px) {
  /* --- Menu items: full-width block, 44px touch targets --- */
  .menu-item {
    display: block;
    padding: 0.65rem 0.5rem;
    min-height: 44px;
    line-height: 1.5;
    margin-bottom: 2px;
    -webkit-tap-highlight-color: rgba(0, 255, 65, 0.15);
  }

  .menu-item:active {
    background: var(--void-mid);
    text-shadow: var(--glow);
  }

  /* --- Tier list (donation) links — full-height tappable --- */
  .tier-list a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 0.5rem;
  }

  .tier-list li {
    padding: 0.25rem 0;
  }

  /* --- Welcome popup close/enter buttons — larger targets --- */
  .welcome-close {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.2rem;
    padding: 4px 12px;
  }

  .welcome-enter {
    min-height: 48px;
    width: 100%;
    font-size: 1rem;
    padding: 14px 24px;
  }

  /* --- Guide links, dir listings, file listings — block-level, tappable --- */
  .guide-links a,
  .dir-listing a,
  .file-listing a {
    display: block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 0.25rem;
  }

  .guide-links li {
    padding: 0;
    text-indent: 0;
    padding-left: 0.5rem;
  }

  .guide-links li::before {
    content: '→ ';
  }

  .dir-listing li,
  .file-listing li {
    padding: 0;
  }

  /* --- Status bar links --- */
  .status-bar a {
    display: inline-block;
    min-height: 36px;
    line-height: 36px;
  }

  /* --- Prevent horizontal overflow --- */
  pre, table, .field-notes {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* --- :active states for all links (mobile has no hover) --- */
  a:active {
    text-shadow: var(--glow);
  }

  a.amber:active {
    text-shadow: var(--glow-amber);
  }

  /* --- Boot screen: allow tap to skip --- */
  #boot-screen {
    cursor: pointer;
  }
}

/* ============================================================
   ARTICLE CONTENT — Preservation subpages & long-form content
   Phosphor green terminal aesthetic for article pages.
   ============================================================ */

/* --- Page Hero --- */
.page-hero {
  background: var(--void-light);
  border-bottom: 2px solid var(--phosphor-dark);
  padding: 2rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--phosphor-dark), transparent);
}

.hero-content {
  max-width: 80ch;
  margin: 0 auto;
}

.page-hero h1 {
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  text-shadow: var(--glow);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.page-hero .subtitle {
  color: var(--white-dim);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* --- Back Link --- */
.back-link {
  display: inline-block;
  color: var(--phosphor-dim);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.25rem 0;
  border-bottom: 1px dotted var(--phosphor-dark);
  transition: all 0.15s ease;
}

.back-link:hover {
  color: var(--phosphor);
  text-shadow: var(--glow);
  border-bottom-color: var(--phosphor);
}

/* --- Article Card --- */
.article-card {
  background: var(--void-light);
  border: 1px solid var(--gray);
  margin-bottom: 1.5rem;
}

.article-content {
  padding: 1rem;
}

.article-content section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray);
}

.article-content section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* --- Article Headings --- */
.article-content h2 {
  color: var(--phosphor);
  font-size: 1.2rem;
  text-shadow: var(--glow-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--phosphor-dark);
}

.article-content h2::before {
  content: '\25B8 ';
  color: var(--amber);
}

.article-content h3 {
  color: var(--amber);
  font-size: 1rem;
  text-shadow: var(--glow-amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

/* --- Article Paragraphs --- */
.article-content p {
  color: var(--white);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.article-content p.muted {
  color: var(--white-dim);
  font-size: 0.85rem;
}

.article-content p.muted a {
  color: var(--phosphor-dim);
}

.article-content p.muted a:hover {
  color: var(--phosphor);
  text-shadow: var(--glow);
}

/* --- Article Lists --- */
.article-content ul,
.article-content ol {
  margin: 0.5rem 0 0.75rem 1.5rem;
  color: var(--white);
  line-height: 1.7;
}

.article-content ul {
  list-style: none;
  margin-left: 0;
  padding-left: 1.2em;
}

.article-content ul li {
  position: relative;
  padding-left: 0.5em;
  margin-bottom: 0.3rem;
}

.article-content ul li::before {
  content: '\25B8 ';
  color: var(--phosphor-dim);
  position: absolute;
  left: -1.2em;
}

.article-content ol {
  list-style: none;
  counter-reset: article-ol;
  padding-left: 0;
}

.article-content ol li {
  counter-increment: article-ol;
  position: relative;
  padding-left: 2em;
  margin-bottom: 0.4rem;
}

.article-content ol li::before {
  content: counter(article-ol) '.';
  color: var(--amber);
  position: absolute;
  left: 0;
  font-weight: bold;
  min-width: 1.5em;
}

.article-content li strong {
  color: var(--phosphor);
}

/* --- Article Blockquote --- */
.article-content blockquote {
  border-left: 3px solid var(--amber);
  background: var(--void-mid);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  color: var(--white-dim);
  font-style: italic;
}

.article-content blockquote p {
  margin-bottom: 0.3rem;
  color: var(--white-dim);
}

/* --- Article Tables --- */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.article-content thead {
  border-bottom: 2px solid var(--phosphor-dark);
}

.article-content th {
  color: var(--amber);
  text-shadow: var(--glow-amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  font-weight: bold;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--phosphor-dark);
}

.article-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray);
  color: var(--white);
  vertical-align: top;
}

.article-content tr:hover td {
  background: var(--void-mid);
}

.article-content td strong {
  color: var(--phosphor);
}

/* --- Callout / Tip / Warning Boxes --- */
.callout,
.tip,
.warning {
  border-left: 3px solid;
  background: var(--void-light);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.callout {
  border-left-color: var(--phosphor-dim);
}

.callout::before {
  content: '\25B8 ';
  color: var(--phosphor-dim);
}

.tip {
  border-left-color: var(--amber);
}

.tip::before {
  content: 'TIP: ';
  color: var(--amber);
  font-weight: bold;
}

.warning {
  border-left-color: var(--red);
}

.warning::before {
  content: 'WARNING: ';
  color: var(--red);
  font-weight: bold;
}

/* --- Code Highlighting --- */
.codehilite {
  background: var(--void-light);
  border: 1px solid var(--gray);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.codehilite pre {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}

/* Pygments token colors (inside .codehilite) */
.codehilite .k { color: var(--phosphor); }          /* Keyword */
.codehilite .n { color: var(--white); }            /* Name */
.codehilite .nf { color: var(--amber); }            /* Name.Function */
.codehilite .nv { color: var(--white-dim); }        /* Name.Variable */
.codehilite .nb { color: var(--phosphor-dim); }     /* Name.Builtin */
.codehilite .s1, .codehilite .s2, .codehilite .ss { color: var(--amber-dim); }  /* Strings */
.codehilite .mf, .codehilite .mi { color: var(--phosphor); }  /* Numbers */
.codehilite .c, .codehilite .c1 { color: var(--white-dim); }  /* Comments */
.codehilite .err { color: var(--red); }             /* Error */
.codehilite .ow { color: var(--phosphor); }          /* Operator.Word */
.codehilite .kr { color: var(--amber); }             /* Keyword.Reserved */
.codehilite .p { color: var(--white-dim); }          /* Punctuation */
.codehilite .o { color: var(--white-dim); }          /* Operator */
.codehilite .w { color: var(--gray); }              /* Whitespace */

/* --- Buttons (in article content) --- */
.article-content .btn,
.btn {
  display: inline-block;
  background: var(--void-light);
  color: var(--phosphor);
  border: 1px solid var(--phosphor-dark);
  padding: 0.4rem 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 0.25rem;
}

.article-content .btn:hover,
.btn:hover {
  background: var(--phosphor-dark);
  text-shadow: var(--glow);
  border-color: var(--phosphor);
}

/* --- Footer (article pages) --- */
.footer {
  border-top: 1px solid var(--phosphor-dark);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.footer-content {
  text-align: center;
}

.footer-links {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--phosphor-dim);
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--gray);
}

.footer-links a:last-child {
  border-right: none;
}

.footer-links a:hover {
  color: var(--phosphor);
  text-shadow: var(--glow);
}

.footer p {
  color: var(--white-dim);
  font-size: 0.8rem;
}

/* --- Article Responsive --- */
@media (max-width: 600px) {
  .page-hero {
    padding: 1.5rem 0.75rem;
  }

  .page-hero h1 {
    font-size: 1.2rem;
  }

  .article-content {
    padding: 0.75rem;
  }

  .article-content ul,
  .article-content ol {
    margin-left: 0.5rem;
  }

  .article-content table {
    font-size: 0.8rem;
  }

  .article-content th,
  .article-content td {
    padding: 0.4rem 0.5rem;
  }

  .footer-links a {
    display: block;
    border-right: none;
    border-bottom: 1px solid var(--gray);
    padding: 0.5rem 0;
    min-height: 44px;
    line-height: 44px;
  }

  .btn {
    display: block;
    text-align: center;
    min-height: 44px;
    line-height: 44px;
    padding: 0 1rem;
    margin: 0.5rem 0;
  }
}
