/* ============================================================
   أعِد بناء الإنترنت من الإلكترون — Design System
   ثيم: محلّل حزم / أوسيلوسكوب ليلي (Packet Analyzer / Scope)
   مشتقّ من صوت المنهج: إشارة رقمية، طبقات تُبنى من القاع، خبايا تحت الغطاء
   ============================================================ */

:root {
  /* surfaces — blue-black void of a capture screen at 3am */
  --bg-void: #04070b;
  --bg-deep: #070c12;
  --bg-panel: #0a121a;
  --bg-elevated: #0f1923;
  --bg-code: #060b10;

  /* borders / lines */
  --line: #16242f;
  --line-strong: #233643;
  --line-faint: #0d1822;

  /* text */
  --fg: #d4e2ea;
  --fg-muted: #8597a3;
  --fg-dim: #556874;
  --fg-faint: #38454f;

  /* accents — teal signal trace dominant, electric-blue addresses secondary */
  --acid: #2ee6c4;       /* dominant — links, active, "live system" */
  --acid-dim: #14887a;
  --cyan: #5b9bff;       /* secondary — h3, addresses, L3 feel */
  --cyan-dim: #2a4f8f;
  --amber: #ffb13d;      /* warn */
  --amber-dim: #8a5e18;
  --red: #ff4d6a;        /* danger / errors */
  --red-dim: #8a2333;
  --magenta: #b98cff;    /* keywords */

  /* type */
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  --ar: "IBM Plex Sans Arabic", "Tajawal", "Noto Sans Arabic", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-void);
  color: var(--fg);
  font-family: var(--ar);
  font-size: 16px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* scope-screen atmosphere: fine scanlines + signal glow */
body {
  background-image:
    repeating-linear-gradient(0deg,
      rgba(46, 230, 196, 0.014) 0px,
      rgba(46, 230, 196, 0.014) 1px,
      transparent 1px, transparent 3px),
    radial-gradient(ellipse at 15% 0%, rgba(91, 155, 255, 0.05) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 90%, rgba(46, 230, 196, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

::selection { background: var(--acid); color: var(--bg-void); }

a { color: var(--acid); text-decoration: none; border-bottom: 1px dashed var(--acid-dim); transition: color .12s, border-color .12s; }
a:hover { color: var(--cyan); border-color: var(--cyan); }

/* reading progress (scanline beam under topbar) */
.beam {
  position: fixed; top: 0; right: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--acid), var(--cyan));
  box-shadow: 0 0 8px var(--acid);
  z-index: 60; transition: width .08s linear;
}

/* ============================================================ LAYOUT */
.shell { display: grid; grid-template-columns: 320px 1fr; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 22px;
  padding: 10px 28px;
  background: rgba(4, 7, 11, 0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-dim);
}
.topbar .brand { color: var(--acid); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.topbar .brand::before { content: "◢◤"; color: var(--acid); animation: blink 1.6s steps(2, end) infinite; }
.topbar .meta { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar .meta b { color: var(--cyan); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .status { color: var(--acid); display: flex; align-items: center; gap: 6px; cursor: default; }
.topbar .status::before {
  content: ""; width: 8px; height: 8px; background: var(--acid); border-radius: 50%;
  box-shadow: 0 0 8px var(--acid); animation: pulse 1.8s ease-in-out infinite;
}
.topbar .kbd-hint { color: var(--fg-faint); cursor: pointer; }
.topbar .kbd-hint:hover { color: var(--acid); }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }

/* sidebar */
.sidebar {
  position: sticky; top: 41px; height: calc(100vh - 41px); overflow-y: auto;
  background: var(--bg-deep); border-left: 1px solid var(--line);
  padding: 26px 20px 60px; font-family: var(--mono); font-size: 13px;
}
.sidebar .sb-title {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fg-dim); margin: 22px 0 8px; display: flex; align-items: center; gap: 8px;
}
.sidebar .sb-title::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--acid); transform: rotate(45deg); }
.sidebar .sb-title:first-child { margin-top: 0; }
.sidebar a {
  display: flex; align-items: flex-start; gap: 10px; padding: 7px 10px;
  border: none; border-radius: 0; color: var(--fg-muted);
  border-right: 2px solid transparent; font-size: 13px; line-height: 1.5; margin-bottom: 1px; transition: all 0.12s;
}
.sidebar a:hover { background: var(--bg-elevated); color: var(--fg); border-right-color: var(--acid-dim); }
.sidebar a.active { background: var(--bg-elevated); color: var(--acid); border-right-color: var(--acid); }
.sidebar a .num { color: var(--fg-dim); font-size: 11px; flex-shrink: 0; min-width: 22px; }
.sidebar a.active .num { color: var(--acid); }
.sidebar a.done .num::after { content: " ✓"; color: var(--acid); }
.sidebar a.locked { opacity: .6; }
.sidebar a.locked .num { color: var(--amber); }
.sidebar .cheat {
  font-family: var(--mono); font-size: 11px; color: var(--fg-dim);
  padding: 4px 10px; line-height: 1.95;
}
.sidebar .cheat b { color: var(--acid); font-weight: 400; }
.sidebar .cheat .w { color: var(--amber); }
.sidebar .cheat .c { color: var(--cyan); }

