/* Ignite design system — single source of truth for both web surfaces.
 *
 * Generated by hand from docs/design.md (no build step). It is:
 *   - linked directly by the public site (site/index.html, site/privacy.html)
 *   - inlined into the <style> block of the client web app (src/web/render.js)
 *
 * Edit tokens/typography HERE — never duplicate them elsewhere.
 *
 * Contents: @font-face · colour tokens (light + dark) · base elements ·
 * the Material-3 type scale as utility classes · shared layout (.wrap, header,
 * footer). App-specific component CSS lives in src/web/render.js.
 */

/* ── fonts ──────────────────────────────────────────────────────────────────
 * Three files only, per the "Loading footprint" note in design.md:
 * Zain 400 (display/headline) + Nunito 400/600 (everything else).
 */
@font-face {
  font-family: 'Zain';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/zain-400.ttf) format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/nunito-400.ttf) format('truetype');
}
@font-face {
  font-family: 'Nunito';
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/nunito-600.ttf) format('truetype');
}

/* ── colour tokens — light (colors.light in design.md) ───────────────────── */
:root {
  --surface: #fafaf9;
  --surface-dim: #d9d8d3;
  --surface-bright: #ffffff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f5f4f0;
  --surface-container: #f1f0ec;
  --surface-container-high: #ebeae5;
  --surface-container-highest: #e5e4e0;
  --surface-variant: #e5e4e0;
  --on-surface: #1c1b18;
  --on-surface-variant: #4a4945;
  --inverse-surface: #2e2d2a;
  --inverse-on-surface: #f5f4f0;
  --outline: #93918b;
  --outline-variant: #cecdc8;
  --surface-tint: #b80000;

  --primary: #b80000;
  --on-primary: #ffffff;
  --primary-container: #e60000;
  --on-primary-container: #ffffff;
  --inverse-primary: #ffb4b4;

  --secondary: #2100c6;
  --on-secondary: #ffffff;
  --secondary-container: #3317fe;
  --on-secondary-container: #ffffff;

  --tertiary: #6c5e00;
  --on-tertiary: #ffffff;
  --tertiary-container: #c3ac00;
  --on-tertiary-container: #1c1900;

  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #410002;

  --background: #fafaf9;
  --on-background: #1c1b18;
  --scrim: #000000;
  --shadow: #000000;

  /* fixed accents — identical across light/dark (colors.fixed) */
  --primary-fixed: #ffdada;
  --primary-fixed-dim: #ffb4b4;
  --on-primary-fixed: #410000;
  --on-primary-fixed-variant: #900000;
  --secondary-fixed: #e2dfff;
  --secondary-fixed-dim: #c2c1ff;
  --on-secondary-fixed: #0c006a;
  --on-secondary-fixed-variant: #2800e7;
  --tertiary-fixed: #ffe32b;
  --tertiary-fixed-dim: #e1c700;
  --on-tertiary-fixed: #211c00;
  --on-tertiary-fixed-variant: #514700;

  /* success — not in design.md; needed for the app's status dots/trends.
   * Amber maps to --tertiary, red to --error. */
  --success: #2f8a3e;

  /* shape (rounded) */
  --r-sm: 0.25rem;
  --r: 0.5rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-xl: 1.5rem;
  --r-full: 9999px;

  /* spacing */
  --gutter: 1.5rem; /* desktop-gutter */
  --stack: 2rem; /* stack-gap */
  --shadow-hard: 4px 4px 0 rgba(28, 27, 24, 0.16);

  /* font stacks (typography.fontStacks) */
  --font-display: 'Zain', 'Arial Narrow', 'Helvetica Neue', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ── colour tokens — dark (colors.dark in design.md) ─────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #161513;
    --surface-dim: #161513;
    --surface-bright: #3d3b37;
    --surface-container-lowest: #100f0d;
    --surface-container-low: #1f1e1b;
    --surface-container: #23221f;
    --surface-container-high: #2e2d29;
    --surface-container-highest: #393834;
    --surface-variant: #4a4945;
    --on-surface: #e5e4e0;
    --on-surface-variant: #cdcbc5;
    --inverse-surface: #e5e4e0;
    --inverse-on-surface: #2e2d2a;
    --outline: #979590;
    --outline-variant: #4a4945;
    --surface-tint: #ffb4b4;

    --primary: #ffb4b4;
    --on-primary: #680000;
    --primary-container: #900000;
    --on-primary-container: #ffdada;
    --inverse-primary: #b80000;

    --secondary: #c2c1ff;
    --on-secondary: #0c006a;
    --secondary-container: #2800e7;
    --on-secondary-container: #e2dfff;

    --tertiary: #e1c700;
    --on-tertiary: #383000;
    --tertiary-container: #514700;
    --on-tertiary-container: #ffe32b;

    --error: #ffb4ab;
    --on-error: #690005;
    --error-container: #93000a;
    --on-error-container: #ffdad6;

    --background: #161513;
    --on-background: #e5e4e0;

    --success: #7fcf8c;
    --shadow-hard: 4px 4px 0 rgba(0, 0, 0, 0.5);
  }
}

