/* =============================================
   ACC: Compiling Agent Trajectories
   Interactive companion · stylesheet
   ============================================= */

:root {
    --bg: #fbfaf7;
    --bg-elevated: #ffffff;
    --ink: #15212e;
    --ink-soft: #3a4a5c;
    --ink-muted: #6b7785;
    --ink-faint: #a4adb8;
    --rule: #e3e0d8;
    --rule-strong: #c9c4b6;

    --upstream: #1f3a52;
    --upstream-soft: #2c537a;
    --midmarket: #4a7396;
    --downstream: #7aa6cc;
    --downstream-soft: #a4c2dc;
    --feedback: #16a085;
    --feedback-soft: #2bbfa1;

    --accent: #c8392c;
    --accent-soft: #e25646;
    --accent-glow: rgba(200, 57, 44, 0.12);
    --warn: #d18b1f;
    --good: #16a085;

    --search-color: #6366f1;
    --swe-color: #f59e0b;
    --sql-color: #10b981;

    --serif: 'Newsreader', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

    --max-width: 920px;
    --shadow-sm: 0 1px 2px rgba(21, 33, 46, 0.04), 0 2px 6px rgba(21, 33, 46, 0.04);
    --shadow-md: 0 2px 4px rgba(21, 33, 46, 0.06), 0 8px 24px rgba(21, 33, 46, 0.06);
    --shadow-lg: 0 8px 16px rgba(21, 33, 46, 0.08), 0 24px 60px rgba(21, 33, 46, 0.10);
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 2.6rem; margin: 0 0 0.8rem 0; }
h3 { font-size: 1.5rem; margin: 2.4rem 0 0.8rem 0; }
h4 { font-size: 1.15rem; margin: 0 0 0.6rem 0; font-weight: 600; }

p { margin: 0 0 1.2rem 0; }
.muted { color: var(--ink-muted); font-size: 0.92em; }
em { font-style: italic; color: inherit; }
b, strong { font-weight: 600; color: var(--ink); }

/* ========== NAV BAR ========== */
.nav-bar {
    position: fixed; top: 0; left: 0; right: 0;
    background: rgba(251, 250, 247, 0.92);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--rule);
    z-index: 100;
    height: 56px;
}
.nav-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 28px;
    height: 100%;
    display: flex; align-items: center; justify-content: space-between;
    position: relative;
}
.nav-title {
    display: flex; flex-direction: column;
    line-height: 1.15;
}
.nav-paper { font-family: var(--serif); font-weight: 600; font-size: 0.96rem; color: var(--ink); }
.nav-sub { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-muted); letter-spacing: 0.02em; text-transform: uppercase; }
.nav-progress {
    position: absolute; bottom: -1px; left: 0; right: 0;
    height: 2px; background: transparent;
}
.nav-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--upstream), var(--accent));
    transition: width 0.15s linear;
}

/* ========== CHAPTER RAIL ========== */
.chapter-rail {
    position: fixed;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
}
.chapter-rail ol {
    list-style: none; margin: 0; padding: 0;
}
.chapter-rail li {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.4rem 0;
    cursor: pointer;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.2s;
}
.chapter-rail li:hover { color: var(--ink); }
.chapter-rail li.active { color: var(--accent); font-weight: 600; }
.chapter-rail .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ink-faint);
    transition: all 0.2s;
}
.chapter-rail li.active .dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: scale(1.2);
}
.chapter-rail .label {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.18s, transform 0.18s;
    pointer-events: none;
    white-space: nowrap;
}
.chapter-rail:hover .label,
.chapter-rail li.active .label { opacity: 1; transform: translateX(0); }

@media (max-width: 1100px) {
    .chapter-rail { display: none; }
}

/* ========== CHAPTER LAYOUT ========== */
.chapter {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 7rem 32px 6rem 32px;
    border-bottom: 1px solid var(--rule);
}
.chapter:last-of-type { border-bottom: none; }

