/**
 * site.css — the landing page, the help centre and the legal pages
 *
 * Kept separate from app.css because these pages are documents, not an
 * application: they want a comfortable reading measure, generous line height
 * and normal page scrolling, none of which the app shell wants.
 *
 * The design tokens are the same as app.css so the two feel like one product,
 * and the accessibility decisions are the same:
 *   - one visible focus treatment, 3px amber, on everything focusable
 *   - a skip link that is visible on focus and not obscured
 *   - a reading measure capped at about 70 characters (SC 1.4.8 is AAA, but it
 *     costs nothing here and helps every reader)
 *   - no fixed heights on text containers, so text spacing overrides do not clip
 *   - dark mode, forced colours and reduced motion all handled
 */

:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --panel-2: #eef2f6;
  --ink: #16202b;
  --ink-soft: #3d4a59;
  --muted: #55647a;
  --line: #ccd6e0;
  --line-strong: #93a3b5;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #ccfbf1;
  --focus: #b45309;
  --radius: 12px;
  --measure: 68ch;
  --min-touch-target: 44px;
  --shadow-1: 0 1px 3px rgba(16, 32, 43, 0.08);
  --shadow-2: 0 6px 20px rgba(16, 32, 43, 0.12);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body.site {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* ── Accessibility utilities ─────────────────────────────────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -1000px;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--panel);
  border: 3px solid var(--focus);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.site-brand img {
  border-radius: 8px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--min-touch-target);
  color: var(--ink-soft);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-touch-target);
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}

.cta:hover {
  background: #115e56;
  border-color: #115e56;
}

.cta-secondary {
  background: var(--panel);
  color: var(--accent);
}

.cta-secondary:hover {
  background: var(--accent-soft);
}

.cta-large {
  font-size: 1.125rem;
  padding: 0.85rem 1.75rem;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
main {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem) 4rem;
}

section {
  margin-bottom: 3.5rem;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin: 0 0 0.5em;
  max-width: 20ch;
}

h2 {
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  line-height: 1.25;
  margin: 0 0 0.6em;
  padding-bottom: 0.3em;
  border-bottom: 2px solid var(--line);
}

h3 {
  font-size: 1.125rem;
  margin: 0 0 0.4em;
  color: var(--accent);
}

p,
li {
  max-width: var(--measure);
}

p {
  margin: 0 0 1em;
}

a {
  color: #0b5c56;
}

.lede {
  font-size: 1.1875rem;
  color: var(--ink-soft);
}

.hero {
  padding: clamp(1.5rem, 4vw, 3rem) 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0.75rem;
}

.hero-note {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  max-width: none;
  padding: 1.1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.card p {
  margin: 0;
  max-width: none;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* ── Lists and tables ────────────────────────────────────────────────────── */
.plain-list {
  margin: 0 0 1em;
  padding-left: 1.35rem;
}

.plain-list li {
  margin-bottom: 0.4em;
}

.curriculum-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--panel);
  font-size: 0.9375rem;
}

.curriculum-table caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: 0.5rem;
  color: var(--ink-soft);
}

.curriculum-table th,
.curriculum-table td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-strong);
  text-align: left;
  vertical-align: top;
  max-width: none;
}

.curriculum-table thead th {
  background: var(--panel-2);
}

.curriculum-table tbody th {
  white-space: nowrap;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 2rem clamp(1rem, 4vw, 3rem);
  background: var(--panel);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--min-touch-target);
}

/* ── Help-page extras ────────────────────────────────────────────────────── */
.help-toc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.6rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.help-toc a {
  display: flex;
  align-items: center;
  min-height: var(--min-touch-target);
  padding: 0.7rem 0.9rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.help-toc a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0.85rem 2.5rem;
  max-width: var(--measure);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.875rem;
}

.callout {
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  background: var(--accent-soft);
  border-left: 5px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  font-weight: 800;
  color: #0b5c56;
}

kbd {
  display: inline-block;
  padding: 0.1em 0.4em;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161d;
    --panel: #1b232c;
    --panel-2: #26313c;
    --ink: #eef4f8;
    --ink-soft: #c6d3de;
    --muted: #9fb0bf;
    --line: #384654;
    --line-strong: #5b6d7d;
    --accent: #5eead4;
    --accent-ink: #05231f;
    --accent-soft: #10403a;
    --focus: #fbbf24;
    --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.6);
  }
  a {
    color: #7dd3c8;
  }
  .callout-title {
    color: var(--accent);
  }
  .cta:hover {
    background: #7cf3e0;
    border-color: #7cf3e0;
  }
}

/* ── Forced colours ──────────────────────────────────────────────────────── */
@media (forced-colors: active) {
  .card,
  .cta,
  .help-toc a,
  .curriculum-table th,
  .curriculum-table td,
  .callout {
    border: 1px solid CanvasText;
  }
  :where(a, button, [tabindex]):focus-visible {
    outline: 3px solid Highlight;
  }
  .steps li::before {
    border: 1px solid CanvasText;
  }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .hero-actions {
    display: none;
  }
  body.site {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  a[href^="http"]::after,
  a[href^="./"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444;
  }
}
