/* ════ FONTS — self-hosted (no third-party request, no render-blocking stylesheet) ════
   Variable woff2, latin + latin-ext only (Polish needs latin-ext). The family names stay 'Inter' and
   'JetBrains Mono' so no rule in the site has to change. Licences: wwwroot/fonts/OFL-*.txt */
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap;
    src: url('fonts/jetbrains-mono-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap;
    src: url('fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ═══════════════════════════════════════════════════════════
   AURA MIXER PORTAL — global styles
   Design tokens mirror the app (src/Ngs.AuraMixer.App/wwwroot/app.css):
   flat surfaces, hairline borders, 2px radius, accent #3b82f6.
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-outer:   #171717;   /* neutral ramp lifted ~6 across the board so near-blacks don't collapse into
                                one flat slab on high-contrast (VA) panels — hierarchy + WCAG AA preserved */
    --bg:         #1c1c1c;
    --surface:    #212121;
    --raised:     #2a2a2a;
    --line:       #2e2e2e;   /* hairline */
    --line-2:     #3a3a3a;   /* interactive border */
    --depth:      #121212;
    --input-bg:   #191919;

    --accent:     #3b82f6;   /* lines, borders, glows and accent fills that carry no text */
    --accent-2:   #60a5fa;   /* accent used AS TEXT / links on dark surfaces */
    --accent-strong:       #2563eb;   /* fill UNDER white text: #fff on it = 5.2:1 (#fff on --accent is 3.7:1 — below WCAG AA) */
    --accent-strong-hover: #1d4ed8;   /* #fff on it = 6.7:1 */

    --text:       #e5e5e5;
    --muted:      #a1a1aa;
    --faint:      #8a8a93;   /* holds ~4.7:1 on the (lifted) surfaces — WCAG AA */

    --green:      #1db954;
    --amber:      #f59e0b;
    --red:        #ef4444;   /* borders, fills, glows — #ef4444 as TEXT is only 4.3:1 on --surface */
    --red-text:   #f87171;   /* red used AS TEXT on dark surfaces: ~5.8:1 */

    /* ── Design language v2 (born on the Home page, shared by every page) ── */
    --r-sm:         6px;     /* chips, small buttons, inputs */
    --r-md:         8px;     /* buttons */
    --sc-wrap:      1200px;
    --sc-radius:    12px;    /* cards, panels, grids */
    --sc-radius-lg: 16px;
    --sc-glass:     rgba(255, 255, 255, .035);
    --sc-glass-hi:  rgba(255, 255, 255, .06);
    --sc-edge:      rgba(255, 255, 255, .11);
    --sc-edge-lo:   rgba(255, 255, 255, .025);
    --sc-blur:      14px;
    --sc-glow:      rgba(59, 130, 246, .16);

    --fs-display:   clamp(36px, 4.7vw, 62px);
    --fs-h2:        clamp(30px, 4vw, 48px);
    --fs-lead:      clamp(16px, 1.45vw, 18px);

    /* status colours AS TEXT on dark glass (every value >= 4.5:1 on --bg-outer / --bg) */
    --st-available: #4ade80;
    --st-coming:    #7cb4fb;
    --st-planned:   #b4b4be;
    --st-premium:   #fbbf24;
}

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

/* ════ COOKIE CONSENT (RODO) — revealed by js/analytics.js on first visit; hidden until a choice is made ════ */
.cookie-consent {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    background: var(--surface);
    border-top: 1px solid var(--line-2);
    box-shadow: 0 -10px 34px rgba(0, 0, 0, .4);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent-inner {
    display: flex; align-items: center; gap: 24px;
    padding: 14px 0;
}
.cookie-consent-text {
    margin: 0; font-size: 13px; line-height: 1.65; color: var(--muted);
}
.cookie-consent-text a { color: var(--accent-2); }
.cookie-consent-actions {
    display: flex; gap: 10px; flex-shrink: 0; margin-left: auto;
}
@media (max-width: 640px) {
    .cookie-consent-inner { flex-direction: column; align-items: stretch; gap: 12px; }
    .cookie-consent-actions { margin-left: 0; justify-content: flex-end; }
}

/* ════ DOWNLOAD CONSENT DIALOG (beta / unsigned-installer heads-up) — opened by js/site.js auraDownload ════ */
.dl-modal {
    width: min(540px, calc(100vw - 32px));
    /* The global `* { margin: 0 }` reset overrides the UA `margin: auto` that centers a modal <dialog>,
       pinning it to the inset:0 top-left corner. Restore it so showModal() centers on both axes. */
    margin: auto;
    padding: 0;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
.dl-modal::backdrop { background: rgba(0, 0, 0, .62); }
.dl-modal-body { position: relative; padding: 30px 30px 24px; }
.dl-modal-x {
    position: absolute; top: 12px; right: 12px;
    width: 30px; height: 30px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--line); border-radius: 4px;
    color: var(--faint); font-size: 13px; cursor: pointer;
}
.dl-modal-x:hover { color: var(--text); border-color: var(--line-2); }
.dl-modal-icon { font-size: 30px; line-height: 1; margin-bottom: 12px; }
.dl-modal-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 12px; }
.dl-modal-lead { font-size: 14px; line-height: 1.7; color: var(--muted); }
.dl-modal-lead strong { color: var(--text); font-weight: 600; }
.dl-modal-box {
    margin-top: 18px; padding: 16px 18px;
    background: var(--depth); border: 1px solid var(--line); border-radius: 4px;
}
.dl-modal-box-title {
    font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--faint); margin-bottom: 10px;
}
.dl-modal-steps { margin: 0 0 0 18px; font-size: 14px; line-height: 1.9; }
.dl-modal-steps strong { color: var(--text); }
.dl-modal-av { margin-top: 12px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.dl-modal-av strong { color: var(--text); }
.dl-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
@media (max-width: 520px) {
    .dl-modal-actions { flex-direction: column-reverse; }
    .dl-modal-actions .btn { width: 100%; }
}

/* Inline heads-up under the download button (also the no-JS fallback path). */
.dl-unsigned {
    margin-top: 10px; font-size: 11px; line-height: 1.65;
    color: var(--faint);
}

/* ════ LANGUAGE SWITCHER (EN / PL) — bordered segmented toggle in the top nav ════ */
.nav-lang {
    display: inline-flex; align-items: stretch;
    border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden;
    font-size: 11.5px; font-weight: 600; letter-spacing: .05em;
    background: rgba(255, 255, 255, .03);
}
.nav-lang a {
    display: inline-flex; align-items: center;
    color: var(--muted); text-decoration: none;
    padding: 6px 10px; transition: color .12s, background .12s;
}
.nav-lang a + a { border-left: 1px solid var(--line-2); }
.nav-lang a:hover { color: var(--text); background: var(--surface); }
.nav-lang a.nav-lang-on { color: #fff; background: var(--accent-strong); }

html { scroll-behavior: smooth; }

body {
    background: var(--bg-outer);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    font-size: 14px;
}

::selection { background: rgba(59, 130, 246, .25); }

/* faint film grain — barely there. Images are lifted above it (see `img` rule
   below) so PNG screenshots don't pick up noise on their flat areas. */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: .015;
}

/* Keep the film grain off bitmap content — the opaque pixels cover the noise. */
img { position: relative; z-index: 1; }

h1, h2, h3 { letter-spacing: -.02em; }

a { color: var(--accent-2); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-outer); }
::-webkit-scrollbar-thumb { background: var(--raised); }

