/* ================================================================
   IDL — Internal Didactics Log · Main Stylesheet
   Visual Identity: Geometric Expressionism · Fractal Abstraction
   Palette: Monochrome + Phosphor (#a3e4b0)
   ================================================================ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Palette */
  --void:          #0a0a0a;
  --obsidian:      #111111;
  --ash:           #1f1f1f;
  --graphite:      #3a3a3a;
  --smoke:         #888888;
  --chalk:         #d4d4d4;
  --white:         #f0f0f0;
  --phosphor:      #d9a441;
  --phosphor-dim:  #8b6426;
  --danger:        #c0392b;

  /* Background Assets */
  --bg-global:   url('/assets/Backgrounds/GlobalSiteBackground.png');
  --bg-entry:    url('/assets/Backgrounds/EntryHeaderBackground.png');
  --bg-glossary: url('/assets/Backgrounds/GlossaryBackground.png');
  --bg-search:   url('/assets/Backgrounds/SearchPageBackground.png');

  /* Typography */
  --font-heading:   'Space Grotesk',            'IBM Plex Sans', system-ui, sans-serif;
  --font-body:      'IBM Plex Sans',             'Inter',         system-ui, sans-serif;
  --font-mono:      'JetBrains Mono',            'IBM Plex Mono', monospace;
  --font-condensed: 'IBM Plex Sans Condensed',   'IBM Plex Sans', system-ui, sans-serif;

  /* Type Scale */
  --text-display: clamp(2.8rem, 6vw, 4.5rem);
  --text-h1:      clamp(1.8rem, 3.5vw, 2.75rem);
  --text-h2:      clamp(1.25rem, 2.5vw, 1.75rem);
  --text-h3:      1.375rem;
  --text-h4:      1.125rem;
  --text-body:    1rem;
  --text-small:   0.875rem;
  --text-micro:   0.75rem;
  --text-code:    0.8125rem;

  /* Spacing (8px base) */
  --s1:  0.25rem;
  --s2:  0.5rem;
  --s3:  1rem;
  --s4:  1.5rem;
  --s5:  2rem;
  --s6:  3rem;
  --s7:  4rem;
  --s8:  6rem;

  /* Layout */
  --container-max: 1100px;
  --content-max:   72ch;
  --nav-height:    48px;

  /* Motion */
  --ease-fast: 150ms ease;
  --ease-base: 250ms ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--void);
  background-image: linear-gradient(rgba(10,10,10,0.72), rgba(10,10,10,0.72)), var(--bg-global);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Page-level background mapping by asset title */
body.page-home {
  background-image: linear-gradient(rgba(10,10,10,0.72), rgba(10,10,10,0.72)), var(--bg-global);
}

body.page-search {
  background-image: linear-gradient(rgba(10,10,10,0.74), rgba(10,10,10,0.74)), var(--bg-search);
}

body.page-contact {
  background-image: linear-gradient(rgba(10,10,10,0.74), rgba(10,10,10,0.74)), var(--bg-search);
}

body.page-glossary {
  background-image: linear-gradient(rgba(10,10,10,0.74), rgba(10,10,10,0.74)), var(--bg-glossary);
}

body.page-entry,
body.page-year,
body.page-month {
  background-image: linear-gradient(rgba(10,10,10,0.72), rgba(10,10,10,0.72)), var(--bg-global);
}

img, video, svg { max-width: 100%; display: block; }
a { color: inherit; }

/* ── Canvas Background — Neural Lattice Noise ───────────────── */
/*   Visual ref: global_site_bg_prompt.txt · Variant 4           */
#fractal-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.28;
  pointer-events: none;
}

/* Secondary grid overlay — adds fractal depth layer */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(240,240,240,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,240,240,0.028) 1px, transparent 1px),
    linear-gradient(rgba(240,240,240,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,240,240,0.012) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  pointer-events: none;
}