.chapter-head {
    margin-bottom: 3rem;
}
.chapter-num {
    font-family: var(--sans);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.lede {
    font-size: 1.18rem;
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 56ch;
    margin-top: 1rem;
}

.prose {
    max-width: 64ch;
}
.prose ul, .prose ol {
    margin: 1.2rem 0;
    padding-left: 1.4rem;
}
.prose li { margin-bottom: 0.7rem; }

.flow-list {
    counter-reset: flow;
    list-style: none;
    padding-left: 0;
}
.flow-list li {
    counter-increment: flow;
    position: relative;
    padding-left: 2.4rem;
    margin-bottom: 0.85rem;
}
.flow-list li::before {
    content: counter(flow);
    position: absolute;
    left: 0; top: 0.05em;
    width: 1.7rem; height: 1.7rem;
    border-radius: 50%;
    background: var(--upstream);
    color: white;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.82rem;
    display: flex; align-items: center; justify-content: center;
}

/* ========== COVER ========== */
.cover {
    min-height: 100vh;
    max-width: none;
    padding: 0;
    border-bottom: 1px solid var(--rule);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cover-inner {
    max-width: var(--max-width);
    padding: 6rem 32px;
    position: relative;
    z-index: 2;
}
.cover-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(200, 57, 44, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(31, 58, 82, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 100%, rgba(22, 160, 133, 0.06) 0%, transparent 50%);
    z-index: 1;
}
.cover-eyebrow {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.2rem;
}
.cover-title {
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    font-weight: 600;
    line-height: 1.05;
    margin: 0 0 1.2rem 0;
    letter-spacing: -0.025em;
}
.cover-title em { font-style: italic; color: var(--accent); }
.cover-subtitle {
    font-size: 1.4rem;
    color: var(--ink-soft);
    font-style: italic;
    margin-bottom: 2.4rem;
    max-width: 30ch;
}
.cover-byline {
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--ink-soft);
    margin-bottom: 2.6rem;
}
.cover-abstract {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    column-gap: 2.4rem;
    row-gap: 1.2rem;
    margin: 0 0 3.6rem 0;
    padding-top: 1.6rem;
    border-top: 1px solid var(--rule);
}
.cover-abstract-label {
    grid-column: 1 / -1;
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0;
}
.cover-abstract p {
    font-family: var(--serif);
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--ink-soft);
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    position: relative;
}
.cover-abstract p::before {
    content: counter(abstract-step, upper-roman);
    counter-increment: abstract-step;
    position: absolute;
    top: 0.85rem;
    right: 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--accent);
    background: var(--bg);
    padding: 0 6px;
    transform: translateY(-50%);
}
.cover-abstract { counter-reset: abstract-step; }
@media (max-width: 820px) {
    .cover-abstract { grid-template-columns: 1fr; }
}
.cover-abstract b, .cover-abstract strong {
    color: var(--ink);
    font-weight: 600;
}
.cover-abstract em {
    color: var(--accent);
    font-style: italic;
}
.cover-pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6rem;
    margin-bottom: 3rem;
}
.pillar {
    padding: 1.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: transform 0.25s, box-shadow 0.25s;
}
.pillar:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.pillar-num {
    position: absolute;
    top: -10px; right: 16px;
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--accent);
    background: var(--bg-elevated);
    padding: 0 6px;
}
.pillar-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.18rem;
    margin-bottom: 0.6rem;
    color: var(--ink);
}
.pillar-text {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--ink-soft);
}

.cover-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}
.cover-meta { font-family: var(--sans); font-size: 0.85rem; }

@media (max-width: 720px) {
    .cover-pillars { grid-template-columns: 1fr; }
}

/* ========== BUTTONS ========== */
.primary-btn {
    background: var(--ink);
    color: white;
    border: none;
    padding: 0.85rem 1.6rem;
    font-family: var(--sans);
    font-size: 0.94rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    box-shadow: var(--shadow-sm);
}
.primary-btn:hover { background: var(--accent); transform: translateY(-1px); }
.primary-btn:active { transform: translateY(0); }

.ghost-btn {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--rule-strong);
    padding: 0.8rem 1.4rem;
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.ghost-btn:hover { color: var(--ink); border-color: var(--ink-soft); background: rgba(0,0,0,0.02); }

.btn-row { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1rem; }

