/* ═══════════════════════════════════════════
   TOKENS — pure black × electric orange
═══════════════════════════════════════════ */
:root {
  --void: #050505;
  --bg: #0a0a0a;
  --bg2: #111;
  --bg3: #181818;
  --bg4: #222;
  --rim: #2e2e2e;
  --rim2: #3e3e3e;
  --text: #f0ede8;
  --sub: #5a5a5a;
  --faint: #2e2e2e;
  --orange: #f50;
  --ok: rgb(255 85 0 / 10%);
  --blue: #3a8eff;
  --bk: rgb(58 142 255 / 10%);
  --green: #2c7;
  --gk: rgb(34 204 119 / 10%);
  --yellow: #f5c400;
  --yk: rgb(245 196 0 / 10%);
  --violet: #96f;
  --vk: rgb(153 102 255 / 10%);
  --red: #f35;
  --rk: rgb(255 51 85 / 10%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: clamp(15px, 1.9vw, 17px);
  line-height: 1.85;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════
   HERO — dark, high-contrast, loss-curve art
═══════════════════════════════════════════ */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--void);
  padding: clamp(48px, 7.5vw, 88px) clamp(24px, 5vw, 68px) 0;
  border-bottom: 1px solid var(--rim);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 75% 50%, rgb(255 85 0 / 10%) 0%, transparent 65%),
    radial-gradient(ellipse 35% 30% at 10% 80%, rgb(58 142 255 / 5%) 0%, transparent 60%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  margin-top: 5%;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  min-width: 0;
}

@media(width <=700px) {
  .hero-inner {
    grid-template-columns: 1fr
  }

  .hero-art {
    display: none
  }
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(9px, 1.3vw, 10.5px);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: clamp(16px, 2.5vw, 24px);
}

.hero-kicker span {
  color: var(--sub)
}

.hero h1 {
  font-family: 'Lexend Deca', sans-serif;
  font-size: clamp(2.5rem, 7.5vw, 5.8rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -.04em;
  color: #fff;
}

.hero h1 .muted {
  color: rgb(240 237 232 / 14%);
  font-weight: 200;
  display: block;
  font-size: .48em;
  letter-spacing: .01em;
  margin-bottom: 6px
}

.hero h1 .accent {
  color: var(--orange)
}

.hero-byline {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(11px, 1.6vw, 13px);
  color: var(--sub);
  line-height: 1.85;
  max-width: 560px;
  margin-top: clamp(16px, 2.5vw, 24px);
}

.hero-extends {
  margin-top: clamp(16px, 2.5vw, 22px);
  padding: clamp(12px, 2vw, 16px) clamp(16px, 2.5vw, 20px);
  background: rgb(255 85 0 / 6%);
  border: 1px solid rgb(255 85 0 / 25%);
  border-radius: 4px;
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(10.5px, 1.5vw, 12px);
  color: var(--sub);
  line-height: 1.75;
  max-width: 580px;
}

.hero-extends a {
  color: var(--orange);
  text-decoration: none;
  border-bottom: 1px solid rgb(255 85 0 / 40%)
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: clamp(18px, 3vw, 26px)
}

.htag {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(8.5px, 1.2vw, 10px);
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid;
  background: transparent;
  white-space: nowrap;
}

.htag.o {
  color: var(--orange);
  border-color: rgb(255 85 0 / 30%)
}

.htag.b {
  color: var(--blue);
  border-color: rgb(58 142 255 / 30%)
}

.htag.g {
  color: var(--green);
  border-color: rgb(34 204 119 / 30%)
}

.htag.y {
  color: var(--yellow);
  border-color: rgb(245 196 0 / 30%)
}

.htag.v {
  color: var(--violet);
  border-color: rgb(153 102 255 / 30%)
}

.htag.r {
  color: var(--red);
  border-color: rgb(255 51 85 / 30%)
}

.hero-art {
  flex-shrink: 0
}

/* Strip */
.hero-strip {
  display: flex;
  border-top: 1px solid var(--rim);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: clamp(28px, 5vw, 46px);
}

.hs-cell {
  flex: 1;
  min-width: clamp(100px, 16vw, 150px);
  padding: clamp(13px, 2.3vw, 18px) clamp(12px, 2vw, 18px);
  border-right: 1px solid var(--rim)
}

.hs-cell:last-child {
  border-right: none
}

.hs-val {
  font-family: 'Lexend Deca', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--orange);
  line-height: 1
}

.hs-label {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(8px, 1.2vw, 9.5px);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sub);
  margin-top: 5px
}