/* main */
.main { padding: 54px 64px 120px; max-width: 1080px; width: 100%; }
.main-index { padding: 0 0 120px; max-width: 1180px; }
.main-index .idx-body { padding: 0 64px; }
.main-index .hero { margin: 0; }

/* ============================================================ TYPE */
h1, h2, h3, h4 { font-family: var(--ar); font-weight: 700; color: var(--fg); line-height: 1.3; text-wrap: balance; }
h1 { font-size: clamp(34px, 4vw, 50px); margin: 0 0 12px; letter-spacing: -0.01em; }
h1 .accent { color: var(--acid); }

h2 { font-size: 29px; margin: 64px 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); position: relative; }
h2[data-num]::before {
  content: attr(data-num); display: inline-block; font-family: var(--mono); font-size: 13px;
  color: var(--acid); margin-left: 14px; padding: 2px 8px;
  background: rgba(46, 230, 196, 0.07); border: 1px solid var(--acid-dim);
  letter-spacing: 0.05em; vertical-align: middle;
}

h3 { font-size: 21px; margin: 38px 0 12px; color: var(--cyan); }
h3::before { content: "// "; font-family: var(--mono); color: var(--fg-dim); font-weight: 400; }

h4 { font-size: 16px; margin: 26px 0 10px; color: var(--amber); font-family: var(--mono); font-weight: 500; letter-spacing: 0.02em; }

p { margin: 0 0 16px; text-wrap: pretty; }
strong, b { color: var(--fg); font-weight: 700; }
em { color: var(--cyan); font-style: normal; font-weight: 500; }

ul, ol { padding-right: 24px; margin: 0 0 18px; }
li { margin-bottom: 8px; }
li::marker { color: var(--acid); }

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

/* inline english/code */
code, .en { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
code {
  background: var(--bg-elevated); color: var(--acid); padding: 1px 6px;
  font-size: 0.86em; border: 1px solid var(--line); border-radius: 2px;
}
a code { color: inherit; }

/* ============================================================ HERO */
.hero { padding: 70px 64px 52px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 18% 30%, rgba(46, 230, 196, 0.10) 0%, transparent 42%),
    radial-gradient(circle at 82% 72%, rgba(91, 155, 255, 0.08) 0%, transparent 42%);
}
.hero > * { position: relative; }
.hero-meta { display: flex; gap: 14px; margin-bottom: 22px; font-family: var(--mono); font-size: 12px; color: var(--fg-dim); letter-spacing: 0.06em; text-transform: uppercase; flex-wrap: wrap; }
.hero-meta .tag { padding: 4px 10px; border: 1px solid var(--line); background: var(--bg-panel); color: var(--fg-muted); }
.hero-meta .tag.live { color: var(--acid); border-color: var(--acid-dim); }
.hero-meta .tag.cls { color: var(--cyan); border-color: var(--cyan-dim); }
.hero h1 { font-size: clamp(38px, 5.2vw, 70px); font-weight: 800; line-height: 1.06; margin: 0 0 16px; }
.hero h1 .accent { color: var(--acid); }
.hero .lede { font-size: 19px; color: var(--fg-muted); max-width: 760px; line-height: 1.7; }

/* hero signal wave (the electron) */
.signal { width: 100%; max-width: 760px; height: 56px; margin: 26px 0 4px; display: block; }
.signal path { fill: none; stroke: var(--acid); stroke-width: 2; filter: drop-shadow(0 0 4px rgba(46,230,196,.5)); }
.signal .wv { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: trace 3.2s ease-out forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }

/* ============================================================ STACK TOWER (index centerpiece) */
.tower-wrap { margin: 36px 0 8px; }
.tower-head { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }
.tower-head b { color: var(--acid); font-weight: 500; }
.tower { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); background: var(--bg-deep); padding: 10px; }
.layer {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--bg-panel); border: 1px solid var(--line-faint);
  font-family: var(--mono); position: relative; overflow: hidden; transition: all .25s;
  border-radius: 0; opacity: .72; filter: grayscale(.3);
}
.layer .ln { font-size: 12px; color: var(--cyan); min-width: 34px; letter-spacing: .05em; }
.layer .lname { color: var(--fg); font-size: 14px; min-width: 130px; }
.layer .lwhat { color: var(--fg-muted); font-size: 12.5px; flex: 1; }
.layer .lreg { font-size: 10px; color: var(--fg-faint); letter-spacing: .1em; }
.layer.lit { opacity: 1; filter: none; border-color: var(--acid-dim); background: var(--bg-elevated); }
.layer.lit .ln { color: var(--acid); }
.layer.lit .lname { color: var(--fg); }
.layer.lit::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 3px;
  background: var(--acid); box-shadow: 0 0 10px var(--acid);
}
.layer.lit .lwhat { color: var(--fg-muted); }
.tower-foot { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); margin-top: 10px; text-align: center; letter-spacing: .08em; }
.tower-foot b { color: var(--acid); }

/* ============================================================ PANELS / CALLOUTS */
.panel { background: var(--bg-panel); border: 1px solid var(--line); padding: 22px 26px; margin: 22px 0; position: relative; }
.panel.bracket::before, .panel.bracket::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--acid); }
.panel.bracket::before { top: -1px; right: -1px; border-bottom: none; border-left: none; }
.panel.bracket::after { bottom: -1px; left: -1px; border-top: none; border-right: none; }

.callout { margin: 24px 0; padding: 16px 22px; background: var(--bg-panel); border-right: 3px solid var(--acid); border-left: 1px solid var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.callout.warn { border-right-color: var(--amber); }
.callout.danger { border-right-color: var(--red); }
.callout.info { border-right-color: var(--cyan); }
.callout .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acid); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.callout.warn .label { color: var(--amber); }
.callout.danger .label { color: var(--red); }
.callout.info .label { color: var(--cyan); }
.callout p:last-child { margin-bottom: 0; }

