/* Agentic Demand — Design Tokens (Direction B, locked 2026-04-22)
   Single source of truth. Every page links this file first.
   See memory/context/content-preferences.md "Web Visual Canon" + docs/brand-system.md.
*/

:root {
  /* Color */
  --color-bg: #FFFFFF;
  --color-bg-soft: #F6FAF8;
  --color-bg-invert: #0F3D2E;
  --color-bg-invert-deep: #0A2A20;

  --color-text: #0A1F17;
  --color-text-muted: #4B5F56;
  --color-text-invert: #FFFFFF;
  --color-text-invert-muted: rgba(255,255,255,0.72);

  --color-brand: #0F3D2E;
  --color-brand-soft: #164A38;

  --color-accent: #34D399;
  --color-accent-soft: #D1FAE5;
  --color-accent-deep: #059669;

  --color-border: #E5EBE8;
  --color-border-strong: #0F3D2E;

  /* Typography */
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-eyebrow: 0.8125rem;       /* 13px */
  --fs-body: 1.0625rem;          /* 17px */
  --fs-lead: 1.25rem;            /* 20px */
  --fs-h3: 1.5rem;               /* 24px */
  --fs-h2: 2.5rem;               /* 40px */
  --fs-h1: 3.5rem;               /* 56px */
  --fs-display: 4.5rem;          /* 72px, big stat numbers */

  --lh-tight: 1.05;
  --lh-snug: 1.2;
  --lh-body: 1.55;

  --tracking-tight: -0.02em;
  --tracking-eyebrow: 0.08em;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 120px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15,61,46,0.06);
  --shadow-md: 0 4px 12px rgba(15,61,46,0.08);
  --shadow-lg: 0 12px 32px rgba(15,61,46,0.12);

  /* Layout */
  --container-max: 1200px;
  --gutter: 24px;

  /* Motion */
  --motion-fast: 150ms ease-out;
  --motion-base: 250ms ease-out;
  --motion-slow: 400ms ease-out;
}

@media (max-width: 720px) {
  :root {
    --fs-h1: 2.5rem;             /* 40px */
    --fs-h2: 1.875rem;           /* 30px */
    --fs-display: 3rem;          /* 48px */
    --gutter: 20px;
    --space-10: 80px;
    --space-9: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-base: 0ms;
    --motion-slow: 0ms;
  }
}

/* Reset + base
   Pages may override but should not need to. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  color: var(--color-brand);
  font-weight: 700;
  margin: 0 0 var(--space-4);
  letter-spacing: var(--tracking-tight);
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-snug); }
h3 { font-size: var(--fs-h3); line-height: 1.3; font-weight: 600; letter-spacing: 0; }

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

a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--color-accent); transition: color var(--motion-fast); }
a:hover { color: var(--color-brand-soft); }

/* Layout helpers */
.agd-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.agd-section { padding: var(--space-9) 0; }
.agd-section--hero { padding: var(--space-10) 0 var(--space-9); }
.agd-section--soft { background: var(--color-bg-soft); }
.agd-section--invert { background: var(--color-bg-invert); color: var(--color-text-invert); }
.agd-section--invert h1, .agd-section--invert h2, .agd-section--invert h3 { color: var(--color-text-invert); }

/* Eyebrow tag */
.agd-eyebrow {
  display: inline-block;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-accent-deep);
  background: var(--color-accent-soft);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}

/* Buttons */
.agd-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}
.agd-btn--primary { background: var(--color-brand); color: var(--color-text-invert); }
.agd-btn--primary:hover { background: var(--color-brand-soft); color: var(--color-text-invert); }
.agd-btn--secondary { background: var(--color-bg); color: var(--color-brand); border-color: var(--color-brand); }
.agd-btn--secondary:hover { background: var(--color-bg-soft); }
.agd-btn--accent { background: var(--color-accent); color: var(--color-brand); }
.agd-btn--accent:hover { background: var(--color-accent-deep); color: var(--color-text-invert); }

/* Tile */
.agd-tile {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    transform var(--motion-fast),
    box-shadow var(--motion-fast),
    color var(--motion-fast);
}
.agd-tile:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.agd-tile:hover h3,
.agd-tile:hover .tile-num,
.agd-tile:hover .home-feature-num {
  color: var(--color-accent-deep);
}

/* Output / stat card */
.agd-stat-card {
  background: linear-gradient(160deg, var(--color-bg-invert) 0%, var(--color-bg-invert-deep) 100%);
  color: var(--color-text-invert);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
}
.agd-stat-card .agd-stat-label { color: var(--color-text-invert-muted); font-size: 14px; text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); margin-bottom: var(--space-2); }
.agd-stat-card .agd-stat-value { color: var(--color-accent); font-size: var(--fs-display); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.agd-stat-card .agd-stat-sub { color: var(--color-text-invert-muted); font-size: 14px; margin-top: var(--space-2); }

/* Focus state */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