/* ═══════════════════════════════════════════
   TOC — numbered list
═══════════════════════════════════════════ */
.toc-outer {
  max-width: 1080px;
  margin: clamp(32px, 5vw, 52px) auto;
  padding: 0 clamp(24px, 5vw, 68px)
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 1px;
  background: var(--rim);
  border: 1px solid var(--rim);
  border-radius: 6px;
  overflow: hidden;
}

.toc-cell a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(11px, 1.8vw, 14px) clamp(13px, 2.2vw, 17px);
  background: var(--bg2);
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(11px, 1.5vw, 12.5px);
  color: var(--sub);
  text-decoration: none;
  transition: background .14s, color .14s;
  line-height: 1.4;
}

.toc-cell a:hover {
  background: var(--bg3);
  color: var(--orange)
}

.toc-n {
  color: var(--orange);
  font-weight: 500;
  min-width: 20px;
  flex-shrink: 0
}

/* ═══════════════════════════════════════════
   CONTENT
═══════════════════════════════════════════ */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 68px) clamp(32px, 5vw, 52px)
}

/* ═══════════════════════════════════════════
   CHAPTER
═══════════════════════════════════════════ */
.ch {
  margin-bottom: clamp(60px, 8.5vw, 105px)
}

.ch-head {
  position: relative;
  padding-top: clamp(32px, 5.5vw, 52px);
  border-top: 1px solid var(--rim);
  margin-bottom: clamp(24px, 3.5vw, 36px);
}

.ch-head::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: clamp(50px, 9vw, 90px);
  height: 2px;
  background: var(--orange)
}

.ch-top {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 2.5vw, 22px);
  flex-wrap: wrap;
  margin-bottom: 8px
}

.ch-num {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 4.5vw, 3rem);
  color: var(--orange);
  opacity: .15;
  line-height: 1;
  letter-spacing: -.04em;
  flex-shrink: 0;
}

.ch-badge {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(8.5px, 1.2vw, 10px);
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid;
  align-self: center;
  flex-shrink: 0;
}

.ch-badge.o {
  color: var(--orange);
  border-color: rgb(255 85 0 / 30%);
  background: var(--ok)
}

.ch-badge.b {
  color: var(--blue);
  border-color: rgb(58 142 255 / 30%);
  background: var(--bk)
}

.ch-badge.g {
  color: var(--green);
  border-color: rgb(34 204 119 / 30%);
  background: var(--gk)
}

.ch-badge.y {
  color: var(--yellow);
  border-color: rgb(245 196 0 / 30%);
  background: var(--yk)
}

.ch-badge.v {
  color: var(--violet);
  border-color: rgb(153 102 255 / 30%);
  background: var(--vk)
}

.ch-badge.r {
  color: var(--red);
  border-color: rgb(255 51 85 / 30%);
  background: var(--rk)
}

.ch h2 {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 700;
  font-size: clamp(1.45rem, 3.8vw, 2.15rem);
  color: #fff;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.ch-sub {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(10px, 1.4vw, 11.5px);
  color: var(--sub);
  margin-top: 6px;
  letter-spacing: .04em;
}

.sub {
  margin: clamp(26px, 4vw, 44px) 0
}

.sh {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 600;
  font-size: clamp(10.5px, 1.5vw, 12px);
  text-transform: uppercase;
  letter-spacing: .18em;
  margin-bottom: clamp(12px, 2vw, 16px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sh::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rim)
}

.sh.o {
  color: var(--orange)
}

.sh.b {
  color: var(--blue)
}

.sh.g {
  color: var(--green)
}

.sh.y {
  color: var(--yellow)
}

.sh.v {
  color: var(--violet)
}

.sh.r {
  color: var(--red)
}

p {
  margin-bottom: clamp(12px, 1.8vw, 16px)
}

/* ═══════════════════════════════════════════
   EQUATION BOXES
═══════════════════════════════════════════ */
.eq {
  margin: clamp(20px, 3.5vw, 32px) 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rim);
  min-width: 0;
}

.eq-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: clamp(8px, 1.4vw, 11px) clamp(14px, 2.5vw, 20px);
  border-bottom: 1px solid var(--rim);
  background: var(--bg3)
}

.eq-name {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(8.5px, 1.2vw, 10px);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--sub)
}

.eq-tag {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(7.5px, 1.1vw, 8.5px);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600
}