/* ============================================================ PEEK — "lift the lid" (الخبيئة) */
.peek { margin: 26px 0; border: 1px solid var(--line-strong); background: var(--bg-panel); }
.peek > .peek-lid {
  display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer;
  padding: 14px 20px; background: repeating-linear-gradient(45deg, var(--bg-elevated) 0 10px, var(--bg-deep) 10px 20px);
  border: none; border-bottom: 1px solid transparent; color: var(--amber);
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em; text-align: right;
  transition: background .15s; position: relative;
}
.peek > .peek-lid::before { content: "🕳️"; font-size: 16px; }
.peek > .peek-lid .hint { margin-right: auto; color: var(--fg-dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.peek > .peek-lid:hover { background: var(--bg-elevated); }
.peek > .peek-body { padding: 0 22px; max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .35s ease; }
.peek.open > .peek-body { padding: 18px 22px 6px; max-height: 1600px; border-top: 1px solid var(--amber-dim); }
.peek.open > .peek-lid { color: var(--amber); }
.peek.open > .peek-lid .hint::after { content: ""; }
.peek .peek-body > *:last-child { margin-bottom: 14px; }

/* ============================================================ SEED — mystery (🌱 بذرة) */
.seed { margin: 30px 0; padding: 20px 24px; background: linear-gradient(180deg, var(--bg-panel), var(--bg-deep)); border: 1px dashed var(--cyan-dim); border-right: 3px solid var(--cyan); position: relative; }
.seed .seed-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.seed .seed-label::before { content: "🌱"; }
.seed p:last-child { margin-bottom: 0; }
.seed em { color: var(--acid); }

/* ============================================================ BOX — puzzles / experiments */
.box { margin: 28px 0; border: 1px solid var(--line); background: var(--bg-panel); padding: 24px 26px 22px; position: relative; }
.box::before {
  content: attr(data-label); position: absolute; top: -10px; right: 20px; background: var(--bg-void);
  padding: 0 10px; font-family: var(--mono); font-size: 11px; color: var(--acid); letter-spacing: 0.12em; text-transform: uppercase;
}
.box.amber { border-color: var(--amber-dim); }
.box.amber::before { color: var(--amber); }
.box.cyan { border-color: var(--cyan-dim); }
.box.cyan::before { color: var(--cyan); }
.box .box-title { font-weight: 700; color: var(--fg); margin: 0 0 10px; font-size: 17px; }
.box ol:last-child, .box ul:last-child, .box p:last-child { margin-bottom: 0; }

/* ============================================================ VAULT GATE (القبو) */
.gate-overlay {
  margin: 30px 0; border: 1px solid var(--red-dim); background: var(--bg-panel);
  padding: 40px 32px; text-align: center; position: relative;
}
.gate-overlay .glock { font-size: 40px; margin-bottom: 12px; }
.gate-overlay h3 { color: var(--red); margin: 0 0 8px; }
.gate-overlay h3::before { content: none; }
.gate-overlay p { color: var(--fg-muted); max-width: 560px; margin: 0 auto 20px; }
.gate-btn {
  font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  background: transparent; color: var(--red); border: 1px solid var(--red); padding: 12px 24px;
  cursor: pointer; transition: all .15s;
}
.gate-btn:hover { background: var(--red); color: var(--bg-void); box-shadow: 0 0 16px rgba(255,77,106,.4); }
.vault-content { display: none; }
.vault-content.open { display: block; animation: fadein .4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================ TABLES */
table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14px; background: var(--bg-panel); border: 1px solid var(--line); }
th { background: var(--bg-elevated); color: var(--acid); font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; text-align: right; padding: 11px 15px; border-bottom: 1px solid var(--line-strong); }
td { padding: 11px 15px; border-bottom: 1px solid var(--line-faint); vertical-align: top; color: var(--fg-muted); }
td:first-child { color: var(--fg); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(46, 230, 196, 0.02); }

/* ============================================================ CODE / TERMINAL */
pre { background: var(--bg-code); border: 1px solid var(--line); padding: 0; margin: 22px 0; overflow: hidden; font-family: var(--mono); font-size: 13px; line-height: 1.65; position: relative; }
pre .term-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--bg-elevated); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--fg-dim); letter-spacing: 0.08em; text-transform: uppercase; }
pre .term-head::before { content: "● ● ●"; color: var(--fg-faint); letter-spacing: 2px; font-size: 8px; }
pre .term-head .tt { color: var(--acid); margin-left: auto; }
pre .copy { background: transparent; border: 1px solid var(--line-strong); color: var(--fg-dim); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; cursor: pointer; transition: all .12s; }
pre .copy:hover { color: var(--acid); border-color: var(--acid-dim); }
pre code { display: block; padding: 16px 20px; background: transparent; border: none; color: var(--fg); white-space: pre; overflow-x: auto; direction: ltr; text-align: left; }
pre code .pmt { color: var(--acid); }
pre code .cmt { color: var(--fg-dim); font-style: italic; }
pre code .kw { color: var(--magenta); }
pre code .str { color: var(--amber); }
pre code .num { color: var(--cyan); }

/* ascii frames */
.ascii { font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre; background: var(--bg-code); border: 1px solid var(--line); padding: 18px 22px; margin: 22px 0; color: var(--fg-muted); overflow-x: auto; direction: ltr; text-align: left; }
.ascii .hl { color: var(--acid); }
.ascii .hl2 { color: var(--cyan); }
.ascii .hl3 { color: var(--amber); }

/* ============================================================ KPI / STATS */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 24px 0; }
.stat { border: 1px solid var(--line); background: var(--bg-panel); padding: 18px; }
.stat .v { font-family: var(--mono); font-size: 30px; color: var(--acid); font-weight: 700; line-height: 1; }
.stat .k { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 8px; }

/* ============================================================ MODULE GRID */
.modgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; margin: 28px 0; }
.modcard { display: block; background: var(--bg-panel); border: 1px solid var(--line); padding: 24px; color: var(--fg); position: relative; transition: all 0.15s ease; overflow: hidden; }
.modcard:hover { border-color: var(--acid-dim); background: var(--bg-elevated); transform: translateY(-2px); }
.modcard::before { content: ""; position: absolute; top: 0; right: 0; width: 60px; height: 60px; background: linear-gradient(225deg, var(--acid-dim) 0%, transparent 50%); opacity: 0.14; }
.modcard .mc-num { font-family: var(--mono); font-size: 11px; color: var(--acid); letter-spacing: 0.15em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.modcard .mc-num::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }
.modcard .mc-title { font-size: 21px; font-weight: 700; margin: 0 0 8px; color: var(--fg); line-height: 1.3; }
.modcard .mc-desc { font-size: 14px; color: var(--fg-muted); line-height: 1.65; margin-bottom: 16px; }
.modcard .mc-foot { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.08em; padding-top: 14px; border-top: 1px solid var(--line); }
.modcard .mc-foot .open { color: var(--acid); }
.modcard:hover .mc-foot .open::after { content: " ←"; }
.modcard.done .mc-num::before { content: "✓ "; color: var(--acid); }
.modcard.sealed { border-color: var(--red-dim); }
.modcard.sealed .mc-num { color: var(--red); }
.modcard.sealed .mc-foot .open { color: var(--red); }

