/* Self-hosted, not fonts.googleapis.com.
 *
 * The Google link was render-blocking on all three pages, which made a third
 * party a single point of failure for painting anything — and it disclosed every
 * visitor's IP and user agent to Google before the first pixel, on a site whose
 * privacy page says there are no third-party trackers on it. It could not be
 * made non-blocking either: the CSP sets `script-src 'self'` with no
 * unsafe-inline, so the usual `onload="this.rel='stylesheet'"` trick is an
 * inline script and would be refused, silently dropping the sheet entirely.
 *
 * One file covers both weights: Google serves Fira Code as a VARIABLE font, so
 * the 400 and 600 faces in its CSS pointed at the same woff2. `font-weight`
 * below is the supported range, which is what lets one 36 KB latin subset do
 * the work of two static faces.
 *
 * SIL OFL 1.1 — assets/fonts/OFL.txt ships beside it, as the licence requires.
 */
@font-face {
    font-family: 'Fira Code';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('/assets/fonts/fira-code-latin.woff2') format('woff2');
    /* Latin subset only, matching what Google served. Everything on the site is
       Latin; a glyph outside this range falls through to the stack in
       --font-mono rather than downloading anything. */
    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;
}

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

:root {
    /* The default theme (Matrix) is dark, and native surfaces have to be told: the
       scrollbars, the <select> popup, the caret and the overscroll gutter are
       painted by the browser, not by these tokens. applyPageTheme overwrites
       this per theme (page-theme.js), and theme-boot replays it pre-paint.
       Not a `--token`: this is a real property, and the parity test walks the
       derived custom properties only. */
    color-scheme: dark;
    /* Semantic theme tokens — set at runtime by lib/page-theme.js (and pre-paint by
       lib/theme-boot.js). Defaults below are the default theme's derived tokens
       (tests/node/theme-default-parity.test.mjs). */
    --bg: #02150a;
    --surface: #031e0e;
    --surface-2: #173d26;
    --surface-3: #284b37;
    --code-bg: #03170b;
    --code-text: #e2e8f0;
    --text: #e5eaea;
    --text-strong: #f8fafc;
    --text-muted: #a7b7bc;
    --text-faint: #a9b6be;
    --text-on-accent: #0f172a;
    --text-on-accent-strong: #0f172a;
    --text-on-danger: #0f172a;
    --accent: #22c55e;
    --accent-strong: #59d486;
    --accent-2: #86efac;
    --accent-soft: #083519;
    --border: #2d4f3b;
    --border-strong: #4b6957;
    --success: #4ade80;
    --success-soft: #083519;
    --warning: #fbbf24;
    --warning-soft: #2e2e0a;
    --danger: #f87171;
    --danger-soft: #2d1d14;

    /* The -text companions: contrast-REPAIRED versions of the seed and status
       colours above, for every place a stylesheet wants accent- or
       status-coloured WORDS. The raw tokens are fills (backgrounds, borders,
       gradients); these clear WCAG AA 4.5 against every sanctioned content
       surface. Derived per theme by lib/theme-derive.js; the defaults below are
       the same repair math run over this file's literal light palette. The
       token-usage spec fails any `color:` that reaches for the raw token. */
    --accent-text: #38cb6e;
    --accent-2-text: #86efac;
    --success-text: #4ade80;
    --warning-text: #fbbf24;
    --danger-text: #fa9595;

    /* Threat-catalog priority ramp, lemon -> orange -> blood red. Real hexes
       rather than aliases onto the status ramp like --featured below: five tiers
       need five hues and the status set only has two. Overwritten at runtime by
       lib/page-theme.js; these are the light-mode defaults. */
    --priority-key-fg: #fef3c7;
    --priority-key-bg: #262a09;
    --priority-watch-fg: #fde047;
    --priority-watch-bg: #2c310a;
    --priority-notable-fg: #fbbf24;
    --priority-notable-bg: #2e2e0a;
    --priority-elevated-fg: #fb923c;
    --priority-elevated-bg: #2e260c;
    --priority-severe-fg: #f87171;
    --priority-severe-bg: #2d1d14;
    --priority-critical-fg: #fecaca;
    --priority-critical-bg: #29180f;

    /* Language colorways for the docs endpoint modal. An identity hue per
       language, mixed into the theme's own surface for the fill and repaired
       against that fill for the ink — so JS still reads gold and Python still
       reads blue, but the pair follows the theme instead of pinning the modal
       to a light palette. Derived by lib/theme-derive.js (COLORWAY_HUES); the
       literals below are that derivation run over the default seed. The -bg and
       -border halves are FILLS: the token-usage spec fails any `color:` that
       reaches for them instead of the -text half. */
    --colorway-js-bg: #252c0d;
    --colorway-js-bg-2: #3b350c;
    --colorway-js-text: #df8b2b;
    --colorway-js-border: #5d430b;
    --colorway-php-bg: #1a2131;
    --colorway-php-bg-2: #282347;
    --colorway-php-text: #b370f0;
    --colorway-php-border: #3f276a;
    --colorway-python-bg: #082931;
    --colorway-python-bg-2: #0c3047;
    --colorway-python-text: #6692f1;
    --colorway-python-border: #113b6b;
    --colorway-serverless-bg: #28270e;
    --colorway-serverless-bg-2: #3f2d0d;
    --colorway-serverless-text: #ee793d;
    --colorway-serverless-border: #64360d;
    --colorway-java-bg: #132c22;
    --colorway-java-bg-2: #1c342f;
    --colorway-java-text: #939eae;
    --colorway-java-border: #2c4243;
    --colorway-aspnet-bg: #0f2430;
    --colorway-aspnet-bg-2: #172846;
    --colorway-aspnet-text: #8d87ee;
    --colorway-aspnet-border: #232f68;
    --colorway-other-bg: #063318;
    --colorway-other-bg-2: #08411e;
    --colorway-other-text: #45b56e;
    --colorway-other-border: #0b5627;

    /* Featured / gold. Aliased onto the warning ramp: it is the only mode-aware
       gold in the set (amber on light themes, a lighter amber on dark) and is
       already contrast-audited for every registry theme. These resolve against
       the inline --warning that lib/page-theme.js writes onto <html>. */
    --featured: var(--warning);
    --featured-soft: var(--warning-soft);
    --featured-text: var(--warning-text);
    --featured-glow: color-mix(in srgb, var(--warning) 38%, transparent);

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    --font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

html {
    scroll-behavior: smooth;
    /* Reserve the scrollbar track at all times. Both site modals lock scrolling
       by setting `overflow: hidden` on <body> (main.js) with no width
       compensation — unlike lib/scroll-lock.js, which measures the gap and pads
       for it. On any platform with classic (space-taking) scrollbars, opening a
       threat or docs modal therefore widened the viewport by the scrollbar's
       width and shifted the whole page sideways underneath the reader. A stable
       gutter costs the same strip on every platform and makes the lock inert. */
    scrollbar-gutter: stable;
    /* iPhone Safari enlarges some text when the phone turns sideways unless
       told not to; the demos, brief and plan already say so. 100%, never none:
       the reader's own text zoom keeps working. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Focus indicator of last resort.
 *
 * This file had no focus rule at all, which meant every `outline: none` written
 * elsewhere was unconditional and total — ten of them, each in a rule that also
 * matched :hover, so keyboard focus was byte-identical to a mouse passing over
 * the control. Those ten are fixed at their source; this is the net underneath,
 * so the next one cannot make a control unreachable-by-eye.
 *
 * It only paints where nothing more specific has an opinion: a single type or
 * class selector outranks `:focus-visible` alone, so every control with its own
 * ring keeps it. :focus-visible, not :focus, so a mouse click never draws it.
 *
 * Deliberately BELOW the :root block above, and written without a :root prefix.
 * tests/node/theme-default-parity.test.mjs harvests the default theme's tokens
 * by slicing from the FIRST literal ':root' to the next '}' — a rule carrying
 * that string above the token block would swallow the slice and report every
 * derived token as missing. */
:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 3px;
}

/* Reduce motion: the scroll half.
 *
 * The widget honours this setting throughout and a few page stylesheets do
 * too, but the global smooth scroll above did not — so a reader who asked
 * their OS to stop animating things still had every in-page jump animated.
 * lib/motion.js is the matching half for JS-driven scrolls; it resolves to
 * 'auto', which defers to this rule rather than fighting it.
 *
 * Deliberately scoped to scrolling rather than a blanket `* { animation: none }`:
 * this site uses animation for progress as well as decoration (the demo's skip
 * spinner), and freezing a spinner misreports the state it exists to report.
 * The decorative animations are neutralised next to their own rules instead. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-family);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
}

/* Held by lib/layout-boot.js (Safari only) until the landing page has arrived. */
html[data-anchor-hold],
html[data-anchor-hold] body {
    overflow-anchor: none;
}

.landing-scale-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 2500px) {
    body {
        zoom: 1.15;
    }
}

