/* ═══════════════════════════════════════════════════════════
   CORRUPT EARTH — Design System
   Dark & Gritty · Blood Red · Rust · Decay
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&family=Share+Tech+Mono&family=Barlow:ital,wght@0,300;0,400;0,600;0,700;1,300&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --black:        #0a0805;
  --dark:         #110e0a;
  --surface:      #1a1410;
  --surface2:     #221c16;
  --surface3:     #2a221a;
  --border:       #2e2318;
  --border2:      #3d2e20;

  --blood:        #7a1515;
  --blood-mid:    #b01e1e;
  --blood-bright: #c44d22;
  --rust:         #8b3a1a;
  --ember:        #d4611a;
  --amber:        #c4832a;

  --ash:          #4a4035;
  --muted:        #7a6a58;
  --text:         #c8b89a;
  --text-dim:     #7a6a58;
  --text-bright:  #e8d4b8;
  --text-faint:   #4a4035;

  --green:        #3a5c2a;
  --green-bright: #5a8c3a;
  --green-text:   #7ab85a;

  --font-display: 'Black Ops One', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;
  --font-body:    'Barlow', sans-serif;

  --radius-sm:    2px;
  --radius:       4px;

  --transition:   0.15s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.35;
  mix-blend-mode: overlay;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--ash); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-bright);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.3rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; }

p { margin-bottom: 1rem; color: var(--text); }
p:last-child { margin-bottom: 0; }

a { color: var(--blood-bright); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--ember); }

strong { font-weight: 600; color: var(--text-bright); }
em { font-style: italic; color: var(--text); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--blood-mid);
  background: var(--surface2);
  padding: 1px 6px;
  border: 1px solid var(--border);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  padding: 1.2rem 1.5rem;
  overflow-x: auto;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ── LAYOUT ── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── NAV ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 8, 5, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-bright);
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-decoration: none;
}
.nav-logo:hover { color: var(--text-bright); }
.nav-logo span { color: var(--blood-mid); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-bright);
  border-color: var(--border2);
}
.nav-links a.active {
  color: var(--blood-bright);
  border-color: var(--blood);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text-dim);
  transition: var(--transition);
}

/* ── HERO ── */
.hero {
  position: relative;
  min-height: calc(100vh - 58px);
  display: flex;
  align-items: flex-end;
  padding-bottom: 5rem;
  overflow: hidden;
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}

.hero > .container {
  width: 100%;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blood-bright);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: '';
  width: 30px; height: 1px;
  background: var(--blood-bright);
  display: inline-block;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 7rem);
  color: var(--text-bright);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-shadow: 0 0 60px rgba(176, 30, 30, 0.35), 3px 3px 0 rgba(0,0,0,0.9);
}
.hero-title .accent { color: var(--blood-mid); }

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text);
  max-width: 520px;
  margin-top: 1.2rem;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.hero-cta-row {
  display: flex;
  gap: 14px;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
  animation: scrollBounce 2.4s ease-in-out infinite;
  user-select: none;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.7rem 1.6rem;
  min-height: 44px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--blood-mid);
  color: var(--text-bright);
}
.btn-primary:hover {
  background: var(--blood-bright);
  color: var(--text-bright);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--ash);
  clip-path: none;
  padding: 0.65rem 1.5rem;
}
.btn-ghost:hover {
  color: var(--text-bright);
  border-color: var(--muted);
}

.btn-danger {
  background: var(--blood);
  color: var(--text-bright);
}
.btn-danger:hover { background: var(--blood-mid); color: var(--text-bright); }

.btn-sm {
  font-size: 10px;
  padding: 0.45rem 1rem;
}

/* ── SECTION LAYOUT ── */
.section {
  padding: 5rem 0;
}
.section--sm { padding: 3rem 0; }
.section--lg { padding: 7rem 0; }
.section--dark { background: var(--dark); }
.section--surface { background: var(--surface); }

