/* ============================================================
   INTEGRAL — global.css
   Shared design system for all pages
   v0.1 // integralcollective.io
   ============================================================ */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&family=IBM+Plex+Mono:wght@300;400;500&family=IBM+Plex+Sans:wght@300;400;500&display=swap');

/* ── CSS VARIABLES ── */
:root {
  /* Backgrounds */
  --bg:              #080c0a;
  --bg2:             #0d1410;
  --bg3:             #111a14;
  --bg4:             #0a0f0b;

  /* Primary — green */
  --primary:         #00c853;
  --primary-mid:     #009c3f;
  --primary-dim:     #007a32;
  --primary-faint:   #004d20;
  --primary-trace:   #001f0d;

  /* Accent — amber (used sparingly) */
  --amber:           #ffab00;
  --amber-dim:       #cc8800;
  --amber-faint:     #3d2900;

  /* Text */
  --text:            #d8ead8;
  --text-mid:        #b0ccb0;
  --text-dim:        #8aaa8a;
  --text-faint:      #607860;
  --text-trace:      #2a3e2a;

  /* Borders */
  --border:          #243424;
  --border-mid:      #1a2e1a;

  /* Effects */
  --scanline:        rgba(0, 200, 83, 0.03);
  --glow:            0 0 12px rgba(0, 200, 83, 0.35);
  --glow-soft:       0 0 6px rgba(0, 200, 83, 0.18);
  --glow-amber:      0 0 10px rgba(255, 171, 0, 0.3);

  /* Typography */
  --font-display:    'VT323', monospace;
  --font-mono:       'IBM Plex Mono', monospace;
  --font-terminal:   'Share Tech Mono', monospace;
  --font-body:       'IBM Plex Sans', sans-serif;

  /* Layout */
  --nav-height:      48px;
  --page-pad:        80px;
  --page-pad-sm:     40px;
  --max-width:       1200px;
  --reading-width:   680px;
}

/* ── RESET ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
  font-size: 13px;
  overflow-x: hidden;
  width: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: crosshair;
  width: 100%;
  max-width: 100vw;
}

/* ── CRT EFFECTS ── */
/* Scanlines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--scanline) 2px,
    var(--scanline) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.65) 100%
  );
  pointer-events: none;
  z-index: 999;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 3px;
  line-height: 1;
  color: var(--primary);
}

h1 { font-size: 80px; text-shadow: var(--glow); }
h2 { font-size: 48px; }
h3 { font-size: 32px; }
h4 { font-size: 22px; color: var(--text-dim); }

p {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-mid);
}

p + p { margin-top: 16px; }

a {
  color: var(--primary-dim);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary);
  text-shadow: var(--glow-soft);
}

strong {
  font-weight: 500;
  color: var(--text);
}

code {
  font-family: var(--font-terminal);
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-trace);
  padding: 2px 6px;
  border: 1px solid var(--primary-faint);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── SECTION LABELS ── */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
  display: block;
}

.section-label::before {
  content: '// ';
  color: var(--primary-faint);
}

/* ── BUTTONS ── */
.btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 10px 24px;
  text-decoration: none;
  border: 1px solid;
  transition: all 0.2s;
  cursor: pointer;
  display: inline-block;
  background: none;
}

.btn-primary {
  background: var(--primary-faint);
  border-color: var(--primary-dim);
  color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg);
  box-shadow: var(--glow);
  text-shadow: none;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}

.btn-secondary:hover {
  border-color: var(--text-dim);
  color: var(--text);
  text-shadow: none;
}

.btn-amber {
  background: var(--amber-faint);
  border-color: var(--amber-dim);
  color: var(--amber);
}

.btn-amber:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--bg);
  box-shadow: var(--glow-amber);
  text-shadow: none;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── NAVIGATION ── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  background: rgba(8, 12, 10, 0.97);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  backdrop-filter: blur(4px);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--primary);
  letter-spacing: 4px;
  text-shadow: var(--glow);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo-tag {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 400;
}

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