/* ── Site Wrapper ───────────────────────────────────────────── */
.site-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: page-in 0.35s ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Container ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--s6);
}

@media (max-width: 768px) {
  .container { padding: 0 var(--s3); }
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(10, 10, 10, 0.88);
  border-bottom: 1px solid var(--ash);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s6);
}

@media (max-width: 768px) {
  .nav-bar { padding: 0 var(--s3); }
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color var(--ease-fast);
}

.nav-logo::before {
  content: '// ';
  color: var(--phosphor);
  font-weight: 400;
  letter-spacing: 0;
}

.nav-logo:hover { color: var(--phosphor); }

.nav-links {
  display: flex;
  gap: var(--s5);
  align-items: center;
}

.nav-link {
  font-family: var(--font-condensed);
  font-size: var(--text-micro);
  font-weight: 500;
  color: var(--smoke);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--ease-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--phosphor);
}

/* ── Shared Hero Structure ──────────────────────────────────── */
.site-hero,
.entry-hero,
.glossary-hero,
.search-hero {
  position: relative;
  padding: var(--s8) 0 var(--s6);
  border-bottom: 1px solid var(--ash);
  overflow: hidden;
}

/* Scanline texture common to all heroes */
.site-hero::after,
.entry-hero::after,
.glossary-hero::after,
.search-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.09) 3px,
    rgba(0,0,0,0.09) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Site Hero — Neural Lattice / Penrose mood ──────────────── */
/*   Visual ref: global_site_bg_prompt.txt · Variant 1 & 4       */
.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(10,10,10,0.72), rgba(10,10,10,0.82)),
    var(--bg-global),
    repeating-radial-gradient(
      ellipse at 15% 85%,
      transparent 0,
      transparent 55px,
      rgba(163, 228, 176, 0.025) 55px,
      rgba(163, 228, 176, 0.025) 56px
    ),
    repeating-radial-gradient(
      ellipse at 85% 15%,
      transparent 0,
      transparent 55px,
      rgba(240, 240, 240, 0.022) 55px,
      rgba(240, 240, 240, 0.022) 56px
    );
  background-size: cover, cover, auto, auto;
  background-position: center, center, center, center;
  pointer-events: none;
}

/* ── Entry Hero — Interference Pattern Stripe ───────────────── */
/*   Visual ref: entry_header_bg_prompt.txt · Variant 2           */
.entry-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(10,10,10,0.7), rgba(10,10,10,0.84)),
    var(--bg-entry),
    repeating-radial-gradient(
      ellipse at 22% 50%,
      transparent 0,
      transparent 38px,
      rgba(240, 240, 240, 0.04) 38px,
      rgba(240, 240, 240, 0.04) 39px
    ),
    repeating-radial-gradient(
      ellipse at 78% 50%,
      transparent 0,
      transparent 38px,
      rgba(240, 240, 240, 0.04) 38px,
      rgba(240, 240, 240, 0.04) 39px
    );
  background-size: cover, cover, auto, auto;
  background-position: center, center, center, center;
  pointer-events: none;
}

/* ── Glossary Hero — Radial Index Burst ─────────────────────── */
/*   Visual ref: glossary_bg_prompt.txt · Variant 4               */
.glossary-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(10,10,10,0.7), rgba(10,10,10,0.84)),
    var(--bg-glossary),
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      rgba(240,240,240,0.04) 0deg 0.4deg,
      transparent 0.4deg 5.4deg
    );
  background-size: cover, cover, auto;
  background-position: center, center, center;
  pointer-events: none;
}

/* ── Search Hero — Radar Sweep + Concentric Rings ───────────── */
/*   Visual ref: search_bg_prompt.txt · Variant 1                 */
.search-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(10,10,10,0.7), rgba(10,10,10,0.84)),
    var(--bg-search),
    repeating-radial-gradient(
      circle at 50% 50%,
      transparent 0,
      transparent 44px,
      rgba(240, 240, 240, 0.028) 44px,
      rgba(240, 240, 240, 0.028) 45px
    );
  background-size: cover, cover, auto;
  background-position: center, center, center;
  pointer-events: none;
}

