/* =====================================================================
   base.css - reset, design tokens, typography

   Every colour, radius and spacing value used anywhere in this project is
   defined once here as a custom property. Never hard-code a hex value in
   another stylesheet.

   Google Sans is loaded from the Google Fonts CDN in the page head. It was
   once a proprietary face that could not be redistributed, which is why
   earlier versions of this file self-hosted it behind a Roboto fallback.
   It is published on Google Fonts now, so that workaround is gone and the
   stack simply names it first.
   ===================================================================== */

:root {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-text: #212529;
  --color-text-muted: #5f6368;
  --color-border: #dee2e6;

  /* Brand accent. The token keeps its original name so the 26 rules that
     reference it stay untouched, but the value is now the warm orange
     #E98B50 rather than the old pale tan. Used for the utility bar,
     table headers, FAQ headers, callouts and the footer. */
  --color-accent-tan: #E98B50;
  --color-accent-tan-hover: #D97A3F;
  --color-accent-tan-light: #EE9A64;   /* gradient top end */
  --color-on-accent: #211106;          /* text that sits on the accent */

  --color-link: #003cc5;               /* links inside article body and tables */
  --color-nav-link: #333333;           /* header/footer navigation links */

  --color-btn-bg: #000000;             /* primary buttons */
  --color-btn-text: #ffffff;
  --color-btn-outline-border: #000000; /* Previous / secondary buttons */

  --color-success: #2e7d32;            /* checkmark bullets, "Scheme Open" sign */
  --color-danger: #c62828;             /* "Scheme Closed" sign, errors, required asterisk */

  --color-table-stripe: #f8f9fa;
  --color-badge-bg: #eef1f4;

  --radius-sm: 4px;
  --radius-md: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --container-max: 1140px;

  --font-family-base: 'Google Sans', 'Product Sans', 'Roboto', Arial, sans-serif;
  --assistant-purple: #5b3ea8;

  /* --- Added for polish. The values above are the specified palette and
     are left exactly as they were; everything below is additive, so no
     existing rule changes meaning. --- */
  --color-border-soft: #edf0f2;      /* hairlines inside cards */
  --color-border-strong: #c9ced4;    /* hover borders */
  --color-surface-sunken: #fafbfc;   /* page wells, table zebra alt */
  --color-link-hover: #002a8f;
  --color-focus: #1a56db;

  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.16);

  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --speed: 160ms;
}

/* --- Reset ---------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol { margin: 0; }

ul[class], ol[class] { padding: 0; list-style: none; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, picture, svg { max-width: 100%; display: block; }

input, button, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

/* --- Typography ------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  letter-spacing: -0.011em;   /* Google Sans sets a touch loose at display sizes */
  text-wrap: balance;         /* ignored where unsupported, no fallback needed */
}

h1 { font-size: 2.4rem; line-height: 1.2; margin-bottom: var(--space-3); }
h2 { font-size: 1.75rem; line-height: 1.28; margin: var(--space-5) 0 var(--space-3); }
h3 { font-size: 1.375rem; line-height: 1.35; margin: var(--space-4) 0 var(--space-2); }
h4 { font-size: 1.125rem; line-height: 1.4; margin: var(--space-3) 0 var(--space-2); }

p { margin-bottom: var(--space-3); }
p { text-wrap: pretty; }

/* Links carry no underline anywhere. Colour plus a hover underline keeps
   them identifiable without the ruled-paper look that underlining every
   nav item, card title and table cell produces. Prose links are the one
   exception and re-add the underline, because inside a paragraph colour
   alone is a weak signal. */
a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}
a:hover { color: var(--color-link-hover); text-decoration: underline; }

small, .meta { font-size: 0.875rem; color: var(--color-text-muted); }

strong, b { font-weight: 700; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }

hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-4) 0; }

::selection { background: #d9e2ff; color: var(--color-text); }


/* --- Focus visibility (accessibility baseline, section 3.8) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-link);
  outline-offset: 2px;
}

/* Screen-reader-only text that stays keyboard reachable. */
.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--color-btn-bg);
  color: var(--color-btn-text);
  padding: var(--space-2) var(--space-3);
}
.skip-link:focus { left: 0; }

/* --- Layout container ------------------------------------------------ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
}

.page {
  /* Vertical only: the `padding` shorthand here used to wipe out the
     0 15px side gutters `.container` sets, since every page is
     `<div class="container page">` and this rule comes later. */
  padding-top: var(--space-4);
  padding-bottom: var(--space-6);
}

/* --- Utility --------------------------------------------------------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.required-mark { color: var(--color-danger); }

/* Smooth in-page jumps for the Quick View table of contents, while
   respecting a visitor who has asked for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* --- Prose links -------------------------------------------------------
   Inside running text, colour alone is too weak a signal, so body copy
   re-adds the underline. Everything structural (nav, cards, tables,
   buttons, breadcrumbs) stays clean. */
.prose p a,
.scheme-body p a,
.scheme-body li a,
.comment__body a,
.footer-legal a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.prose p a:hover,
.scheme-body p a:hover,
.scheme-body li a:hover,
.comment__body a:hover,
.footer-legal a:hover {
  text-decoration-color: currentColor;
}
