/* Long-form reading pages (legal pages, user guide) in the dark landing design.
   Tokens, base, buttons, nav and footer are copied verbatim from the stylesheet inlined in
   index.html / features.html: if those change, change these too. Versioned filename because
   Cloudflare caches 404s and assets for hours; bump the suffix on any breaking edit. */
:root {
    --bg: #0F172A;
    --bg-deep: #0B1222;
    --surface: #1E293B;
    --surface-2: #162034;
    --raise: #243247;
    --line: rgba(148, 163, 184, 0.14);
    --line-strong: rgba(148, 163, 184, 0.24);
    --text-hi: #F8FAFC;
    --text: #CBD5E1;
    --text-mute: #94A3B8;
    --coral: #E08888;
    --coral-hover: #EDA0A0;
    --on-coral: #0F172A;
    --green: #4ADE80;
    --radius: 12px;
    --wrap: 1200px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { color: var(--text-hi); margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
::selection { background: rgba(224, 136, 136, 0.32); color: var(--text-hi); }
:focus-visible { outline: 2px solid var(--text-hi); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: 88px; }
html { scrollbar-color: #334155 var(--bg); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip {
    position: absolute; left: 12px; top: -48px; z-index: 200;
    background: var(--text-hi); color: var(--bg); padding: 10px 14px; border-radius: 8px;
    font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border-radius: 10px;
    font: 500 15px/1 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -0.01em;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
    white-space: nowrap;
}
.btn-primary { background: var(--coral); color: var(--on-coral); font-weight: 600;
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 8px 24px -8px rgba(224,136,136,0.45); }
.btn-primary:hover { background: var(--coral-hover); }
.btn-quiet { background: var(--raise); color: var(--text-hi); border-color: var(--line-strong); }
.btn-quiet:hover { background: #2C3B52; border-color: rgba(148,163,184,0.36); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; border-radius: 8px; }

/* Nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 70; background: rgba(15, 23, 42, 0.72);
    backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--line); }
.nav-in { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-hi);
    font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav-links a { color: var(--text-mute); text-decoration: none; transition: color .2s ease; }
.nav-links a:hover { color: var(--text-hi); }
.nav-end { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.nav-end a.login { color: var(--text-mute); text-decoration: none; }
.nav-end a.login:hover { color: var(--text-hi); }
.m-menu { display: none; position: relative; }
.m-menu summary { list-style: none; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 8px; color: var(--text-hi); border: 1px solid var(--line); }
.m-menu summary::-webkit-details-marker { display: none; }
.m-panel { position: absolute; right: 0; top: 48px; width: min(280px, calc(100vw - 40px)); padding: 8px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
    box-shadow: 0 24px 48px -12px rgba(0,0,0,0.6); }
.m-panel a { display: block; padding: 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.m-panel a:hover { background: var(--raise); color: var(--text-hi); }
.m-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 64px 0 40px; font-size: 14px; background: var(--bg-deep); }
.foot { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 32px; }
.foot h4 { margin: 0 0 14px; font-size: 13px; font-weight: 500; color: var(--text-hi); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot a { color: var(--text-mute); text-decoration: none; }
.foot a:hover { color: var(--text-hi); }
.foot-blurb { margin-top: 14px; color: var(--text-mute); max-width: 34ch; }
.legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--text-mute); font-size: 13px; }
.legal p + p { margin-top: 6px; }
.legal a { color: var(--text-hi); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }

/* ---------- Reading layout ---------- */
.doc-hero { padding: 152px 0 48px; position: relative; isolation: isolate; border-bottom: 1px solid var(--line); }
.doc-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(60% 80% at 18% 0%, rgba(148,163,184,0.10), transparent 70%), linear-gradient(180deg, var(--bg-deep), var(--bg)); }
.measure { max-width: 70ch; }
.doc-hero h1 { font-size: clamp(2.25rem, 1.3rem + 3vw, 3.25rem); line-height: 1.06; letter-spacing: -0.03em; }
.doc-hero .meta { margin-top: 16px; font-size: 15px; color: var(--text-mute); }

.doc { padding: 56px 0 112px; font-size: 17px; line-height: 1.75; color: var(--text); }
.doc > .wrap > * { max-width: 70ch; }
.doc h2 { margin: 56px 0 16px; font-size: 22px; line-height: 1.3; letter-spacing: -0.015em; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin: 40px 0 12px; font-size: 19px; line-height: 1.35; letter-spacing: -0.01em; }
.doc h4 { margin: 28px 0 8px; font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--text-hi); }
.doc p { margin: 0 0 18px; }
.doc strong { color: var(--text-hi); font-weight: 600; }
.doc em { color: var(--text-mute); }
.doc ul, .doc ol { margin: 0 0 22px; padding-left: 1.4em; }
.doc li { margin: 0 0 10px; padding-left: 4px; }
.doc li::marker { color: var(--text-mute); }
.doc ol > li::marker { font-variant-numeric: tabular-nums; }
.doc a { color: var(--text-hi); text-decoration: underline; text-decoration-color: rgba(224,136,136,0.55);
    text-underline-offset: 4px; text-decoration-thickness: 1px; overflow-wrap: anywhere; transition: text-decoration-color .2s ease; }
.doc a:hover { text-decoration-color: var(--text-hi); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

/* Tables scroll inside their own box, never the page */
.table-scroll { overflow-x: auto; margin: 8px 0 28px; border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--surface-2); -webkit-overflow-scrolling: touch; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.doc th { text-align: left; font-weight: 600; color: var(--text-hi); background: var(--surface);
    padding: 12px 16px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.doc td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); min-width: 12ch; }
.doc tbody tr:last-child td { border-bottom: 0; }

.doc blockquote { margin: 28px 0; padding: 18px 22px; border-left: 3px solid var(--coral);
    background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; }
.doc blockquote p { margin: 0; color: var(--text); }

/* Responsive (nav + footer rules from the reference stylesheet) */
@media (max-width: 960px) {
    .nav-links, .nav-end .login { display: none; }
    .m-menu { display: block; }
    .foot { grid-template-columns: 1fr 1fr; }
    .foot > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .wrap { padding: 0 20px; }
    .doc-hero { padding: 112px 0 36px; }
    .doc { padding: 40px 0 88px; font-size: 16px; }
    .doc h2 { margin-top: 44px; font-size: 20px; }
    .doc th, .doc td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.001ms !important; animation: none !important; }
}