/* Radar sweep — rotating phosphor arc */
.search-hero .radar-sweep {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 352deg,
    rgba(163, 228, 176, 0.06) 352deg 358deg,
    transparent 358deg 360deg
  );
  animation: radar 6s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes radar {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Hero Typography ────────────────────────────────────────── */
.hero-eyebrow {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--phosphor);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--s4);
}

.hero-eyebrow::before {
  content: '> ';
  opacity: 0.55;
}

.hero-title {
  position: relative;
  z-index: 2;
  font-family: var(--font-heading);
  font-size: var(--text-display);
  font-weight: 700;
  color: var(--white);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: var(--s5);
}

/* Blinking terminal cursor */
.cursor {
  display: inline-block;
  width: 0.07em;
  height: 0.85em;
  background: var(--phosphor);
  margin-left: 0.06em;
  vertical-align: middle;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-desc {
  position: relative;
  z-index: 2;
  font-size: var(--text-small);
  color: var(--smoke);
  max-width: 520px;
  line-height: 1.75;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--graphite);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--ash);
  margin-bottom: var(--s6);
  letter-spacing: 0.04em;
}

.breadcrumb a {
  color: var(--smoke);
  text-decoration: none;
  transition: color var(--ease-fast);
}

.breadcrumb a:hover  { color: var(--phosphor); }
.breadcrumb span     { color: var(--graphite); margin: 0 var(--s2); }

/* ── Section ────────────────────────────────────────────────── */
.section {
  padding: var(--s7) 0;
  border-bottom: 1px solid var(--ash);
}

.section:last-child { border-bottom: none; }

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: var(--s5);
}

.section-title::after {
  content: ' /';
  color: var(--graphite);
  font-weight: 400;
}

.feed-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
  margin-bottom: var(--s4);
}

.feed-btn {
  border: 1px solid var(--ash);
  background: var(--obsidian);
  color: var(--smoke);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color var(--ease-fast), color var(--ease-fast), background var(--ease-fast);
}

.feed-btn:hover {
  border-color: var(--graphite);
  color: var(--chalk);
}

.feed-btn.active {
  border-color: var(--phosphor-dim);
  color: var(--phosphor);
  background: #0e1610;
}

.feed-status {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--graphite);
  margin-left: var(--s2);
}

.feed-empty {
  border: 1px dashed var(--ash);
  padding: var(--s4);
  color: var(--smoke);
  font-size: var(--text-small);
  background: rgba(17, 17, 17, 0.7);
}

/* ── Entry Cards ────────────────────────────────────────────── */
.entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
  max-width: 960px;
}

.entry-card {
  background: var(--obsidian);
  border: 1px solid var(--ash);
  padding: 0;
  text-decoration: none;
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  position: relative;
  overflow: hidden;
  transition: border-color var(--ease-fast);
}

@media (max-width: 860px) {
  .entry-card {
    grid-template-columns: 1fr;
  }
}

.card-media {
  position: relative;
  min-height: 220px;
  border-right: 1px solid var(--ash);
  overflow: hidden;
}

@media (max-width: 860px) {
  .card-media {
    border-right: none;
    border-bottom: 1px solid var(--ash);
    min-height: 180px;
  }
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.08);
  transform: scale(1.02);
  transition: transform var(--ease-base), filter var(--ease-base);
}

.entry-card:hover .card-media img {
  transform: scale(1.05);
  filter: grayscale(20%) contrast(1.1);
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4);
}

.card-meta {
  display: flex;
  gap: var(--s3);
  align-items: center;
}

/* Phosphor line slides up on hover */
.entry-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--phosphor), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease-base);
}

.entry-card:hover                 { border-color: var(--graphite); }
.entry-card:hover::before         { transform: scaleX(1); }

