/*
 * the.ridgwell.family - the whole site's styles, in one file. No framework, no build step.
 * The family palette, as on projects.ridgwell.family: blue #2a6bff on deep navy #061033. Dark by default,
 * light with the device's setting or the header's switch. Poppins throughout.
 * Copyright (c) 2026 The Ridgwell Family. All Rights Reserved.
 */

/* Self-hosted Poppins (SIL Open Font License, see static/fonts/OFL-poppins.txt), latin subset. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/poppins-800.woff2") format("woff2"); }

:root {
    --blue: #2a6bff;
    --grad: linear-gradient(135deg, #2a6bff 0%, #1f4fd1 100%);
    --glow: radial-gradient(640px 340px at 50% 0%, rgba(42, 107, 255, 0.32), transparent 70%);

    --bg: #061033;
    --bg-raised: #0a1640;
    --surface: #0b1845;
    --surface-hover: #0f1f5c;
    --border: #1b2a66;
    --border-strong: #2a3a7d;
    --text: #eef2ff;
    --muted: #a8afd4;
    --faint: #8b93bd;
    --link: #7ea4ff;
    --link-hover: #b3c9ff;
    --header-bg: rgba(6, 16, 51, 0.82);
    --shadow: 0 18px 44px -24px rgba(0, 0, 0, 0.7);

    --radius: 16px;
    --wrap: 1080px;
    --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color-scheme: dark;
}

/* Light theme: the device's setting, unless the visitor picked dark with the header's switch... */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f5f7ff;
        --bg-raised: #eaeefb;
        --surface: #ffffff;
        --surface-hover: #f3f6ff;
        --border: #dde3f5;
        --border-strong: #c3cceb;
        --text: #0a1433;
        --muted: #46507a;
        --faint: #5d678f;
        --link: #1f54d6;
        --link-hover: #12318a;
        --header-bg: rgba(245, 247, 255, 0.86);
        --shadow: 0 18px 44px -28px rgba(10, 30, 90, 0.35);
        --glow: radial-gradient(640px 340px at 50% 0%, rgba(42, 107, 255, 0.16), transparent 70%);
        color-scheme: light;
    }
}
/* ...or the switch set light. */
:root[data-theme="light"] {
    --bg: #f5f7ff;
    --bg-raised: #eaeefb;
    --surface: #ffffff;
    --surface-hover: #f3f6ff;
    --border: #dde3f5;
    --border-strong: #c3cceb;
    --text: #0a1433;
    --muted: #46507a;
    --faint: #5d678f;
    --link: #1f54d6;
    --link-hover: #12318a;
    --header-bg: rgba(245, 247, 255, 0.86);
    --shadow: 0 18px 44px -28px rgba(10, 30, 90, 0.35);
    --glow: radial-gradient(640px 340px at 50% 0%, rgba(42, 107, 255, 0.16), transparent 70%);
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.7 var(--font); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px; padding: 0.05em 0.35em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.icon { width: 20px; height: 20px; flex: none; }
.lead { color: var(--muted); font-size: 1.08rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 600; color: var(--link); margin-bottom: 0.6em; }

/* Banners (dev, debug, holding-page reminders) */
.dev-banner { background: #fff4d6; color: #5a3f00; border-bottom: 1px solid #f0d58a; font-size: 0.85rem; padding: 6px 16px; text-align: center; }
.dev-banner strong { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; margin-right: 6px; }
.dev-banner code { background: transparent; border-color: #e6c870; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; min-height: 64px; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.brand:hover { color: var(--text); }
.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 8px 12px; border-radius: 999px; }
.site-nav a:hover { color: var(--text); background: var(--surface-hover); }
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--blue); color: var(--link); }
.icon-sun { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .icon-sun { display: block; }
    :root:not([data-theme="dark"]) .icon-moon { display: none; }
}

/* Buttons */
.button { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; text-decoration: none; border: 2px solid var(--border-strong); color: var(--text); background: var(--surface); }
.button:hover { border-color: var(--blue); color: var(--text); }
.button.primary { color: #fff; background: var(--grad); border-color: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Home */
.hero { background: var(--glow); }
.hero-inner { display: grid; justify-items: center; text-align: center; padding-block: 64px 32px; }
.hero-logo { width: min(460px, 86vw); filter: drop-shadow(0 20px 40px rgba(42, 107, 255, 0.35)); margin-bottom: 20px; }
.hero .lead { max-width: 560px; }
.section { padding-block: 48px 72px; }
.section-head { text-align: center; margin: 0 auto 28px; max-width: 620px; }
.page-head { padding-block: 52px 16px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 500; text-decoration: none; margin-bottom: 16px; }
.crumb .icon { width: 16px; height: 16px; }

/* The family's sites */
.sites { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.sites a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease; }
.sites a:hover { transform: translateY(-2px); border-color: var(--blue); background: var(--surface-hover); color: var(--text); }
.sites strong { font-size: 1.05rem; }
.sites span { color: var(--muted); font-size: 0.93rem; }
.sites small { margin-top: auto; padding-top: 6px; color: var(--link); font-weight: 500; }
.sites.compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; text-align: left; margin: 24px 0; }
.sites.compact a { padding: 14px 16px; box-shadow: none; gap: 2px; }
.sites.compact strong { font-size: 0.95rem; }
.sites.compact small { padding-top: 2px; }

/* Prose (legal, changelog, sitemap) */
.prose { font-size: 1.02rem; }
.prose h2 { font-size: 1.3rem; margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose .updated { color: var(--faint); font-size: 0.9rem; margin-top: 2em; }
.prose .sites { padding: 0; }
.legal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 1.6em; }
.legal-grid a { display: block; text-decoration: none; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.legal-grid a:hover { border-color: var(--blue); }
.legal-grid strong { display: block; color: var(--text); }
.legal-grid span { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 560px) { .legal-grid { grid-template-columns: 1fr; } }
.cl-badge { display: inline-block; font-size: 0.78rem; font-weight: 700; color: #fff; padding: 3px 12px; border-radius: 999px; background: #8a8a94; }
.cl-badge.cl-added { background: #2ecc71; }
.cl-badge.cl-changed { background: #3ba7ff; }
.cl-badge.cl-fixed { background: #ffa64d; }
.cl-badge.cl-removed { background: #ff4d4d; }
.cl-badge.cl-security { background: #b06bff; }
.cl-badge.cl-deprecated { background: #8a8a94; }
.cl-badge.cl-added, .cl-badge.cl-changed, .cl-badge.cl-fixed { color: #0a1433; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 24px; font-size: 0.88rem; color: var(--faint); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.footer-row p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a, .footer-row a { color: var(--muted); text-decoration: none; }
.footer-links a:hover, .footer-row a:hover { color: var(--link-hover); }
.heart { color: #ff4d6d; vertical-align: -1px; }

/* Error and holding pages */
.error-page { padding-block: 96px; text-align: center; }
.error-page .actions { justify-content: center; }
body.holding { min-height: 100vh; display: grid; background: var(--glow), var(--bg); }
.holding-main { display: grid; place-items: center; padding: 40px 16px; }
.holding-card { text-align: center; max-width: 820px; }
.holding-logo { width: min(380px, 80vw); margin: 0 auto 26px; filter: drop-shadow(0 20px 40px rgba(42, 107, 255, 0.35)); }
.holding-card .lead { max-width: 560px; margin-inline: auto; }
.holding-foot { font-size: 0.85rem; color: var(--faint); }
.holding-foot a { color: var(--muted); }