.section-header {
  margin-bottom: 3rem;
}
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blood-bright);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-eyebrow::before {
  content: '';
  width: 20px; height: 1px;
  background: var(--blood-bright);
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--rust);
  padding: 1.5rem;
  position: relative;
  transition: border-color var(--transition);
}
.card::before {
  content: '';
  position: absolute;
  top: -2px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blood-mid), transparent);
}
.card:hover { border-color: var(--border2); }

.card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.card-body {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1px;
  background: var(--border);
}
.card-grid .card { margin: 0; }

/* ── STATUS BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-complete  { color: var(--green-text);    border-color: var(--green);         background: rgba(58,92,42,0.15); }
.badge-progress  { color: var(--ember);          border-color: rgba(212,97,26,0.4);  background: rgba(212,97,26,0.08); }
.badge-planned   { color: var(--muted);          border-color: var(--ash);           background: transparent; }

/* ── STAT BLOCKS ── */
.stat-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  text-align: center;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-bright);
  line-height: 1;
  display: block;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blood-bright);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
}

/* ── DIVIDERS ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.divider-glyph {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0;
  color: var(--blood-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.divider-glyph::before, .divider-glyph::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── PROGRESS BAR ── */
.progress-bar {
  background: var(--surface2);
  height: 3px;
  position: relative;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blood), var(--blood-bright));
  position: relative;
  transition: width 0.6s ease;
}
.progress-fill.complete {
  background: linear-gradient(90deg, var(--green), var(--green-bright));
}

/* ── FORMS ── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--ash);
  border-bottom: 2px solid var(--rust);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem; /* ≥16px prevents iOS auto-zoom */
  font-weight: 400;
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  appearance: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  background: var(--surface3);
  border-color: var(--ash);
  border-bottom-color: var(--blood-mid);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-faint); }
.form-textarea { resize: vertical; min-height: 140px; font-family: var(--font-body); }
.form-select { cursor: pointer; background-image: none; }
.form-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}
.form-error {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blood-bright);
  letter-spacing: 0.1em;
  margin-top: 0.3rem;
}

/* ── TAGS ── */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 10px;
  min-height: 32px;
  border: 1px solid var(--border2);
  color: var(--muted);
  background: var(--surface2);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition), border-color var(--transition);
}
.tag:hover, .tag.active {
  color: var(--text-bright);
  border-color: var(--blood);
}
.tag.active { color: var(--blood-bright); }

/* ── SEARCH BAR ── */
.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-bottom: 2px solid var(--ash);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem; /* ≥16px prevents iOS auto-zoom */
  letter-spacing: 0.05em;
  padding: 0.65rem 0.9rem 0.65rem 2.4rem;
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-bottom-color: var(--blood-mid); }
.search-input::placeholder { color: var(--text-faint); font-size: 11px; }

/* ── ALERTS / NOTICES ── */
.alert {
  padding: 0.9rem 1.2rem;
  border-left: 3px solid;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.alert-danger { border-color: var(--blood-mid); background: rgba(122,21,21,0.1); color: var(--text); }
.alert-success { border-color: var(--green-bright); background: rgba(58,92,42,0.1); color: var(--text); }
.alert-warning { border-color: var(--amber); background: rgba(196,131,42,0.1); color: var(--text); }
.alert-info { border-color: var(--ash); background: var(--surface2); color: var(--text); }

/* ── FOOTER ── */
.site-footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand .nav-logo {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  display: block;
}
.footer-brand p {
  font-size: 0.83rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.footer-nav h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 0.9rem;
}
.footer-nav ul { list-style: none; }
.footer-nav ul li { margin-bottom: 0.4rem; }
.footer-nav ul a {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color var(--transition);
}
.footer-nav ul a:hover { color: var(--text-bright); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── ADMIN PANEL ── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--dark);
  border-right: 1px solid var(--border);
  padding: 2rem 0;
}
.admin-sidebar .nav-logo {
  padding: 0 1.5rem;
  display: block;
  margin-bottom: 2rem;
  font-size: 1rem;
}
.admin-nav { list-style: none; }
.admin-nav a {
  display: block;
  padding: 0.6rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-left: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.admin-nav a:hover, .admin-nav a.active {
  color: var(--text-bright);
  background: var(--surface);
  border-left-color: var(--blood-mid);
}
.admin-content { padding: 2.5rem; }
.admin-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* ── BLOG ── */
.blog-post-header { margin-bottom: 2.5rem; }
.blog-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.blog-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.blog-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.blog-body h2 { margin: 2rem 0 0.75rem; font-size: 1.4rem; }
.blog-body h3 { margin: 1.5rem 0 0.6rem; font-size: 1.1rem; }
.blog-body p { margin-bottom: 1.1rem; }
.blog-body ul, .blog-body ol { margin: 0 0 1rem 1.5rem; }
.blog-body li { margin-bottom: 0.4rem; }
.blog-body blockquote {
  border-left: 3px solid var(--rust);
  padding: 0.75rem 1.25rem;
  background: var(--surface2);
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-dim);
}