.card-date {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--smoke);
  letter-spacing: 0.06em;
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: color var(--ease-fast);
}

.entry-card:hover .card-title { color: var(--phosphor); }

.card-abstract {
  font-size: var(--text-small);
  color: var(--smoke);
  line-height: 1.65;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: auto;
}

.card-read-more {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--graphite);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: var(--s2);
  transition: color var(--ease-fast), transform var(--ease-fast);
}

.entry-card:hover .card-read-more {
  color: var(--phosphor);
  transform: translateX(4px);
}

/* ── Tags ───────────────────────────────────────────────────── */
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--smoke);
  border: 1px solid var(--graphite);
  padding: 2px 6px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--ease-fast), border-color var(--ease-fast);
  display: inline-block;
}

.tag::before  { content: '#'; color: var(--graphite); transition: color var(--ease-fast); }
.tag:hover    { color: var(--phosphor); border-color: var(--phosphor); }
.tag:hover::before { color: var(--phosphor-dim); }

/* ── Archive — Year List ─────────────────────────────────────── */
.year-list {
  display: flex;
  flex-direction: column;
}

.year-item {
  display: flex;
  align-items: baseline;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--ash);
  text-decoration: none;
  transition: padding-left var(--ease-base);
}

.year-item:hover  { padding-left: var(--s3); }

.year-number {
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  transition: color var(--ease-fast);
}

.year-count {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--graphite);
  letter-spacing: 0.06em;
}

.year-item:hover .year-number { color: var(--phosphor); }

/* ── Profile Section ───────────────────────────────────────── */
.profile-section {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 340px;
  border: 1px solid var(--ash);
  background-image:
    linear-gradient(120deg, rgba(10,10,10,0.46), rgba(10,10,10,0.74)),
    url('/assets/Backgrounds/AvatarSilhouetteBackground.png');
  background-size: cover;
  background-position: center right;
  overflow: hidden;
}

.profile-panel {
  position: relative;
  max-width: 820px;
  width: min(820px, 78%);
  padding: var(--s6);
  background: linear-gradient(110deg, rgba(10, 10, 10, 0.7), rgba(10, 10, 10, 0.38));
  border-right: 1px solid rgba(58, 58, 58, 0.5);
  backdrop-filter: blur(2px);
}

.profile-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--phosphor);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--s3);
}

.profile-title {
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: var(--s4);
}

.profile-text {
  font-size: var(--text-small);
  line-height: 1.95;
  color: var(--chalk);
  max-width: 68ch;
  white-space: pre-line;
}

@media (max-width: 768px) {
  .profile-panel {
    width: 100%;
    padding: var(--s4);
  }
}

/* ── Month Grid ─────────────────────────────────────────────── */
.month-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s3);
}

.month-item {
  padding: var(--s3) var(--s4);
  border: 1px solid var(--ash);
  background: var(--obsidian);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color var(--ease-fast);
}

.month-item:hover { border-color: var(--graphite); }

.month-name {
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: 600;
  color: var(--white);
  transition: color var(--ease-fast);
}

.month-item:hover .month-name { color: var(--phosphor); }

.month-count {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--graphite);
}

/* ── Entry Page Layout ──────────────────────────────────────── */
.entry-content {
  padding: var(--s7) 0;
}

.entry-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: var(--s7);
  align-items: start;
}

@media (max-width: 1024px) {
  .entry-layout    { grid-template-columns: 1fr; }
  .entry-toc       { display: none; }
}

.entry-body { max-width: var(--content-max); }

/* ── Table of Contents ──────────────────────────────────────── */
.entry-toc {
  position: sticky;
  top: calc(var(--nav-height) + var(--s4));
  border: 1px solid var(--ash);
  padding: var(--s3) var(--s4);
  background: var(--obsidian);
}

