/* ==========================================================================
   Base: reset, typography roles, layout primitives
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 8px); scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg); color: var(--fg);
  font: 400 var(--fs-body)/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
p, h1, h2, h3, h4, figure, dl, dd, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
::selection { background: var(--bb-yellow); color: var(--bb-black); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; left: var(--sp-4); top: -60px; z-index: 200; background: var(--bb-yellow); color: var(--bb-black); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: var(--sp-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Typography roles ---------------------------------------------------- */
.hero-title, .display-l, .display-m, .heading { font-family: var(--font-display); text-wrap: balance; }
.hero-title { font-size: var(--fs-hero); font-weight: 800; line-height: .98; letter-spacing: -.035em; }
.display-l  { font-size: var(--fs-display-l); font-weight: 800; line-height: 1.04; letter-spacing: -.03em; }
.display-m  { font-size: var(--fs-display-m); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; }
.heading    { font-size: var(--fs-heading); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.lede  { font-size: var(--fs-body-l); color: var(--fg-muted); max-width: var(--measure); line-height: 1.6; }
.small { font-size: var(--fs-small); color: var(--fg-muted); }
.caption { font-size: var(--fs-caption); color: var(--fg-faint); }
.label {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 var(--fs-eyebrow)/1.3 var(--font-accent); letter-spacing: .01em; color: var(--accent-text);
}
/* Scan reticle: four corner brackets around a dot, like the helmet locking onto a room.
   Drawn in currentColor, so it matches the label on light, dark and orange grounds. */
.label::before {
  content: ""; flex: none; width: 13px; height: 13px;
  background:
    radial-gradient(circle, currentColor 0 1.9px, transparent 2.4px) center / 100% 100% no-repeat,
    linear-gradient(currentColor, currentColor) left top / 5px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 1.6px 5px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 5px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 1.6px 5px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 5px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 1.6px 5px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 5px 1.6px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 1.6px 5px no-repeat;
  animation: lock-on 3.6s var(--ease-out) infinite;
}
@keyframes lock-on { 0%, 62%, 100% { transform: scale(1); } 74% { transform: scale(.72); } 86% { transform: scale(1.06); } }
.label.plain::before { display: none; }
.label.muted { color: var(--fg-muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.slogan { font-family: var(--font-slogan); font-weight: 400; letter-spacing: 0; }

/* Gradient text: brand highlight. Each theme supplies a gradient that passes contrast on its ground. */
.grad {
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.prose { display: grid; gap: var(--sp-4); max-width: var(--measure); }
.prose p { color: var(--fg-muted); }

/* ---- Layout -------------------------------------------------------------- */
.container { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container.wide { max-width: calc(var(--max-wide) + 2 * var(--gutter)); }
.section { position: relative; padding-block: var(--section-y); background: var(--bg); color: var(--fg); }
.section.tight { padding-block: calc(var(--section-y) * .55); }
.section.flush-top { padding-top: 0; }
.section.flush-bottom { padding-bottom: 0; }
.stack { display: grid; gap: var(--sp-5); align-content: start; }
.stack-sm { display: grid; gap: var(--sp-3); align-content: start; }
.stack-lg { display: grid; gap: var(--sp-8); align-content: start; }
/* Grid children may shrink below their content width, so wide content
   (a scrolling tab row, a table) scrolls inside the screen instead of widening the page */
.stack > *, .stack-sm > *, .stack-lg > * { min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.center { text-align: center; justify-items: center; margin-inline: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--sp-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: var(--sp-5); }
.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: clamp(32px, 6vw, 104px); align-items: center; }
.split.even { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.split.top { align-items: start; }
.mt-5 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); } .mt-7 { margin-top: var(--sp-7); } .mt-8 { margin-top: var(--sp-8); }

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: minmax(0,1fr); }
  .split, .split.even { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .grid-2, .grid-4 { grid-template-columns: minmax(0,1fr); }
}
