/* Palette = the app's Classic Cream theme (lib/app/theme/app_tokens.dart,
   AppPalette): parchment surfaces, forest-teal primary, amber accent.
   Dark mode mirrors the app's night-forest scheme. */
:root {
  --bg: #fff8ee;          /* parchment */
  --surface: #f6ecdd;     /* parchmentHigh (cards) */
  --text: #2a2420;        /* ink */
  --muted: #5e554d;       /* inkMuted */
  --border: #e6d9c6;      /* outline #b5a898, softened */
  --primary: #2f6f5e;     /* forest */
  --primary-ink: #ffffff;
  --accent: #f6be5a;      /* amberLight */
  --soft: #cdede2;        /* forestContainer */
  --on-soft: #16483c;     /* forestContainerDark */
  --shadow: rgb(47 111 94 / .25);
  --radius: 20px;
  --max: 960px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a18;        /* night */
    --surface: #1e2a27;   /* nightHigh */
    --text: #ede6dc;      /* moonlight */
    --muted: #bfb6aa;     /* moonlightMuted */
    --border: #33413d;
    --primary: #7fc8b2;   /* forestLight */
    --primary-ink: #16483c;
    --accent: #f6be5a;
    --soft: #16483c;      /* forestContainerDark */
    --on-soft: #cdede2;
    --shadow: rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

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

a { color: var(--primary); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--surface); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { left: 16px; z-index: 10; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.site-nav { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--primary); }

@media (max-width: 640px) {
  .site-nav { order: 3; width: 100%; margin-left: 0; }
  .lang { margin-left: auto; }
}

.lang {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-weight: 700; font-size: .85rem; text-decoration: none;
}
.lang:hover { border-color: var(--primary); color: var(--primary); }

/* Hero */
.hero { padding: 56px 0 40px; text-align: center; }
.hero img.icon { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 12px 32px var(--shadow); }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.15; margin: 20px 0 12px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  background: var(--primary); color: var(--primary-ink);
  font-weight: 800; text-decoration: none;
}
.btn.secondary { background: var(--soft); color: var(--on-soft); }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Sections */
section { padding: 32px 0; }
section > h2 { font-size: 1.6rem; margin: 0 0 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }

/* Legal / document pages */
.doc { padding: 40px 0 24px; max-width: 760px; }
.doc h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.2; margin: 0 0 8px; }
.doc .meta { color: var(--muted); margin: 0 0 28px; }
.doc h2 { font-size: 1.3rem; margin: 32px 0 8px; }
.doc h3 { font-size: 1.1rem; margin: 20px 0 6px; }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc li { margin: 4px 0; }
.callout {
  background: var(--soft); color: var(--on-soft); border-radius: var(--radius);
  padding: 16px 20px; margin: 20px 0;
}
.callout p { margin: 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .97rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-weight: 800; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 28px 0 40px; color: var(--muted); font-size: .95rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.site-footer a { color: var(--muted); }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.missing { color: #a6452f; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
