/* sssxdown — design-system tokens.
   Light is the DEFAULT theme (:root); [data-theme="dark"] is the override.
   Source of truth for colour, type, spacing, shape and elevation.
   Retune here only — components.css and app.css consume these names. */

:root {
  color-scheme: light;

  /* — type —————————————————————————————————————————————— */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading-weight: 600;

  /* — core semantic colours ————————————————————————————— */
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;          /* hero band, cards, footer */
  --color-surface-2: #f1f3f5;        /* one step deeper than surface */
  --color-text: #212529;
  --color-muted: #6c757d;
  --color-border: #dee2e6;
  --color-divider: #dee2e6;

  --color-brand: #1573b4;            /* navbar bar colour — deep enough that
                                        white nav text clears WCAG AA (5.07:1) */
  --color-brand-hover: #125e93;
  --color-on-brand: #ffffff;

  --color-accent: #1d9bf0;
  --color-accent-hover: #1a8cd8;
  --color-accent-2: #495057;
  --color-accent-soft: #e8f4fd;      /* light blue tint (selected rows, links bg) */
  /* Link text needs more contrast than the brand fill: #1d9bf0 on white is only
     3.0:1. Fills (navbar, bullets, borders) keep --color-accent; text uses this. */
  --color-link: #1573b4;             /* 5.07:1 on white */
  --color-link-hover: #125e93;

  --color-dark: #212529;             /* primary CTA background */
  --color-dark-hover: #343a40;
  --color-on-dark: #ffffff;          /* text on the primary CTA */

  --color-danger: #b02a37;
  --color-danger-bg: #fdf2f3;
  --color-danger-border: #f0c2c7;

  /* — neutral ramp ——————————————————————————————————————
     100 = faintest surface tint … 900 = strongest text.
     The semantics of each step hold in both themes, so anything
     referencing a step (including assets/js/app.js, which inlines
     --color-neutral-600) stays readable after a theme flip. */
  --color-neutral-100: #f8f9fa;
  --color-neutral-200: #e9ecef;
  --color-neutral-300: #dee2e6;
  --color-neutral-400: #ced4da;
  --color-neutral-500: #adb5bd;
  --color-neutral-600: #6c757d;
  --color-neutral-700: #495057;
  --color-neutral-800: #343a40;
  --color-neutral-900: #212529;

  /* — accent ramp ———————————————————————————————————————
     100–300 = tints usable as backgrounds, 400 = icon-strength
     (assets/js/app.js inlines --color-accent-400), 500 = the brand
     blue itself, 600–900 = progressively deeper shades. */
  --color-accent-100: #f1f8fe;
  --color-accent-200: #ddeffc;
  --color-accent-300: #bde0fa;
  --color-accent-400: #7ec5f5;
  --color-accent-500: #1d9bf0;
  --color-accent-600: #1a8cd8;
  --color-accent-700: #1573b4;
  --color-accent-800: #10598b;
  --color-accent-900: #0b3f62;

  /* — secondary (slate) ramp, same 100→900 orientation — */
  --color-accent-2-100: #f8f9fa;
  --color-accent-2-200: #eceff1;
  --color-accent-2-300: #dde1e5;
  --color-accent-2-400: #c2c9cf;
  --color-accent-2-500: #8d97a1;
  --color-accent-2-600: #6c757d;
  --color-accent-2-700: #495057;
  --color-accent-2-800: #343a40;
  --color-accent-2-900: #212529;

  /* — tinted band (extension promo) — */
  --color-section: #1d9bf0;
  --color-section-glow: #4db2f4;
  --color-section-ghost: #8ccff8;
  --band-a: var(--color-section);
  --band-b: #1a8cd8;
  --band-fg: rgba(255, 255, 255, 0.92);
  --band-kicker: rgba(255, 255, 255, 0.78);

  /* — misc ground-dependent tokens — */
  --glow: var(--color-bg);
  --thumb-a: #f1f3f5;
  --thumb-b: #e3e7ea;

  /* — spacing (4px base) — */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  /* — layout — */
  --container-max: 960px;
  --container-narrow-max: 760px;
  --container-privacy-max: 680px;
  --container-gutter: 16px;
  --container-pad-block: 48px;

  /* — shape — */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* — elevation — */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --focus-ring: 0 0 0 3px rgba(29, 155, 240, 0.25);
}