/* ════ ACCESSIBILITY ════ */

/* Visible focus ring for keyboard users; suppressed for pointer interactions. */
:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }
/* Programmatic focus targets (skip-link target, FocusOnNavigate <h1>) shouldn't show a ring. */
[tabindex="-1"]:focus { outline: none; }

/* Placeholder text: the browser default (#757575) is only ~3.8:1 on --input-bg; --faint is ~5:1. */
::placeholder { color: var(--faint); opacity: 1; }

/* Skip to main content — first tab stop, slides in only when focused. */
.skip-link {
    position: fixed;
    top: 8px; left: 8px;
    z-index: 200;
    transform: translateY(-150%);
    background: var(--accent-strong);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--r-md);
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); }

/* Screen-reader-only text (visually hidden, still announced). */
.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;
}

/* Honour users who ask the OS to reduce motion. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .fi { opacity: 1 !important; transform: none !important; }
}

/* ════ TYPE UTILITIES ════ */

.mono { font-family: 'JetBrains Mono', monospace; }

.label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 500;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--faint);
}

/* ════ LAYOUT UTILITIES ════ */

.container {
    max-width: var(--sc-wrap);   /* same measure as .sc-wrap, so the nav, footer and every page share one left edge */
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.container-sm  { max-width: 672px; }
.container-md  { max-width: 896px; }

/* ════ SECTION HEADER — index + rule + name ════ */

.sec-head { margin-bottom: 56px; }

.sec-rule {
    display: flex; align-items: baseline; gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 14px; margin-bottom: 28px;
}

.sec-idx {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; color: var(--accent-2); font-weight: 600;
}

.sec-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--faint);
}

