/* ============================================================
   TRAILHEAD — light theme: tokens, base, top menu, buttons, logo, footer
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,800&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink: #14213D;           /* main text, navy sections, dark headers */
  --muted: #4A5568;         /* secondary text */
  --paper: #F5F7FA;         /* page background */
  --surface: #FFFFFF;       /* white sections and cards */
  --line: #DDE3EC;          /* borders and dividers */
  --trail: #C2410C;         /* main buttons, progress, selected answers, links */
  --trail-hover: #9A3412;
  --trail-soft: #FFEDD5;    /* notices, the survey block, selected answers */
  --trail-soft-ink: #7C2D12;
  --compass: #0F766E;       /* confidence badges and time labels */
  --compass-soft: #CCFBF1;
  --compass-soft-ink: #134E4A;
  --star: #FDBA74;          /* the star on navy */
  --dots: #94A3B8;          /* dotted trail grey */
  --error: #B91C1C;
  --input-focus: #2563EB;   /* border of a text field being typed in */
  --input-focus-ring: #DBEAFE;

  --font-display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-button: 14px;
  --radius-card: 18px;
  --gutter: 16px;
  --nav-height: 4.5rem;

  /* Logo colours; the navy contexts swap them */
  --logo-trail: var(--ink);
  --logo-star: var(--trail);
  --focus: var(--trail);
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  background-color: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

main {
  flex: 1;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}

h3, h4 {
  font-weight: 700;
  line-height: 1.35;
}

a {
  color: var(--trail);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--trail-hover);
}

img, svg {
  display: block;
  max-width: 100%;
}

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

[hidden] {
  display: none !important;
}

/* ---------- LOGO ---------- */
/* The mark (templates/partials/logo-mark.svg) is inlined so its colours follow the context.
   Dotted from 32px up; .logo-solid for anything smaller. */
.logo-mark {
  flex: none;
  width: 36px;
  height: 36px;
  overflow: visible;
}

.logo-mark .logo-trail {
  stroke: var(--logo-trail);
}

.logo-mark .logo-star {
  fill: var(--logo-star);
}

.logo-solid .logo-trail {
  stroke-dasharray: none;
  stroke-width: 5;
}

.on-navy {
  --logo-trail: #FFFFFF;
  --logo-star: var(--star);
  --focus: var(--star);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--ink);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ---------- TOP MENU ---------- */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-height);
  padding: 0.75rem 2.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a:not(.btn-primary) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:not(.btn-primary):hover {
  color: var(--trail);
}

.nav-cta.btn-primary {
  min-height: 44px;
  padding: 0.5rem 1.1rem;
}

/* Language switch: a small segmented control (static/js/i18n.js changes every text at once) */
.lang-switch {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.lang-switch button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.6rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-switch button:hover {
  color: var(--ink);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- BUTTONS ---------- */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--trail);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--trail-hover);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-weight: 500;
}

.btn-secondary:hover {
  background: var(--paper);
  color: var(--ink);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Small pill above a page title */
.hero-badge {
  display: inline-block;
  max-width: 100%;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--trail-soft);
  color: var(--trail-soft-ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

/* ---------- FOOTER ---------- */
footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem var(--gutter);
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

footer .logo-mark {
  width: 22px;
  height: 22px;
}

/* ---------- PHONES ---------- */
@media (max-width: 720px) {
  nav {
    padding: 0.6rem var(--gutter);
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-page-link {
    display: none;
  }

  .nav-cta.btn-primary {
    padding: 0.5rem 0.85rem;
  }
}

@media (max-width: 400px) {
  .nav-logo .logo-mark {
    width: 32px;
    height: 32px;
  }

  .wordmark {
    font-size: 1.25rem;
  }
}

@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;
  }
}

/* Staging only (ENVIRONMENT=staging) */
.test-site-banner {
  margin: 0;
  padding: 0.35rem 1rem;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.8rem;
  text-align: center;
}

@media print {
  .test-site-banner {
    display: none;
  }
}
