/* eagraiclainne website — shared styles. Extracted from docs/design-plan.html
   (the frozen spec); tokens and rules are the design-plan's, applied.

   Mark colours use the app's canonical names (--mark-red … --mark-grey,
   matching web/src/theme/themes.css) rather than the design-plan's symbol
   aliases (--mark-fox …) — one scheme site-wide, since assets/css/app-themes.css
   and demo/demo.css are verbatim app copies using the colour names.

   Canonical header/footer markup (duplicate per page, greps must match):

   <header class="site band">
     <div class="wrap">
       <nav class="topnav" aria-label="Site">
         <a class="wordmark" href="{root}">eagraiclainne</a>
         <a href="{root}demo/">Demo</a>
         <a href="{root}compare/">Compare</a>
         <a href="{root}docs/">Docs</a>
       </nav>
       ...page hero/heading...
     </div>
   </header>

   <footer class="site band">
     <div class="wrap">
       <nav aria-label="Footer"><a href="{root}docs/">Docs</a> · <a href="{root}demo/">Demo</a> · <a href="{root}compare/">Compare</a> · <a href="{root}docs/install.html">Install</a></nav>
       <p class="soft">No cookies. No analytics. No external requests.</p>
     </div>
   </footer>
*/

/* ---------- Tokens: one family, light + dark ---------- */
:root {
  --paper:#F6F3EC; --card:#FFFFFF; --ink:#26221B; --ink-soft:#6C6154;
  --band:#14382E; --on-band:#F3F1E8; --on-band-soft:#AFC6BB;
  --accent:#1E6E5C; --on-accent:#FFFFFF;
  --celebrate:#E8A33D; --danger:#A63A2B; --line:#E4DDCE;
  --radius:12px;
}
[data-mode="dark"] {
  --paper:#161D19; --card:#212A24; --ink:#EDEAE1; --ink-soft:#A8B0A4;
  --band:#1E3A30; --on-band:#EDF5EF; --on-band-soft:#A9C2B6;
  --accent:#58B598; --on-accent:#161D19;
  --celebrate:#E8A33D; --danger:#E2715E; --line:#33403A;
}

/* Member marks: fixed across every theme, mode, and surface. Law, not taste.
   (Okabe-Ito; names match the app's themes.css.) */
:root {
  --mark-red:#D55E00; --mark-orange:#E69F00; --mark-yellow:#F0E442;
  --mark-green:#009E73; --mark-blue:#0072B2; --mark-sky:#56B4E9;
  --mark-pink:#CC79A7; --mark-grey:#595959;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { font-size: 18px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  line-height: 1.6; font-variant-numeric: tabular-nums;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3 { font-family: "Familjen Grotesk", sans-serif; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; margin: 0 0 0.4rem; }
h2 { font-size: 1.6rem; font-weight: 700; margin: 0 0 1rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.measure { max-width: 46rem; }

/* ---------- Mode toggle ---------- */
.mode-dock {
  position: fixed; top: 0.9rem; right: 0.9rem; z-index: 50;
  display: flex; gap: 0.3rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.25rem;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.10);
}
.mode-dock button {
  font-family: inherit; font-size: 0.8rem; font-weight: 700;
  min-height: 44px; padding: 0.2rem 0.8rem;
  border: 2px solid transparent; border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.mode-dock button[aria-pressed="true"] {
  background: var(--accent); color: var(--on-accent);
}

/* ---------- Spruce bands: the site's own move ---------- */
.band {
  background: var(--band); color: var(--on-band);
  transition: background 0.3s ease, color 0.3s ease;
}
.band a { color: var(--on-band); }
.band .soft { color: var(--on-band-soft); }

header.site { padding: 2rem 0 2.6rem; }
@media (max-width: 700px) { header.site { padding-top: 4.6rem; } }
.topnav {
  display: flex; align-items: baseline; gap: 1.4rem;
  margin-bottom: 2rem; font-weight: 700;
  padding: 0.8rem 0; /* room for the mark, which overhangs the text row */
}
.topnav a { text-decoration: none; padding: 0.4rem 0; }
.topnav a:hover { text-decoration: underline; }
/* The mark is absolutely positioned so the wordmark and nav links share a
   true text baseline — flex-centring two different faces never lines up. */
.topnav a.wordmark {
  font-family: "Familjen Grotesk", sans-serif; font-weight: 700;
  font-size: 1.15rem; margin-right: 1.2rem;
  position: relative; padding-left: calc(60px + 0.7rem);
}
.wordmark-logo {
  position: absolute; left: 0; top: 50%; margin-top: -30px;
  border-radius: 13px;
}
.kicker {
  font-family: "Familjen Grotesk", sans-serif; font-weight: 600;
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--on-band-soft); margin-bottom: 0.6rem;
}

footer.site { padding: 2.2rem 0 2.6rem; font-size: 0.9rem; }
footer.site nav { font-weight: 700; }
footer.site .soft { margin: 0.7rem 0 0; }

/* ---------- Shared pieces ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.6rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.btn {
  font-family: inherit; font-size: 0.95rem; font-weight: 700;
  min-height: 44px; padding: 0.55rem 1.3rem; cursor: pointer;
  border-radius: var(--radius); border: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 0.45rem;
  text-decoration: none;
}
.btn-solid { background: var(--celebrate); color: #26221B; border-color: var(--celebrate); }
.btn-ghost { background: transparent; color: var(--on-band); border-color: var(--on-band-soft); }
.btn-ghost:hover { border-color: var(--on-band); }
.btn-accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.mark {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.5rem; color: #fff;
}
.mark.sm { width: 28px; height: 28px; font-size: 0.85rem; }

.alert-danger {
  background: color-mix(in srgb, var(--danger) 12%, var(--card));
  border-left: 5px solid var(--danger);
  border-radius: var(--radius); padding: 0.7rem 1rem; font-size: 0.92rem;
}
.alert-danger b { color: var(--danger); }

pre {
  background: color-mix(in srgb, var(--ink) 6%, var(--paper));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem; overflow-x: auto; font-size: 0.8rem; line-height: 1.5;
}
code { font-family: "Sligoil Micro", ui-monospace, Menlo, monospace; }
p > code, li > code, td > code, h1 > code, h2 > code, h3 > code {
  background: color-mix(in srgb, var(--ink) 8%, var(--paper));
  padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.85em;
}
.band pre {
  background: rgb(0 0 0 / 0.25); border-color: transparent; color: var(--on-band);
}
.band p > code, .band li > code {
  background: rgb(0 0 0 / 0.25); color: var(--on-band);
}

table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }

/* ---------- Confetti (ported from the app's confetti.ts / app.css) ---------- */
.confetti-layer {
  position: fixed; inset: 0; overflow: hidden;
  pointer-events: none; z-index: 999;
}
.confetti-piece {
  position: absolute;
  animation: confetti-path var(--dur) linear var(--delay) both;
}
@keyframes confetti-path {
  0% {
    transform: translate(0, 0);
    animation-timing-function: cubic-bezier(0.15, 0.65, 0.35, 1);
  }
  18% {
    transform: translate(var(--mx), var(--my));
    animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.6);
  }
  100% { transform: translate(var(--ex), var(--ey)); }
}
.confetti-flake {
  display: block;
  animation: confetti-sway var(--sway) ease-in-out var(--sdelay) infinite alternate;
}
@keyframes confetti-sway {
  from { transform: translateX(calc(-1 * var(--amp))) rotate(var(--r1)); }
  to   { transform: translateX(var(--amp)) rotate(var(--r2)); }
}