.sec-title {
    font-size: clamp(28px, 3.8vw, 44px);
    font-weight: 700; line-height: 1.1; letter-spacing: -.03em; color: var(--text);
}

.sec-split {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 40px; align-items: end;
}

.sec-desc { color: var(--muted); font-size: 15px; line-height: 1.7; }

@media (max-width: 768px) {
    .sec-split { grid-template-columns: 1fr; gap: 16px; }
}

/* ════ PANELS — hairline surface, 12 px radius, a faint top highlight ════ */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--sc-radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.panel-hover { transition: border-color .15s, transform .2s ease, box-shadow .2s ease; }
.panel-hover:hover { border-color: var(--line-2); }
@media (hover: hover) {
    .panel-hover:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 12px 32px rgba(0, 0, 0, .28); }
}

/* hairline grid — cells separated by 1px lines, rounded as one unit */
.hairline-grid {
    display: grid;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--sc-radius);
    overflow: hidden;
}

.hairline-grid > * { background: var(--surface); }

.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
    .cols-4 { grid-template-columns: 1fr 1fr; }
}

/* accent top edge — replaces glow for highlighted cells */
.cell-accent {
    border-top: 2px solid var(--accent);
    margin-top: -1px;
}

/* ════ BUTTONS — flat, square, no glow ════ */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 22px; border-radius: var(--r-md);
    font-size: 13.5px; font-weight: 600; letter-spacing: .005em;
    cursor: pointer; text-decoration: none; border: 1px solid transparent;
    transition: background .15s, border-color .15s, color .15s, transform .15s;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent-strong); color: #fff; border-color: var(--accent-strong);
}
.btn-primary:hover {
    background: var(--accent-strong-hover); border-color: var(--accent-strong-hover);
}

.btn-outline { background: rgba(255, 255, 255, .02); color: var(--text); border-color: var(--line-2); }
.btn-outline:hover { border-color: #5a5a64; background: rgba(255, 255, 255, .06); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .btn-primary:hover, .btn-outline:hover { transform: translateY(-1px); }
}

.btn-sm {
    padding: 6px 14px; font-size: 11px; border-radius: var(--r-sm);
    font-family: 'JetBrains Mono', monospace; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
}

.btn-lg { padding: 14px 30px; font-size: 15px; }

.btn-block { width: 100%; }

/* ════ SPINNER — busy state for buttons/links waiting on the server ════ */

@keyframes aura-spin { to { transform: rotate(360deg); } }

.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: aura-spin .6s linear infinite;
    flex-shrink: 0;
}

.spinner-sm { width: 12px; height: 12px; }

/* a link/button mid-action, set by js/site.js (auraBusy) */
.is-busy { opacity: .75; pointer-events: none; cursor: progress; }

/* ════ TAGS — square mono chips ════ */

.tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    border: 1px solid var(--line-2); color: var(--muted); background: rgba(255, 255, 255, .03);
}

.tag-blue  { color: var(--accent-2); border-color: rgba(59, 130, 246, .35); background: rgba(59, 130, 246, .08); }
.tag-green { color: var(--st-available); border-color: rgba(74, 222, 128, .35); background: rgba(74, 222, 128, .07); }

/* ════ MEDIA PLACEHOLDER ════ */

.ph {
    background: var(--depth); border: 1px dashed #2e2e2e; border-radius: var(--r-md);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; color: var(--faint); font-size: 11px;
    font-family: 'JetBrains Mono', monospace; text-align: center; padding: 20px;
    line-height: 1.7;
}