.toc-title {
  font-family: var(--font-condensed);
  font-size: var(--text-micro);
  font-weight: 500;
  color: var(--graphite);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--s3);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--ash);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.toc-list a {
  font-size: var(--text-small);
  color: var(--smoke);
  text-decoration: none;
  display: block;
  line-height: 1.4;
  transition: color var(--ease-fast), padding-left var(--ease-fast);
}

.toc-list a:hover,
.toc-list a.active { color: var(--phosphor); }

.toc-list a.active { padding-left: var(--s2); }

.toc-h3 a {
  padding-left: var(--s3);
  font-size: var(--text-micro);
  color: var(--graphite);
}

/* ── Article Typography ─────────────────────────────────────── */
.entry-body h2,
.entry-body h3,
.entry-body h4 {
  font-family: var(--font-heading);
  color: var(--white);
  letter-spacing: -0.01em;
  margin-top: var(--s6);
  margin-bottom: var(--s3);
}

.entry-body h2 {
  font-size: var(--text-h2);
  font-weight: 600;
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--ash);
}

.entry-body h3 { font-size: var(--text-h3); font-weight: 600; }
.entry-body h4 { font-size: var(--text-h4); font-weight: 500; }

.entry-body p  { margin-bottom: var(--s4); color: var(--chalk); }

.entry-body a {
  color: var(--phosphor);
  text-decoration: none;
  border-bottom: 1px solid var(--phosphor-dim);
  transition: border-color var(--ease-fast);
}

.entry-body a:hover { border-bottom-color: var(--phosphor); }

.entry-body ul,
.entry-body ol  { padding-left: var(--s5); margin-bottom: var(--s4); }
.entry-body li  { margin-bottom: var(--s2); color: var(--chalk); }

.entry-body strong { color: var(--white); font-weight: 600; }
.entry-body em     { color: var(--chalk); }

/* ── Abstract Block ─────────────────────────────────────────── */
.entry-abstract {
  border-left: 3px solid var(--phosphor);
  background: var(--obsidian);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s6);
}

.abstract-label {
  font-family: var(--font-condensed);
  font-size: var(--text-micro);
  font-weight: 500;
  color: var(--phosphor);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--s2);
}

.abstract-text {
  font-size: var(--text-small);
  color: var(--chalk);
  line-height: 1.75;
  font-style: italic;
}

/* ── Callout Boxes ──────────────────────────────────────────── */
.callout {
  border-left: 3px solid var(--graphite);
  background: var(--obsidian);
  padding: var(--s3) var(--s4);
  margin: var(--s5) 0;
}

.callout-label {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--s2);
}

.callout.note       { border-left-color: var(--smoke);   }
.callout.note       .callout-label { color: var(--smoke);   }
.callout.definition { border-left-color: var(--phosphor); }
.callout.definition .callout-label { color: var(--phosphor); }
.callout.warning    { border-left-color: var(--danger);   }
.callout.warning    .callout-label { color: var(--danger);   }
.callout.insight    { border-left-color: var(--white);    }
.callout.insight    .callout-label { color: var(--white);    }

/* Contact page: keep form panel readable over the themed background */
.contact-card {
  background: rgba(12, 12, 12, 0.42);
  border: 1px solid var(--ash);
  border-left: 3px solid var(--phosphor-dim);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

/* ── Code Blocks ────────────────────────────────────────────── */
pre {
  position: relative;
  background: #0d0d0d;
  border: 1px solid var(--ash);
  border-left: 3px solid var(--graphite);
  padding: var(--s4);
  overflow-x: auto;
  margin: var(--s5) 0;
  transition: border-left-color var(--ease-fast);
}

pre:hover { border-left-color: var(--phosphor-dim); }

code {
  font-family: var(--font-mono);
  font-size: var(--text-code);
  line-height: 1.65;
  color: #c9d1d9;
}

pre code { background: none; border: none; padding: 0; }

:not(pre) > code {
  background: var(--obsidian);
  border: 1px solid var(--ash);
  padding: 1px 5px;
  font-size: var(--text-code);
  color: var(--chalk);
}

.code-lang {
  position: absolute;
  top: var(--s2);
  right: var(--s3);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--graphite);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
}