/* ========== PROPERTY CARDS ========== */
.property-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
    margin: 2.4rem 0;
}
.property-card {
    padding: 1.8rem;
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s, box-shadow 0.25s;
}
.property-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.property-icon {
    font-size: 2.4rem;
    color: var(--upstream-soft);
    line-height: 1;
    margin-bottom: 0.8rem;
    font-family: var(--serif);
}
.property-name {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
    color: var(--ink);
}
.property-detail {
    font-size: 0.96rem;
    color: var(--ink-soft);
    margin-bottom: 1rem;
    line-height: 1.5;
}
.property-tech {
    font-family: var(--sans);
    font-size: 0.82rem;
    color: var(--ink-muted);
    padding-top: 0.8rem;
    border-top: 1px solid var(--rule);
}
.property-tech .tag {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-right: 0.4rem;
}
@media (max-width: 720px) {
    .property-grid { grid-template-columns: 1fr; }
}

/* ========== CALLOUTS ========== */
.callout {
    margin: 3rem 0;
    padding: 1.6rem 1.8rem;
    background: linear-gradient(180deg, rgba(200, 57, 44, 0.04), rgba(200, 57, 44, 0.02));
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
}

.plain-card {
    margin: 2rem 0 2.4rem 0;
    padding: 1.6rem 1.8rem 1.4rem 1.8rem;
    background: linear-gradient(180deg, #fff8ec 0%, #fffaf0 100%);
    border: 1px solid #f0e4c9;
    border-left: 4px solid #d4a849;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(212, 168, 73, 0.08);
}
.plain-label {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #a07719;
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.plain-label::before {
    content: "\2726";
    font-size: 0.95rem;
    color: #d4a849;
    letter-spacing: 0;
    transform: translateY(-1px);
}
.plain-card p {
    margin: 0 0 0.85rem 0;
    color: #2a2618;
    font-family: var(--serif);
    font-size: 1.04rem;
    line-height: 1.65;
}
.plain-card p:last-child { margin-bottom: 0; }
.plain-card b, .plain-card strong { color: #15212e; }
.plain-card em { color: #a07719; font-style: italic; }
.callout.subtle {
    background: rgba(31, 58, 82, 0.04);
    border-left-color: var(--upstream);
}
.callout-label {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.callout.subtle .callout-label { color: var(--upstream); }
.callout-body {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-soft);
}

/* ========== EQUATION BLOCKS ========== */
.equation-block {
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 1.4rem;
    margin: 1.8rem 0;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.equation-block.large { padding: 2rem; }
.equation-block .katex { font-size: 1.05em; }
.equation-block.large .katex-display { margin: 0; }

/* ========== INTERACTIVE SECTIONS ========== */
.interactive-section {
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: var(--shadow-md);
}
.interactive-section h3 {
    margin-top: 0;
    color: var(--upstream);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.interactive-section h3::before {
    content: '\25B6';
    font-size: 0.65em;
    color: var(--accent);
}

.viz-container {
    width: 100%;
    min-height: 280px;
    border-radius: 4px;
    background: var(--bg);
    border: 1px solid var(--rule);
    margin: 1.4rem 0;
    position: relative;
    overflow: hidden;
}
.viz-container.tall { min-height: 460px; }
.viz-container.short { min-height: 240px; }

/* ========== CONTROLS ========== */
.ctrl, .ctrl-row {
    margin-bottom: 1rem;
}
.ctrl label, .ctrl-row label {
    display: block;
    font-family: var(--sans);
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
}
.ctrl label span, .ctrl-row label span {
    color: var(--accent);
    font-family: var(--mono);
    font-weight: 600;
    margin-left: 0.4rem;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--rule);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(200, 57, 44, 0.4);
    transition: transform 0.12s, box-shadow 0.12s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.ctrl-tick {
    display: flex; justify-content: space-between;
    font-family: var(--sans);
    font-size: 0.72rem;
    color: var(--ink-muted);
    margin-top: 0.3rem;
}

.sim-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
    margin: 1.5rem 0;
    padding: 1.4rem;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid var(--rule);
}

.sim-controls .btn-row {
    grid-column: 1 / -1;
}

/* ========== READOUTS ========== */
.readouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.4rem;
}
.readout {
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 1rem 1.2rem;
}
.readout-label {
    font-family: var(--sans);
    font-size: 0.74rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-bottom: 0.4rem;
}
.readout-val {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--ink);
}

/* ========== DUAL COLUMN ========== */
.dual-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2.4rem 0;
}
.dual-col h4 {
    color: var(--upstream);
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--rule);
}
@media (max-width: 720px) {
    .dual-col { grid-template-columns: 1fr; }
}

/* ========== CHART GRIDS ========== */
.chart-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}
@media (max-width: 720px) {
    .chart-grid-2 { grid-template-columns: 1fr; }
}

