/* ==========================================================================
   BrokeRisk : base. Reset, design tokens, typography, accessibility.
   Dark surface throughout. Sections are separated by elevation and hairline
   rules rather than by changing the background colour.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: 6rem;
  color-scheme: dark;
}

img, svg, video, canvas { display: block; max-inline-size: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; }

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg:        #0B0D10;
  --surface:   #14181F;
  --raised:    #1A1F28;
  --line:      #232A35;
  --line-soft: #1B212B;
  --line-hard: #2E3745;

  /* Two accents with separate jobs, so neither is decoration.
     Blue is the ACTION colour: buttons, links, icons, focus, navigation.
     Gold is the DATA colour: risk figures, exposure bars, ratings, counters.
     --blue is dark enough to need a white label; --blue-bright is the variant
     that clears AA as text on charcoal. */
  --blue:        #2452C8;
  --blue-hover:  #3563E9;
  --blue-bright: #6D9BFF;
  --blue-dim:    rgba(109, 155, 255, .13);
  --blue-line:   rgba(109, 155, 255, .32);

  --gold:      #E0B252;

  --text:   #F2F5FA;
  --text-2: #B6C0CD;
  --slate:  #8593A6;

  --danger: #FF6B5E;

  /* On a dark ground a drop shadow does almost nothing. Depth comes from a
     lighter hairline on top plus a wide, very dark pool underneath. */
  --shadow-2: 0 1px 0 rgba(255,255,255,.06) inset, 0 28px 60px -28px #000;

  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Type scale. 16px base keeps B2B copy dense and businesslike. */
  --step--1: 0.8125rem;
  --step-0:  1rem;
  --step-1:  1.125rem;
  --step-2:  clamp(1.35rem, 1.1rem + 1.1vw, 1.8rem);
  --step-3:  clamp(1.8rem, 1.35rem + 2vw, 2.7rem);
  --step-4:  clamp(2.4rem, 1.5rem + 3.9vw, 4.3rem);

  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: Inter, 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1280px;
  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
  --section-y: clamp(4.5rem, 8vw, 8rem);

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* --------------------------------------------------------------------------
   Page ground: the coordinate plane the whole layout sits on
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text-2);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0);
  background-size: 34px 34px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.028em;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: var(--step-4); letter-spacing: -0.038em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.015em; }

p { text-wrap: pretty; }
strong { color: var(--text); font-weight: 600; }

.lede { font-size: var(--step-1); line-height: 1.6; color: var(--text-2); max-inline-size: 58ch; }
.section-intro { max-inline-size: 56ch; margin-block-start: 1.1rem; color: var(--slate); }

/* Mono is used for figures only, because figures are data. It never appears
   on a label, an eyebrow, or a heading. */
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: 1rem;
  z-index: 200;
  background: var(--blue);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 600;
}
.skip-link:focus { inset-block-start: 0; }

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--blue); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