.ph-label { color: #4a4a4a; font-weight: 600; }

/* ════ FADE-IN ON SCROLL (js/site.js attaches .in) ════ */

/* Visible by default. Where scroll-driven animations exist the block fades up as it scrolls into view
   (position-driven, so fast scrolling / anchor jumps never leave a blank void); elsewhere it just shows.
   The old JS toggle (.fi → .fi.in) hid content until Blazor finished attaching a circuit — gone with it. */
@keyframes fi-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* Fine-pointer (mouse) devices only: on touch phones/tablets the reveal is skipped — a scroll-driven animation on
   top of a backdrop-filter card re-blurs it every frame, which is what made scrolling stutter there. And
   html.no-reveal (site.js) switches it off for good after the tab was frozen/restored, because Chromium can leave a
   view() timeline stuck at its first frame — the .fi/.reveal blocks then stay at opacity 0 (empty-looking page). */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
        html:not(.no-reveal) .fi {
            animation: fi-rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 35%;
        }
    }
}

/* ════ DESIGN LANGUAGE v2 — shared primitives (SectionHeader, glass cards, scroll reveal) ════
   Born on the Home page (HOME_REDESIGN_PLAN.md) and promoted here so every page can use the same components.
   Rules: at most ~6 blurred (backdrop-filter) surfaces in one viewport, a solid fallback where unsupported,
   glow is a radial wash behind things (never a text-shadow), every colour pair is contrast-probed. */

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

.sc-head {
    max-width: 780px;
    margin: 0 auto clamp(40px, 5.5vw, 68px);
    text-align: center;
}
.sc-head-left { margin-left: 0; text-align: left; }

.sc-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; font-weight: 500;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--accent-2);
}
.sc-eyebrow::before, .sc-eyebrow::after {
    content: ''; width: 22px; height: 1px; background: currentColor; opacity: .45;
}
.sc-head-left .sc-eyebrow::before { display: none; }

.sc-h2 {
    margin: 16px 0 18px;
    font-size: var(--fs-h2);
    font-weight: 700; line-height: 1.08; letter-spacing: -.03em;
    color: var(--text);
    text-wrap: balance;
}

.sc-lead {
    font-size: var(--fs-lead);
    line-height: 1.65;
    color: var(--muted);
}

/* glass card: translucent fill + a 1 px gradient hairline drawn with a masked border */
.glass {
    position: relative;
    background: var(--sc-glass);
    border-radius: var(--sc-radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 50px rgba(0, 0, 0, .32);
    -webkit-backdrop-filter: blur(var(--sc-blur)) saturate(125%);
            backdrop-filter: blur(var(--sc-blur)) saturate(125%);
}
.glass::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(155deg, var(--sc-edge) 0%, var(--sc-edge-lo) 52%, rgba(59, 130, 246, .20) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass { background: var(--surface); }
}

.glass-hover { transition: transform .25s ease, background .25s ease, box-shadow .25s ease; }
/* Real hover only: on a touchscreen a finger resting on a card to start a scroll counts as :hover, and the card
   would lift 3 px under it — the page visibly "jumps" as the scroll begins. */
@media (hover: hover) {
    .glass-hover:hover {
        background: var(--sc-glass-hi);
        transform: translateY(-3px);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 24px 60px rgba(0, 0, 0, .42), 0 0 0 1px rgba(59, 130, 246, .18);
    }
}

/* accent variant: a blue wash behind the card (pricing highlight, final CTA) */
.glass-accent {
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(59, 130, 246, .20), transparent 60%),
        var(--sc-glass);
}

/* scroll reveal — visible by default; where scroll-driven animations exist an element fades up as it enters */
@keyframes sc-reveal {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
        html:not(.no-reveal) .reveal {
            animation: sc-reveal linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 38%;
        }
        html:not(.no-reveal) .reveal-d1 { animation-range: entry 6% entry 44%; }
        html:not(.no-reveal) .reveal-d2 { animation-range: entry 12% entry 50%; }
    }
}