.eq-body {
  background: var(--bg2);
  padding: clamp(18px, 3vw, 26px) clamp(16px, 3.5vw, 32px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch
}

.eq-note {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(9.5px, 1.3vw, 11px);
  color: var(--sub);
  margin-top: 10px;
  line-height: 1.65;
  font-style: italic;
  padding-top: 10px;
  border-top: 1px solid var(--rim)
}

.eq.o .eq-top {
  border-bottom-color: rgb(255 85 0 / 20%)
}

.eq.o .eq-body {
  border-left: 3px solid var(--orange)
}

.eq.o .eq-tag {
  background: var(--ok);
  color: var(--orange)
}

.eq.b .eq-top {
  border-bottom-color: rgb(58 142 255 / 20%)
}

.eq.b .eq-body {
  border-left: 3px solid var(--blue)
}

.eq.b .eq-tag {
  background: var(--bk);
  color: var(--blue)
}

.eq.g .eq-top {
  border-bottom-color: rgb(34 204 119 / 20%)
}

.eq.g .eq-body {
  border-left: 3px solid var(--green)
}

.eq.g .eq-tag {
  background: var(--gk);
  color: var(--green)
}

.eq.y .eq-top {
  border-bottom-color: rgb(245 196 0 / 20%)
}

.eq.y .eq-body {
  border-left: 3px solid var(--yellow)
}

.eq.y .eq-tag {
  background: var(--yk);
  color: var(--yellow)
}

.eq.v .eq-top {
  border-bottom-color: rgb(153 102 255 / 20%)
}

.eq.v .eq-body {
  border-left: 3px solid var(--violet)
}

.eq.v .eq-tag {
  background: var(--vk);
  color: var(--violet)
}

.eq.r .eq-top {
  border-bottom-color: rgb(255 51 85 / 20%)
}

.eq.r .eq-body {
  border-left: 3px solid var(--red)
}

.eq.r .eq-tag {
  background: var(--rk);
  color: var(--red)
}

/* ═══════════════════════════════════════════
   THEOREM
═══════════════════════════════════════════ */
.thm {
  position: relative;
  overflow: hidden;
  background: var(--bg3);
  border: 1px solid var(--rim);
  border-radius: 6px;
  padding: clamp(22px, 3.5vw, 34px) clamp(20px, 4vw, 36px);
  margin: clamp(22px, 3.5vw, 36px) 0;
  min-width: 0;
}

.thm::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), var(--yellow), transparent)
}

.thm-badge {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(8.5px, 1.2vw, 10px);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px
}

.thm-badge::before {
  content: '▲'
}

.thm p {
  font-size: clamp(14px, 1.9vw, 16px);
  line-height: 1.85;
  margin-bottom: 0;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch
}

/* ═══════════════════════════════════════════
   LENS callout — flat, left-border
═══════════════════════════════════════════ */
.lens {
  display: flex;
  gap: clamp(14px, 2.5vw, 20px);
  background: var(--bg2);
  border: 1px solid var(--rim);
  border-radius: 6px;
  padding: clamp(18px, 3vw, 26px);
  margin: clamp(18px, 3vw, 28px) 0;
  align-items: flex-start
}

.lens-icon {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  line-height: 1;
  flex-shrink: 0;
  padding-top: 3px
}

.lens-content .lens-title {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 700;
  font-size: clamp(9px, 1.3vw, 10.5px);
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 8px
}

.lens-content p {
  font-size: clamp(13.5px, 1.8vw, 15px);
  line-height: 1.78;
  margin-bottom: 0
}

.lens.o {
  border-left: 3px solid var(--orange)
}

.lens.o .lens-icon,
.lens.o .lens-title {
  color: var(--orange)
}

.lens.b {
  border-left: 3px solid var(--blue)
}

.lens.b .lens-icon,
.lens.b .lens-title {
  color: var(--blue)
}

.lens.g {
  border-left: 3px solid var(--green)
}

.lens.g .lens-icon,
.lens.g .lens-title {
  color: var(--green)
}

.lens.y {
  border-left: 3px solid var(--yellow)
}

.lens.y .lens-icon,
.lens.y .lens-title {
  color: var(--yellow)
}

.lens.v {
  border-left: 3px solid var(--violet)
}

.lens.v .lens-icon,
.lens.v .lens-title {
  color: var(--violet)
}

.lens.r {
  border-left: 3px solid var(--red)
}

.lens.r .lens-icon,
.lens.r .lens-title {
  color: var(--red)
}

/* ═══════════════════════════════════════════
   DERIVATION
═══════════════════════════════════════════ */
.drv {
  border: 1px solid var(--rim);
  border-radius: 6px;
  overflow: hidden;
  margin: clamp(20px, 3.5vw, 32px) 0
}

.drv-hdr {
  background: var(--bg3);
  padding: clamp(9px, 1.5vw, 12px) clamp(14px, 3vw, 22px);
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(8.5px, 1.2vw, 10px);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sub);
  border-bottom: 1px solid var(--rim)
}