.chart-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}
@media (max-width: 900px) {
    .chart-grid-3 { grid-template-columns: 1fr; }
}

/* ========== STRATEGY / SELECTABLE CARDS ========== */
.strategy-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.4rem 0;
}
.strat-card {
    padding: 1.3rem;
    background: var(--bg);
    border: 2px solid var(--rule);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.strat-card:hover {
    border-color: var(--ink-soft);
    transform: translateY(-2px);
}
.strat-card.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(200, 57, 44, 0.05), transparent);
    box-shadow: var(--shadow-md);
}
.strat-name {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 0.4rem;
}
.strat-meta {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-bottom: 0.8rem;
}
.strat-desc {
    font-size: 0.9rem;
    color: var(--ink-soft);
    line-height: 1.45;
}
@media (max-width: 720px) {
    .strategy-cards { grid-template-columns: 1fr; }
}

/* ========== CHAPTER FOOT LINK ========== */
.chapter-foot {
    display: block;
    margin-top: 4rem;
    padding: 1.4rem 1.8rem;
    border-top: 1px dashed var(--rule);
    text-align: right;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s, padding 0.2s;
    border-radius: 0 0 6px 6px;
}
.chapter-foot:hover {
    background: linear-gradient(90deg, transparent, rgba(200, 57, 44, 0.06));
    padding-right: 2.2rem;
}
.chapter-foot:hover .next-hint {
    color: var(--accent);
}
.chapter-foot:hover .next-arrow {
    transform: translateX(4px);
}
.next-hint {
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink-soft);
    font-style: normal;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.next-arrow {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    transition: transform 0.2s;
}

.live-hint {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-style: italic;
    color: var(--ink-muted);
    align-self: center;
    margin-left: 0.4rem;
}

/* ========== FOOTER ========== */
.site-footer {
    padding: 2.4rem 32px;
    text-align: center;
    border-top: 1px solid var(--rule);
    background: var(--bg-elevated);
}
.site-footer .muted { font-family: var(--sans); font-size: 0.85rem; }

/* ========== TRAJECTORY FLOW DIAGRAM ========== */
.traj-flow {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 1.5rem 0;
    overflow-x: auto;
    padding: 1rem 0;
}
.traj-node {
    padding: 0.8rem 1.1rem;
    border-radius: 6px;
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    min-width: 90px;
    position: relative;
}
.traj-node.question { background: var(--upstream); color: white; }
.traj-node.reasoning { background: #e8e0f0; color: #4a3560; }
.traj-node.action { background: #dbeafe; color: #1e40af; }
.traj-node.observation { background: #fef3c7; color: #92400e; }
.traj-node.observation.masked {
    opacity: 0.4;
    text-decoration: line-through;
}
.traj-node.answer { background: var(--accent); color: white; }
.traj-node.context { background: var(--feedback); color: white; }
.traj-arrow {
    font-size: 1.3rem;
    color: var(--ink-muted);
    padding: 0 0.3rem;
    flex-shrink: 0;
}

/* ========== NUMBERS ROW ========== */
.numbers-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
    margin: 2rem 0;
}
.big-num {
    text-align: center;
    padding: 1.6rem 1rem;
    border-radius: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-sm);
}
.num-val {
    font-family: var(--mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.6rem;
}
.num-desc { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.45; }
@media (max-width: 720px) {
    .numbers-row { grid-template-columns: 1fr; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 720px) {
    body { font-size: 16px; }
    h2 { font-size: 1.9rem; }
    .chapter { padding: 5rem 20px 4rem 20px; }
    .equation-block { padding: 1rem; font-size: 0.92rem; }
    .interactive-section { padding: 1.4rem; }
}

/* katex tweaks */
.katex { font-size: 1.02em !important; }