.nav-links a {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  text-shadow: var(--glow-soft);
  border-bottom-color: var(--primary-dim);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

.status-dot.green {
  background: var(--primary);
}

/* ── PHASE BAR ── */
.phase-bar {
  margin-top: var(--nav-height);
  padding: 14px var(--page-pad);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.phase-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  white-space: nowrap;
}

.phase-item.active {
  color: var(--primary);
}

.phase-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-dot.active {
  background: var(--primary);
  box-shadow: var(--glow-soft);
  animation: pulse 2.5s ease-in-out infinite;
}

.phase-dot.pending {
  background: transparent;
  border: 1px solid var(--text-faint);
}

.phase-divider {
  color: var(--text-faint);
  font-size: 11px;
}

/* ── TERMINAL PANEL ── */
.terminal {
  background: var(--bg2);
  border: 1px solid var(--border);
  font-family: var(--font-terminal);
  font-size: 13px;
  position: relative;
}

.terminal-header {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-title {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.terminal-dots {
  display: flex;
  gap: 5px;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.terminal-body {
  padding: 20px;
}

.t-line {
  display: flex;
  gap: 10px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.t-line.indent { padding-left: 20px; }
.t-line.gap    { margin-bottom: 12px; }

.t-prompt  { color: var(--primary-mid); flex-shrink: 0; }
.t-cmd     { color: var(--primary); }
.t-out     { color: var(--text); }
.t-key     { color: var(--amber); flex-shrink: 0; }
.t-val     { color: var(--text-mid); }
.t-ok      { color: var(--primary); flex-shrink: 0; }
.t-warn    { color: var(--amber); flex-shrink: 0; }
.t-err     { color: #ff5252; flex-shrink: 0; }
.t-dim     { color: var(--text-dim); }
.t-comment { color: var(--text-dim); font-style: italic; }

.t-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

/* Terminal animation — staggered line reveal */
.terminal-animate .t-line,
.terminal-animate .t-divider {
  opacity: 0;
  animation: t-appear 0.2s forwards;
}

.terminal-animate .t-line:nth-child(1)  { animation-delay: 0.1s; }
.terminal-animate .t-line:nth-child(2)  { animation-delay: 0.4s; }
.terminal-animate .t-line:nth-child(3)  { animation-delay: 0.7s; }
.terminal-animate .t-line:nth-child(4)  { animation-delay: 1.0s; }
.terminal-animate .t-line:nth-child(5)  { animation-delay: 1.3s; }
.terminal-animate .t-line:nth-child(6)  { animation-delay: 1.6s; }
.terminal-animate .t-line:nth-child(7)  { animation-delay: 1.9s; }
.terminal-animate .t-line:nth-child(8)  { animation-delay: 2.2s; }
.terminal-animate .t-line:nth-child(9)  { animation-delay: 2.5s; }
.terminal-animate .t-line:nth-child(10) { animation-delay: 2.8s; }
.terminal-animate .t-line:nth-child(11) { animation-delay: 3.1s; }
.terminal-animate .t-line:nth-child(12) { animation-delay: 3.4s; }
.terminal-animate .t-line:nth-child(13) { animation-delay: 3.7s; }
.terminal-animate .t-line:nth-child(14) { animation-delay: 4.0s; }
.terminal-animate .t-divider            { animation-delay: 1.8s; }

@keyframes t-appear {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── PLACEHOLDER PANEL ── */
.placeholder-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.placeholder-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    var(--text-trace) 10px,
    var(--text-trace) 11px
  );
  opacity: 0.3;
}

.placeholder-panel-inner {
  position: relative;
  z-index: 1;
}

.placeholder-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--primary-mid);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.placeholder-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-mid);
  letter-spacing: 3px;
  margin-bottom: 16px;
}

.placeholder-desc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
  max-width: 420px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.placeholder-needs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
  text-align: left;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.placeholder-need-item {
  font-family: var(--font-terminal);
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
}

.placeholder-need-item::before {
  content: '→';
  color: var(--primary-dim);
  flex-shrink: 0;
}

/* ── PAGE LAYOUT ── */
.page-wrap {
  padding-top: var(--nav-height);
}

.page-hero {
  padding: 80px var(--page-pad) 60px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.page-hero-label {
  margin-bottom: 20px;
}

.page-hero h1 {
  font-size: 64px;
  margin-bottom: 12px;
}

.page-hero-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-mid);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.page-hero-desc {
  max-width: 600px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  font-weight: 300;
}

.page-content {
  padding: 60px var(--page-pad);
}

.page-content-narrow {
  padding: 60px var(--page-pad);
  max-width: calc(var(--reading-width) + (var(--page-pad) * 2));
}

/* ── CONTENT GRIDS ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.grid-sidebar {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 60px;
  align-items: start;
}

.grid-sidebar-left {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 60px;
  align-items: start;
}

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 28px;
  transition: background 0.2s, border-color 0.2s;
}

.card:hover {
  background: var(--bg3);
  border-color: var(--primary-faint);
}

.card-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
  font-family: var(--font-mono);
}

.card-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-mid);
  letter-spacing: 2px;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.card:hover .card-title {
  color: var(--primary);
}

.card-indicator {
  width: 3px;
  height: 20px;
  background: var(--primary-faint);
  margin-bottom: 16px;
  transition: background 0.2s, box-shadow 0.2s;
}

.card:hover .card-indicator {
  background: var(--primary);
  box-shadow: var(--glow-soft);
}

.card-body {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.7;
  font-weight: 300;
}

.card-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--primary-mid);
  font-family: var(--font-mono);
  text-decoration: none;
}

.card-link::after { content: ' →'; }
.card-link:hover  { color: var(--primary); text-shadow: var(--glow-soft); }

/* ── READING CONTENT ── */
.reading-block {
  max-width: var(--reading-width);
}

.reading-block h2 {
  font-size: 36px;
  margin-bottom: 20px;
  margin-top: 48px;
}

.reading-block h2:first-child {
  margin-top: 0;
}

.reading-block h3 {
  font-size: 24px;
  margin-bottom: 16px;
  margin-top: 36px;
  color: var(--text-dim);
}

.reading-block p {
  margin-bottom: 16px;
}

.reading-block ul,
.reading-block ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.reading-block li {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 6px;
}

.pull-quote {
  border-left: 2px solid var(--primary-dim);
  padding: 16px 24px;
  margin: 32px 0;
  background: var(--primary-trace);
}

.pull-quote p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  font-weight: 400;
}

/* ── NAV FOOTER (section bottom navigation) ── */
.nav-footer-section {
  border-top: 1px solid var(--border);
  padding: 48px var(--page-pad);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
}

.nav-footer-cell {
  background: var(--bg);
  padding: 32px;
}

.nav-footer-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.nav-footer-link {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-mid);
  letter-spacing: 2px;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.nav-footer-link:hover {
  color: var(--primary);
  text-shadow: var(--glow-soft);
}

.nav-footer-desc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  font-weight: 300;
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px var(--page-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg2);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-dim);
  letter-spacing: 4px;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-mid);
}