/* ── Tables ─────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s5) 0;
  font-size: var(--text-small);
}

th {
  font-family: var(--font-condensed);
  font-size: var(--text-micro);
  font-weight: 500;
  color: var(--smoke);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--ash);
  background: var(--obsidian);
}

td {
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--ash);
  color: var(--chalk);
  vertical-align: top;
}

tr:hover td { background: rgba(255,255,255,0.018); }

/* ── Open Questions ─────────────────────────────────────────── */
.open-questions { list-style: none; margin: var(--s3) 0; }

.open-questions li {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--ash);
  font-size: var(--text-small);
  color: var(--chalk);
}

.open-questions li::before {
  content: '[ ]';
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--graphite);
  flex-shrink: 0;
  margin-top: 3px;
}

/* ── Figures & Media ────────────────────────────────────────── */
figure {
  margin: var(--s5) 0;
}

.entry-cover {
  margin-top: 0;
  border: 1px solid var(--ash);
  background: var(--obsidian);
}

.entry-cover img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  opacity: 0.9;
  filter: grayscale(100%) contrast(1.1);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s3);
  margin: var(--s5) 0;
}

.media-grid figure {
  margin: 0;
  border: 1px solid var(--ash);
  background: var(--obsidian);
  padding: var(--s2);
}

.media-grid img,
.media-grid video {
  width: 100%;
  height: 180px;
  object-fit: cover;
  filter: grayscale(100%);
}

figcaption {
  font-family: var(--font-condensed);
  font-size: var(--text-micro);
  color: var(--smoke);
  margin-top: var(--s2);
  line-height: 1.5;
}

figcaption strong {
  color: var(--white);
  font-weight: 500;
}

/* ── Entry Metadata ─────────────────────────────────────────── */
.entry-meta {
  padding: var(--s5) 0;
  border-top: 1px solid var(--ash);
  margin-top: var(--s6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  align-items: flex-start;
}

.meta-group {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.meta-label {
  font-family: var(--font-condensed);
  font-size: var(--text-micro);
  color: var(--graphite);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meta-value {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--smoke);
}

/* ── Entry Navigation ───────────────────────────────────────── */
.entry-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
  padding: var(--s5) 0;
  border-top: 1px solid var(--ash);
}

.entry-nav-item {
  padding: var(--s3) var(--s4);
  border: 1px solid var(--ash);
  background: var(--obsidian);
  text-decoration: none;
  transition: border-color var(--ease-fast);
}

.entry-nav-item:hover { border-color: var(--graphite); }
.entry-nav-item.next  { text-align: right; }

.nav-direction {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--graphite);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--s2);
}

.nav-entry-title {
  font-size: var(--text-small);
  color: var(--chalk);
  line-height: 1.4;
}

/* ── Glossary ───────────────────────────────────────────────── */
.glossary-alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--ash);
  margin-bottom: var(--s6);
}

.alpha-link {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--smoke);
  text-decoration: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ash);
  transition: color var(--ease-fast), border-color var(--ease-fast);
}

.alpha-link:hover        { color: var(--phosphor); border-color: var(--phosphor); }
.alpha-link.empty        { color: var(--graphite); border-color: transparent; pointer-events: none; }

.glossary-section  { margin-bottom: var(--s6); }

.glossary-letter {
  font-family: var(--font-heading);
  font-size: var(--text-display);
  font-weight: 700;
  color: var(--ash);
  line-height: 1;
  margin-bottom: var(--s4);
  letter-spacing: -0.03em;
  user-select: none;
}

.glossary-term {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--ash);
}

.term-name {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--s2);
}

.term-definition {
  font-size: var(--text-body);
  color: var(--chalk);
  line-height: 1.7;
  margin-bottom: var(--s2);
}

