/* ==========================================================================
   DigiD Media — design tokens, reset, base type, shared utilities
   Identity: "The Instrument" — pricing read off a calibrated scale.
   See DESIGN_NOTES.md for the full spec. Do not add tokens here without
   updating that file.
   ========================================================================== */

:root {
  /* --- colour ------------------------------------------------------------
     One accent only (--amber). Tier is encoded by POSITION on the scale,
     never by hue. Resist adding a second accent. */
  --deep:     #0E2A2F;  /* petrol — dark section backgrounds */
  --deeper:   #081C20;  /* footer, deepest wells */
  --field:    #E9EDE7;  /* pale sage — light section backgrounds */
  --chalk:    #FAFBF9;  /* card surfaces on light sections */
  --amber:    #E9A03C;  /* signal — CTAs, active bracket, focus */
  --amber-d:  #C9832A;  /* amber, pressed/hover */
  --moss:     #4E7C6B;  /* quiet secondary — inactive scale track */
  --muted:    #54615F;  /* muted text on light  (5.5:1 on --field) */
  --muted-i:  #8FA5A3;  /* muted text on deep   (5.8:1 on --deep)  */
  --rule:     #1D3D42;  /* hairline on deep */
  --rule-l:   #CFD8CE;  /* hairline on light */

  /* --- type --------------------------------------------------------------
     Display: Bricolage Grotesque — engineered but humane, used with restraint.
     Body:    IBM Plex Sans — quiet, legible.
     Utility: IBM Plex Mono — dollar figures, brackets, eyebrows. Functional,
              not decorative: money and ranges want tabular figures. */
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* --- measure ----------------------------------------------------------- */
  --wrap: 1160px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --radius: 4px;      /* near-square: instrument panel, not app card */
  --radius-lg: 6px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--field);
  color: var(--deep);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

/* --------------------------------------------------------------------------
   type scale
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.55rem, 6vw, 4.5rem); line-height: 1.01; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.7vw, 2.85rem); }
h3 { font-size: clamp(1.12rem, 1.7vw, 1.35rem); font-weight: 600; letter-spacing: -0.015em; }

p { text-wrap: pretty; }

.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.58;
  max-width: 56ch;
}

/* Eyebrow — a real label, not decoration. Names the section's subject. */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moss);
  display: block;
  margin-bottom: 1.1rem;
}
.on-deep .eyebrow { color: var(--amber); }

/* --------------------------------------------------------------------------
   layout primitives
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* .section owns vertical rhythm. Never override its padding from a
   component class — that is how these files start cancelling each other out. */
.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.on-deep  { background: var(--deep);   color: var(--field); }
.on-deep h1, .on-deep h2, .on-deep h3 { color: var(--field); }
.on-light { background: var(--field);  color: var(--deep); }

.section-head { max-width: 60ch; margin-bottom: clamp(2.2rem, 4vw, 3.4rem); }
.section-head p { color: var(--muted); }
.on-deep .section-head p { color: var(--muted-i); }

/* --------------------------------------------------------------------------
   links & buttons
   -------------------------------------------------------------------------- */
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;                 /* tap target floor */
  padding: 0.78rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-family: var(--body);
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn--primary { background: var(--amber); color: #17130A; }
.btn--primary:hover { background: var(--amber-d); }

.btn--ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn--ghost:hover { background: rgba(233, 160, 60, 0.12); border-color: var(--amber); color: var(--amber); }

.btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   focus — amber ring, always visible, never removed
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2.5px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--amber);
  color: #17130A;
  padding: 0.75rem 1.15rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   reduced motion — global off switch
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