.drv-row {
  background: var(--bg2);
  padding: clamp(14px, 2.5vw, 20px) clamp(14px, 3vw, 26px);
  border-bottom: 1px solid var(--rim);
  display: grid;
  grid-template-columns: clamp(28px, 4vw, 38px) 1fr;
  gap: clamp(10px, 2vw, 18px);
  align-items: start;
  min-width: 0;
}

.drv-row>div {
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch
}

.drv-row:last-child {
  border-bottom: none
}

.dn {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(10px, 1.4vw, 12px);
  font-weight: 600;
  padding-top: 3px
}

.dn.o {
  color: var(--orange)
}

.dn.b {
  color: var(--blue)
}

.dn.g {
  color: var(--green)
}

.dn.y {
  color: var(--yellow)
}

.dn.v {
  color: var(--violet)
}

.dn.r {
  color: var(--red)
}

.dnote {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(10px, 1.4vw, 11.5px);
  color: var(--sub);
  font-style: italic;
  margin-top: 8px;
  line-height: 1.65
}

/* ═══════════════════════════════════════════
   FIGURES
═══════════════════════════════════════════ */
.fig {
  margin: clamp(24px, 4vw, 42px) 0
}

.fig-box {
  background: var(--bg2);
  border: 1px solid var(--rim);
  border-radius: 6px;
  padding: clamp(16px, 3vw, 26px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch
}

.fig-cap {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(10px, 1.4vw, 11.5px);
  color: var(--sub);
  margin-top: clamp(10px, 1.8vw, 14px);
  font-style: italic
}

/* ═══════════════════════════════════════════
   TABLES
═══════════════════════════════════════════ */
.t-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: clamp(18px, 3vw, 28px) 0;
  border-radius: 6px;
  border: 1px solid var(--rim)
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(12.5px, 1.7vw, 14px);
  min-width: 420px
}

thead {
  background: var(--bg4)
}

thead th {
  padding: clamp(10px, 1.8vw, 13px) clamp(10px, 2vw, 16px);
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(8px, 1.2vw, 9.5px);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sub);
  text-align: left;
  border-bottom: 1px solid var(--rim)
}

tbody tr {
  border-bottom: 1px solid var(--rim)
}

tbody tr:hover {
  background: var(--bg3)
}

tbody td {
  padding: clamp(10px, 1.8vw, 13px) clamp(10px, 2vw, 16px);
  vertical-align: top;
  line-height: 1.55
}

/* ═══════════════════════════════════════════
   TWO-COL
═══════════════════════════════════════════ */
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 2.5vw, 20px);
  margin: clamp(16px, 3vw, 26px) 0
}

@media(width <=620px) {
  .two {
    grid-template-columns: 1fr
  }
}

.tcol {
  background: var(--bg2);
  border: 1px solid var(--rim);
  border-radius: 6px;
  padding: clamp(16px, 2.5vw, 24px);
  min-width: 0;
}

.tcol h4 {
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 700;
  font-size: clamp(9.5px, 1.4vw, 11px);
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: clamp(10px, 1.8vw, 14px)
}

.tcol p {
  font-size: clamp(13px, 1.7vw, 14.5px);
  margin-bottom: 8px
}

/* ═══════════════════════════════════════════
   FEATURE LIST
═══════════════════════════════════════════ */
.fl {
  list-style: none;
  margin: clamp(10px, 2vw, 14px) 0
}

.fl li {
  padding: clamp(9px, 1.6vw, 12px) 0 clamp(9px, 1.6vw, 12px) clamp(22px, 3.5vw, 30px);
  border-bottom: 1px solid var(--rim);
  position: relative;
  font-size: clamp(14px, 1.9vw, 15.5px);
  line-height: 1.72
}

.fl li:last-child {
  border-bottom: none
}

.fl li::before {
  content: '→';
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: .9em;
  top: clamp(11px, 1.8vw, 14px)
}

.fl.o li::before {
  color: var(--orange)
}

.fl.b li::before {
  color: var(--blue)
}

.fl.g li::before {
  color: var(--green)
}

.fl.y li::before {
  color: var(--yellow)
}

.fl.v li::before {
  color: var(--violet)
}

.fl.r li::before {
  color: var(--red)
}

/* ═══════════════════════════════════════════
   CODE
═══════════════════════════════════════════ */
.cb {
  background: var(--void);
  border: 1px solid var(--rim);
  border-radius: 6px;
  overflow: hidden;
  margin: clamp(16px, 3vw, 26px) 0
}

