/* ── Colour tokens: light mode ── */
:root {
  --bg:      #fbfaf4;
  --text:    #1d241f;
  --muted:   #4f5b52;
  --panel:   #ffffff;
  --accent:  #255c3b;
  --accent-2:#e3b23c;
  --line:    #d8d5c8;
  --shadow:  0 18px 45px rgba(29, 36, 31, 0.08);
  --focus:   #255c3b;
}

/* ── Colour tokens: dark mode (OS preference) ── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #12190f;
    --text:    #e4ede6;
    --muted:   #9ab09e;
    --panel:   #1c261a;
    --accent:  #5dba82;
    --accent-2:#e3b23c;
    --line:    #2e3d2c;
    --shadow:  0 18px 45px rgba(0, 0, 0, 0.35);
    --focus:   #5dba82;
  }
}

/* ── Manual overrides (set by theme toggle JS) ── */
[data-theme="light"] {
  --bg:      #fbfaf4;
  --text:    #1d241f;
  --muted:   #4f5b52;
  --panel:   #ffffff;
  --accent:  #255c3b;
  --accent-2:#e3b23c;
  --line:    #d8d5c8;
  --shadow:  0 18px 45px rgba(29, 36, 31, 0.08);
  --focus:   #255c3b;
}

[data-theme="dark"] {
  --bg:      #12190f;
  --text:    #e4ede6;
  --muted:   #9ab09e;
  --panel:   #1c261a;
  --accent:  #5dba82;
  --accent-2:#e3b23c;
  --line:    #2e3d2c;
  --shadow:  0 18px 45px rgba(0, 0, 0, 0.35);
  --focus:   #5dba82;
}

/* ── Reset ── */
* { box-sizing: border-box; }

/* ── Smooth theme transition; respect reduced-motion ── */
*, *::before, *::after {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none; }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--accent); }

/* ── Skip link: visually hidden until focused ── */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.15s ease;
}
.skip-link:focus {
  transform: translateY(0);
}

/* ── Focus rings: outline, never box-shadow alone ── */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── Header ── */
.site-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 650;
}

nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

/* ── Theme toggle button ── */
#theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  line-height: 1;
}
#theme-toggle:hover { color: var(--text); border-color: var(--muted); }
#theme-toggle .sun-icon { display: none; }
#theme-toggle .moon-icon { display: block; }
[data-theme="dark"] #theme-toggle .sun-icon,
html:not([data-theme]) #theme-toggle .sun-icon {
  display: none;
}
/* Show sun (switch-to-light) when dark; show moon (switch-to-dark) when light */
[data-theme="dark"] #theme-toggle .moon-icon { display: none; }
[data-theme="dark"] #theme-toggle .sun-icon  { display: block; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) #theme-toggle .moon-icon { display: none; }
  html:not([data-theme]) #theme-toggle .sun-icon  { display: block; }
}

/* ── Main ── */
main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

section { margin: 4rem 0; }

.hero {
  min-height: 58vh;
  display: grid;
  align-items: center;
  padding: 5rem 0 3rem;
}

.hero.compact { min-height: auto; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
}

h1, h2, h3 { line-height: 1.15; }

h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  max-width: 900px;
  margin: 0.3rem 0 1rem;
}

h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); }

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.85rem 1.15rem;
  border-radius: 0.65rem;
  text-decoration: none;
  font-weight: 750;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.notice, .cta, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}

.notice { border-left: 0.5rem solid var(--accent-2); }

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid.two   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.steps {
  display: grid;
  gap: 1rem;
  padding-left: 1.3rem;
}

li + li { margin-top: 0.4rem; }

/* ── Footer ── */
footer {
  margin-top: 5rem;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.footer-social a {
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.footer-social a:hover { color: var(--accent); }

/* ── Misc ── */
.plan-description {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.program-list { list-style: none; padding: 0; }
.program-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.program-list li:last-child { border-bottom: none; }
.jurisdiction { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

/* ── Forced-colors / Windows High Contrast ── */
@media (forced-colors: active) {
  .card, .notice, .cta { border: 1px solid CanvasText; }
  .skip-link:focus { outline: 2px solid Highlight; }
  :focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
  .button { border: 1px solid ButtonText; forced-color-adjust: none; }
  #theme-toggle { border: 1px solid ButtonText; }
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
}