@media (min-width: 3200px) {
    body {
        zoom: 1.3;
    }
}

@media (min-width: 4200px) {
    body {
        zoom: 1.5;
    }
}

@media (min-width: 5400px) {
    body {
        zoom: 1.75;
    }
}

@media (min-width: 6800px) {
    body {
        zoom: 2;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

/* Increase contrast (macOS / iOS "prefers-contrast: more"): secondary ink becomes the
   body ink. Measured over every theme, --text-faint sits at 5.6-6.2:1 everywhere
   and --text-muted is under 7:1 on 24 of them, while --text is 9:1 or better on
   every one. The theme writes these tokens inline on :root (lib/page-theme.js), so
   !important is what lets the reader's setting win over the theme. */
@media (prefers-contrast: more) {
    :root {
        --text-muted: var(--text) !important;
        --text-faint: var(--text) !important;
    }
}

/* "(opens in a new tab)" inside a target=_blank link: said by a screen reader,
   not drawn. A sighted reader sees the tab open; a listener was not told. */
.opens-new-tab {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}


/* ---- The widget mounts' loading placeholder ----
 *
 * The header and footer logos are live widgets, mounted behind a fetch and a
 * dynamic import, so their slots sit empty above the fold for as long as that
 * takes. The copy-paste snippet solves this with a static PA key inside the mount
 * div (lib/release-snippet.js), and index.html pastes the same SVG into both
 * logo slots -- markup that arrives with the document is the only thing that
 * can paint before the widget module exists.
 *
 * The ART is shared with the snippet and drift-guarded against it. The PAINT is
 * not, and deliberately: the snippet ships its own <style> with colour literals
 * because it lands on a stranger's page where there is no theme and no token to
 * read, while here the same four --pa-ph-* hooks it declares are pointed at
 * this site's tokens, so the key wears the active theme like everything else.
 * A host reading the snippet can do exactly what this block does.
 *
 * Nothing removes these: createShadowRoot() empties the mount element as the
 * first statement of mount(), so the placeholder goes when the widget paints.
 *
 * All three mounts carry it, and they size it two different ways. The logo slots
 * have a definite height, so the art takes 100% of the box and follows it if the
 * slot ever changes. The Widget tab's mount is full-width with only a
 * min-height, where a percentage resolves to auto -- it names the trigger's own
 * length instead, beside the reservation it already matches
 * (landing-tabs.css). */
.pa-ph {
    /* Sized by the SLOT, not by a repeated number: both mounts carry a definite
       height, so 100% follows navigation.css/footer.css if either changes. The
       snippet's own copy falls back to the trigger's full 8rem instead. */
    width: var(--pa-ph-size, 100%);
    height: var(--pa-ph-size, 100%);
    display: block;
    /* The trigger this becomes is centred by the widget's own
       .pa-widget-trigger-wrap (flex, align-items:center). In a slot exactly the
       widget's size -- the two logo mounts -- this changes nothing; in the
       Widget tab's full-width mount it is the difference between the key
       sitting where the button will be and the button jumping to the middle. */
    margin-inline: auto;
}

/* The disc is the trigger's own face, so the slot already shows the shape and
   the colour the button will land in. It does NOT turn: it is the fixed frame
   the key turns inside, and without it the rotation below reads as a squash. */
.pa-ph-face {
    fill: var(--pa-ph-face, var(--accent));
    stroke: var(--pa-ph-edge, var(--accent-strong));
}

/* On-accent, not accent: these sit ON the disc above, and --text-on-accent is
   the token that is guaranteed legible there on every theme. */
.pa-ph-key {
    stroke: var(--pa-ph-key, var(--text-on-accent));
}

.pa-ph-mark {
    fill: var(--pa-ph-mark, var(--text-on-accent));
}

/* The key and its mark, and nothing else. transform-box is load-bearing: an SVG
   child transforms about the viewBox origin by default, which swings the key out
   of the disc instead of turning it in place. */
.pa-ph-spin {
    transform-box: fill-box;
    transform-origin: center;
    animation: pa-ph-spin 0.21s linear infinite;
}

/* The turning key is drawn smaller than the key at rest, on both shapes: it
   reads as a loading mark, and growing to full size as the turn ends is what
   makes the hand-off to the static key feel like arriving rather than switching.
   The live trigger turns its key at 0.7 of its resting size on both shapes
   (--pa-widget-key-spin-scale in lib/widget-styles/base.js), and the placeholder's
   key has to be the same size in pixels at the swap or it pops. The shield art
   draws its key at the size it ends up (56% of the box), so 0.7 is that
   directly. The round art draws a slightly larger key than the live one (about
   100px against 91px in an 8rem box), so its factor is 0.63, which makes the
   turning key the same width the live one turns at. Both are fractions of the
   shape, so the key stays proportional to it at every --pa-ph-size. */
.pa-ph:not(.pa-ph--shield) .pa-ph-spin {
    scale: 0.63;
}

.pa-ph--shield .pa-ph-spin {
    scale: 0.7;
}

/* Scripts off, so no widget will ever arrive: the turning key said "loading"
   forever. It rests at full size instead, the mark rather than a spinner. The
   readers of a privacy-first service are the ones most likely to browse with
   scripts off (Tor Browser's Safest level). Same selectors as the two rules
   above, so this wins on order. */
@media (scripting: none) {
    .pa-ph:not(.pa-ph--shield) .pa-ph-spin,
    .pa-ph--shield .pa-ph-spin {
        animation: none;
        scale: 1;
    }
}

/* Reading pages mount their logo widgets on first use (assets/site-widgets.js,
   html[data-widgets="on-use"]): until then the placeholder is the mark at rest
   and a button, and it turns only while the widget loads ("loading"). */
html[data-widgets="on-use"] .pa-ph:not(.pa-ph--shield) .pa-ph-spin,
html[data-widgets="on-use"] .pa-ph--shield .pa-ph-spin {
    animation: none;
    scale: 1;
}

html[data-widgets="on-use"] [role="button"]:is(.navbar-widget-mount, .footer-widget-mount) {
    cursor: pointer;
    border-radius: 50%;
}

html[data-widgets="on-use"] [role="button"]:is(.navbar-widget-mount, .footer-widget-mount):focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 3px;
}

/* The Widget tab's placeholder when the reader's pick is Shield
   (lib/trigger-boot.js swaps it in from <template id="landing-widget-ph-shield">
   before first paint). Same art as the widget's shield trigger, painted from this
   page's theme: the two tokens the live trigger mixes its shades from are the
   page's own accent and accent-2, so a theme change recolours it the way it
   recolours the trigger.

   The rules below are GENERATED, not hand-written, and must not be edited by
   hand: they are shieldThemeCss('.pa-ph--shield') in lib/widget-shield-trigger.js,
   the same table the widget's own stylesheet is built from, and
   site-loading-placeholder.spec.mjs fails if this block drifts from it. */
.pa-ph--shield {
    --pa-widget-shield-accent: var(--accent);
    --pa-widget-shield-accent2: var(--accent-2);
}

/* The art carries the signed-in (frozen) layer too, because the live trigger
   needs it; a loading preview is never signed in. */
.pa-ph--shield .pa-sh-ice {
    opacity: 0;
}

    .pa-ph--shield .pa-sh-face-0 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 38%, #000); }
    .pa-ph--shield .pa-sh-face-1 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 22%, #000); }
    .pa-ph--shield .pa-sh-face-2 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 12%, #000); }
    .pa-ph--shield .pa-sh-face-3 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 7%, #000); }
    .pa-ph--shield .pa-sh-face-4 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 3%, #000); }
    .pa-ph--shield .pa-sh-face { stroke:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 24%, #000); }
    .pa-ph--shield .pa-sh-rim-0 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 35%, #fff); }
    .pa-ph--shield .pa-sh-rim-1 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 75%, #fff); }
    .pa-ph--shield .pa-sh-rim-2 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 45%, #000); }
    .pa-ph--shield .pa-sh-rim-3 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 65%, #000); }
    .pa-ph--shield .pa-sh-rim-4 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 30%, #000); }
    .pa-ph--shield .pa-sh-line { stroke:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 70%, transparent); }
    .pa-ph--shield .pa-sh-bevel { stroke:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 40%, #fff); }
    .pa-ph--shield .pa-sh-ice-0 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 12%, #fff); }
    .pa-ph--shield .pa-sh-ice-1 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 28%, #8fb0c2); }
    .pa-ph--shield .pa-sh-ice-2 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 22%, #34505f); }
    .pa-ph--shield .pa-sh-ice-3 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 18%, #c4e3ec); }
    .pa-ph--shield .pa-sh-ice-4 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 18%, #4a6676); }
    .pa-ph--shield .pa-sh-ice { stroke:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 20%, #91b7c7); }
    .pa-ph--shield .pa-sh-ice-rim-0 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 8%, #fff); }
    .pa-ph--shield .pa-sh-ice-rim-1 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 16%, #cfeff8); }
    .pa-ph--shield .pa-sh-ice-rim-2 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 26%, #6f93a4); }
    .pa-ph--shield .pa-sh-ice-rim-3 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 10%, #e6fbff); }
    .pa-ph--shield .pa-sh-key-0 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 35%, #fff); }
    .pa-ph--shield .pa-sh-key-1 { stop-color:var(--pa-widget-shield-accent2, #86efac); }
    .pa-ph--shield .pa-sh-key-2 { stop-color:var(--pa-widget-shield-accent, #22c55e); }
    .pa-ph--shield .pa-sh-key-3 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 55%, #000); }
    .pa-ph--shield .pa-sh-key-edge { stroke:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 28%, #000); }
    .pa-ph--shield .pa-sh-key-disc { fill:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 14%, #000);stroke:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 45%, #fff); }
    .pa-ph--shield .pa-sh-key-ink { fill:color-mix(in srgb, var(--pa-widget-shield-accent2, #86efac) 30%, #fff); }

/* The saved White base on the placeholder (lib/trigger-boot.js sets data-base on
   the svg before first paint). Black needs no rules: the shield is already the
   dark face. GENERATED like the block above, from shieldBaseCss('.pa-ph--shield'),
   and pinned by site-loading-placeholder.spec.mjs; do not edit by hand. */
    .pa-ph--shield[data-base="white"] .pa-sh-face-0 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 20%, #fff); }
    .pa-ph--shield[data-base="white"] .pa-sh-face-1 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 14%, #fff); }
    .pa-ph--shield[data-base="white"] .pa-sh-face-2 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 9%, #fff); }
    .pa-ph--shield[data-base="white"] .pa-sh-face-3 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 6%, #fff); }
    .pa-ph--shield[data-base="white"] .pa-sh-face-4 { stop-color:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 3%, #fff); }
    .pa-ph--shield[data-base="white"] .pa-sh-face { stroke:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 40%, #fff); }
    .pa-ph--shield[data-base="white"] .pa-sh-line { stroke:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 55%, transparent); }
    .pa-ph--shield[data-base="white"] .pa-sh-bevel { stroke:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 30%, #fff); }
    .pa-ph--shield[data-base="white"] .pa-sh-key-disc { fill:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 9%, #fff);stroke:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 45%, #fff); }
    .pa-ph--shield[data-base="white"] .pa-sh-key-ink { fill:color-mix(in srgb, var(--pa-widget-shield-accent, #22c55e) 75%, #000); }
    .pa-ph--shield[data-base="white"] path[fill="url(#pa-sh-vignette)"] { opacity: 0.18; }

/* The ROUND placeholder's base: the key and its letters, as the live trigger's
   data-base rules do (lib/widget-styles/base.js), with the same thin opposite-tone
   halo so a white key stays legible on a pale theme. Unset follows the theme. */
.pa-ph:not(.pa-ph--shield)[data-base="white"] {
    --pa-ph-key: #ffffff;
    --pa-ph-mark: #ffffff;
}

.pa-ph:not(.pa-ph--shield)[data-base="black"] {
    --pa-ph-key: #0f172a;
    --pa-ph-mark: #0f172a;
}

.pa-ph:not(.pa-ph--shield)[data-base="white"] .pa-ph-spin {
    filter: drop-shadow(0 0 0.05em rgba(15, 23, 42, 0.55));
}

.pa-ph:not(.pa-ph--shield)[data-base="black"] .pa-ph-spin {
    filter: drop-shadow(0 0 0.05em rgba(255, 255, 255, 0.55));
}

/* rotateY, not rotate. The art is a preview of a control rather than a spinner,
   and turning it in depth says "arriving" where a flat spin says "working".

   720px, not a tighter lens: perspective magnifies the near half of whatever
   turns, by P / (P - half-width). At 240px a ~110-wide key swelled ~30% as it
   went edge-on and looked like it was ballooning; at 720px the swell is ~8% and
   the foreshortening still carries the depth. The same figure is in the
   snippet's own style block (lib/release-snippet.js) and the live trigger's
   --pa-widget-key-spin-p (lib/widget-styles/base.js), and they move together. */
@keyframes pa-ph-spin {
    from { transform: perspective(720px) rotateY(0deg); }
    to { transform: perspective(720px) rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .pa-ph-spin {
        animation: none;
    }
}

/* Paper is white whatever theme is saved. Browsers drop background colours in
   print, so a dark theme's light ink printed as nothing (the threat matrix, the
   threat modal, the tab labels), and white-on-colour labels lost their colour
   in every theme. page-theme.js writes the theme inline on <html>; an
   !important here outranks that, in print only. Keywords and color-mix, no
   literals: the theme's own hues, darkened toward ink. */
@media print {
    :root {
        color-scheme: light !important;
        --text: CanvasText !important;
        --text-strong: CanvasText !important;
        --text-muted: color-mix(in srgb, CanvasText 75%, Canvas) !important;
        --text-faint: color-mix(in srgb, CanvasText 68%, Canvas) !important;
        --text-on-accent: CanvasText !important;
        --accent-text: color-mix(in srgb, var(--accent) 45%, CanvasText) !important;
        --accent-2-text: color-mix(in srgb, var(--accent-2) 45%, CanvasText) !important;
        --success-text: color-mix(in srgb, var(--success) 45%, CanvasText) !important;
        --warning-text: color-mix(in srgb, var(--warning) 45%, CanvasText) !important;
        --danger-text: color-mix(in srgb, var(--danger) 45%, CanvasText) !important;
        /* And the surfaces, for a reader who prints WITH background graphics:
           otherwise that ink lands on the dark theme's own fills. Code blocks
           were light-on-dark in every theme, so their text vanished too. */
        --bg: Canvas !important;
        --surface: Canvas !important;
        --surface-2: color-mix(in srgb, CanvasText 4%, Canvas) !important;
        --surface-3: color-mix(in srgb, CanvasText 8%, Canvas) !important;
        --code-bg: color-mix(in srgb, CanvasText 6%, Canvas) !important;
        --code-text: CanvasText !important;
        --border: color-mix(in srgb, CanvasText 22%, Canvas) !important;
        --border-strong: color-mix(in srgb, CanvasText 38%, Canvas) !important;
    }

    /* A label whose meaning IS its fill (a verdict, the demo's start chip) keeps
       the fill on paper; its text is then ink on that colour. */
    .threat-verdict-label,
    .embedded-threat-demo-start-label,
    .worst-sum strong {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
