:root {
    --page: #f3f6fa;
    --surface: #ffffff;
    --surface-muted: #e9eff5;
    --surface-raised: #f8fafc;
    --text: #1c2025;
    --secondary: #62676d;
    --muted: #7c8186;
    --border: #d5dee7;
    --border-strong: #b8c5d0;
    --accent: #4169E1;
    --accent-strong: #3457D5;
    --accent-text: #3457D5;
    --accent-soft: #E7EDFC;
    --on-accent: #ffffff;
    --code: #20252a;
    --code-text: #f2f0e9;
    --warning: #765b2f;
    --warning-soft: #f1ead9;
    --diagram-line: #62676d;
    --diagram-muted: #a5a7a5;
    --diagram-grid: #d9e1e8;
    --diagram-fill: #ffffff;
    --max: 1180px;
    --measure: 70ch;
    --radius: 4px;
    --font-sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
    --page: #141618;
    --surface: #1c1f22;
    --surface-muted: #23272b;
    --surface-raised: #202428;
    --text: #eeece6;
    --secondary: #a8aaad;
    --muted: #85898d;
    --border: #35393d;
    --border-strong: #4b5156;
    --accent: #7393F5;
    --accent-strong: #9AB0F8;
    --accent-text: #7393F5;
    --accent-soft: #17224A;
    --on-accent: #141618;
    --code: #111315;
    --code-text: #eeece6;
    --warning: #d3b77e;
    --warning-soft: #3b3326;
    --diagram-line: #a8aaad;
    --diagram-muted: #656b70;
    --diagram-grid: #35393d;
    --diagram-fill: #1c1f22;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--page);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--page);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    overflow-x: hidden;
}

::selection {
    color: var(--on-accent);
    background: var(--accent);
}

a {
    color: var(--accent-text);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--accent-strong);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

img,
svg,
canvas {
    max-width: 100%;
}

.container,
.wrap {
    width: min(calc(100% - 3rem), var(--max));
    margin-inline: auto;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--border);
    background: var(--page);
}

.site-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 4.4rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.65rem;
    color: var(--text);
    text-decoration: none;
}

.brand img {
    width: auto;
    height: 2rem;
    max-width: none;
    border: 0;
}