/* Touch devices: backdrop-filter on every card is the single most expensive thing to scroll past on a phone GPU.
   Over the near-black page the blur is invisible anyway (the fill is 3.5% white), so drop it and trim the shadow. */
@media (hover: none), (pointer: coarse), (max-width: 900px) {
    .glass {
        -webkit-backdrop-filter: none;
                backdrop-filter: none;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 22px rgba(0, 0, 0, .28);
    }
}

@media (max-width: 640px) {
    .sc-wrap { padding-left: 16px; padding-right: 16px; }
    .sc-head { text-align: left; }
    .sc-eyebrow::after { display: none; }
}

/* ════ FORMS v2 — one look for every input in the portal ════
   Used raw (class="input" on an <input>/<InputText>/<select>) or through Shared/Components/FormField.razor, which adds
   the label, hint and error wiring. Focus is a clear 3 px ring (no glow), invalid is carried by border + text. */

.input {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    background: var(--input-bg);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    color: var(--text);
    font: inherit; font-size: 15px; line-height: 1.4;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #5a5a64; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, .25); }
.input[aria-invalid="true"], .input.invalid { border-color: var(--red); }
.input[aria-invalid="true"]:focus, .input.invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, .25); }
.input:disabled { opacity: .55; cursor: not-allowed; }
textarea.input { min-height: 110px; resize: vertical; }

/* input + trailing button (show / hide password, copy…) */
.input-wrap { position: relative; }
.input-wrap > .input { padding-right: 78px; }
.input-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    padding: 6px 10px;
    border: 0; border-radius: var(--r-sm);
    background: transparent;
    color: var(--muted);
    font: inherit; font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    transition: color .15s, background .15s;
}
.input-toggle:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.input-toggle[hidden] { display: none; }

/* checkbox / radio row */
.check {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 14px; line-height: 1.5; color: var(--muted);
    cursor: pointer;
}
.check input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    flex-shrink: 0;
    width: 20px; height: 20px; margin: 1px 0 0;
    display: grid; place-content: center;
    background: var(--input-bg);
    border: 1px solid var(--line-2);
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.check input[type="checkbox"]::before {
    content: '';
    width: 10px; height: 10px;
    background: #fff;
    clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 22%, 84% 8%, 40% 66%);
    transform: scale(0); transition: transform .12s;
}
.check input[type="checkbox"]:checked { background: var(--accent-strong); border-color: var(--accent-strong); }
.check input[type="checkbox"]:checked::before { transform: scale(1); }
.check input[type="checkbox"]:hover { border-color: #5a5a64; }
.check input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px rgba(59, 130, 246, .25); outline: none; border-color: var(--accent); }
.check a { color: var(--accent-2); }

/* ════ SHOWCASE REGIONS — full-bleed sections, blueprint grid, legend, screenshot lightbox ════
   (was showcase.css, loaded on Home only; promoted so every page can build with the same sections) */

/* ════ LAYOUT ════ */

/* `overflow: clip` (not hidden) on purpose: a hidden/auto ancestor becomes the scroll container that
   scroll-driven reveals bind to, and a container that never scrolls would leave them invisible. */
.sc-section {
    position: relative;
    padding: clamp(72px, 9vw, 132px) 0;
    overflow: clip;
}

.sc-section-alt { background: var(--bg); }

/* hairline divider between showcase regions */
.sc-section + .sc-section::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-2) 20%, var(--line-2) 80%, transparent);
}

/* very low-contrast blueprint grid, faded out toward the edges */
.sc-grid::after {
    content: '';
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 0%, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 0%, transparent 75%);
}

.sc-section > .sc-wrap { position: relative; z-index: 1; }

/* ════ STATUS BADGES / TAGS (shared with StatusBadge.razor) ════ */

.sc-legend {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--faint);
}

/* ════ LIGHTBOX (created by js/showcase.js) ════ */