.term-seealso {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--graphite);
  margin-top: var(--s2);
}

.term-seealso a {
  color: var(--smoke);
  text-decoration: none;
  transition: color var(--ease-fast);
}

.term-seealso a:hover { color: var(--phosphor); }

/* ── Search ─────────────────────────────────────────────────── */
.search-form {
  display: flex;
  border: 1px solid var(--ash);
  margin-bottom: var(--s6);
  transition: border-color var(--ease-fast);
}

.search-form:focus-within { border-color: var(--graphite); }

.search-input {
  flex: 1;
  background: var(--obsidian);
  border: none;
  border-right: 1px solid var(--ash);
  padding: var(--s3) var(--s4);
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--chalk);
  outline: none;
  caret-color: var(--phosphor);
  transition: background var(--ease-fast);
}

.search-input::placeholder { color: var(--graphite); }
.search-input:focus         { background: #0d0d0d; }

.search-btn {
  background: var(--ash);
  border: none;
  padding: var(--s3) var(--s5);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--smoke);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--ease-fast), color var(--ease-fast);
}

.search-btn:hover { background: var(--graphite); color: var(--phosphor); }

.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s5);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--ash);
  align-items: center;
}

.filter-label {
  font-family: var(--font-condensed);
  font-size: var(--text-micro);
  color: var(--graphite);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: var(--s2);
}

.search-result {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--ash);
}

.result-date {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--graphite);
  letter-spacing: 0.06em;
  margin-bottom: var(--s2);
}

.result-title {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  line-height: 1.3;
  display: block;
  margin-bottom: var(--s2);
  transition: color var(--ease-fast);
}

.result-title:hover { color: var(--phosphor); }

.result-abstract {
  font-size: var(--text-small);
  color: var(--smoke);
  line-height: 1.65;
  margin-bottom: var(--s3);
}

.no-results {
  padding: var(--s7) 0;
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--graphite);
  text-align: center;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  height: var(--nav-height);
  background: rgba(10,10,10,0.92);
  border-top: 1px solid var(--ash);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s6);
  font-family: var(--font-condensed);
  font-size: var(--text-micro);
  color: var(--graphite);
  margin-top: auto;
}

@media (max-width: 768px) { .site-footer { padding: 0 var(--s3); } }

.footer-top {
  color: var(--graphite);
  text-decoration: none;
  font-family: var(--font-mono);
  transition: color var(--ease-fast);
}

.footer-top:hover { color: var(--phosphor); }

/* ── Utilities ──────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

hr {
  border: none;
  border-top: 1px solid var(--ash);
  margin: var(--s5) 0;
}

blockquote {
  border-left: 3px solid var(--graphite);
  padding: var(--s2) var(--s4);
  margin: var(--s4) 0;
  color: var(--smoke);
  font-style: italic;
}

/* ── Admin / Editing UI ────────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--s5);
}

@media (max-width: 1024px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  border: 1px solid var(--ash);
  background: rgba(17, 17, 17, 0.82);
  padding: var(--s4);
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.admin-field-full {
  grid-column: 1 / -1;
}

.admin-field label {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--smoke);
  letter-spacing: 0.05em;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
  background: #0d0d0d;
  border: 1px solid var(--ash);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: var(--text-small);
  padding: 0.55rem 0.65rem;
  outline: none;
}

.admin-field textarea {
  resize: vertical;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
  border-color: var(--phosphor-dim);
}

.admin-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  align-items: center;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.admin-item {
  width: 100%;
  border: 1px solid var(--ash);
  background: rgba(17, 17, 17, 0.82);
  padding: var(--s3);
  text-align: left;
  color: var(--chalk);
}

button.admin-item {
  cursor: pointer;
}

.admin-item:hover {
  border-color: var(--graphite);
}

.admin-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s2);
  margin-bottom: var(--s2);
}
