/**
 * Shared styling for the map's document pages (about.html, contact.html).
 *
 * These are prose, not dashboard: one centred column, read top to bottom. They
 * take their palette, type and theme tokens from styles.css and only describe
 * the layout a document needs, so a theme picked on the map carries over here.
 *
 * styles.css pins html and body to the viewport with overflow: hidden, because
 * the app is a fixed dashboard that never scrolls. A page of prose very much
 * does, so both are released below.
 */

html {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
}

body.doc-page {
    margin: 0;
    height: auto;
    overflow: visible;
    min-height: 100vh;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    background:
        radial-gradient(900px 520px at 50% -5%, rgba(var(--accent-rgb), 0.13), transparent 62%),
        radial-gradient(700px 500px at 88% 32%, rgba(var(--accent-sky-rgb), 0.06), transparent 60%),
        linear-gradient(180deg, var(--page-grad-1) 0%, var(--page-grad-2) 100%);
    background-attachment: fixed;
}

/* A faint starfield, so the empty margins are not flatly empty */
body.doc-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 78% 14%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 34% 67%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1px 1px at 63% 81%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(1px 1px at 91% 58%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 22% 91%, rgba(255, 255, 255, 0.3), transparent);
}

/* ---------- top bar ---------- */

.doc-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 22px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(var(--chrome-rgb), 0.82);
    backdrop-filter: blur(8px);
}

.doc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--accent-sky);
}

.doc-brand img { width: 26px; height: 26px; }

.doc-bar-links { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }

/* The language picker is the map's control (.lang-select in styles.css), reused
   here so a pilot's choice carries between the map and these pages. It is
   shaped to sit beside the pills rather than in a toolbar. */
.doc-bar .lang-select {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.86rem;
}

.doc-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border: 1px solid rgba(var(--accent-sky-rgb), 0.45);
    border-radius: 999px;
    background: rgba(var(--accent-sky-rgb), 0.10);
    color: var(--accent-sky);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.15s ease;
}

.doc-back:hover {
    background: rgba(var(--accent-sky-rgb), 0.22);
    transform: translateY(-1px);
}

.doc-back.is-quiet {
    border-color: var(--border-color);
    background: transparent;
    color: var(--text-secondary);
}

.doc-back.is-quiet:hover { color: var(--accent-sky); background: rgba(255, 255, 255, 0.04); }

/* ---------- shared layout: everything is centred ---------- */

.doc-wrap {
    position: relative;
    max-width: 940px;
    margin: 0 auto;
    padding: 0 22px 96px;
    text-align: center;
}

/* Everything on these pages is centred, body copy included. The measure is kept
   deliberately short, because centred text is read from a ragged left edge and
   long lines make that hard: the eye has to hunt for where the next one starts.
   .doc-prose and .doc-lead-in differ only in name, which is kept so the markup
   still says which blocks are section intros. */
.doc-prose,
.doc-lead-in {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
}

.doc-wrap p { margin: 0 0 18px; color: var(--text-secondary); }
.doc-wrap strong { color: var(--text-primary); font-weight: 600; }

/* ---------- hero ---------- */

.doc-hero { padding: 76px 0 8px; }

.doc-hero-logo {
    width: 76px;
    height: 76px;
    margin-bottom: 22px;
    filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), 0.45));
}

.doc-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.doc-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4.6vw, 2.8rem);
    line-height: 1.2;
    margin: 14px auto 18px;
    max-width: 20ch;
    background: linear-gradient(180deg, var(--text-primary) 30%, var(--accent-sky) 160%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Written as .doc-wrap p.doc-lede on purpose. `.doc-wrap p` below sets a margin
   on every paragraph on the page and outranks a bare class selector, so a plain
   .doc-lede rule would lose its `margin: 0 auto` and the box would sit flush left
   while its text still read centred. Any centred <p> here needs the same weight. */
.doc-wrap p.doc-lede {
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.16rem;
    color: var(--text-secondary);
}

.doc-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 34px;
    margin: 34px 0 0;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.doc-stats b {
    display: block;
    font-family: var(--font-display);
    font-size: 1.45rem;
    letter-spacing: 0;
    color: var(--accent-sky);
}

/* ---------- section rhythm ---------- */

.doc-rule {
    width: 100%;
    max-width: 340px;
    margin: 58px auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color) 18%, rgba(var(--accent-sky-rgb), 0.55) 50%, var(--border-color) 82%, transparent);
    position: relative;
}

.doc-rule::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: var(--accent-sky);
    box-shadow: 0 0 10px rgba(var(--accent-sky-rgb), 0.9);
}

.doc-wrap h2 {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.6vw, 1.5rem);
    letter-spacing: 0.5px;
    margin: 0 0 22px;
    color: var(--text-primary);
}

.doc-h2-mark {
    display: block;
    width: 44px;
    height: 3px;
    margin: 12px auto 0;
    border-radius: 2px;
    background: var(--accent-sky);
    box-shadow: 0 0 12px rgba(var(--accent-sky-rgb), 0.7);
}

/* ---------- pull quote ---------- */

.doc-pull {
    max-width: 700px;
    margin: 34px auto 0;
    padding: 26px 30px;
    border: 1px solid rgba(var(--accent-sky-rgb), 0.28);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(var(--accent-sky-rgb), 0.10), rgba(var(--accent-sky-rgb), 0.02));
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text-primary);
    position: relative;
}