.sc-lightbox {
    border: 0; padding: 0; margin: auto;
    background: transparent; color: var(--text);
    max-width: 96vw; max-height: 96vh;
    overflow: visible;
}
.sc-lightbox::backdrop {
    background: rgba(6, 6, 9, .84);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
}
.sc-lightbox-fig { margin: 0; text-align: center; }
.sc-lightbox-img {
    display: block; margin: 0 auto;
    max-width: 94vw; max-height: 82vh;
    border-radius: 10px;
    border: 1px solid var(--sc-edge);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
}
.sc-lightbox-cap {
    margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--muted);
}
.sc-lightbox-x {
    position: fixed; top: 16px; right: 16px;
    width: 44px; height: 44px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(28, 28, 28, .9); color: var(--text);
    border: 1px solid var(--line-2); border-radius: 50%;
    font-size: 18px; line-height: 1; cursor: pointer;
}
.sc-lightbox-x:hover { border-color: #666; background: var(--raised); }

/* ════ MISC ════ */

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .3; }
}

.live-dot {
    width: 6px; height: 6px; background: var(--green); border-radius: 50%;
    display: inline-block; animation: pulse 2s ease-in-out infinite;
}

.hide-mobile { display: block; }
.hide-desktop { display: none; }

@media (max-width: 768px) {
    .hide-mobile { display: none; }
    .hide-desktop { display: block; }
}

/* ════ ADMIN — shared page header (used across /admin pages) ════ */

.adm-page-head {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.adm-h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.adm-sub { margin-top: 6px; font-size: 13px; color: var(--faint); }

/* stat tiles (inside a .hairline-grid) */
.adm-stat { padding: 18px 20px; }
.adm-stat-lbl {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
    color: var(--faint); margin-bottom: 9px;
}
.adm-stat-val { font-size: 22px; font-weight: 700; color: var(--text); display: flex; align-items: baseline; gap: 8px; }
.adm-stat-delta { font-size: 11px; font-weight: 600; color: #34d058; }
.adm-stat-accent { border-top: 2px solid var(--accent); margin-top: -1px; }
.adm-stat-accent .adm-stat-val { color: var(--accent-2); }

/* tab strip */
.adm-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.adm-tab {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; margin-bottom: -1px;
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--faint); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: color .12s;
}
.adm-tab:hover { color: var(--muted); }
.adm-tab-on { color: var(--text); border-bottom-color: var(--accent); }
.adm-tab-n { font-size: 9.5px; color: var(--faint); }
.adm-tab-on .adm-tab-n { color: var(--accent-2); }

/* data table */
.adm-table-wrap { border: 1px solid var(--line); border-radius: 2px; overflow-x: auto; background: var(--surface); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.adm-table th, .adm-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table thead th {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--faint); background: var(--depth);
    border-bottom: 1px solid var(--line-2);
}
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-table td { color: var(--text); }
.adm-table .adm-num { text-align: right; }

/* ════ ADMIN — icon action buttons (shared across all /admin tables) ════
   Uniform 28px squares so action columns stay tidy. Global (not scoped) on purpose: the icon SVG is
   injected via AdminIcons.Render (MarkupString) and carries no component scope, so a scoped
   `.adm-iconbtn svg` rule would never match it. */
.adm-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.adm-iconbtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; flex: 0 0 28px; padding: 0;
    border: 1px solid var(--line-2); border-radius: 4px;
    background: var(--input-bg); color: var(--faint);
    cursor: pointer; text-decoration: none;
    transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.adm-iconbtn:hover { color: var(--text); border-color: var(--line); }
.adm-iconbtn:disabled { opacity: .35; cursor: default; }
.adm-iconbtn svg { width: 14px; height: 14px; display: block; }
.adm-iconbtn-go:hover { color: #34d058; border-color: rgba(52, 208, 88, .45); }
.adm-iconbtn-danger:hover { color: #f87171; border-color: rgba(248, 113, 113, .45); }

/* ════ DOCS — rendered page content (shared across all /docs pages) ════ */

.docs-body {
    font-size: 15px; line-height: 1.8; color: var(--muted);
    margin-top: 20px; padding-top: 26px;
    border-top: 1px solid var(--line);
}
.docs-body > *:first-child { margin-top: 0; }
.docs-body p { margin: 0 0 16px; }
.docs-body strong { color: var(--text); font-weight: 600; }
.docs-body em { font-style: italic; }
.docs-body a { color: var(--accent-2); text-decoration: none; }
.docs-body a:hover { text-decoration: underline; }

.docs-body h2 {
    font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25;
    color: var(--text); margin: 44px 0 16px;
}
.docs-body h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--text); margin: 30px 0 10px; }
/* a jump to #anchor must land BELOW the fixed 56 px nav */
.docs-body h2, .docs-body h3 { scroll-margin-top: 84px; }
/* "#" link next to a heading, added by js/site.js on hover/focus (copy-link) */
.docs-anchor {
    margin-left: .45em; font-weight: 400; color: var(--faint); text-decoration: none !important;
    opacity: 0; transition: opacity .12s, color .12s;
}
.docs-body h2:hover .docs-anchor, .docs-body h3:hover .docs-anchor, .docs-anchor:focus-visible { opacity: 1; }
.docs-anchor:hover { color: var(--accent-2); }

.docs-body ul, .docs-body ol { margin: 0 0 16px; padding-left: 22px; }
.docs-body li > ul, .docs-body li > ol { margin: 9px 0 0; }
.docs-body li { margin-bottom: 9px; }
.docs-body li::marker { color: var(--faint); }

.docs-body code {
    font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
    padding: 1px 6px; color: var(--accent-2);
    overflow-wrap: anywhere;   /* a long identifier (e.g. an RPC name) must wrap on a phone, not widen the page */
}
.docs-body hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.docs-body pre {
    background: var(--depth); border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 16px 18px; margin: 0 0 18px; overflow-x: auto;
}
.docs-body pre code { background: none; border: none; padding: 0; color: var(--muted); }

/* tables — the wrap scrolls sideways on a phone instead of pushing the page wider than the screen */
.docs-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin: 4px 0 20px; }
.docs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.docs-table th, .docs-table td { text-align: left; padding: 11px 14px; border: 1px solid var(--line); vertical-align: top; }
.docs-table tr > :first-child { border-left: 0; } .docs-table tr > :last-child { border-right: 0; }
.docs-table thead tr:first-child > * { border-top: 0; } .docs-table tbody tr:last-child > * { border-bottom: 0; }
.docs-table thead th {
    font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--faint); background: var(--depth);
}
.docs-table td { color: var(--muted); }
.docs-table strong { color: var(--text); }