/* ── base elements ──────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
p {
  margin: 0.6em 0;
}
ul,
ol {
  padding-left: 1.4em;
}
li {
  margin: 0.3em 0;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
strong,
b {
  font-weight: 600;
} /* emphasis token — inherits size/line-height */
.muted {
  color: var(--on-surface-variant);
}
.small {
  font-size: 14px;
}

/* ── type scale (typography.* in design.md) ─────────────────────────────────
 * Utility classes; h1/h2/h3 default to the headline tiers. Mobile overrides
 * below the 640px breakpoint (breakpoints.mobile-max).
 */
.display-lg,
.display-md,
.display-sm,
.headline-lg,
.headline-md,
.headline-sm,
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0 0 0.4em;
}
.title-lg,
.title-md,
.title-sm,
.body-lg,
.body-md,
.body-sm,
.label-lg,
.label-md,
.label-sm {
  font-family: var(--font-body);
}

.display-lg {
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.display-md {
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.display-sm {
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.headline-lg,
h1 {
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.headline-md,
h2 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.headline-sm,
h3 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.title-lg {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.title-md {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.title-sm {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.body-lg {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
}
.body-md {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}
.body-sm {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.label-lg {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.label-md {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.label-sm {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

/* ── buttons (design.md §Components) ─────────────────────────────────────────
 * Shared across the public site and (potentially) the app. Primary = filled
 * red; secondary = neutral ghost with an outline. 0.5rem radius, label-lg text.
 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition:
    filter 0.15s ease,
    background 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  filter: brightness(0.95);
}
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-secondary {
  background: transparent;
  color: var(--on-surface);
  border-color: var(--outline);
}
.btn-secondary:hover {
  background: var(--surface-container);
  filter: none;
}

/* ── shared layout ──────────────────────────────────────────────────────── */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.col {
  max-width: 880px;
}

header.bar {
  border-bottom: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
}
header.bar .wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
header.bar img.logo {
  height: 40px;
  width: 40px;
  border-radius: var(--r-full);
  display: block;
}
header.bar .brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
}
header.bar .who {
  margin-left: auto;
  font-size: 14px;
  color: var(--on-surface-variant);
}

footer.bar {
  border-top: 1px solid var(--outline-variant);
  margin-top: 3rem;
  padding: 1.2rem 0;
  font-size: 13px;
  color: var(--on-surface-variant);
}

/* ── mobile (≤ breakpoints.mobile-max) ──────────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --gutter: 1rem;
  } /* mobile-gutter */
  .display-lg {
    font-size: 44px;
  }
  .display-md {
    font-size: 38px;
  }
  .display-sm {
    font-size: 34px;
  }
  .headline-lg,
  h1 {
    font-size: 30px;
  }
  .headline-md,
  h2 {
    font-size: 26px;
  }
  header.bar .brand {
    font-size: 18px;
  }
}
