/*
  Shared design system for every page in this project.
  Plain, solid surfaces, one accent color, a single typeface.
  Page stylesheets build on these tokens; don't hard-code colors there.
*/

:root {
  color-scheme: light;

  /* Type */
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Neutrals (light) */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --surface-3: #e5e9ef;
  --border: #dde3ea;
  --border-strong: #c3ccd7;
  --text: #111827;
  --muted: #4b5563;
  --subtle: #8a94a3;

  /* Accent */
  --accent: #1858d4;
  --accent-hover: #1247ae;
  --accent-soft: #e8effc;
  --on-accent: #ffffff;

  /* Brand bands (the "30%" color areas: headers, hero, footer) */
  --brand: #1650c8;
  --brand-deep: #0f1d3a;
  --on-brand: #ffffff;
  --on-brand-muted: rgba(255, 255, 255, 0.78);
  --brand-line: rgba(255, 255, 255, 0.22);
  --brand-fill: rgba(255, 255, 255, 0.1);
  --brand-fill-hover: rgba(255, 255, 255, 0.18);
  --card-on-brand: 0 10px 30px rgba(6, 20, 60, 0.25), 0 2px 6px rgba(6, 20, 60, 0.15);

  /* Pale brand tint for page-title bands */
  --brand-tint: #eaf1fd;
  --brand-tint-line: #d5e2f8;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 32px rgba(15, 23, 42, 0.08);

  /* Status */
  --success: #1a7f37;
  --error: #c4302b;
  --success-soft: #e3f3e7;
  --error-soft: #fbe7e6;

  /* Shape */
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(23, 24, 20, 0.06), 0 1px 1px rgba(23, 24, 20, 0.04);
  --shadow-pop: 0 12px 32px rgba(23, 24, 20, 0.16), 0 2px 6px rgba(23, 24, 20, 0.08);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);

  /* Legacy names some scripts still reference */
  --primary: var(--accent);
  --primary-color: var(--accent);
  --light-text-color: var(--on-accent);
  --footer-text-color: var(--muted);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1218;
  --surface: #171b22;
  --surface-2: #1e232b;
  --surface-3: #272d36;
  --border: #2a313b;
  --border-strong: #3b4451;
  --text: #e8ebf0;
  --muted: #a4adba;
  --subtle: #747e8c;
  --accent: #7ba3ff;
  --accent-hover: #9bbaff;
  --accent-soft: rgba(123, 163, 255, 0.14);
  --on-accent: #0b1430;
  --success: #4cc26b;
  --error: #ff7b72;
  --success-soft: rgba(76, 194, 107, 0.14);
  --error-soft: rgba(255, 123, 114, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  --brand: #1b3a80;
  --brand-deep: #0b1428;
  --card-on-brand: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --brand-tint: #121b2c;
  --brand-tint-line: #1e2b44;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 1;
}

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

h1,
h2,
h3,
h4 {
  letter-spacing: -0.01em;
  line-height: 1.2;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