.footer-version {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

/* ── BREADCRUMB ── */
.breadcrumb {
  padding: 12px var(--page-pad);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg2);
}

.breadcrumb a,
.breadcrumb span {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--text-mid); }

.breadcrumb-sep {
  color: var(--text-faint);
}

.breadcrumb-current {
  color: var(--primary-mid) !important;
}

/* ── SYSTEM BADGE ── */
.system-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.system-badge.cds { border-color: var(--primary-faint); color: var(--primary-dim); }
.system-badge.oad { border-color: var(--border); }
.system-badge.itc { border-color: var(--border); }
.system-badge.cos { border-color: var(--border); }
.system-badge.frs { border-color: var(--primary-faint); color: var(--primary-dim); }

/* ── KEYFRAME ANIMATIONS ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

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

@keyframes ripple {
  0%   { transform: scale(0.5); opacity: 0.6; }
  100% { transform: scale(2.8); opacity: 0; }
}

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

@keyframes t-appear {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Blinking cursor */
.cursor::after {
  content: '█';
  color: var(--primary);
  animation: blink 1.2s step-end infinite;
  margin-left: 2px;
}

/* ── UTILITY ── */
.text-primary  { color: var(--primary); }
.text-dim      { color: var(--text-dim); }
.text-faint    { color: var(--text-faint); }
.text-amber    { color: var(--amber); }
.text-mono     { font-family: var(--font-mono); }
.text-terminal { font-family: var(--font-terminal); }
.text-display  { font-family: var(--font-display); }
.text-upper    { text-transform: uppercase; letter-spacing: 2px; }
.text-sm       { font-size: 12px; }
.text-xs       { font-size: 11px; }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mt-64 { margin-top: 64px; }