/* callouts (from blockquotes) */
.docs-callout {
    background: var(--surface); border: 1px solid var(--line);
    border-left: 3px solid var(--line-2); border-radius: var(--r-md);
    padding: 16px 20px; margin: 0 0 20px;
}
.docs-callout p { margin: 0; font-size: 14px; color: var(--muted); }
.docs-callout-title { font-size: 10px; letter-spacing: .1em; color: var(--muted); margin-bottom: 7px; }
.docs-callout-star { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.docs-callout-star .docs-callout-title { color: var(--accent-2); }
.docs-callout-tip { border-left-color: var(--amber); background: color-mix(in srgb, var(--amber) 6%, var(--surface)); }
.docs-callout-tip .docs-callout-title { color: var(--amber); }
.docs-callout-warn { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 7%, var(--surface)); }
.docs-callout-warn .docs-callout-title { color: #f87171; }
.docs-callout-new { border-left-color: var(--green); background: color-mix(in srgb, var(--green) 6%, var(--surface)); }
.docs-callout-new .docs-callout-title { color: var(--green); }

/* image placeholder (fill in later) */
.docs-fig {
    margin: 0 0 20px;
    background: var(--depth); border: 1px dashed #2e2e2e; border-radius: var(--r-md);
    padding: 24px; text-align: center;
}
.docs-fig-tag { font-size: 9px; letter-spacing: .14em; color: var(--accent-2); margin-bottom: 9px; }
.docs-fig-desc { font-size: 12px; color: var(--muted); line-height: 1.6; max-width: 460px; margin: 0 auto 9px; }
.docs-fig-path { font-size: 10px; color: #4a4a4a; }

/* inline SVG diagram (signal flow, channel chain, bus chain…) */
.docs-svg {
    margin: 0 0 22px;
    padding: 22px 20px;
    background: var(--depth);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow-x: auto;
}
.docs-svg svg { display: block; width: 100%; height: auto; min-width: 640px; }
.docs-svg figcaption {
    margin-top: 12px; font-size: 11px; color: var(--faint);
    text-align: center; line-height: 1.55;
}

/* real image figure */
.docs-figure { margin: 0 0 22px; }
.docs-figure img {
    display: block; width: 100%; height: auto;
    border: 1px solid var(--line); border-radius: var(--r-md);
    background: var(--depth);
}
.docs-figure figcaption {
    margin-top: 9px; font-size: 11px; color: var(--faint);
    text-align: center; line-height: 1.55;
}

/* collapsible block inside a guide body (/guides — e.g. "Exact values, to set it up by hand").
   Global because guide bodies are separate content components, outside the page's CSS scope. */
.guide-details {
    background: var(--surface); border: 1px solid var(--line); border-radius: 2px;
    margin: 0 0 22px;
}
.guide-details > summary {
    cursor: pointer; padding: 13px 18px;
    font-size: 13.5px; font-weight: 600; color: var(--text);
}
.guide-details > summary:hover { color: var(--accent-2); }
.guide-details[open] > summary { border-bottom: 1px solid var(--line); }
.guide-details > :not(summary) { margin-left: 18px; margin-right: 18px; }
.guide-details > h3:first-of-type { margin-top: 18px; }
.guide-details > :last-child { margin-bottom: 18px; }

/* "::: premium" callout — amber like the 🔒 Premium badge */
.docs-callout-premium { border-left-color: var(--amber); }
.docs-callout-premium .docs-callout-title { color: var(--amber); }

/* "::: youtube" block — responsive 16:9 privacy-enhanced embed */
.guide-video { margin: 0 0 22px; }
.guide-video-frame {
    position: relative; aspect-ratio: 16 / 9;
    background: var(--depth); border: 1px solid var(--line); border-radius: 2px; overflow: hidden;
}
.guide-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.guide-video figcaption {
    margin-top: 9px; font-size: 11px; color: var(--faint);
    text-align: center; line-height: 1.55;
}

/* ════ ERROR PAGES (404 / 500) — shared chrome ════ */

.errp {
    min-height: calc(100vh - 56px);
    display: flex; align-items: center;
    padding: 120px 0 96px;
}

.errp-box { width: 100%; text-align: center; }

.errp-eyebrow {
    font-size: 11px; font-weight: 500;
    letter-spacing: .18em;
    color: var(--accent-2);
    margin-bottom: 14px;
}
.errp-eyebrow-warn { color: var(--amber); }

/* big code as a faded gradient watermark — the eyebrow carries the real label */
.errp-code {
    font-size: clamp(96px, 20vw, 200px);
    font-weight: 800; line-height: .9;
    letter-spacing: -.05em;
    background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .02));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    user-select: none;
    margin-bottom: 6px;
}
.errp-500 .errp-code { background-image: linear-gradient(180deg, rgba(245, 158, 11, .32), rgba(245, 158, 11, .03)); }

