:root {
  /* WCAG 2.2 AA — calm defaults, trauma-informed (no alarm reds in normal flow) */
  --nav-bg: #0a0a0a;
  --nav-text: #ffffff;
  --nav-muted: #c5ccd4;
  --nav-active: #7ec8ff;
  --nav-hover-bg: rgba(255, 255, 255, 0.1);

  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #0f1419;
  --muted: #4f5863;
  --placeholder: #5a6270;
  --border: #b8c0ca;

  --accent: #0057b8;
  --accent-hover: #004494;
  --accent-soft: #e3eef9;
  --accent-text: #003366;

  --tip-bg: #eef4fb;
  --tip-border: #7ba3d4;

  --warn: #5c3d00;
  --warn-text: #4a3200;
  --warn-bg: #fff4d6;

  --danger: #9f1239;
  --danger-bg: #fff1f2;
  --danger-border: #fecdd3;

  --focus-ring: #0057b8;
  --focus-offset: 2px;
  --shadow: 0 2px 8px rgba(15, 20, 25, 0.08);
  --radius: 12px;
  --app-nav-height: 3.25rem;
}

/* High-contrast mode — optional; stronger borders and text for low vision / ND users who prefer it */
html[data-contrast="high"] {
  --nav-bg: #000000;
  --nav-text: #ffffff;
  --nav-muted: #ffffff;
  --nav-active: #ffff00;
  --nav-hover-bg: #333333;

  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;
  --muted: #1a1a1a;
  --placeholder: #333333;
  --border: #000000;

  --accent: #0000cc;
  --accent-hover: #000099;
  --accent-soft: #e8e8e8;
  --accent-text: #000000;

  --tip-bg: #f0f0f0;
  --tip-border: #000000;

  --warn: #000000;
  --warn-text: #000000;
  --warn-bg: #fff3b0;

  --danger: #8b0000;
  --danger-bg: #ffe0e0;
  --danger-border: #8b0000;

  --focus-ring: #000000;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: var(--focus-offset);
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible),
[contenteditable]:focus:not(:focus-visible) {
  outline: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.625rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
}

.skip-link:focus {
  top: 0;
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.app-footer {
  margin-top: auto;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.offline-banner {
  background: var(--warn-bg);
  border-bottom: 1px solid #e6d9a8;
  color: var(--warn-text);
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  text-align: center;
}

.offline-banner.hidden {
  display: none;
}

.offline-banner strong {
  color: var(--warn);
}

.offline-banner button {
  margin-left: 0.75rem;
  font: inherit;
  cursor: pointer;
  border: 1px solid #e6d9a8;
  background: #fff;
  border-radius: 6px;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--text);
}

.home-hero {
  text-align: center;
  padding: 2rem 1.5rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.home-hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-text);
}

.home-hero p {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.home-main {
  flex: 1;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.path-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.path-step {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.path-step:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 87, 184, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .path-step:hover {
    transform: none;
  }
}

.path-step:focus-visible {
  border-color: var(--accent);
}

.path-step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.path-step h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-text);
}

.path-step p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.path-step .path-cta {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}

.continue-card {
  background: var(--accent-soft);
  border: 2px solid var(--tip-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.continue-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--accent-text);
}

.continue-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.continue-card a {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
}

.continue-card a:hover {
  background: var(--accent-hover);
}

.continue-card a:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

html[data-contrast="high"] button.primary,
html[data-contrast="high"] .continue-card a {
  border: 2px solid #000000;
}

html[data-contrast="high"] .path-step:hover {
  transform: none;
  box-shadow: none;
}