.doc-pull::before {
    content: "\201C";
    position: absolute;
    top: -10px;
    left: 16px;
    font-family: var(--font-display);
    font-size: 3.4rem;
    line-height: 1;
    color: rgba(var(--accent-sky-rgb), 0.35);
}

/* ---------- cards ---------- */

.doc-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 28px 0 0;
}

.doc-card {
    flex: 1 1 200px;
    max-width: 260px;
    padding: 22px 20px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 70%), var(--bg-card);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.doc-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-accent, var(--accent-sky));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.doc-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    border-radius: 50%;
    font-size: 1.3rem;
    background: color-mix(in srgb, var(--card-accent, var(--accent-sky)) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--card-accent, var(--accent-sky)) 45%, transparent);
}

.doc-card h3 {
    font-family: var(--font-display);
    font-size: 0.92rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 8px;
    color: var(--card-accent, var(--accent-sky));
}

.doc-card p { margin: 0; font-size: 0.95rem; line-height: 1.6; }

/* ---------- icon rows ---------- */

.doc-rows {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin: 26px 0 0;
}

.doc-row {
    flex: 1 1 260px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(var(--surface-rgb), 0.55);
}

.doc-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.2rem;
    background: rgba(var(--accent-sky-rgb), 0.12);
    border: 1px solid rgba(var(--accent-sky-rgb), 0.35);
    flex: 0 0 auto;
}

.doc-row h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.doc-row p { margin: 0; font-size: 0.93rem; line-height: 1.6; }

/* ---------- labelled notes ---------- */

.doc-notes { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 26px; }

.doc-note {
    flex: 1 1 250px;
    max-width: 300px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-top: 2px solid rgba(var(--accent-sky-rgb), 0.55);
    border-radius: 12px;
    background: rgba(var(--surface-2-rgb), 0.6);
}

.doc-note-name {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-sky);
    margin-bottom: 6px;
}

.doc-note p { margin: 0; font-size: 0.93rem; line-height: 1.6; }

/* ---------- contact handles ---------- */

.doc-handles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin: 30px 0 0;
    text-align: center;
}

.doc-handle {
    flex: 1 1 280px;
    max-width: 360px;
    padding: 26px 22px;
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--card-accent, var(--accent-sky));
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 70%), var(--bg-card);
}

.doc-handle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
    border-radius: 50%;
    font-size: 1.5rem;
    background: color-mix(in srgb, var(--card-accent, var(--accent-sky)) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--card-accent, var(--accent-sky)) 45%, transparent);
}

.doc-handle h3 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin: 0 0 4px;
    color: var(--card-accent, var(--accent-sky));
}

.doc-handle-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    letter-spacing: 1px;
    color: var(--text-primary);
    margin: 6px 0 4px;
    word-break: break-all;
}

.doc-handle p { margin: 6px 0 0; font-size: 0.92rem; }

.doc-copy {
    margin-top: 14px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-sky-rgb), 0.45);
    background: rgba(var(--accent-sky-rgb), 0.10);
    color: var(--accent-sky);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.doc-copy:hover { background: rgba(var(--accent-sky-rgb), 0.24); }
.doc-copy.is-copied { border-color: #10b981; color: #34d399; background: rgba(16, 185, 129, 0.16); }

/* ---------- numbered checklist ---------- */

.doc-steps { counter-reset: doc-step; list-style: none; margin: 24px auto 0; padding: 0; max-width: 620px; }

.doc-steps li {
    counter-increment: doc-step;
    padding: 0 0 16px;
    color: var(--text-secondary);
}

.doc-steps li::before {
    content: counter(doc-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-right: 10px;
    vertical-align: middle;
    border-radius: 50%;
    background: rgba(var(--accent-sky-rgb), 0.14);
    border: 1px solid rgba(var(--accent-sky-rgb), 0.45);
    color: var(--accent-sky);
    font-family: var(--font-display);
    font-size: 0.8rem;
}

/* ---------- closing card ---------- */

.doc-cta {
    margin: 54px auto 0;
    padding: 34px 28px;
    max-width: 700px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.10), transparent 75%), var(--bg-card);
}

.doc-cta h2 { margin-bottom: 12px; }
.doc-wrap .doc-cta p { max-width: 540px; margin: 0 auto 22px; }

.doc-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-sky-rgb), 0.6);
    background: rgba(var(--accent-sky-rgb), 0.16);
    color: var(--accent-sky);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.doc-cta-btn:hover { background: rgba(var(--accent-sky-rgb), 0.28); transform: translateY(-1px); }

.doc-footer {
    margin-top: 46px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.doc-footer strong { color: var(--accent-sky); }

@media (max-width: 620px) {
    body.doc-page { font-size: 1rem; }
    .doc-hero { padding: 48px 0 4px; }
    .doc-stats { gap: 10px 22px; }
    .doc-pull { padding: 22px 20px; font-size: 1.03rem; }
    .doc-bar { padding: 10px 14px; justify-content: center; }
    /* Brand, picker and two pills do not fit a phone in one row, and the bar
       wraps them. Without this the row can still overflow sideways. */
    .doc-bar-links { width: 100%; }
}
