/* === DESIGN TOKENS === */
:root {
  --bg:           #F9F8F6;
  --surface:      #FFFFFF;
  --border:       #D0C9C2;   /* darkened from E5E1DC for better border visibility */
  --text:         #1C1916;
  --muted:        #66605A;   /* darkened from 6E6760; gives 5.35:1 on bg */
  --accent:       #C13822;
  --accent-h:     #9E2D1A;   /* hover / darker red */
  --accent-soft:  rgba(193,56,34,0.09);
  --accent-text:  #9E2D1A;   /* darkened from C13822; 5.86:1 on accent-soft pill bg */
  --cta-bg:       #C13822;   /* constant — not overridden in dark mode; 5.12:1 with white */
  --header-bg:    rgba(249,248,246,0.90);
  --shadow:       0 2px 16px rgba(28,25,22,0.06);
  --radius:       12px;
  --max:          1080px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #131110;
    --surface:      #1C1917;
    --border:       #3A3530;
    --text:         #EDE9E4;
    --muted:        #9A9390;   /* 6.37:1 on dark bg */
    --accent:       #DC4430;
    --accent-h:     #F05540;
    --accent-soft:  rgba(220,68,48,0.13);
    --accent-text:  #FF7055;   /* 6.73:1 on dark bg */
    /* --cta-bg intentionally NOT redefined — stays #C13822 (5.12:1 with white) */
    --header-bg:    rgba(19,17,16,0.90);
    --shadow:       0 2px 16px rgba(0,0,0,0.32);
  }
}
:root[data-theme="dark"] {
  --bg:           #131110;
  --surface:      #1C1917;
  --border:       #3A3530;
  --text:         #EDE9E4;
  --muted:        #9A9390;
  --accent:       #DC4430;
  --accent-h:     #F05540;
  --accent-soft:  rgba(220,68,48,0.13);
  --accent-text:  #FF7055;
  --header-bg:    rgba(19,17,16,0.90);
  --shadow:       0 2px 16px rgba(0,0,0,0.32);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-padding-top: 64px; } /* accounts for sticky header in anchor/focus scrolling */
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Atkinson Hyperlegible", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;        /* 16px minimum */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}
ul { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* === UTILITIES === */
.visually-hidden {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 16px; top: 16px;
  width: auto; height: auto;
  overflow: visible;  /* override .visually-hidden's overflow:hidden */
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; z-index: 200;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* === HEADER === */
header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.logo { display: inline-flex; align-items: center; }
.logo-img { height: 48px; width: auto; display: block; }
nav { position: relative; }
nav ul {
  display: flex; gap: 32px;
  list-style: none; margin: 0; padding: 0;
}
nav a {
  color: var(--muted); font-size: 0.9rem;
  font-weight: 400; transition: color .15s;
}
nav a:hover, nav a[aria-current="page"] { color: var(--text); }
nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.menu-btn {
  display: none; background: none;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 14px; color: var(--text);
  font-size: 0.9rem; font-family: inherit; cursor: pointer;
  min-height: 40px;
}
.nav-cta {
  background: var(--accent); color: #fff;
  padding: 10px 20px; border-radius: 8px;
  font-weight: 700; font-size: 0.9rem;
  transition: background .15s;
  min-height: 40px; display: inline-flex; align-items: center;
}
.nav-cta:hover { background: var(--accent-h); }

/* === FOOTER === */
footer {
  padding: 36px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.875rem;
}
.footer-inner {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-nav {
  display: flex; flex-wrap: wrap; gap: 0 20px;
  list-style: none; padding: 0; margin: 0;
}
.footer-nav a {
  display: inline-flex; align-items: center;
  padding: 8px 0; min-height: 40px;
  transition: color .15s;
}
.footer-nav a:hover { color: var(--text); }
.footer-copy { margin: 0; }

/* === REDUCED MOTION (shared) === */
@media (prefers-reduced-motion: reduce) {
  nav a, .nav-cta, .footer-nav a { transition: none; }
}

/* === MOBILE NAV & FOOTER === */
@media (max-width: 680px) {
  .menu-btn { display: inline-flex; }
  .nav-cta { display: none; }
  nav ul {
    display: none;
    position: absolute; left: -24px; right: -24px; top: 100%;
    flex-direction: column; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  nav ul.open { display: flex; }
  nav ul li { padding: 10px 0; border-bottom: 1px solid var(--border); }
  nav ul li:last-child { border-bottom: none; }
  .footer-nav { display: none; }
  .footer-inner { justify-content: center; }
  .footer-copy { text-align: center; }
}
