/* RN2KMP — rn2kmp.dev
   No framework, no build step, no external request. Dark by design: a deep indigo stage, violet and
   pink for Kotlin Multiplatform, cyan for React Native, flat rounded cards with thin borders. */

:root {
    color-scheme: dark;
    --bg: #0b0622;
    --bg-2: #130a38;
    --glass: rgba(255, 255, 255, 0.045);
    --glass-strong: rgba(255, 255, 255, 0.08);
    --fg: #f5f2ff;
    --fg-muted: #b9b1db;
    --fg-faint: #8a81b8;
    --line: rgba(190, 170, 255, 0.16);
    --violet: #a66bff;
    --violet-deep: #7b3fe4;
    --pink: #f06ba8;
    --cyan: #4cc9f0;
    --cyan-deep: #2b9fd6;
    --code-bg: #0e0830;
    --radius: 24px;
    --radius-sm: 14px;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
    --card: #150d3a;
    --card-2: #1b1148;
    --line: rgba(166, 107, 255, 0.28);
    --line-cyan: rgba(76, 201, 240, 0.4);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    background-attachment: scroll;
    color: var(--fg);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
img, video, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: rgba(166, 107, 255, 0.13);
    border: 1px solid rgba(166, 107, 255, 0.2);
    border-radius: 7px;
    padding: 0.1em 0.4em;
    overflow-wrap: anywhere;
}

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }
.wrap.narrow { max-width: 820px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--violet); color: #12072f; padding: 0.5rem 1rem; border-radius: 10px; }

.grad-cyan { color: var(--cyan); }
.grad-violet { color: var(--violet); }

.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.74rem; font-weight: 700; color: var(--violet); margin-bottom: 0.9rem; }
.eyebrow a:hover { text-decoration: underline; }

/* Header */