.blog-figure { margin: 1.75rem 0; }
.blog-figure img { max-width: 100%; height: auto; display: block; border: 1px solid var(--border); }

.blog-yt { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin: 1.75rem 0; border: 1px solid var(--border); }
.blog-yt iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  display: block;
  transition: border-color var(--transition);
  text-decoration: none;
  position: relative;
}
.post-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--blood);
  transition: background var(--transition);
}
.post-card:hover { border-color: var(--border2); color: inherit; }
.post-card:hover::after { background: var(--blood-bright); }
.post-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}
.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

/* ── DOCS ── */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 58px;
  max-height: calc(100vh - 58px);
  overflow-y: auto;
  background: var(--dark);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0 3rem;
}
.docs-sidebar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blood-bright);
  padding: 0 1.25rem;
  margin-bottom: 0.5rem;
  margin-top: 1.25rem;
}
.docs-sidebar-link {
  display: block;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition), background var(--transition);
  border-left: 2px solid transparent;
}
.docs-sidebar-link:hover, .docs-sidebar-link.active {
  color: var(--text-bright);
  background: var(--surface2);
  border-left-color: var(--blood);
}

.docs-content { padding: 2.5rem 3rem; }
.docs-search-wrap { padding: 1.5rem 1.25rem; border-bottom: 1px solid var(--border); }

.class-block {
  margin-bottom: 3rem;
  border: 1px solid var(--border);
  border-top: 2px solid var(--rust);
}
.class-header {
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
}
.class-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-bright);
}
.class-parent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--blood-mid);
}
.class-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
.class-body { padding: 1.5rem; }
.class-desc {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.prop-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prop-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blood-bright);
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.prop-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
}
.prop-table tr:last-child td { border-bottom: none; }
.prop-table .prop-name { color: var(--text-bright); font-family: var(--font-mono); font-size: 11px; }
.prop-table .prop-type { color: var(--ember); font-family: var(--font-mono); font-size: 11px; }
.prop-table .prop-default { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }

.callback-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.callback-sig {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blood-bright);
  margin-bottom: 0.5rem;
}
.callback-desc {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.callback-params { list-style: none; }
.callback-params li {
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 0.2rem 0;
  display: flex;
  gap: 0.5rem;
}
.callback-params .param-name { color: var(--text); font-family: var(--font-mono); font-size: 11px; }
.callback-params .param-type { color: var(--ember); font-family: var(--font-mono); font-size: 11px; }

/* ── ROADMAP ── */
.phase-block {
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.phase-header {
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.phase-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-bright);
}
.phase-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-right: 0.5rem;
}
.phase-body {
  padding: 1.25rem 1.5rem;
}
.phase-items { list-style: none; }
.phase-items li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.88rem;
}
.phase-items li:last-child { border-bottom: none; }
.phase-item-name { color: var(--text); font-weight: 400; }
.phase-item-desc { color: var(--text); font-size: 0.85rem; flex: 1; }

