/* Self-hosted fonts (SIL OFL, licences in /fonts). No request ever goes to Google. Latin subset, variable weights. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/manrope-latin.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: 400 500; font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.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; }

/* Secrabbit site overrides, loaded after the kit (assets/) so the kit stays untouched. */

/* Rabbit brand mark: the alpha mask takes the colour of the surrounding text, so it follows light/dark themes. */
.mark--rabbit {
  display: inline-block;
  width: 1.15em;
  height: 1.5em;
  vertical-align: -0.3em;
  margin-inline-end: 0.5em;
  background: currentColor;
  -webkit-mask: url("brand/rabbit-mask.png") center / contain no-repeat;
  mask: url("brand/rabbit-mask.png") center / contain no-repeat;
}

/* ---- Theme: dark is the default; light follows the OS or the nav toggle (data-theme set by site.js) ---- */
:root { color-scheme: dark light; }
:root[data-theme="light"] {
  color-scheme: light;
  --p-bg: #f6f8fb; --p-surface: #ffffff; --p-ink: #0a0d14; --p-muted: #4b5668;
  --p-accent: #0b64a8; --p-accent-ink: #ffffff; --p-action: #0b64a8; --p-action-ink: #ffffff;
  --p-inv-bg: #0a0d14; --p-inv-surface: #131824; --p-inv-ink: #e9edf3; --p-inv-muted: #a6afbe;
  --p-inv-accent: #5ab9fc; --p-inv-accent-ink: #0a0d14; --p-inv-action: #5ab9fc; --p-inv-action-ink: #0a0d14;
}
:root[data-theme="light"] .hero__lead { color: var(--p-muted); }
:root[data-theme="light"] .hero__fact { color: var(--p-muted); }

@media (prefers-color-scheme: light) {
  html:not(.theme-js) :root[data-theme="light"] {
    color-scheme: light;
    --p-bg: #f6f8fb; --p-surface: #ffffff; --p-ink: #0a0d14; --p-muted: #4b5668;
    --p-accent: #0b64a8; --p-accent-ink: #ffffff; --p-action: #0b64a8; --p-action-ink: #ffffff;
    --p-inv-bg: #0a0d14; --p-inv-surface: #131824; --p-inv-ink: #e9edf3; --p-inv-muted: #a6afbe;
    --p-inv-accent: #5ab9fc; --p-inv-accent-ink: #0a0d14; --p-inv-action: #5ab9fc; --p-inv-action-ink: #0a0d14;
  }
}

/* Theme toggle button in the nav */
.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  color: var(--p-ink); background: transparent; border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: var(--r-md, 8px); cursor: pointer;
}
.theme-toggle:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.theme-toggle:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }

/* Product mock windows stay dark in both themes: their fixed light text needs a dark surface. */
:root[data-theme="light"] :is(.console, .dash, .hero__window) {
  --p-surface: #131824; --p-ink: #e9edf3; --p-muted: #8891a1;
  border-color: rgb(255 255 255 / .08);
}

/* ---- Accessibility ---- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--p-accent); outline-offset: 3px; border-radius: 4px;
}
.ground-inverse :focus-visible { outline-color: var(--p-inv-accent); }
.console__q small { color: #b7bfcc; }               /* severity tags: 3.4:1 -> AAA on the dark window */

/* ---- Hero ripple: expanding water rings under the pointer (replaces the kit's liquid-type wiggle) ---- */
.hero { position: relative; }
.ripple-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.ripple {
  position: absolute; width: 0; height: 0; border-radius: 50%; translate: -50% -50%;
  border: 1.5px solid color-mix(in srgb, var(--p-accent) 70%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--p-accent) 28%, transparent), inset 0 0 24px color-mix(in srgb, var(--p-accent) 14%, transparent);
  animation: ripple-out var(--rp-dur, 1600ms) cubic-bezier(.2, .6, .3, 1) forwards;
}
.ripple--2 { animation-delay: 140ms; opacity: 0; animation-fill-mode: both; }
.ripple--3 { animation-delay: 300ms; opacity: 0; animation-fill-mode: both; }
@keyframes ripple-out {
  0%   { width: 0; height: 0; opacity: .9; }
  100% { width: var(--rp-size, 360px); height: var(--rp-size, 360px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .ripple-layer { display: none; } }

/* ---- Inner pages: the kit sizes every hero to fill the viewport; only the home hero should. ---- */
main > .hero:not(.hero--centred) { height: auto !important; min-height: 0 !important; }
main > .hero:not(.hero--centred) h1 { margin-bottom: var(--s-4, 1rem); }
main > .hero:not(.hero--centred) .t-lead { margin-bottom: var(--s-5, 1.5rem); }

/* Breadcrumbs: the kit makes .crumbs a grid; keep them on one wrapping line. */
.crumbs { display: flex !important; flex-wrap: wrap; }

/* Buttons inside .prose keep their own text colour (link colour would match the accent background). */
.prose a.btn { text-decoration: none; }
.prose a.btn--primary { color: var(--p-action-ink); }

/* ---- Contrast fixes found by the in-browser audit (all pages, both themes) ---- */
/* Pages hard-code pale lead text for a dark ground; in light mode it must follow the token. */
:root[data-theme="light"] :is(.t-lead, .hero__lead) { color: var(--p-muted); }
/* The closing band and footer are always dark. In light mode the kit mixes the light page background
   into them (mid grey), so give the band the dark tokens explicitly. */
:root[data-theme="light"] .footer--dark {
  --p-bg: #0a0d14; --p-surface: #131824; --p-ink: #e9edf3; --p-muted: #a6afbe;
  --p-accent: #5ab9fc; --p-accent-ink: #0a0d14; --p-action: #5ab9fc; --p-action-ink: #0a0d14;
  background: #0a0d14; color: #e9edf3;
}
:root[data-theme="light"] .footer--dark :is(.t-lead, .hero__lead) { color: #cdd4df; }
/* Example console: severity tags and line numbers were 2.4-3.9:1. */
.console__q small { color: #b7bfcc !important; }
.console__ln > span:first-child { color: #9aa4b5 !important; }

/* Dark theme (default): the kit's inverse band is LIGHT, but pages hard-code pale lead text (1.27:1 on it). */
.ground-inverse :is(.t-lead, .hero__lead) { color: var(--p-inv-muted); }
