/* ── V3 DESIGN SYSTEM ─────────────────────────────────────────── */

:root {
  --bg: oklch(0.93 0.006 80);
  --bg2: oklch(0.90 0.008 78);
  --bg3: oklch(0.87 0.010 76);
  --ink: oklch(0.18 0.025 60);
  --ink2: oklch(0.38 0.02 60);
  --ink3: oklch(0.55 0.015 60);
  --accent: oklch(0.62 0.19 52);
  --accent2: oklch(0.50 0.19 270);
  --accent3: oklch(0.55 0.17 160);
  --border: oklch(0.82 0.012 78);
  --border2: oklch(0.76 0.016 76);
  --code-bg: oklch(0.1 0.025 260);
  --code-fg: oklch(0.93 0.01 260);
  --mono: 'JetBrains Mono', monospace;
  --sans: 'IBM Plex Sans Thai', sans-serif;
  --display: 'Kanit', sans-serif;
  --nav-h: 60px;
}

[data-dark="true"] {
  --bg: oklch(0.10 0.025 260);
  --bg2: oklch(0.14 0.025 260);
  --bg3: oklch(0.18 0.022 260);
  --ink: oklch(0.96 0.008 260);
  --ink2: oklch(0.78 0.012 260);
  --ink3: oklch(0.55 0.015 260);
  --border: oklch(0.22 0.02 260);
  --border2: oklch(0.28 0.02 260);
  --code-bg: oklch(0.07 0.02 260);
  --code-fg: oklch(0.93 0.01 260);
}

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

html { scroll-behavior: smooth; font-size: 18px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* ── NAV ─────────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
  backdrop-filter: blur(12px);
  transition: background 0.3s, border-color 0.3s;
}
.nav-logo {
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 0.5rem;
  white-space: nowrap;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex; gap: 0.25rem; list-style: none; flex: 1;
  overflow-x: auto; scrollbar-width: none;
}
.nav-links a {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  color: var(--ink3); text-decoration: none; padding: 0.35rem 0.75rem;
  border-radius: 4px; white-space: nowrap;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.02em;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); background: color-mix(in oklch, var(--accent) 10%, transparent); }

.nav-tag {
  font-family: var(--mono); font-size: 0.68rem;
  background: color-mix(in oklch, var(--accent) 15%, transparent);
  color: var(--accent); padding: 0.2rem 0.5rem; border-radius: 3px;
  white-space: nowrap;
}

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.nav-btn {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  border: 1.5px solid var(--border2); background: transparent;
  color: var(--ink3); padding: 0.25rem 0.6rem; border-radius: 4px;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn.active { border-color: var(--accent); color: var(--accent); background: color-mix(in oklch, var(--accent) 10%, transparent); }

/* Mobile nav hamburger */
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 4px; margin-left: auto;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px; transition: all 0.25s;
}
.mobile-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem; flex-direction: column; gap: 0.25rem; z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--mono); font-size: 0.9rem; color: var(--ink2);
  text-decoration: none; padding: 0.65rem 0.75rem; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.mobile-menu a:hover { background: var(--bg3); color: var(--accent); }

/* ── LAYOUT ─────────────────────────────────────────────────── */
main { padding-top: var(--nav-h); }

section { padding: 5rem 2rem; }

.container { max-width: 1100px; margin: 0 auto; }
.container-wide { max-width: 1300px; margin: 0 auto; }

/* ── HERO ───────────────────────────────────────────────────── */
#hero {
  min-height: 88vh; display: flex; align-items: center;
  background: var(--bg);
  position: relative; overflow: hidden; padding: 5rem 2rem;
}

.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.5;
}
.hero-grid::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 60% 50%, transparent 40%, var(--bg) 100%);
}

.hero-inner { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; width: 100%; }
.hero-eyebrow {
  font-family: var(--mono); font-size: 0.72rem; color: var(--accent);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.hero-eyebrow::before {
  content: ''; width: 32px; height: 2px; background: var(--accent);
}

h1.hero-title {
  font-family: var(--display); font-weight: 900; font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 1.05; letter-spacing: -0.02em; color: var(--ink);
  margin-bottom: 1.5rem;
}
h1.hero-title em { color: var(--accent); font-style: normal; }

.hero-desc {
  font-size: 1.15rem; color: var(--ink2); max-width: 580px;
  margin-bottom: 2.5rem; line-height: 1.8;
}

.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }

.btn-primary {
  font-family: var(--mono); font-size: 0.8rem; font-weight: 700;
  background: var(--accent); color: #fff;
  padding: 0.75rem 1.5rem; border-radius: 6px; text-decoration: none;
  letter-spacing: 0.05em; transition: opacity 0.15s, transform 0.15s;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-sec {
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
  background: transparent; color: var(--ink); border: 1.5px solid var(--border2);
  padding: 0.75rem 1.5rem; border-radius: 6px; text-decoration: none;
  letter-spacing: 0.04em; transition: border-color 0.15s, color 0.15s;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-sec:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; gap: 0.15rem; }
.hero-stat-num {
  font-family: var(--display); font-weight: 700; font-size: 2rem; color: var(--ink);
  line-height: 1;
}
.hero-stat-num span { color: var(--accent); }
.hero-stat-label {
  font-family: var(--mono); font-size: 0.68rem; color: var(--ink3); letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── SECTION HEADERS ────────────────────────────────────────── */
.section-header { margin-bottom: 3rem; }
.section-tag {
  font-family: var(--mono); font-size: 0.68rem; color: var(--accent);
  letter-spacing: 0.12em; text-transform: uppercase;
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem;
}
.section-tag::before { content: '//'; opacity: 0.5; }

h2.section-title {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.15; letter-spacing: -0.01em; color: var(--ink);
  margin-bottom: 0.75rem;
}
.section-subtitle { font-size: 1.05rem; color: var(--ink2); max-width: 640px; line-height: 1.8; }

/* ── CONCEPTS ───────────────────────────────────────────────── */
#concepts { background: var(--bg2); }

.concepts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5px;
  border: 1.5px solid var(--border2); border-radius: 12px; overflow: hidden;
  background: var(--border2);
}
.concept-card {
  background: var(--bg); padding: 1.75rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: background 0.15s;
  cursor: default;
}
.concept-card:hover { background: var(--bg3); }

.concept-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in oklch, var(--accent) 12%, transparent);
  padding: 0.25rem 0.6rem; border-radius: 4px; width: fit-content;
}

h3.concept-name {
  font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--ink);
  line-height: 1.25;
}
.concept-desc { font-size: 0.95rem; color: var(--ink2); line-height: 1.7; }
.concept-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: auto; }
.concept-tag {
  font-family: var(--mono); font-size: 0.62rem; color: var(--ink3);
  border: 1px solid var(--border); padding: 0.15rem 0.45rem; border-radius: 3px;
}
.concept-meta {
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink3);
  display: flex; gap: 1rem; margin-top: 0.25rem;
}

/* Comparison table */
.comparison-table { margin-top: 3rem; }
.comparison-table h3 {
  font-family: var(--display); font-weight: 600; font-size: 1.2rem;
  margin-bottom: 1rem; color: var(--ink);
}
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1.5px solid var(--border2); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead tr { background: var(--bg3); }
th {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2);
  padding: 0.85rem 1.1rem; text-align: left; border-bottom: 1.5px solid var(--border2);
  white-space: nowrap;
}
td {
  padding: 0.8rem 1.1rem; color: var(--ink2);
  border-bottom: 1px solid var(--border);
}
td:first-child { font-weight: 600; color: var(--ink); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }
.td-mono { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); }
.td-freq { font-family: var(--mono); font-size: 0.72rem; }

/* ── CODE BLOCK ─────────────────────────────────────────────── */
.code-block {
  background: var(--code-bg); border-radius: 10px; overflow: hidden;
  margin: 2rem 0; border: 1px solid oklch(0.2 0.02 260);
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 1rem;
  background: oklch(0.15 0.025 260);
  border-bottom: 1px solid oklch(0.2 0.02 260);
}
.code-lang {
  font-family: var(--mono); font-size: 0.65rem; font-weight: 700;
  color: oklch(0.65 0.15 52); letter-spacing: 0.08em; text-transform: uppercase;
}
.code-dots { display: flex; gap: 0.35rem; }
.code-dots span { width: 10px; height: 10px; border-radius: 50%; }
.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }
pre {
  padding: 1.25rem 1.5rem; overflow-x: auto;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.7;
  color: var(--code-fg);
}
.c-comment { color: oklch(0.5 0.02 260); }
.c-keyword { color: oklch(0.72 0.16 310); }
.c-string { color: oklch(0.75 0.14 145); }
.c-num { color: oklch(0.72 0.16 52); }
.c-fn { color: oklch(0.72 0.12 220); }

/* ── METRICS ────────────────────────────────────────────────── */
#metrics { background: var(--bg); }

.metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem;
  margin-bottom: 3rem;
}
.metric-card {
  border: 1.5px solid var(--border2); border-radius: 10px;
  padding: 1.5rem; background: var(--bg2);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.metric-icon {
  font-size: 1.5rem; width: 44px; height: 44px; display: flex; align-items: center;
  justify-content: center; background: color-mix(in oklch, var(--accent) 10%, transparent);
  border-radius: 8px; margin-bottom: 0.25rem;
}
h3.metric-name {
  font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--ink);
}
.metric-desc { font-size: 0.95rem; color: var(--ink2); line-height: 1.7; }