.errp-title {
    font-size: clamp(30px, 4.6vw, 52px);
    font-weight: 700; line-height: 1.06; letter-spacing: -.035em;
    color: var(--text);
    margin-bottom: 16px;
}

.errp-desc {
    max-width: 52ch; margin: 0 auto;
    font-size: var(--fs-lead); line-height: 1.7;
    color: var(--muted);
}

.errp-wave {
    width: 100%; max-width: 440px; height: 40px;
    display: block; margin: 32px auto;
    opacity: .7;
}

.errp-ctas {
    display: flex; gap: 10px;
    justify-content: center; flex-wrap: wrap;
}

.errp-rid {
    margin-top: 24px;
    font-size: 12px; color: var(--faint);
}
.errp-rid code { color: var(--muted); }

.errp-links { margin-top: 56px; }

.errp-links-label {
    font-size: 11px; letter-spacing: .16em;
    color: var(--faint); margin-bottom: 16px;
}

.errp-link-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
    max-width: 860px; margin: 0 auto;
}

.errp-link {
    display: flex; flex-direction: column; gap: 4px;
    padding: 18px 20px; text-align: left;
    text-decoration: none;
}
.errp-link-name { font-size: 15px; font-weight: 600; color: var(--text); }
.errp-link-sub  { font-size: 11.5px; color: var(--faint); }

@media (max-width: 760px) {
    .errp-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .errp { padding: 96px 0 64px; }
}