.cb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px clamp(14px, 2.5vw, 20px);
  background: var(--bg3);
  border-bottom: 1px solid var(--rim)
}

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

.cb-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%
}

.cb-lang {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(8.5px, 1.2vw, 9.5px);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sub)
}

.cb-body {
  padding: clamp(16px, 3vw, 26px) clamp(16px, 3.5vw, 28px);
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(11px, 1.6vw, 13px);
  line-height: 2.1;
  color: rgb(240 237 232 / 40%);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch
}

.kw {
  color: var(--violet)
}

.fn {
  color: var(--blue)
}

.var {
  color: var(--green)
}

.num {
  color: var(--orange)
}

.cmt {
  color: rgb(240 237 232 / 18%);
  font-style: italic
}

.str {
  color: var(--yellow)
}

/* ═══════════════════════════════════════════
   INLINE
═══════════════════════════════════════════ */
code {
  font-family: 'Roboto Mono', monospace;
  font-size: .84em;
  background: var(--bg3);
  border: 1px solid var(--rim);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--orange)
}

.ho {
  color: var(--orange);
  font-weight: 600
}

.hb {
  color: var(--blue);
  font-weight: 600
}

.hg {
  color: var(--green);
  font-weight: 600
}

.hy {
  color: var(--yellow);
  font-weight: 600
}

.hv {
  color: var(--violet);
  font-weight: 600
}

.hr {
  color: var(--red);
  font-weight: 600
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px
}

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

::-webkit-scrollbar-thumb {
  background: var(--rim2);
  border-radius: 2px
}

/* ═══════════════════════════════════════════
   RESPONSIVE — mobile / narrow viewport
═══════════════════════════════════════════ */

/* site-footer dark override (same as other DL articles) */
.site-footer {
  background: #0a0a0a;
  border-top: 1px solid var(--rim);
}

.site-footer .copyright,
.site-footer .footer-meta {
  color: rgb(255 255 255 / 55%)
}

.site-footer .back-to-top,
.site-footer .social-link11 {
  color: rgb(255 255 255 / 45%)
}

.site-footer .back-to-top:hover {
  color: var(--orange)
}

.site-footer .social-link11:hover {
  color: #fff
}

.site-footer .made-with {
  color: rgb(255 255 255 / 30%);
  border-top-color: var(--rim)
}

@media(width <=768px) {
  .ch-sub {
    display: none
  }

  .eq-top {
    flex-direction: column;
    align-items: flex-start
  }

  .hero-strip {
    scrollbar-width: none
  }

  .hero-strip::-webkit-scrollbar {
    display: none
  }
}

@media(width <=480px) {
  /* hero */
  .hero {
    padding-left: clamp(16px, 5vw, 24px);
    padding-right: clamp(16px, 5vw, 24px)
  }

  .hero h1 {
    font-size: clamp(2rem, 12vw, 3rem)
  }

  .hero-extends {
    font-size: clamp(10px, 3.5vw, 12px)
  }

  /* page content */
  .page {
    padding-left: clamp(16px, 5vw, 24px);
    padding-right: clamp(16px, 5vw, 24px)
  }

  .toc-outer {
    padding-left: clamp(16px, 5vw, 24px);
    padding-right: clamp(16px, 5vw, 24px)
  }

  /* chapter headers */
  .ch-head::before {
    width: 40px
  }

  .ch h2 {
    font-size: clamp(1.25rem, 7vw, 1.7rem)
  }

  /* equation boxes */
  .eq-body {
    padding-left: clamp(12px, 4vw, 20px);
    padding-right: clamp(12px, 4vw, 20px)
  }

  /* derivation rows */
  .drv-row {
    grid-template-columns: 24px 1fr;
    gap: 8px;
    padding-left: clamp(12px, 4vw, 18px);
    padding-right: clamp(12px, 4vw, 18px)
  }

  /* lens callout */
  .lens {
    flex-direction: column;
    gap: 10px
  }

  /* theorem */
  .thm {
    padding-left: clamp(14px, 4vw, 22px);
    padding-right: clamp(14px, 4vw, 22px)
  }

  /* TOC grid: single column on very narrow */
  .toc-grid {
    grid-template-columns: 1fr
  }

  /* complete mental model SVG — make it fully scrollable */
  .fig-box {
    padding: clamp(10px, 3vw, 16px)
  }

  /* hero strip: let numbers stay readable */
  .hs-val {
    font-size: clamp(1rem, 5vw, 1.3rem)
  }

  .hs-label {
    font-size: clamp(7px, 2.5vw, 9px)
  }
}