/*
 * Design tokens. Every colour, font and radius in the app comes from here;
 * components never hardcode a hex value.
 *
 * Light values come from the registration-flow wireframe and dark values from
 * Option A (Midnight Cabo), which share one palette. Mapping table:
 * design/wireframe/README.md.
 *
 * Dark mode follows the visitor's system setting. A page can force a theme
 * with <Base theme="dark">, which sets data-theme on <html>; the invitation
 * landing page does this because Option A is dark by design.
 */

:root {
  --bg: #f9f9fb;
  --surface: #ffffff;
  --fg: #1a191d;
  --muted: #4f4c56;
  --line: #ceccd3;
  --line-soft: #e6e5e9;
  --field-border: #847f90;
  --accent: #593ba0;
  --accent-hover: #6e47d1;
  --on-accent: #ffffff;
  --accent-soft: #ece7f9;
  --link: #593ba0;
  --focus: #6e47d1;

  --success-bg: #edfcef;
  --success-fg: #165020;
  --success-line: #227e31;
  --warn-bg: #fdf9ed;
  --warn-fg: #5a490c;
  --warn-line: #b39219;
  --danger-bg: #fbeeee;
  --danger-fg: #7a2e2e;
  --danger-line: #b34a4a;

  --font-body: "Avenir", "Avenir Next", "Nunito Sans", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --font-display: "Unity Display", "Outfit", system-ui, -apple-system,
    "Segoe UI", sans-serif;

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 16px;

  /* The "invitation shell" (registration steps and trip hub, 2026-11-05):
     a dark photo band on top, light cards overlapping it. The band is dark
     in every theme, so its colours are fixed rather than themed. */
  --shell-page: #f4f3f7;
  --shell-band: #0d0d0e;
  --shell-lilac: #c9b8f2;
  --shell-on-band: #e6e5e9;
  --shell-on-band-muted: #ceccd3;
  --radius-card: 20px;
  --radius-control: 12px;
  --shadow-card: 0 12px 32px rgba(13, 13, 14, 0.12);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Touch targets: 44px minimum; the designs use 50px buttons, 46px fields. */
  --control-h: 50px;
  --field-h: 46px;

  color-scheme: light;
}

/*
 * The dark palette appears twice: once for visitors whose system is set to
 * dark (unless the page forces light), and once for pages that force dark.
 * CSS can't share one block between a media query and a selector, so keep the
 * two in step when you change either.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0e;
    --surface: #1a191d;
    --fg: #f9f9fb;
    --muted: #ceccd3;
    --line: #2b2735;
    --line-soft: #232128;
    --field-border: #847f90;
    --accent: #593ba0;
    --accent-hover: #6e47d1;
    --on-accent: #ffffff;
    --accent-soft: #2d2347;
    --link: #c9b8f2;
    --focus: #8b6be0;

    --success-bg: #12301a;
    --success-fg: #b9efc4;
    --success-line: #3fa356;
    --warn-bg: #2e2710;
    --warn-fg: #f1dc8e;
    --warn-line: #b39219;
    --danger-bg: #3a1a1a;
    --danger-fg: #f6c7c1;
    --danger-line: #c96a6a;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0d0e;
  --surface: #1a191d;
  --fg: #f9f9fb;
  --muted: #ceccd3;
  --line: #2b2735;
  --line-soft: #232128;
  --field-border: #847f90;
  --accent: #593ba0;
  --accent-hover: #6e47d1;
  --on-accent: #ffffff;
  --accent-soft: #2d2347;
  --link: #c9b8f2;
  --focus: #8b6be0;

  --success-bg: #12301a;
  --success-fg: #b9efc4;
  --success-line: #3fa356;
  --warn-bg: #2e2710;
  --warn-fg: #f1dc8e;
  --warn-line: #b39219;
  --danger-bg: #3a1a1a;
  --danger-fg: #f6c7c1;
  --danger-line: #c96a6a;

  color-scheme: dark;
}
/*
 * Element defaults and a few utility classes. Component styles live in the
 * component's own .astro file; colours and sizes come from tokens.css.
 */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font-body);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-3);
}
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.375rem, 4vw, 1.75rem); }
h3 { font-size: 1.125rem; }

p { margin: 0 0 var(--space-4); }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }

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

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--accent);
}

/* A centred reading column. Pages that need full-bleed sections skip it. */
.container {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: var(--space-7) var(--space-4);
}

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--link);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

/* Visually hidden but still read by screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  font-size: 0.875rem;
  color: var(--muted);
}

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