.site-header { position: sticky; top: 0; z-index: 10; background: rgba(11, 6, 34, 0.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; font-weight: 800; letter-spacing: -0.01em; font-size: 1.1rem; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 0.25rem; margin-left: auto; }
.nav a { padding: 0.45rem 0.85rem; border-radius: 999px; color: var(--fg-muted); font-size: 0.95rem; font-weight: 500; transition: color .15s, background .15s; }
.nav a:hover { color: var(--fg); background: var(--glass); }
.nav a[aria-current] { color: var(--fg); background: rgba(166, 107, 255, 0.18); }

/* Buttons */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.7rem 1.35rem; border-radius: 999px; font-weight: 650; font-size: 0.98rem; border: 1px solid transparent; transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn-primary { background: #8f55f2; color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px -10px rgba(166, 107, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn-ghost { background: var(--glass); border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { background: var(--glass-strong); border-color: rgba(190, 170, 255, 0.35); }
.site-header .btn { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* Cards: flat, with a thin border */

.card {
    display: block;
    padding: 1.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
}
.card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.card p { color: var(--fg-muted); }
.card-link { transition: transform .18s, box-shadow .18s; }
.card-link:hover { transform: translateY(-3px); box-shadow: 0 30px 60px -30px rgba(166, 107, 255, 0.55); }

.icon { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 14px; margin-bottom: 1rem; font-weight: 800; color: #efe3ff; background: rgba(166, 107, 255, 0.22); border: 1px solid rgba(220, 200, 255, 0.25); }
.icon-lg { width: 4rem; height: 4rem; border-radius: 18px; float: left; margin: 0 1.1rem 0.5rem 0; }

.chip { display: inline-block; max-width: 100%; margin-top: 1rem; padding: 0.4rem 1rem; border-radius: 999px; background: rgba(9, 5, 30, 0.6); border: 1px solid var(--line); font-size: 0.92rem; font-weight: 500; overflow-wrap: anywhere; }
.chip:hover { border-color: rgba(190, 170, 255, 0.45); }

.more { color: #c9a9ff; font-weight: 600; }
.more:hover { color: #fff; }
.more-line { margin-top: 1.5rem; }

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

.feature { overflow: hidden; }
.feature-cyan { border-color: var(--line-cyan); }
.feature-cyan .icon { background: rgba(76, 201, 240, 0.2); }
.feature h3 { font-size: 1.55rem; }
.feature p { margin-bottom: 0; }
.feature .chip { clear: both; }

/* Home */

.hero { padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 800; margin-bottom: 1.4rem; }
.hero .lead { font-size: 1.22rem; color: var(--fg-muted); max-width: 36rem; margin-bottom: 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.hero-visual { display: grid; gap: 1.5rem; min-width: 0; }
.hero-logos { position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(0.55rem, 2vw, 1.1rem); padding: 0.6rem 0 0.25rem; }
.tile { width: clamp(5.25rem, 9.5vw, 7.5rem); aspect-ratio: 1; border-radius: 24px; display: grid; place-items: center; padding: 0.75rem; border: 1px solid transparent; }
.tile img { width: 66%; height: auto; }
.tile-rn { background: #10204a; border-color: var(--line-cyan); transform: rotate(-4deg); }
.tile-kmp { width: clamp(6.5rem, 11vw, 8.75rem); border-radius: 28px; background: #2a1670; border-color: var(--line); transform: rotate(3deg); }
.hero-arrow { width: clamp(2rem, 5vw, 3.5rem); color: #b58cff; flex: none; }
.sparks { position: absolute; top: 0; right: 0.5rem; width: clamp(1.75rem, 5vw, 3rem); color: #c9a9ff; }

.hero-editor {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--code-bg);
    box-shadow: 0 22px 48px -36px rgba(166, 107, 255, 0.75);
}
.hero-editor pre {
    min-height: calc(5 * 1.55em + 1.6rem);
    margin: 0;
    padding: 0.8rem clamp(0.8rem, 2vw, 1.15rem);
    overflow-x: auto;
    color: #e6e0ff;
    font: clamp(0.72rem, 1.3vw, 0.9rem)/1.55 var(--mono);
}
.hero-editor code { padding: 0; border: 0; background: none; font: inherit; overflow-wrap: normal; }
.hero-editor-symbol { color: #b3ebff; }
.hero-editor-typing { display: inline-block; vertical-align: top; color: #f2a9ff; }
.hero-editor.is-playing .hero-editor-typing {
    --typing-duration: 0.95s;
    --typing-delay: 0.4s;
    overflow: hidden;
    white-space: nowrap;
    border-inline-end: 2px solid transparent;
    animation:
        hero-type var(--typing-duration) steps(var(--characters)) var(--typing-delay) both,
        hero-caret 0.76s step-end var(--typing-delay) infinite;
}
.hero-import-first, .hero-import-second { color: inherit; }
.hero-editor.is-playing .hero-import-first {
    animation-name: hero-type, hero-caret-first-line;
    animation-duration: var(--typing-duration);
    animation-iteration-count: 1;
}
.hero-editor.is-playing .hero-import-second {
    --typing-delay: calc(0.4s + var(--typing-duration));
}
@keyframes hero-type {
    from { width: 0; }
    to { width: calc(var(--characters) * 1ch + 2px); }
}
@keyframes hero-caret {
    0% { border-color: #e8b3ff; }
    50% { border-color: transparent; }
}
@keyframes hero-caret-first-line {
    from { border-color: #e8b3ff; }
    to { border-color: transparent; }
}

.hero-editor-playback:not([hidden]) {
    position: absolute;
    inset: auto 0.5rem 0.5rem auto;
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--code-bg);
    color: var(--fg-muted);
    opacity: 0;
    cursor: pointer;
}
.hero-editor:hover .hero-editor-playback,
.hero-editor-playback:focus-visible { opacity: 1; }
.hero-editor-playback:hover { color: var(--fg); }
.hero-editor:not(.is-playing) .hero-icon-pause,
.hero-editor.is-playing .hero-icon-play { display: none; }

/* Sections */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-head { max-width: 46rem; margin-bottom: 2.25rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 1rem; }
.section-head p { color: var(--fg-muted); font-size: 1.1rem; }

.proof { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: center; gap: 1.5rem; }
.proof-video {
    display: block;
    width: 100%;
    height: auto;
    min-height: 200px;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
}
.proof-side { display: flex; flex-direction: column; }
.proof-side .more { margin-top: auto; padding-top: 1rem; }
.checks { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.75rem; color: var(--fg-muted); }
.checks li { position: relative; padding-left: 1.7rem; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.9rem; height: 0.5rem; border-left: 2.5px solid var(--cyan); border-bottom: 2.5px solid var(--cyan); transform: translateY(-50%) rotate(-45deg); }

.mechanism { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.25rem; }
.mechanism h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-faint); margin-bottom: 1.2rem; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.flow li { position: relative; display: grid; gap: 0.15rem; padding: 0.9rem 1rem 0.9rem 3.4rem; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--line); counter-increment: step; }
.flow li + li { margin-top: 1.4rem; }
.flow li + li::after { content: "↓"; position: absolute; left: 1.35rem; top: -1.45rem; color: var(--violet); font-weight: 700; }
.flow li::before { content: counter(step); position: absolute; left: 0.9rem; top: 0.95rem; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; background: #8f55f2; font-weight: 800; font-size: 0.85rem; }
.flow strong { font-size: 1.02rem; }
.flow span { color: var(--fg-muted); font-size: 0.93rem; }

.runtime { display: grid; gap: 1rem; }
.router { padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); background: rgba(76, 201, 240, 0.09); border: 1px dashed rgba(76, 201, 240, 0.5); display: grid; }
.router strong { color: var(--cyan); }
.router span { color: var(--fg-muted); font-size: 0.93rem; }
.screens { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.screen { padding: 1rem; border-radius: var(--radius-sm); display: grid; font-weight: 700; font-size: 1.15rem; border: 1px solid var(--line); }
.screen small { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.68rem; color: var(--fg-faint); }
.screen span { font-weight: 500; font-size: 0.88rem; color: var(--fg-muted); }
.screen-rn { background: rgba(76, 201, 240, 0.08); border-color: rgba(76, 201, 240, 0.35); }
.screen-kmp { background: rgba(166, 107, 255, 0.18); border-color: rgba(166, 107, 255, 0.55); }
.runtime-note { color: var(--fg-muted); font-size: 0.95rem; margin: 0; }

.join { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-top: 3rem; padding: 0 0.5rem; }
.join p { font-size: 1.25rem; font-weight: 600; max-width: 32rem; margin: 0; }

/* Documentation pages */

.doc-layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr) 14rem; gap: 3rem; padding-top: 3rem; padding-bottom: 4rem; align-items: start; }
.doc-layout.no-sidebar { grid-template-columns: minmax(0, 1fr) 14rem; }
.sidebar, .toc { position: sticky; top: 5.5rem; font-size: 0.93rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
.sidebar nav, .toc { display: flex; flex-direction: column; gap: 0.1rem; }
.sidebar-title { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.74rem; font-weight: 700; color: var(--violet); margin-bottom: 0.75rem; display: block; }
.sidebar nav a { padding: 0.45rem 0.8rem; border-radius: 10px; color: var(--fg-muted); }
.sidebar nav a:hover { background: var(--glass); color: var(--fg); }
.sidebar nav a[aria-current] { background: rgba(166, 107, 255, 0.18); color: var(--fg); font-weight: 600; }
.toc-mobile { display: none; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 0.7rem 1rem; margin-bottom: 1.5rem; font-size: 0.93rem; }
.toc-mobile summary { cursor: pointer; color: var(--fg-muted); font-weight: 600; }
.toc-mobile nav { display: flex; flex-direction: column; margin-top: 0.6rem; }
.toc-mobile a { color: var(--fg-muted); padding: 0.3rem 0; }
.toc-mobile a.toc-3 { padding-left: 1rem; font-size: 0.88rem; }
.toc h2 { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-faint); margin-bottom: 0.6rem; }
.toc a { color: var(--fg-muted); padding: 0.25rem 0 0.25rem 0.85rem; border-left: 1px solid var(--line); }
.toc a:hover { color: var(--fg); border-left-color: var(--violet); }
.toc .toc-3 { padding-left: 1.7rem; font-size: 0.88rem; }

.prose { min-width: 0; }
.prose h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; margin-bottom: 1rem; }
.prose .lead { font-size: 1.22rem; color: var(--fg-muted); margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.prose h2 { font-size: 1.7rem; margin: 3rem 0 1rem; }
.prose h3 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.prose h2 .anchor, .prose h3 .anchor { margin-left: 0.5rem; color: var(--fg-faint); font-weight: 400; opacity: 0; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose p, .prose li { color: #ddd7f5; }
.prose a:not(.btn):not(.card):not(.pager-prev):not(.pager-next):not(.anchor) { color: #c9a9ff; text-decoration: underline; text-decoration-color: rgba(201, 169, 255, 0.4); text-underline-offset: 3px; }
.prose a:not(.btn):not(.card):hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--violet); }
.prose strong { color: var(--fg); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose img { border-radius: var(--radius-sm); }
.prose .cards { margin: 1.5rem 0; }
.prose .card h3 { margin-top: 0; }
.prose .card { color: inherit; }
.prose .card p { margin-bottom: 0; }

.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--fg); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; background: var(--glass); }
.prose td { color: #ddd7f5; }

.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-left: 3px solid var(--violet); background: var(--glass); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose blockquote p { color: var(--fg); }

.callout { margin: 1.6rem 0; padding: 1.1rem 1.3rem; border-radius: var(--radius-sm); border: 1px solid rgba(76, 201, 240, 0.35); background: rgba(76, 201, 240, 0.07); }
.callout p { margin: 0 0 0.5rem; color: var(--fg); }
.callout p:last-child { margin: 0; }
.callout > strong:first-child { display: block; margin-bottom: 0.25rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.74rem; }
.callout-warn { border-color: rgba(240, 107, 168, 0.45); background: rgba(240, 107, 168, 0.07); }
.callout-warn > strong:first-child { color: var(--pink); }

/* Every ordered list of a page is a numbered path */
.prose > ol { list-style: none; padding: 0 !important; counter-reset: step; display: grid; gap: 1rem; margin: 1.5rem 0 !important; }
.prose > ol > li { counter-increment: step; position: relative; padding: 1.1rem 1.3rem 1.1rem 4.2rem; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--line); margin: 0; }
.prose > ol > li::before { content: counter(step); position: absolute; left: 1.1rem; top: 1.05rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 50%; font-weight: 800; background: #8f55f2; color: #fff; }
.prose > ol > li > strong:first-child { display: block; font-size: 1.1rem; margin-bottom: 0.25rem; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 4rem; }
.pager a { display: block; padding: 1rem 1.3rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--glass); font-weight: 650; color: var(--fg); transition: border-color .15s, background .15s; }
.pager a:hover { border-color: rgba(166, 107, 255, 0.6); background: var(--glass-strong); }
.pager small { display: block; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.68rem; margin-bottom: 0.2rem; font-weight: 600; }
.pager-next { text-align: right; grid-column: 2; }

/* Code */

figure.code { margin: 1.5rem 0; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--code-bg); overflow: hidden; }
figure.code figcaption { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.5rem 0.4rem 1rem; border-bottom: 1px solid var(--line); background: rgba(166, 107, 255, 0.07); font-family: var(--mono); font-size: 0.74rem; color: var(--fg-faint); text-transform: lowercase; }
.copy { font: inherit; font-family: var(--sans); font-size: 0.78rem; color: var(--fg-muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 0.2rem 0.65rem; cursor: pointer; }
.copy:hover { color: var(--fg); border-color: rgba(190, 170, 255, 0.45); }
figure.code pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.88rem; line-height: 1.6; tab-size: 4; }
figure.code code { background: none; border: 0; padding: 0; font-size: inherit; color: #e6e0ff; overflow-wrap: normal; }
.tk-c { color: #7f78a8; font-style: italic; }
.tk-s { color: #8fe3b4; }
.tk-k { color: #d4a2ff; }
.tk-t { color: #7fd6f5; }
.tk-a { color: #ff8cc0; }
.tk-n { color: #ffc98a; }
.tk-f { color: #ffc98a; }

/* Articles */

.article-list { display: grid; gap: 1.25rem; padding-bottom: 4rem; }
.article-card .article-meta { font-size: 0.82rem; color: var(--fg-faint); font-variant-numeric: tabular-nums; margin: 0; }
.article-card time { font-size: 0.82rem; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.article-card h2 { font-size: 1.5rem; margin: 0.3rem 0 0.6rem; }
.article-card .more { display: inline-block; margin-top: 1rem; }
.narrow .prose { padding-top: 3rem; }
.narrow .article-list { padding-top: 1rem; }
.narrow > .prose:only-child { padding-bottom: 4rem; }

/* Examples */

.demo-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: center; margin: 1.5rem 0 2rem; }
.demo-card h3 { margin-top: 0 !important; }

/* Footer */

.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: rgba(8, 4, 26, 0.6); padding: 3rem 0 1.5rem; }
.site-footer .wrap:first-child { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer-brand p { color: var(--fg-muted); font-size: 0.93rem; margin-top: 0.9rem; max-width: 22rem; }
.footer-col { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.93rem; }
.footer-col h2 { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-faint); margin-bottom: 0.4rem; }
.footer-col a { color: var(--fg-muted); }
.footer-col a:hover, .footer-end a:hover { color: var(--fg); }
.footer-end { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--fg-faint); font-size: 0.86rem; }
.footer-end a { text-decoration: underline; text-underline-offset: 3px; }

/* Error */

.error { padding: 7rem 0; text-align: center; }
.error .code { font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; line-height: 1; color: var(--violet); margin-bottom: 1rem; }
.error p { color: var(--fg-muted); margin-bottom: 2rem; }

/* Responsive */

@media (max-width: 1100px) {
    .doc-layout { grid-template-columns: 13rem minmax(0, 1fr); }
    .doc-layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
    .toc { display: none; }
    .toc-mobile { display: block; }
    .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .hero-grid, .proof, .mechanism, .demo-card { grid-template-columns: minmax(0, 1fr); }
    .hero-visual { width: 100%; max-width: 34rem; margin-inline: auto; }
    .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 2rem; }
    .sidebar { position: static; max-height: none; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; }
    .sidebar nav a { border: 1px solid var(--line); }
    .cards-3, .cards-2 { grid-template-columns: minmax(0, 1fr); }
    .join { flex-direction: column; align-items: flex-start; padding: 0; }
    .site-footer .wrap:first-child { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
    .site-header .wrap { flex-wrap: wrap; gap: 0.25rem 1rem; padding-top: 0.6rem; padding-bottom: 0.4rem; }
    .site-header .btn { margin-left: auto; }
    .nav { order: 3; width: 100%; margin-left: -0.5rem; overflow-x: auto; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    .cards-4 { grid-template-columns: minmax(0, 1fr); }
    .pager { grid-template-columns: 1fr; }
    .pager-next { grid-column: auto; }
    .icon-lg { width: 3.2rem; height: 3.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
    .hero-editor.is-playing .hero-editor-typing { animation: none; border: 0; }
}
.empty { color: var(--fg-muted); }
.proof-note { color: var(--fg-muted); font-size: 0.93rem; margin: 1rem 0; }