.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.border-top    { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }

.bg-2 { background: var(--bg2); }
.bg-3 { background: var(--bg3); }

/* ============================================================
   RESPONSIVE — TABLET & MOBILE
   Breakpoints:
   1024px — tablet landscape
    768px — tablet portrait
    480px — mobile
   ============================================================ */

/* ── TABLET LANDSCAPE (≤1024px) ── */
@media (max-width: 1024px) {

  :root {
    --page-pad: 48px;
  }

  h1 { font-size: 64px; }
  h2 { font-size: 40px; }
  h3 { font-size: 28px; }

  .grid-2,
  .grid-sidebar,
  .grid-sidebar-left {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .site-nav {
    padding: 0 var(--page-pad);
  }

  .nav-links { gap: 20px; }

  .phase-bar {
    padding: 12px var(--page-pad);
    gap: 16px;
  }

  .phase-divider { display: none; }

  .page-hero { padding: 60px var(--page-pad) 48px; }
  .page-hero h1 { font-size: 52px; }

  .page-content,
  .page-content-narrow {
    padding: 48px var(--page-pad);
  }

  .site-footer { padding: 28px var(--page-pad); }
}

/* ── TABLET PORTRAIT (≤768px) ── */
@media (max-width: 768px) {

  :root { --page-pad: 24px; }

  h1 { font-size: 52px; }
  h2 { font-size: 32px; }
  h3 { font-size: 24px; }

  .nav-links { display: none; }
  .site-nav { padding: 0 var(--page-pad); }
  .nav-logo-tag { display: none; }

  .phase-bar {
    padding: 10px var(--page-pad);
    gap: 12px;
    flex-wrap: wrap;
  }

  .phase-item { font-size: 10px; }

  .breadcrumb { padding: 10px var(--page-pad); }

  .page-hero { padding: 48px var(--page-pad) 36px; }
  .page-hero h1 { font-size: 44px; }
  .page-hero-desc { font-size: 14px; }

  .grid-2,
  .grid-3,
  .grid-sidebar,
  .grid-sidebar-left {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .page-content,
  .page-content-narrow {
    padding: 36px var(--page-pad);
  }

  .terminal-body {
    padding: 16px;
    overflow-x: auto;
  }

  .t-line {
    flex-wrap: nowrap;
    overflow-x: auto;
    font-size: 11px;
  }

  .btn-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .reading-block { max-width: 100%; }

  .pull-quote { padding: 14px 16px; }

  .card { padding: 20px; }

  .placeholder-panel { padding: 28px 20px; }

  .seed-section { padding: 32px var(--page-pad); }

  .site-footer {
    padding: 24px var(--page-pad);
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .footer-links { gap: 16px; }

  .nav-footer-section {
    padding: 0;
    grid-template-columns: 1fr;
  }

  .nav-footer-cell {
    padding: 24px var(--page-pad);
    border-bottom: 1px solid var(--border);
  }
}

/* ── MOBILE (≤480px) ── */
@media (max-width: 480px) {

  :root { --page-pad: 16px; }

  html { font-size: 12px; }

  h1 { font-size: 42px; letter-spacing: 4px; }
  h2 { font-size: 28px; letter-spacing: 2px; }
  h3 { font-size: 22px; letter-spacing: 2px; }

  .hero {
    padding: 80px var(--page-pad) 48px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .phase-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 10px var(--page-pad);
    gap: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .phase-item {
    white-space: nowrap;
    font-size: 10px;
  }

  .page-hero { padding: 40px var(--page-pad) 28px; }
  .page-hero h1 { font-size: 36px; letter-spacing: 3px; }
  .page-hero-sub { font-size: 10px; letter-spacing: 2px; }
  .page-hero-desc { font-size: 13px; }

  .page-content,
  .page-content-narrow {
    padding: 28px var(--page-pad);
  }

  .terminal { overflow-x: auto; }

  .terminal-body {
    padding: 12px;
    min-width: 280px;
  }

  .t-line {
    font-size: 11px;
    white-space: nowrap;
  }

  .outcome-grid { grid-template-columns: 1fr; }

  .recursive-diagram {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .recursive-arrow {
    transform: rotate(90deg);
    padding: 4px 0 4px 16px;
  }

  .systems-grid { grid-template-columns: 1fr; }

  .system-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .map-section {
    padding: 40px var(--page-pad);
    grid-template-columns: 1fr;
  }

  .map-placeholder { height: 200px; }

  .loop-section { padding: 40px var(--page-pad); }

  .loop-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .loop-diagram { height: 260px; }

  .seed-section { padding: 24px var(--page-pad); }
  .seed-section h2 { font-size: 32px; }

  .principle-block { padding: 16px 20px; }

  .card { padding: 16px; }

  .btn {
    font-size: 11px;
    padding: 10px 16px;
    width: 100%;
    text-align: center;
  }

  .site-footer { padding: 20px var(--page-pad); }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }

  .nav-footer-section { grid-template-columns: 1fr; }
  .nav-footer-link { font-size: 20px; }
}

/* ── MOBILE NAV TOGGLE ── */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 6px 12px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-mobile-toggle { display: block; }
}

.nav-mobile-open .nav-links {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(8, 12, 10, 0.98);
  border-bottom: 1px solid var(--border);
  padding: 20px var(--page-pad);
  gap: 16px;
  z-index: 400;
  backdrop-filter: blur(8px);
}

.nav-mobile-open .nav-links a {
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

/* ── TOUCH IMPROVEMENTS ── */
@media (hover: none) {
  .btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* ── PRINT ── */
@media print {
  body::before,
  body::after { display: none; }

  .site-nav,
  .phase-bar,
  .breadcrumb,
  .site-footer,
  .nav-footer-section { display: none; }

  body { background: white; color: black; font-size: 11pt; }
  h1, h2, h3, h4 { color: black; }
}


/* ── SECTION STRIP ── */
/* Persistent sub-navigation bar shown on all section sub-pages */

.section-strip {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
  position: relative;
  /* Fixed height so tabs sit consistently */
  height: 42px;
  display: flex;
  align-items: stretch;
}

.section-strip::-webkit-scrollbar {
  display: none;
}

/* Right fade hint */
.section-strip::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
  z-index: 2;
}

.section-strip-inner {
  display: inline-flex;
  align-items: stretch;
  padding: 0 var(--page-pad);
  min-width: 100%;
  gap: 2px;
  position: relative;
  z-index: 1;
}

.section-strip-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--primary-faint);
  text-transform: uppercase;
  padding: 0 14px 0 0;
  border-right: 1px solid var(--border);
  margin-right: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.section-strip-label::before {
  content: '// ';
  color: var(--text-trace);
}

.section-strip-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-faint);
  text-decoration: none;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  /* Tab border — top + sides visible, bottom cancels strip border */
  border-top: 2px solid transparent;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  position: relative;
  /* Pull tab down to overlap and cancel the strip border-bottom */
  margin-bottom: -2px;
  background: transparent;
}

.section-strip-link:hover {
  color: var(--text-dim);
  text-shadow: none;
  background: var(--bg2);
  border-top-color: var(--border);
  border-left-color: var(--border);
  border-right-color: var(--border);
  border-bottom-color: var(--bg2);
}

/* Active tab — green top accent, filled, bottom merges with page */
.section-strip-link.active {
  color: var(--primary);
  background: var(--bg2);
  border-top-color: var(--primary);
  border-left-color: var(--border);
  border-right-color: var(--border);
  border-bottom-color: var(--bg2);
  text-shadow: var(--glow-soft);
}

/* Separators hidden — tab borders do the work */
.section-strip-sep {
  display: none;
}

@media (max-width: 768px) {
  .section-strip {
    height: 38px;
  }

  .section-strip-inner {
    padding: 0 8px;
    gap: 1px;
  }

  .section-strip-label {
    display: none;
  }

  .section-strip-link {
    font-size: 10px;
    padding: 0 12px;
    letter-spacing: 0.5px;
  }
}

@media (max-width: 480px) {
  .section-strip {
    height: 36px;
  }

  .section-strip-link {
    font-size: 10px;
    padding: 0 10px;
  }
}



/* ── FOOTER SOCIAL ── */
.footer-social {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.footer-social-link {
  color: var(--text-dim);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.footer-social-link:hover {
  color: var(--primary);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary-faint);
  border-radius: 0;
}

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

/* ── SELECTION ── */
::selection {
  background: var(--primary-faint);
  color: var(--primary);
}

/* ── MOBILE OVERFLOW FIXES ── */
/* Applied after all other rules to ensure containment */
@media (max-width: 768px) {

  /* Hard contain everything to viewport */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  /* Terminal panels scroll internally, don't expand page */
  .terminal {
    max-width: 100%;
    overflow: hidden;
  }

  .terminal-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Remove max-width: 100% exception for terminal lines
     so they scroll inside the panel, not the page */
  .t-line {
    max-width: none;
    display: flex;
  }

  /* Ensure grids don't overflow */
  .outcome-grid,
  .systems-grid,
  .grid-2,
  .grid-3,
  .grid-sidebar,
  .grid-sidebar-left,
  .recursive-diagram {
    width: 100%;
    max-width: 100%;
  }

  /* Pull quotes */
  .pull-quote {
    max-width: 100%;
    overflow: hidden;
  }

  /* Seed section full width */
  .seed-section {
    max-width: 100%;
    overflow: hidden;
  }

  /* Nav status text — hide on very small screens */
  .nav-status span {
    display: none;
  }
}

/* ── TAB-TO-PAGE CONNECTION ── */
/* Ensures the active tab's bg2 color flows into the content below */
.section-strip + .breadcrumb,
.section-strip + .page-hero,
.section-strip + .doc-layout,
.section-strip + .page-content {
  background: var(--bg2);
}

.page-hero {
  background: var(--bg2);
}

/* ── MAILING LIST SECTION ── */
.mailing-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  padding: 80px var(--page-pad);
}

.mailing-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: var(--max-width);
}