.threshold-bar { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.threshold-row { display: flex; align-items: center; gap: 0.75rem; }
.threshold-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: oklch(0.62 0.17 145); }
.dot-yellow { background: oklch(0.82 0.16 85); }
.dot-red { background: oklch(0.58 0.2 25); }
.threshold-label { font-family: var(--mono); font-size: 0.75rem; color: var(--ink3); }
.threshold-val { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; color: var(--ink); margin-left: auto; }

/* Percentile visual */
.percentile-visual {
  border: 1.5px solid var(--border2); border-radius: 10px;
  padding: 2rem; background: var(--bg2); margin-bottom: 1.5rem;
}
.percentile-visual h3 {
  font-family: var(--display); font-weight: 700; font-size: 1.2rem;
  color: var(--ink); margin-bottom: 0.5rem;
}
.percentile-warning {
  font-family: var(--mono); font-size: 0.85rem;
  background: color-mix(in oklch, oklch(0.58 0.2 52) 10%, transparent);
  border-left: 3px solid var(--accent);
  color: var(--ink2); padding: 0.75rem 1rem; border-radius: 0 6px 6px 0;
  margin: 1rem 0; line-height: 1.55;
}
.pct-rows { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.25rem; }
.pct-row { display: flex; align-items: center; gap: 1rem; }
.pct-label { font-family: var(--mono); font-size: 0.8rem; font-weight: 700; color: var(--ink2); width: 42px; }
.pct-bar-wrap { flex: 1; background: var(--bg3); border-radius: 3px; height: 22px; overflow: hidden; position: relative; }
.pct-bar { height: 100%; border-radius: 3px; display: flex; align-items: center; padding: 0 0.6rem; }
.pct-bar span { font-family: var(--mono); font-size: 0.72rem; font-weight: 700; color: #fff; }
.pct-note { font-family: var(--mono); font-size: 0.72rem; color: var(--ink3); width: 210px; }

/* SLA table */
.sla-table { margin-top: 2rem; }

/* ── TOOLS ──────────────────────────────────────────────────── */
#tools { background: var(--bg2); }

.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.tool-card {
  border: 1.5px solid var(--border2); border-radius: 10px;
  padding: 1.5rem; background: var(--bg);
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.tool-header { display: flex; align-items: center; gap: 0.75rem; }
.tool-logo {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 0.75rem;
  flex-shrink: 0;
}
h3.tool-name { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.tool-tagline { font-family: var(--mono); font-size: 0.68rem; color: var(--ink3); margin-top: 0.15rem; }

.tool-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tool-chip {
  font-family: var(--mono); font-size: 0.72rem; color: var(--ink2);
  border: 1px solid var(--border); padding: 0.2rem 0.5rem; border-radius: 3px;
}
.tool-chip.highlight { border-color: var(--accent2); color: var(--accent2); }

.tool-desc { font-size: 0.95rem; color: var(--ink2); line-height: 1.7; }
.tool-best {
  font-family: var(--mono); font-size: 0.78rem;
  background: color-mix(in oklch, var(--accent3) 12%, transparent);
  color: var(--accent3); padding: 0.3rem 0.6rem; border-radius: 4px; width: fit-content;
}

/* ── PLANNING ───────────────────────────────────────────────── */
#planning { background: var(--bg); }

.planning-steps { display: flex; flex-direction: column; gap: 0; margin-bottom: 3rem; }
.step-row {
  display: grid; grid-template-columns: 56px 1fr; gap: 0;
  position: relative;
}
.step-left { display: flex; flex-direction: column; align-items: center; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--border2); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; color: var(--accent);
  flex-shrink: 0; z-index: 1; position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.step-row:hover .step-num { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 10%, transparent); }
.step-line { width: 2px; flex: 1; background: var(--border); margin: 0 auto; }
.step-row:last-child .step-line { display: none; }

.step-content { padding: 0 0 2.5rem 1.5rem; padding-top: 0.55rem; }
h3.step-title {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  color: var(--ink); margin-bottom: 0.4rem;
}
.step-desc { font-size: 0.95rem; color: var(--ink2); line-height: 1.75; max-width: 640px; }
.step-note {
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink3);
  margin-top: 0.6rem; padding: 0.5rem 0.75rem;
  background: var(--bg3); border-radius: 5px; width: fit-content;
}

/* Best practices */
.best-practices { margin-top: 3rem; }
.bp-header {
  font-family: var(--display); font-weight: 700; font-size: 1.4rem;
  color: var(--ink); margin-bottom: 1.25rem;
}
.bp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.bp-card {
  border-radius: 10px; padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.bp-do { background: color-mix(in oklch, var(--accent3) 8%, transparent); border: 1.5px solid color-mix(in oklch, var(--accent3) 30%, transparent); }
.bp-dont { background: color-mix(in oklch, oklch(0.58 0.2 25) 8%, transparent); border: 1.5px solid color-mix(in oklch, oklch(0.58 0.2 25) 25%, transparent); }

.bp-label { font-family: var(--mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.bp-do .bp-label { color: var(--accent3); }
.bp-dont .bp-label { color: oklch(0.58 0.2 25); }
.bp-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.bp-list li { font-size: 0.92rem; color: var(--ink2); display: flex; align-items: flex-start; gap: 0.5rem; line-height: 1.6; }
.bp-list li::before { content: '→'; font-family: var(--mono); color: var(--ink3); flex-shrink: 0; margin-top: 0.05rem; }

/* ── GLOSSARY ───────────────────────────────────────────────── */
#glossary { background: var(--bg2); }

.glossary-search {
  display: flex; align-items: center; gap: 0.75rem;
  border: 1.5px solid var(--border2); border-radius: 8px;
  padding: 0.6rem 1rem; background: var(--bg);
  margin-bottom: 2rem; max-width: 480px;
}
.glossary-search input {
  border: none; background: transparent; font-family: var(--mono); font-size: 0.85rem;
  color: var(--ink); flex: 1; outline: none;
}
.glossary-search input::placeholder { color: var(--ink3); }
.search-icon { font-size: 1rem; color: var(--ink3); }

.glossary-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.glossary-item {
  background: var(--bg); padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.glossary-term { font-family: var(--mono); font-weight: 700; font-size: 1rem; color: var(--accent); }
.glossary-def { font-size: 0.9rem; color: var(--ink2); line-height: 1.6; }
.glossary-cat {
  font-family: var(--mono); font-size: 0.62rem; color: var(--ink3);
  border: 1px solid var(--border); padding: 0.1rem 0.4rem;
  border-radius: 3px; width: fit-content; margin-top: 0.25rem;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
footer {
  background: var(--code-bg); color: oklch(0.55 0.015 260);
  padding: 2.5rem 2rem; text-align: center;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-brand { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: oklch(0.75 0.01 260); margin-bottom: 0.5rem; }
.footer-brand span { color: var(--accent); }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.footer-links a {
  font-family: var(--mono); font-size: 0.72rem; color: oklch(0.5 0.015 260);
  text-decoration: none; transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-family: var(--mono); font-size: 0.68rem; color: oklch(0.35 0.01 260); margin-top: 0.75rem; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  html { font-size: 17px; }
  section { padding: 3.5rem 1.25rem; }
  .nav-links, .nav-tag { display: none; }
  .nav-hamburger { display: flex; }
  .nav-actions { gap: 0.35rem; }
  .nav-btn { font-size: 0.65rem; padding: 0.2rem 0.45rem; }

  #hero { min-height: 75vh; padding: 4rem 1.25rem 3rem; }
  h1.hero-title { font-size: 2.4rem; }
  .hero-desc { font-size: 1rem; }
  .hero-stats { gap: 1.5rem; flex-wrap: wrap; }
  .hero-stat-num { font-size: 1.75rem; }
  .hero-ctas { flex-direction: column; }
  .btn-primary, .btn-sec { justify-content: center; }

  h2.section-title { font-size: 1.75rem; }
  .section-subtitle { font-size: 0.95rem; }

  .concepts-grid { grid-template-columns: 1fr; }
  .concept-desc { font-size: 0.92rem; }

  .metrics-grid { grid-template-columns: 1fr; }
  .metric-desc { font-size: 0.9rem; }
  .pct-note { display: none; }

  .tools-grid { grid-template-columns: 1fr; }
  .tool-desc { font-size: 0.9rem; }

  .table-wrap { border-radius: 8px; }
  table { font-size: 0.82rem; }
  th, td { padding: 0.65rem 0.9rem; }

  .bp-grid { grid-template-columns: 1fr; }
  h3.step-title { font-size: 1.05rem; }
  .step-desc { font-size: 0.9rem; }

  .glossary-grid { grid-template-columns: 1fr; }
  .glossary-def { font-size: 0.88rem; }

  pre { font-size: 0.72rem; padding: 1rem; }

  .percentile-visual { padding: 1.25rem; }
  .pct-rows { gap: 0.6rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  html { font-size: 17px; }
  .concepts-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