/* ============================================================ PAGER */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 60px 0 0; border-top: 1px solid var(--line); padding-top: 28px; }
.pager a { display: block; padding: 18px 22px; background: var(--bg-panel); border: 1px solid var(--line); color: var(--fg); transition: all 0.15s; }
.pager a:hover { border-color: var(--acid-dim); background: var(--bg-elevated); }
.pager .label { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.pager .title { font-size: 15px; color: var(--acid); }
.pager .next { text-align: left; }
.pager .next .label::before { content: "→ "; }
.pager .prev .label::after { content: " ←"; }

/* ============================================================ BADGES / TOC / FOOTER */
.badge { display: inline-block; padding: 2px 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--fg-muted); background: var(--bg-elevated); vertical-align: middle; direction: ltr; }
.badge.ok { color: var(--acid); border-color: var(--acid-dim); }
.badge.bad { color: var(--red); border-color: var(--red-dim); }
.badge.warn { color: var(--amber); border-color: var(--amber-dim); }
.badge.info { color: var(--cyan); border-color: var(--cyan-dim); }

.toc { background: var(--bg-panel); border: 1px solid var(--line); padding: 18px 26px; margin: 24px 0 32px; font-size: 14px; }
.toc .toc-h { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 10px; }
.toc ol { padding-right: 18px; margin: 0; }
.toc a { color: var(--fg-muted); border: none; }
.toc a:hover, .toc a.active { color: var(--acid); }

.foot { border-top: 1px solid var(--line); margin-top: 60px; padding: 28px 64px; font-family: var(--mono); font-size: 11px; color: var(--fg-dim); letter-spacing: 0.08em; text-transform: uppercase; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; background: var(--bg-void); }
.foot .sig { color: var(--acid); }

/* ============================================================ COMMAND PALETTE (/) */
.cmdk-back { position: fixed; inset: 0; background: rgba(2, 5, 9, .7); backdrop-filter: blur(3px); z-index: 100; display: none; align-items: flex-start; justify-content: center; padding-top: 14vh; }
.cmdk-back.open { display: flex; }
.cmdk { width: min(560px, 92vw); background: var(--bg-elevated); border: 1px solid var(--acid-dim); box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(46,230,196,.06); }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.cmdk-in::before { content: "›"; color: var(--acid); font-size: 18px; }
.cmdk-in input { flex: 1; background: transparent; border: none; outline: none; color: var(--fg); font-family: var(--mono); font-size: 15px; }
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; font-family: var(--mono); font-size: 13px; color: var(--fg-muted); }
.cmdk-item .ci-num { color: var(--fg-dim); min-width: 26px; }
.cmdk-item.sel, .cmdk-item:hover { background: var(--bg-panel); color: var(--acid); }
.cmdk-item.sel .ci-num { color: var(--acid); }
.cmdk-hint { padding: 8px 16px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10px; color: var(--fg-faint); letter-spacing: .06em; text-transform: uppercase; display: flex; gap: 16px; }

/* keyboard help modal reuse cmdk-back */
.khelp { width: min(420px, 92vw); background: var(--bg-elevated); border: 1px solid var(--line-strong); padding: 24px; }
.khelp h4 { margin-top: 0; }
.khelp .row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; color: var(--fg-muted); padding: 5px 0; border-bottom: 1px solid var(--line-faint); }
.khelp kbd { background: var(--bg-panel); border: 1px solid var(--line-strong); border-radius: 3px; padding: 1px 7px; color: var(--acid); font-size: 12px; }

/* ============================================================ RESPONSIVE + MOTION */
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; top: 0; max-height: none; }
  .main { padding: 40px 22px 80px; }
  .main-index { padding: 0 0 80px; }
  .main-index .idx-body { padding: 0 22px; }
  .hero { padding: 54px 22px 38px; }
  .foot { padding: 28px 22px; }
  .layer .lwhat { display: none; }
  .pager { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
  .signal .wv { stroke-dashoffset: 0; }
}