.mailing-heading {
  font-family: var(--font-display);
  font-size: 64px;
  color: var(--text-dim);
  letter-spacing: 4px;
  line-height: 1;
  margin-bottom: 16px;
}

.mailing-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.8;
  font-weight: 300;
  max-width: 360px;
}

.mailing-form-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
}

.mailing-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  font-family: var(--font-terminal);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.brevo-field-wrap {
  padding: 24px 20px;
}

.brevo-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--primary-mid);
  margin-bottom: 12px;
}

.brevo-input-row {
  display: flex;
  gap: 0;
}

.brevo-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.brevo-input:focus {
  border-color: var(--primary-dim);
}

.brevo-input::placeholder {
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.brevo-submit {
  background: var(--primary-dim);
  border: 1px solid var(--primary-dim);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  font-weight: 600;
}

.brevo-submit:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.brevo-msg {
  font-family: var(--font-terminal);
  font-size: 11px;
  padding: 10px 20px;
  letter-spacing: 1px;
  border-top: 1px solid var(--border);
}

.brevo-msg--error   { color: var(--amber); }
.brevo-msg--success { color: var(--primary); }

.brevo-inline-error {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  margin-top: 8px;
  min-height: 16px;
}

@media (max-width: 900px) {
  .mailing-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .mailing-heading { font-size: 48px; }
}

@media (max-width: 480px) {
  .mailing-section { padding: 48px var(--page-pad-sm); }
  .mailing-heading { font-size: 40px; }
  .brevo-input-row { flex-direction: column; }
  .brevo-input { border-right: 1px solid var(--border); border-bottom: none; }
  .brevo-submit { width: 100%; text-align: center; }
}