/* ————————————————————————————————————————————————————————
   Dark variant. Only the values change — every name above keeps
   its meaning, so no rule elsewhere needs a theme-specific branch.
   ———————————————————————————————————————————————————————— */
[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: #15202b;
  --color-surface: #1e2732;
  --color-surface-2: #22303c;
  --color-text: #e7e9ea;
  --color-muted: #8b98a5;
  --color-border: #38444d;
  --color-divider: #38444d;

  --color-brand: #1573b4;
  --color-brand-hover: #125e93;
  --color-on-brand: #ffffff;

  --color-accent: #1d9bf0;
  --color-accent-hover: #4db2f4;
  --color-accent-2: #8b98a5;
  --color-accent-soft: #16354b;
  --color-link: #7ec5f5;             /* lifted for contrast on the dark ground */
  --color-link-hover: #a8d8f8;

  --color-dark: #e7e9ea;             /* CTA inverts so it stays high-contrast */
  --color-dark-hover: #ffffff;
  --color-on-dark: #15202b;

  --color-danger: #f3a7ad;
  --color-danger-bg: #331a1e;
  --color-danger-border: #5c2a31;

  --color-neutral-100: #1a2430;
  --color-neutral-200: #1e2732;
  --color-neutral-300: #2a3540;
  --color-neutral-400: #38444d;
  --color-neutral-500: #5b6b7a;
  --color-neutral-600: #8b98a5;
  --color-neutral-700: #aab8c2;
  --color-neutral-800: #ccd6dd;
  --color-neutral-900: #e7e9ea;

  --color-accent-100: #0f2c40;
  --color-accent-200: #133a54;
  --color-accent-300: #1a4d6e;
  --color-accent-400: #5bb3ee;
  --color-accent-500: #1d9bf0;
  --color-accent-600: #3aa9f3;
  --color-accent-700: #7ec5f5;
  --color-accent-800: #bde0fa;
  --color-accent-900: #e8f5fe;

  --color-accent-2-100: #1a2430;
  --color-accent-2-200: #1e2732;
  --color-accent-2-300: #2a3540;
  --color-accent-2-400: #38444d;
  --color-accent-2-500: #5b6b7a;
  --color-accent-2-600: #8b98a5;
  --color-accent-2-700: #aab8c2;
  --color-accent-2-800: #ccd6dd;
  --color-accent-2-900: #e7e9ea;

  --color-section: #1d9bf0;
  --color-section-glow: #4db2f4;
  --color-section-ghost: #8ccff8;
  --band-a: #176ea8;
  --band-b: #114e78;

  --glow: var(--color-bg);
  --thumb-a: #22303c;
  --thumb-b: #15202b;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.65);
  --focus-ring: 0 0 0 3px rgba(29, 155, 240, 0.4);
}

/* ————————————————————————————————————————————————————————
   Base elements
   ———————————————————————————————————————————————————————— */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.25;
  letter-spacing: normal;
  margin: 0 0 var(--space-3);
  text-wrap: pretty;
}
h1 { font-size: clamp(30px, 6vw, 40px); font-weight: 300; }
h2 { font-size: clamp(24px, 4vw, 28px); font-weight: 600; }
h3 { font-size: 22px; font-weight: 600; }
h4 { font-size: 18px; font-weight: 600; }
h5 { font-size: 16px; font-weight: 600; }
h6 { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

p { margin: 0 0 var(--space-3); }

a { color: var(--color-link); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

strong, b { font-weight: 600; }
small { font-size: 87.5%; }

img { display: block; max-width: 100%; }
svg { flex: none; }
figure { margin: 0; }
figcaption { font-size: 12px; margin-top: var(--space-1); color: var(--color-muted); }

hr { height: 1px; border: 0; background: var(--color-divider); margin: var(--space-6) 0; }

code, kbd, samp { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.925em; }

table { border-collapse: collapse; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

.text-muted { color: var(--color-muted); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: rgba(29, 155, 240, 0.22); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
