@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;550;600;650;700;750;800&family=Space+Mono:wght@400;700&display=swap');

:root { color-scheme: dark; --bg: #080909; --surface: #111313; --surface-high: #191c1b; --line: #292d29; --text: #f0f1ed; --muted: #a0a69e; --lime: #c1ff72; --purple: #c8a0fa; --cyan: #99e3e1; --font: 'Inter', Arial, sans-serif; --mono: 'Space Mono', monospace; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button { color: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 5px; }
::selection { background: var(--lime); color: var(--bg); }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.055em; line-height: 1.1; }
h1 { font-size: clamp(48px, 5.9vw, 86px); }
h2 { font-size: clamp(32px, 4vw, 54px); }
h3 { font-size: 26px; letter-spacing: -.035em; }
h4 { font-size: 18px; }
p { color: var(--muted); }
sup { font-size: .55em; }
code, .mono { font-family: var(--mono); }
code { color: var(--lime); font-size: .9em; overflow-wrap: anywhere; }
strong { color: var(--text); font-weight: 600; }
.container { width: min(1280px, calc(100% - 96px)); margin-inline: auto; }
.section { padding-block: 85px; }
.text-lime { color: var(--lime); }
.muted { color: var(--muted); }
.eyebrow { font: 10px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.status-dot { display: inline-block; width: 7px; height: 7px; background: var(--lime); border-radius: 50%; margin-right: 9px; box-shadow: 0 0 12px #c1ff7250; }
.skip-link { position: fixed; left: 20px; top: -80px; z-index: 100; background: var(--lime); color: var(--bg); padding: 10px 20px; border-radius: 10px; }
.skip-link:focus { top: 10px; }
.site-header { min-height: 94px; width: min(1440px, 100%); padding: 20px 48px; margin: auto; display: flex; gap: 32px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; font-size: 22px; font-weight: 650; letter-spacing: -.055em; }
.brand-mark { font-size: 29px; letter-spacing: -5px; font-weight: 800; transform: rotate(25deg); margin-right: 14px; color: var(--lime); }
.brand-dot { color: var(--lime); }
.site-header nav { display: flex; gap: 25px; font-size: 12px; align-items: center; }
.site-header nav a { color: var(--muted); padding-block: 9px; white-space: nowrap; transition: color .2s; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--lime); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 24px; padding: 14px 23px; border: 1px solid var(--lime); border-radius: 100px; background: var(--lime); color: #152008; font-size: 13px; font-weight: 600; line-height: 1.5; transition: background .2s, transform .2s; }
.button:hover { background: #d7ffa6; transform: translateY(-2px); }
.button-small { padding: 10px 17px; font-size: 11px; white-space: nowrap; }
.button-ghost { background: transparent; color: var(--text); border-color: #41473e; }
.button-ghost:hover { background: #20271c; }
.button-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.text-link { color: var(--lime); font-size: 13px; display: inline-block; border-bottom: 1px solid #c1ff7250; padding-bottom: 4px; }
.text-link:hover { border-color: var(--lime); }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; min-height: 705px; padding-block: 62px 68px; position: relative; }
.hero-copy { position: relative; z-index: 1; }
.hero h1 { margin-bottom: 30px; }
.hero-description { font-size: 14px; line-height: 1.85; }
.hero-caption { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 39px; }
.mini-orbit { font-size: 25px; color: var(--lime); }
.hero-art { position: relative; min-width: 0; height: 570px; overflow: clip; background: radial-gradient(ellipse at 55% 48%, #648c1820, transparent 57%); }
.prism { width: 110%; height: 100%; position: absolute; top: 0; left: -5%; object-fit: contain; animation: float 9s ease-in-out infinite; }
.orbital { position: absolute; width: 92%; height: 58%; border: 1px solid #73836425; border-radius: 50%; left: 6%; top: 22%; transform: rotate(-36deg); }
.orbital-two { transform: rotate(42deg); width: 80%; left: 14%; }
.art-coordinate { position: absolute; font: 8px var(--mono); letter-spacing: .15em; color: #8a9586; }
.coordinate-top { top: 3%; right: 0; }
.coordinate-bottom { bottom: 0; left: 22%; }
.floating-number { position: absolute; width: 47px; height: 47px; border: 1px solid #7b8b6e60; border-radius: 14px; display: grid; place-items: center; font: 17px var(--mono); backdrop-filter: blur(12px); box-shadow: inset 0 0 20px #b9ff7710; }
.number-two { top: 15%; left: 8%; color: var(--lime); transform: rotate(-12deg); }
.number-three { right: 1%; top: 50%; color: var(--cyan); transform: rotate(13deg); }
.number-five { bottom: 9%; left: 15%; color: var(--purple); transform: rotate(8deg); }
.art-tag { position: absolute; bottom: 14%; right: 2%; border: 1px solid #86947e50; border-radius: 20px; background: #1b2319b0; padding: 7px 13px; font-size: 9px; backdrop-filter: blur(12px); }
@keyframes float { 50% { transform: translateY(-14px) rotate(2deg); } }
.ticker { border-block: 1px solid var(--line); background: #101210; overflow: hidden; }
.ticker-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: 19px; white-space: nowrap; font: 9px var(--mono); letter-spacing: .08em; }
.asterisk { color: var(--lime); font-size: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 35px; margin-bottom: 40px; }
.section-heading > p { font-size: 13px; max-width: 390px; }
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.level-card { padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(150deg, #161a14, #0f110f 70%); display: flex; flex-direction: column; transition: transform .25s, border-color .25s; }
.level-card:hover { transform: translateY(-7px); border-color: var(--lime); }
.level-purple { background: linear-gradient(150deg, #1b1722, #101012 70%); }
.level-purple:hover { border-color: var(--purple); }
.level-cyan { background: linear-gradient(150deg, #142022, #101213 70%); }
.level-cyan:hover { border-color: var(--cyan); }
.card-top, .card-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill { display: inline-flex; padding: 5px 10px; border: 1px solid #71845c70; border-radius: 30px; font: 9px var(--mono); color: var(--lime); letter-spacing: .09em; }
.level-purple .pill { color: var(--purple); border-color: #8668a580; }
.level-cyan .pill { color: var(--cyan); border-color: #578b8a80; }
.card-arrow { font-size: 23px; color: var(--muted); }
.level-symbol { height: 158px; display: flex; justify-content: center; align-items: center; font: 70px var(--mono); letter-spacing: -.1em; color: var(--lime); text-shadow: 0 8px 40px #bcff6940; }
.level-symbol span { color: #46553b; transform: translateY(-8px) rotate(-14deg); }
.level-cyan .level-symbol { color: var(--cyan); text-shadow: 0 8px 40px #99e3e140; }
.level-cyan .level-symbol span { color: #43625f; margin-left: 12px; }
.symbol-rings { position: relative; }
.symbol-rings i { position: absolute; border: 12px solid #c5a0eb; width: 100px; height: 100px; border-radius: 50%; transform: rotateX(57deg) rotateY(-15deg); box-shadow: 0 8px 0 #594773; }
.symbol-rings i:nth-child(2) { top: 36px; left: calc(50% - 20px); border-color: #8a70a6; }
.symbol-rings i:nth-child(3) { top: 20px; left: calc(50% - 77px); border-color: #e0c0ff; }
.level-card .eyebrow { font-size: 8px; margin-bottom: 12px; }
.level-card h3 { margin-bottom: 16px; }
.level-card p:not(.eyebrow) { font-size: 12px; line-height: 1.9; }
.card-footer { border-top: 1px solid var(--line); margin-top: auto; padding-top: 22px; font: 8px/1.8 var(--mono); color: var(--muted); }
.level-card > div:nth-last-child(2) { padding-bottom: 27px; }
.feature-panel { border: 1px solid #3b4930; border-radius: 25px; padding: 64px; background: radial-gradient(ellipse at 90% 70%, #52732625, transparent 65%), #11150f; display: grid; grid-template-columns: 1.15fr 1fr; gap: 90px; align-items: center; }
.feature-panel h2 { margin-bottom: 24px; }
.feature-panel p:not(.eyebrow) { max-width: 415px; font-size: 13px; margin-bottom: 28px; }
.preview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; transform: rotate(-7deg); }
.preview-grid span { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #35412f; border-radius: 11px; color: #687361; background: #182014; font-family: var(--mono); font-size: 16px; }
.preview-grid .lit { background: var(--lime); color: #243217; border-color: var(--lime); box-shadow: 0 0 24px #c1ff7218; }
.record-teaser { text-align: center; padding-block: 65px 115px; }
.record-equation { font: clamp(40px, 6.2vw, 78px) var(--mono); color: var(--lime); letter-spacing: -.06em; margin-block: 35px 20px; }
.record-equation sup { vertical-align: super; }
.record-teaser p:not(.eyebrow) { font-size: 13px; margin-bottom: 24px; }
.journey-end { border-block: 1px solid var(--line); padding-block: 42px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.journey-end .eyebrow { margin: 0; }
.journey-end > a { font-size: clamp(26px, 4vw, 50px); letter-spacing: -.05em; }
.journey-end > a span { color: var(--lime); margin-left: 30px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; padding-block: 38px; gap: 25px; }
.site-footer p, .site-footer > a:last-child { font-size: 10px; color: var(--muted); }

/* Learning pages share a quiet reading surface around the interactive elements. */
.page-hero { padding-block: 68px 56px; border-bottom: 1px solid var(--line); position: relative; }
.breadcrumbs { color: var(--muted); font: 10px var(--mono); margin-bottom: 38px; display: flex; gap: 12px; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--lime); }
.page-hero .pill { margin-bottom: 20px; }
.page-hero h1 { max-width: 950px; margin-bottom: 24px; }
.page-hero > p:not(.eyebrow) { max-width: 650px; font-size: 15px; }
.chapter-nav { display: flex; gap: 24px; overflow-x: auto; padding-block: 24px; font: 10px var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); }
.chapter-nav a { white-space: nowrap; padding: 4px 0; }
.chapter-nav a:hover { color: var(--lime); }
.content-section { padding-block: 64px; border-bottom: 1px solid var(--line); }
.content-section > h2 { margin-bottom: 25px; }
.lead { max-width: 760px; margin-bottom: 30px; }
.reading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.reading-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--surface); padding: 32px; border: 1px solid var(--line); border-radius: 20px; min-width: 0; }
.panel h3, .panel h4 { margin-bottom: 18px; }
.panel p + p { margin-top: 18px; }
.panel p, .panel li { font-size: 14px; }
.panel .big-number { font: 52px var(--mono); color: var(--lime); margin-bottom: 20px; }
.panel ul, .panel ol { color: var(--muted); padding-left: 20px; }
.panel li + li { margin-top: 12px; }
.callout { background: #c1ff7209; border: 1px solid #c1ff7233; border-left: 3px solid var(--lime); border-radius: 0 14px 14px 0; padding: 22px 26px; margin-top: 26px; color: var(--muted); font-size: 14px; }
.callout.purple { border-color: #c8a0fa44; border-left-color: var(--purple); background: #c8a0fa08; }
.formula { font: clamp(18px, 2.3vw, 30px)/1.9 var(--mono); color: var(--lime); padding: 22px 0; overflow-wrap: anywhere; }
.source-note { font-size: 11px; color: var(--muted); margin-block: 20px; }
.source-note a, .prose-link { color: var(--lime); text-decoration: underline; text-underline-offset: 4px; }
.timeline { margin-top: 40px; }
.timeline-item { display: grid; grid-template-columns: 170px 1fr; gap: 42px; position: relative; padding-bottom: 36px; }
.timeline-item time { font: 12px var(--mono); color: var(--lime); padding-top: 6px; }
.timeline-item > div { border-left: 1px solid var(--line); padding-left: 32px; padding-bottom: 10px; position: relative; }
.timeline-item > div::before { content: ''; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); left: -5px; top: 8px; }
.timeline-item h3 { font-size: 23px; margin-bottom: 12px; }
.timeline-item p { max-width: 720px; font-size: 14px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
caption { text-align: left; padding: 18px 22px; color: var(--muted); font-size: 11px; }
th, td { padding: 20px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font: 10px var(--mono); text-transform: uppercase; color: var(--muted); background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:first-child { background: #c1ff7208; }
.tabs { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 22px; padding: 5px; }
[role="tab"] { border: 1px solid var(--line); border-radius: 40px; background: transparent; padding: 12px 22px; color: var(--muted); white-space: nowrap; font-size: 12px; }
[role="tab"][aria-selected="true"] { background: var(--lime); color: #17210e; border-color: var(--lime); }
.algorithm-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 25px; }
.algorithm-meta .pill { color: var(--cyan); border-color: #99e3e140; }
.details-list { display: grid; gap: 12px; margin-top: 25px; }
details { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 19px 24px; }
summary { cursor: pointer; color: var(--text); }
details[open] summary { color: var(--lime); margin-bottom: 18px; }
.prime-range { font: 12px/2.2 var(--mono); color: var(--muted); }
.next-chapter { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: center; padding-block: 45px; }
.glossary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; }
.glossary > div { border-bottom: 1px solid var(--line); padding: 22px 0; }
dt { font-size: 19px; color: var(--lime); margin-bottom: 10px; }
dd { margin: 0; color: var(--muted); font-size: 14px; }
.source-list { list-style: none; padding: 0; }
.source-list li { padding: 20px 0; border-bottom: 1px solid var(--line); }
.source-list a { color: var(--lime); }
.source-list p { font-size: 13px; margin-top: 5px; }
.lab-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 25px; flex-wrap: wrap; margin-bottom: 25px; }
.lab-toolbar h2 { font-size: 32px; margin-bottom: 12px; }
.lab-toolbar p { font-size: 13px; }
.lab-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lab-controls label { font-size: 11px; color: var(--muted); }
select { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 30px; padding: 10px; font-size: 12px; }
.sieve-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 30px; }
.sieve-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 7px; }
.number-cell { aspect-ratio: 1; display: grid; place-items: center; font: 13px var(--mono); border: 1px solid #32382e; border-radius: 9px; background: #151914; color: #c1c8ba; transition: background .2s, color .2s, transform .2s; }
.number-cell.prime { background: var(--lime); color: #192610; border-color: var(--lime); }
.number-cell.composite { color: #858b80; background: #0c0e0b; text-decoration: line-through; border-color: #232720; }
.number-cell.unit { border-style: dashed; color: var(--purple); }
.number-cell.current { border-color: var(--cyan); background: #224b43; transform: scale(1.08); color: #fff; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; font-size: 10px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; background: var(--lime); }
.legend .composite-key::before { background: #555e4d; }
.legend .unit-key::before { background: var(--purple); }
.sieve-status { background: #0c0f0b; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.sieve-status .eyebrow { color: var(--lime); margin-bottom: 15px; }
#statusText { min-height: 100px; font-size: 13px; }
.count-line { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 20px; font-size: 12px; }
#primeCount { color: var(--lime); font-family: var(--mono); }
#primeList { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
#primeList span { padding: 4px 7px; border-radius: 5px; background: #c1ff7210; color: var(--lime); font: 11px var(--mono); }
.analyzer-section { margin-top: 38px; }
.input-label { display: block; margin-bottom: 10px; font-size: 12px; color: var(--text); }
.input-row { display: flex; gap: 12px; margin-bottom: 12px; }
.input-row input { min-width: 0; flex: 1; border: 1px solid #48533d; background: #090c08; border-radius: 12px; padding: 15px 18px; color: var(--text); font: 15px var(--mono); }
.input-row input[aria-invalid="true"] { border-color: #ffab9c; }
.helper-text { font-size: 11px; }
.examples { margin-block: 17px 25px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.examples button { border: 1px solid var(--line); background: transparent; border-radius: 20px; color: var(--lime); padding: 4px 12px; font-size: 11px; }
.error-message { color: #ffab9c; font-size: 13px; }
.analysis-feedback { margin-top: 20px; font-size: 13px; color: var(--lime); }
.analysis-heading { margin-bottom: 20px; overflow-wrap: anywhere; }
.analysis-heading h3 { color: var(--lime); margin-bottom: 9px; }
.divisor-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-block: 28px 15px; }
.divisor-toolbar h4 { font-size: 14px; }
.prime-neighbors { border-block: 1px solid var(--line); padding-bottom: 24px; margin-top: 28px; }
.neighbor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.neighbor-card { border: 1px solid #38432e; background: #0d120b; border-radius: 14px; padding: 22px 18px; min-width: 0; }
.neighbor-card .eyebrow { display: block; margin-bottom: 14px; font-size: 9px; }
.neighbor-card strong { display: block; color: var(--lime); font: clamp(14px, 1.65vw, 23px)/1.6 var(--mono); overflow-wrap: anywhere; }
.neighbor-card p { margin-top: 12px; font-size: 11px; overflow-wrap: anywhere; }
.neighbor-input { background: #c1ff7210; border-color: #c1ff7244; }
.neighbor-input strong { color: var(--text); }
.neighbor-span { padding-top: 20px; }
.neighbor-span > span { display: block; color: var(--muted); font-size: 12px; }
.neighbor-span strong { display: block; color: var(--lime); font: 14px/1.8 var(--mono); margin-top: 6px; overflow-wrap: anywhere; }
.neighbor-span p, #neighborLimitNote { font-size: 11px; margin-top: 10px; }
.divisor-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 15px; overscroll-behavior: contain; }
.divisor-list button { border: 1px solid #38432e; background: #151c11; color: var(--text); border-radius: 7px; padding: 7px 11px; font: 12px var(--mono); }
.divisor-list button:hover, .divisor-list button[aria-pressed="true"] { background: var(--lime); color: #13220a; }
#factorPair { margin-top: 17px; color: var(--lime); font: 13px/1.8 var(--mono); overflow-wrap: anywhere; min-height: 26px; }
.wave-visual { height: 95px; display: flex; align-items: center; justify-content: center; gap: 7px; margin: 25px 0; }
.wave-visual i { height: var(--height); width: 5px; border-radius: 4px; background: linear-gradient(var(--purple), #674793); }
.clock-visual { border: 1px solid #758957; border-radius: 50%; width: 115px; height: 115px; margin: 25px auto; position: relative; display: grid; place-items: center; font: 30px var(--mono); color: var(--lime); background: radial-gradient(#c1ff7210, transparent); }
.clock-visual::after { content: 'mod 7'; font: 9px var(--mono); position: absolute; bottom: 16px; color: var(--muted); }
@media (min-width: 1500px) { .hero { min-height: 770px; } .hero-art { height: 620px; } }
@media (max-width: 1280px) {
    .container { width: calc(100% - 64px); }
    .site-header { padding-inline: 32px; gap: 20px; flex-wrap: wrap; }
    .site-header nav { order: 3; width: 100%; justify-content: center; gap: 30px; }
    .hero { min-height: 630px; }
    .hero-art { height: 470px; }
    .level-card { padding: 23px; }
    .feature-panel { padding: 40px; gap: 45px; }
    .ticker-inner { justify-content: flex-start; }
    .sieve-layout { grid-template-columns: 1.5fr 1fr; gap: 20px; }
    .number-cell { font-size: 11px; }
}
@media (max-width: 760px) {
    .container { width: calc(100% - 40px); }
    .site-header { padding: 17px 20px 12px; gap: 15px; }
    .site-header nav { overflow-x: auto; justify-content: flex-start; gap: 24px; min-width: 0; scrollbar-width: thin; scrollbar-color: #3a4530 transparent; }
    .brand { font-size: 21px; }
    .hero { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 28px; }
    .hero h1 { font-size: clamp(45px, 10vw, 74px); }
    .hero-description { font-size: 13px; }
    .hero-art { height: 420px; width: 100%; max-width: 470px; margin: 35px auto 0; }
    .hero-caption { margin-top: 25px; }
    .art-tag { right: 2%; }
    .coordinate-top { right: 5%; }
    .section { padding-block: 50px; }
    .section-heading { flex-direction: column; align-items: flex-start; gap: 20px; }
    .level-grid { grid-template-columns: 1fr; }
    .level-card { padding: 28px; }
    .level-symbol { height: 140px; }
    .level-card p:not(.eyebrow) { font-size: 14px; }
    .card-footer { font-size: 9px; }
    .feature-panel { grid-template-columns: 1fr; gap: 55px; padding: 32px 25px 45px; }
    .preview-grid { max-width: 320px; width: 90%; margin: auto; }
    .record-teaser { padding-block: 45px 70px; }
    .record-equation { font-size: clamp(29px, 8vw, 50px); }
    .journey-end, .site-footer { flex-wrap: wrap; }
    .site-footer { gap: 18px; }
    .site-footer p { order: 3; width: 100%; }
    .page-hero { padding-block: 40px; }
    .page-hero h1 { font-size: 46px; }
    .content-section { padding-block: 42px; }
    .reading-grid, .reading-grid.three, .glossary { grid-template-columns: 1fr; }
    .panel { padding: 23px; }
    .timeline-item { grid-template-columns: 1fr; gap: 14px; padding-bottom: 30px; }
    .timeline-item > div { padding-left: 23px; }
    .sieve-layout { grid-template-columns: 1fr; }
    .sieve-grid { gap: 4px; }
    .number-cell { border-radius: 5px; font-size: 11px; }
    #statusText { min-height: 65px; }
    .input-row { flex-direction: column; }
    .input-row input { width: 100%; font-size: 13px; }
    .divisor-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
    .neighbor-grid { grid-template-columns: 1fr; }
    .neighbor-card strong { font-size: 19px; }
    .desktop-break { display: none; }
}
@media (max-width: 380px) { .hero h1 { font-size: 41px; } .hero-art { height: 335px; } .number-cell { font-size: 9px; } .panel { padding: 17px; } .button { padding-inline: 18px; } .page-hero h1 { font-size: 39px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Shared teaching surfaces: data remains readable independently of the graphics. */
.interactive-lesson { margin-top: 28px; }
.lesson-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 18px; margin-bottom: 20px; }
.lesson-controls label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); flex: 1 1 170px; min-width: 0; max-width: 290px; }
.lesson-controls input, .lesson-controls select, .catalog-search { min-width: 0; width: 100%; background: #090c08; color: var(--text); border: 1px solid #48533d; border-radius: 10px; padding: 12px 15px; font: 13px var(--mono); }
.lesson-controls input[type="range"] { accent-color: var(--lime); padding: 10px 0; min-height: 45px; border: 0; }
.lesson-svg { display: block; width: 100%; height: auto; max-height: 380px; margin: 20px auto; overflow: visible; }
.factor-svg { max-height: 530px; }
.window-svg { max-height: 170px; }
.spiral-svg { max-width: 620px; max-height: none; overflow: hidden; background: #0a0d08; border: 1px solid var(--line); border-radius: 10px; }
.spiral-svg rect { cursor: pointer; }
.clock-svg { max-width: 310px; }
.lesson-summary { color: var(--lime); font: 13px/1.9 var(--mono); margin-top: 24px; overflow-wrap: anywhere; }
.lesson-summary + p { margin-top: 14px; }
.lesson-notes { margin-top: 26px; }
.content-section > details, .lesson-notes + details { margin-top: 20px; }
details p { font-size: 14px; }
details p + p { margin-top: 15px; }
.discovery-card { display: block; transition: border-color .2s, transform .2s; }
.discovery-card:hover { border-color: var(--lime); transform: translateY(-3px); }
.discovery-card h3, .panel > .pill + h3, .panel > .status-label + h3 { margin-top: 24px; }
.euclid-steps { padding-left: 24px; margin: 28px 0; }
.euclid-step { padding-block: 12px; font: 15px/1.8 var(--mono); }
.remainder-bar { display: block; height: 5px; background: linear-gradient(90deg, var(--lime), #47622a); margin-top: 9px; border-radius: 5px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 20px; font-size: 11px; }
.chart-legend span::before { content: ''; display: inline-block; width: 16px; height: 3px; vertical-align: middle; margin-right: 7px; }
.key-lime::before { background: var(--lime); }
.key-purple::before { background: var(--purple); }
.metric-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.metric-card { border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: #0c100a; min-width: 0; }
.metric-card > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.metric-card strong { color: var(--lime); font: clamp(23px, 3vw, 38px) var(--mono); overflow-wrap: anywhere; }
.metric-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 10px; }
.rsa-flow { margin-block: 25px; }
.compact-table { align-self: start; }
.compact-table th, .compact-table td { text-align: center; padding: 8px 9px; font: 11px var(--mono); }
.compact-table caption { padding: 12px; font-size: 10px; }
.compact-table .inverse-cell { color: #152008; background: var(--lime); }
.comparison-row { margin: 25px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.comparison-row > span { color: var(--muted); font-size: 13px; }
.comparison-row > strong { font: 15px var(--mono); }
.comparison-track { height: 16px; border-radius: 8px; background: #242b20; overflow: hidden; grid-column: 1 / -1; }
.comparison-track i { height: 100%; display: block; background: var(--purple); border-radius: 8px; }
.comparison-track .lime-bar { background: var(--lime); }
.pair-list { max-height: 380px; overflow-y: auto; margin-top: 25px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; overscroll-behavior: contain; }
.goldbach-pair { display: grid; grid-template-columns: 105px 1fr; align-items: center; gap: 15px; padding: 8px; }
.goldbach-pair > span:first-child { font: 12px var(--mono); color: var(--text); }
.pair-bar { display: block; height: 14px; background: var(--purple); border-radius: 5px; overflow: hidden; }
.pair-bar i { height: 100%; display: block; background: var(--lime); }
.scroll-notes { max-height: 180px; overflow-y: auto; padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 30px; }
.topic-card { padding: 23px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); display: block; }
.topic-card:hover { border-color: var(--lime); }
.topic-card strong { display: block; font-size: 16px; margin-bottom: 10px; }
.topic-card span { display: block; color: var(--muted); font-size: 12px; }
.catalog-search { max-width: 640px; margin-bottom: 12px; }
.research-notes { display: grid; gap: 25px; }
.research-note { padding: 36px; }
.research-note h3 { font-size: 30px; max-width: 950px; }
.research-note .byline { font-size: 12px; color: var(--cyan); margin-bottom: 24px; }
.research-meta, .status-key { display: flex; gap: 15px; flex-wrap: wrap; align-items: center; margin-bottom: 25px; }
.research-meta time { font: 10px var(--mono); color: var(--muted); }
.status-label { font: 9px/1.6 var(--mono); letter-spacing: .04em; padding: 5px 9px; border: 1px solid; border-radius: 7px; display: inline-block; }
.status-label.proved { color: var(--lime); border-color: #c1ff7250; background: #c1ff7209; }
.status-label.computed { color: var(--cyan); border-color: #99e3e150; background: #99e3e109; }
.status-label.open { color: var(--purple); border-color: #c8a0fa50; background: #c8a0fa09; }
.research-note details { margin-top: 22px; }
.research-checklist { padding-left: 23px; color: var(--muted); max-width: 950px; }
.research-checklist li { margin-bottom: 18px; padding-left: 10px; }
.warning { border-color: #d0b46f50; border-left-color: #d0b46f; background: #d0b46f09; margin-bottom: 25px; }
@media (max-width: 1100px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .lesson-controls label { max-width: none; }
    .topic-grid, .metric-row { grid-template-columns: 1fr; }
    .research-note { padding: 24px; }
    .research-note h3 { font-size: 25px; }
    .comparison-row { grid-template-columns: 1fr; gap: 8px; }
    .comparison-track { grid-column: 1; }
    .euclid-step { font-size: 12px; }
    .goldbach-pair { grid-template-columns: 90px 1fr; gap: 8px; }
    .goldbach-pair > span:first-child { font-size: 10px; }
    .lesson-summary { font-size: 12px; }
    #distributionSvg text, #windowSvg text, #progressionSvg text { font-size: 22px; }
}