/* ── UTILITY ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-mono   { font-family: var(--font-mono); }
.text-dim    { color: var(--text-dim); }
.text-bright { color: var(--text-bright); }
.text-blood  { color: var(--blood-bright); }
.text-ember  { color: var(--ember); }
.text-green  { color: var(--green-text); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .docs-content { padding: 2rem 1.5rem; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 58px; left: 0; right: 0; background: rgba(10,8,5,0.98); border-bottom: 1px solid var(--border); padding: 1rem; gap: 0.25rem; z-index: 99; }
  .nav-hamburger { display: flex; }
  .hero-title { font-size: clamp(2.5rem, 12vw, 4rem); }
  .hero { min-height: calc(100svh - 58px); padding-bottom: 4rem; }
  .section { padding: 3rem 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .container { padding: 0 1rem; }
  .card-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 1.5rem 1rem; }
  .hero-cta-row { flex-direction: column; }
  .btn { text-align: center; justify-content: center; }
}

/* ── LANDSCAPE / SHORT VIEWPORT ── */
@media (max-height: 500px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 58px; left: 0; right: 0; background: rgba(10,8,5,0.98); border-bottom: 1px solid var(--border); padding: 1rem; gap: 0.25rem; z-index: 99; }
  .nav-hamburger { display: flex; }
  .hero {
    min-height: 0;
    padding: 2rem 0 2.5rem;
    align-items: center;
  }
  .hero-title { font-size: clamp(1.8rem, 6vh, 3rem); }
  .hero-tagline { font-size: 0.9rem; margin-top: 0.75rem; }
  .hero-cta-row { margin-top: 1rem; }
  .hero-scroll-hint { display: none; }
}

/* ── HERO THEME SWITCHING ── */
.hero-art--dark,
.hero-art--light {
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.hero-art--light {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
[data-theme="light"] .hero-art--dark  { opacity: 0; visibility: hidden; pointer-events: none; }
[data-theme="light"] .hero-art--light { opacity: 1; visibility: visible; pointer-events: auto; }

/* Soft bottom fade so hero text reads on light background */
[data-theme="light"] .hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 240px;
  background: linear-gradient(to top, rgba(245,240,232,0.72), transparent);
  pointer-events: none;
  z-index: 1;
}
[data-theme="light"] .hero-content { z-index: 2; }
[data-theme="light"] .hero-scroll-hint { z-index: 2; }

/* Title shadow doesn't suit a bright background */
[data-theme="light"] .hero-title {
  text-shadow: 0 2px 24px rgba(160,80,20,0.18);
}

/* ── THEME TOGGLE BUTTON ── */
.theme-toggle {
  background: none;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text-bright);
  border-color: var(--border2);
}
/* Icons are now <span> wrappers — display: none on a span is reliable everywhere */
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: flex; }

/* ── LIGHT MODE ── */
[data-theme="light"] {
  --black:       #f5f0e8;
  --dark:        #ede8df;
  --surface:     #e5ddd0;
  --surface2:    #ddd5c5;
  --surface3:    #d5ccba;
  --border:      #c4b49a;
  --border2:     #b0a088;

  --ash:         #9a8878;
  --muted:       #7a6a58;
  --text:        #2a2018;
  --text-dim:    #6a5848;
  --text-bright: #0f0c08;
  --text-faint:  #9a8878;
}

[data-theme="light"] body::before {
  opacity: 0.12;
  mix-blend-mode: multiply;
}
[data-theme="light"] .site-nav {
  background: rgba(237, 232, 223, 0.96);
}
[data-theme="light"] .nav-links.open {
  background: rgba(237, 232, 223, 0.98);
}

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(122,21,21,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero--sm { padding: 2.5rem 0 2rem; }
.page-hero h1 { margin-top: 0.4rem; }
.page-hero-sub {
  color: var(--text);
  margin-top: 0.75rem;
  max-width: 560px;
  font-size: 1rem;
}