.brand-title {
    color: var(--text);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.brand-title span {
    color: var(--accent-text);
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
    min-width: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.05rem;
    min-width: 0;
}

.nav-links a,
.mobile-nav a {
    color: var(--secondary);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links a[aria-current="page"],
.mobile-nav a:hover,
.mobile-nav a[aria-current="page"] {
    color: var(--accent-text);
}

.nav-links a.active,
.nav-links a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.45rem;
}

.beta-pill,
.version-badge,
.example-meta {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.2rem 0.45rem;
    color: var(--secondary);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.theme-toggle,
.mobile-menu-toggle {
    appearance: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: transparent;
    color: var(--secondary);
    cursor: pointer;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.25rem;
    padding: 0 0.65rem;
}

.theme-toggle:hover,
.mobile-menu-toggle:hover {
    border-color: var(--accent-text);
    color: var(--accent-text);
    background: var(--accent-soft);
}

.theme-toggle-icon {
    width: 1rem;
    color: var(--accent-text);
    text-align: center;
}

.theme-toggle-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.25rem;
    padding: 0 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
}

.mobile-menu-icon {
    color: var(--accent-text);
}

.mobile-nav {
    display: none;
}

.mobile-nav[hidden] {
    display: none;
}

main {
    display: block;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.12;
}

h1 {
    font-size: clamp(3rem, 7vw, 6.2rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.65rem);
}

p {
    margin: 0 0 1rem;
}

code,
pre {
    font-family: var(--font-mono);
}

code {
    color: var(--accent-strong);
    font-size: 0.9em;
}

pre {
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

pre code {
    color: inherit;
    font-size: inherit;
}

.hero-shell {
    border-bottom: 1px solid var(--border);
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: clamp(2rem, 4vw, 4rem);
    min-height: min(760px, calc(100vh - 4.4rem));
    padding-block: clamp(4rem, 10vw, 8.5rem);
}

.hero-copy {
    max-width: 42rem;
    min-width: 0;
}

.eyebrow,
.section-marker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.eyebrow-dot {
    width: 0.55rem;
    height: 0.55rem;
    border: 1px solid var(--accent);
    border-radius: 50%;
}

.hero-shell h1 {
    max-width: 14ch;
    font-size: clamp(2.5rem, 5.4vw, 4.9rem);
    line-height: 1.05;
}

.hero-shell h1 em {
    color: var(--text);
    font-style: normal;
}

.hero-intro {
    max-width: 58ch;
    margin-top: 1.75rem;
    color: var(--secondary);
    font-size: clamp(1.05rem, 1.7vw, 1.25rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.button-primary {
    color: var(--on-accent);
    background: var(--accent);
}

.button-primary:hover {
    color: var(--on-accent);
    border-color: var(--accent-strong);
    background: var(--accent-strong);
}

.button-secondary {
    color: var(--accent-text);
    background: transparent;
}

.button-secondary:hover {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.2rem;
    margin-top: 1.25rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.hero-links a {
    color: var(--secondary);
}

.hero-links a:hover {
    color: var(--accent-text);
}

.theorem-figure {
    min-width: 0;
    width: 100%;
    margin: 0;
}

.canvas-shell {
    position: relative;
    min-height: 31rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

#geometryCanvas {
    display: block;
    width: 100%;
    height: 31rem;
}

.theorem-caption {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-top: 0;
    padding: 0.8rem 0.9rem;
    color: var(--secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.diagram-index {
    color: var(--accent-text);
}

.canvas-fallback {
    max-width: 56ch;
    margin: 0.8rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.editorial-section {
    padding-block: clamp(4.5rem, 9vw, 8rem);
    border-bottom: 1px solid var(--border);
}

.section-heading {
    display: grid;
    grid-template-columns: minmax(12rem, 0.38fr) minmax(0, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.section-heading h2 {
    max-width: 15ch;
}

.section-heading p {
    max-width: var(--measure);
    color: var(--secondary);
}

.principle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border);
}

.principle {
    min-height: 14rem;
    border-right: 1px solid var(--border);
    padding: 1.2rem 1.25rem 0 0;
}

.principle + .principle {
    padding-left: 1.25rem;
}

.principle:last-child {
    border-right: 0;
}

.principle-number {
    display: block;
    margin-bottom: 2.5rem;
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.principle p,
.application p,
.philosophy-item p {
    max-width: 36ch;
    margin-top: 0.8rem;
    color: var(--secondary);
    font-size: 0.92rem;
}

.syntax-feature {
    padding-block: clamp(4.5rem, 9vw, 8rem);
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.syntax-feature-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: clamp(2rem, 7vw, 7rem);
}

.syntax-feature-copy h2 {
    max-width: 16ch;
}

.syntax-feature-copy > p {
    max-width: 46ch;
    margin-top: 1rem;
    color: var(--secondary);
}

.syntax-feature-copy ul {
    max-width: 45ch;
    margin: 1.5rem 0;
    padding-left: 1.2rem;
    color: var(--secondary);
}

.syntax-feature-copy li + li {
    margin-top: 0.45rem;
}

.syntax-feature-link {
    font-weight: 700;
}

.syntax-feature-code,
.code-panel {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--code);
    color: var(--code-text);
}

.syntax-feature-code {
    padding: clamp(1rem, 3vw, 2rem);
}

.syntax-feature-code pre {
    font-size: clamp(0.78rem, 1.2vw, 0.95rem);
    line-height: 1.75;
}

.discovery-section {
    padding-block: clamp(4.5rem, 9vw, 8rem);
    border-bottom: 1px solid var(--border);
}

.discovery-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
    gap: clamp(2rem, 7vw, 7rem);
}

.discovery-copy h2 {
    max-width: 15ch;
}

.discovery-copy > p {
    max-width: 47ch;
    margin-top: 1rem;
    color: var(--secondary);
}

.discovery-claims {
    margin: 1.75rem 0 0;
    padding: 0;
    border-top: 1px solid var(--border);
    list-style: none;
}

.discovery-claim {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0;
}

.discovery-claim-index {
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.discovery-claim strong,
.discovery-claim span {
    display: block;
}

.discovery-claim span {
    margin-top: 0.15rem;
    color: var(--secondary);
    font-size: 0.82rem;
}

.discovery-figure {
    min-width: 0;
    margin: 0;
}

.discovery-shell {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

#discoveryCanvas {
    display: block;
    width: 100%;
    height: 28rem;
}

.discovery-caption {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-top: 0;
    padding: 0.8rem 0.9rem;
    color: var(--secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.applications {
    padding-block: clamp(4.5rem, 9vw, 8rem);
    border-bottom: 1px solid var(--border);
}

.application-list {
    border-top: 1px solid var(--border);
}

.application {
    display: grid;
    grid-template-columns: 4rem minmax(12rem, 0.7fr) minmax(0, 1.25fr) auto;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding: 1.3rem 0;
}

.application-index {
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.application p {
    margin: 0;
    max-width: 48ch;
}

.application .button {
    white-space: nowrap;
}

.downloads {
    padding-block: clamp(4.5rem, 9vw, 8rem);
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.release {
    border-top: 1px solid var(--border);
    padding-block: 1.6rem;
}

.release-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.release-current h3 {
    font-size: 2rem;
}

.release-summary {
    max-width: 70ch;
    margin: 0.7rem 0 1.25rem;
    color: var(--secondary);
}

.release-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--border);
    background: var(--border);
}

.release-option {
    display: flex;
    flex-direction: column;
    min-height: 10.5rem;
    padding: 1.1rem;
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
}

.release-option:hover {
    color: var(--text);
    background: var(--surface-raised);
}

.release-option strong {
    font-size: 1rem;
}

.release-option span {
    margin-top: 0.45rem;
    color: var(--secondary);
    font-size: 0.8rem;
}

.release-option .download-action {
    margin-top: auto;
    padding-top: 1rem;
    color: var(--accent-text);
    font-weight: 700;
}

.release-archive {
    margin-top: 2rem;
}

.release-archive summary {
    cursor: pointer;
    color: var(--accent-text);
    font-weight: 700;
}

.release-archive summary::marker {
    color: var(--accent-text);
}

.release-archive .release {
    padding-bottom: 0;
}

.philosophy {
    padding-block: clamp(4.5rem, 9vw, 8rem);
    border-bottom: 1px solid var(--border);
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.philosophy-item {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.site-footer {
    padding-block: 2.5rem 3.5rem;
}

.footer-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.footer-copy,
.footer-links,
.footer-meta {
    color: var(--secondary);
    font-size: 0.8rem;
}

.footer-copy {
    max-width: 48ch;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem 1rem;
}

.footer-meta {
    margin-top: 1.75rem;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
}

/* User guide */
.guide-page-container {
    width: min(calc(100% - 3rem), var(--max));
    padding-block: clamp(3rem, 7vw, 6rem);
}

.guide-header {
    max-width: 70ch;
    padding-bottom: 3rem;
}

.guide-header h1 {
    max-width: 12ch;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
}

.guide-header p {
    margin-top: 1.2rem;
    color: var(--secondary);
    font-size: 1.05rem;
}

.guide-layout {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
    align-items: start;
    gap: clamp(2rem, 5vw, 4.5rem);
}

.guide-sidebar {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    border-top: 2px solid var(--accent);
    padding-top: 0.8rem;
}

.guide-sidebar h2 {
    margin: 0 0 0.8rem;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guide-sidebar ol {
    margin: 0;
    padding-left: 1.7rem;
}

.guide-sidebar li {
    margin: 0.25rem 0;
}

.guide-sidebar a {
    color: var(--secondary);
    font-size: 0.8rem;
    text-decoration: none;
}

.guide-sidebar a:hover,
.guide-sidebar a.is-current {
    color: var(--accent-text);
}

.guide-mobile-toc {
    display: none;
    margin: 0 0 2rem;
    border-block: 1px solid var(--border);
    padding: 0.9rem 0;
}

.guide-mobile-toc summary {
    cursor: pointer;
    color: var(--accent-text);
    font-weight: 700;
}

.guide-mobile-toc ol {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.guide-content {
    min-width: 0;
}

.guide-landing,
.guide-section {
    scroll-margin-top: 6rem;
}

.guide-landing {
    border-top: 2px solid var(--accent);
    padding: 1.5rem 0 2.5rem;
}

.guide-section {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
}

.guide-section h2,
.guide-landing h2 {
    max-width: 22ch;
}

.guide-section h3 {
    margin-top: 2.4rem;
    font-size: 1.45rem;
}

.guide-section h4 {
    margin-top: 1.8rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    letter-spacing: 0;
}

.guide-section p,
.guide-section li,
.guide-landing p {
    max-width: var(--measure);
    color: var(--secondary);
}

.guide-section strong,
.guide-landing strong {
    color: var(--text);
}

.guide-section ul,
.guide-section ol {
    padding-left: 1.2rem;
}

.guide-section li + li {
    margin-top: 0.4rem;
}

.guide-section code,
.guide-landing code {
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.08rem 0.25rem;
    background: var(--surface-muted);
}

.guide-section pre,
.guide-landing pre {
    margin: 1.2rem 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    background: var(--code);
    color: var(--code-text);
    line-height: 1.7;
}

.guide-section pre code,
.guide-landing pre code {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
}

.guide-section table {
    width: 100%;
    margin: 1.2rem 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.guide-section th,
.guide-section td {
    border: 1px solid var(--border);
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.guide-section th {
    color: var(--text);
    background: var(--surface-muted);
}

.guide-section td {
    color: var(--secondary);
}

.guide-section blockquote {
    margin: 1.2rem 0;
    border-left: 2px solid var(--accent);
    padding-left: 1rem;
    color: var(--secondary);
}

.guide-choice-grid,
.example-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    background: var(--border);
}

.guide-choice-card,
.example-card {
    display: block;
    padding: 1rem;
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
}

.guide-choice-card:hover,
.example-card:hover {
    color: var(--text);
    background: var(--surface-raised);
}

.guide-choice-card strong,
.guide-choice-card span {
    display: block;
}

.guide-choice-card span,
.example-card p {
    margin-top: 0.35rem;
    color: var(--secondary);
    font-size: 0.88rem;
}

.syntax-callout {
    margin-top: 2rem;
    border-left: 2px solid var(--accent);
    padding: 1rem 0 1rem 1rem;
}

.syntax-callout pre {
    margin-top: 0.8rem;
}

.example-card {
    display: flex;
    flex-direction: column;
}

.example-card h3 {
    margin-top: 0.8rem;
}

.example-card .example-meta {
    align-self: flex-start;
}

.example-card details {
    margin-top: auto;
    padding-top: 1rem;
}

.example-card summary {
    cursor: pointer;
    color: var(--accent-text);
    font-weight: 700;
}

.guide-content img {
    height: auto;
    border: 1px solid var(--border);
}

.guide-back {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.section-num {
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 0.7em;
}

.beta-note {
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    padding: 0.8rem 1rem;
    color: var(--secondary);
}

[data-reserved-filter] {
    width: min(100%, 28rem);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.65rem 0.75rem;
    color: var(--text);
    background: var(--surface);
    font: inherit;
}

/* Legal and privacy pages */
main.wrap {
    padding-block: clamp(3rem, 7vw, 6rem);
}

.hero {
    max-width: 70ch;
    padding-bottom: 2.5rem;
}

.hero h1,
main.wrap > h1 {
    max-width: 14ch;
    font-size: clamp(2.8rem, 6vw, 5rem);
}

.intro {
    margin-top: 1rem;
    color: var(--secondary);
    font-size: 1.05rem;
}

.section-title,
.lang-title {
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
}

.section-title h2,
.lang-title h2 {
    font-size: 1.7rem;
}

.card {
    margin-top: 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    background: var(--surface);
}

.card h2 {
    font-size: 1.35rem;
}

.card p,
.card li {
    color: var(--secondary);
}

.label {
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.placeholder {
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.08rem 0.3rem;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

.alert {
    border: 1px solid var(--border);
    border-left: 2px solid var(--warning);
    padding: 1rem;
    color: var(--warning);
    background: var(--warning-soft);
}

footer.wrap {
    padding-block: 1rem 3rem;
    color: var(--secondary);
}

@media (max-width: 980px) {
    .nav-links {
        gap: 0.7rem;
    }

    .nav-links a {
        font-size: 0.75rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-copy {
        max-width: 55rem;
    }

    .hero-shell h1 {
        max-width: 16ch;
    }

    .theorem-figure {
        width: min(100%, 48rem);
        max-width: 48rem;
    }
}

@media (max-width: 760px) {
    .container,
    .wrap,
    .guide-page-container {
        width: min(calc(100% - 1.4rem), var(--max));
    }

    .site-nav .container {
        min-height: 4rem;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .mobile-nav:not([hidden]) {
        display: grid;
        gap: 0;
        border-top: 1px solid var(--border);
        padding: 0.35rem 0.7rem 0.7rem;
    }

    .mobile-nav a {
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 0.2rem;
    }

    .nav-actions {
        gap: 0.45rem;
    }

    .theme-toggle-label {
        display: none;
    }

    .hero-content {
        gap: 2.5rem;
        padding-block: 3.8rem 4.5rem;
    }

    .hero-shell h1 {
        max-width: none;
        font-size: clamp(2.45rem, 12vw, 4rem);
        overflow-wrap: break-word;
    }

    .hero-intro {
        font-size: 1rem;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .canvas-shell,
    #geometryCanvas {
        min-height: 22rem;
        height: 22rem;
    }

    #discoveryCanvas {
        height: 22rem;
    }

    .section-heading,
    .syntax-feature-grid,
    .discovery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .principle-grid,
    .philosophy-grid,
    .release-list,
    .grid {
        grid-template-columns: 1fr;
    }

    .principle,
    .principle + .principle {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 1rem 0 1.3rem;
    }

    .principle:last-child {
        border-bottom: 0;
    }

    .principle-number {
        margin-bottom: 1rem;
    }

    .application {
        grid-template-columns: 2.5rem 1fr;
        gap: 0.6rem 1rem;
    }

    .application p {
        grid-column: 2;
    }

    .application .button {
        grid-column: 2;
        justify-self: start;
        width: auto;
    }

    .release-header,
    .footer-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .release-option {
        min-height: 8rem;
    }

    .footer-links {
        justify-content: flex-start;
    }

    .guide-page-container {
        padding-block: 3rem;
    }

    .guide-layout {
        display: block;
    }

    .guide-sidebar {
        display: none;
    }

    .guide-mobile-toc {
        display: block;
    }

    .guide-header h1 {
        font-size: clamp(2.8rem, 14vw, 4.5rem);
    }

    .guide-choice-grid,
    .example-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* Wide guide tables scroll inside themselves on phones instead of widening the page. */
@media (max-width: 720px) {
    .guide-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}

/* Global Settings guide: annotated panel beside its numbered list. */
.gs-howto {
    color: var(--muted);
}
.gs-page {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin: 18px 0 8px;
}
.gs-panel-shot {
    position: sticky;
    top: 84px;
    margin: 0;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}
.gs-panel-shot img {
    display: block;
    width: 100%;
    height: auto;
}
.gs-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.gs-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 90px;
}
.gs-item:last-child {
    border-bottom: 0;
}
.gs-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #E5701E;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
}
.gs-body h4 {
    margin: 2px 0 8px;
    font-size: 1rem;
}
.gs-body p {
    margin: 6px 0;
}
.gs-crop {
    display: block;
    width: 100%;
    max-width: 376px;
    height: auto;
    border-radius: 6px;
}
.gs-meta {
    color: var(--muted);
    font-size: 0.9rem;
}
.gs-more {
    margin: 20px 0 6px;
}
.gs-more-list li {
    margin: 6px 0;
    scroll-margin-top: 90px;
}
@media (max-width: 860px) {
    .gs-page {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
    .gs-panel-shot {
        position: static;
        max-height: 60vh;
        max-width: 380px;
    }
}
