/*
 * Strixe design tokens + component layer.
 * Load on every page alongside /assets/design-tokens.js (Tailwind theme).
 * Rules live in design.md at the repo root.
 *
 * Palette: brand green #1d7a55 · dark navy #0f172a · pure white #ffffff.
 * No cream, no purple, no gradients-as-decoration.
 */

:root {
  /* Color */
  --color-brand: #1d7a55;
  --color-brand-dark: #176145;
  --color-brand-tint: #f0faf5;
  --color-navy: #0f172a;
  --color-navy-deep: #0b1220;
  --color-white: #ffffff;
  --color-ink: #0f172a;
  --color-ink-muted: #475569;
  --color-ink-faint: #64748b;
  --color-line: #e2e8f0;

  /* Typography */
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --text-base: 1rem;
  --leading-body: 1.65;
  --tracking-heading: -0.02em;
  --tracking-hero: -0.03em;
  --tracking-label: 0.14em;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .08);
  --shadow-lift: 0 24px 48px -24px rgba(15, 23, 42, .16);
  --shadow-brand: 0 12px 32px -12px rgba(29, 122, 85, .35);
}

/* ---------- Base ---------- */

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--color-white);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

.dark body {
  /* navy-deep page surface so navy (#0f172a) cards keep contrast */
  background: var(--color-navy-deep);
  color: #f1f5f9;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
  line-height: 1.15;
}

h1 {
  letter-spacing: var(--tracking-hero);
  line-height: 1.05;
}

/* ---------- Components ---------- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0.875rem 1.75rem;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
  cursor: pointer;
}

.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
  background: var(--color-brand);
  color: var(--color-white);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { background: var(--color-brand-dark); }

.btn-secondary {
  background: var(--color-white);
  color: var(--color-brand-dark);
  box-shadow: inset 0 0 0 1px #b4e5cc;
}
.btn-secondary:hover { background: var(--color-brand-tint); }

.btn-ghost {
  background: transparent;
  color: var(--color-ink-muted);
}
.btn-ghost:hover { color: var(--color-ink); }

.btn-navy {
  background: var(--color-navy);
  color: var(--color-white);
}
.btn-navy:hover { background: #1e293b; }

/* Card */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, .8), var(--shadow-soft);
}

.dark .card {
  background: var(--color-navy);
  box-shadow: inset 0 0 0 1px rgba(51, 65, 85, .8);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
}
.badge-brand { color: var(--color-brand-dark); background: var(--color-brand-tint); box-shadow: inset 0 0 0 1px #d9f2e4; }
.badge-neutral { color: var(--color-ink-faint); background: #f1f5f9; }
.badge-navy { color: #e2e8f0; background: var(--color-navy); }

/* Inputs */
.input {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  background: var(--color-white);
  color: var(--color-ink);
  box-shadow: inset 0 0 0 1px var(--color-line);
  transition: box-shadow .15s ease;
}
.input::placeholder { color: #94a3b8; }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--color-brand); }
.input[readonly] { background: #f1f5f9; color: var(--color-ink-faint); cursor: not-allowed; }
.dark .input { background: #1e293b; color: #f1f5f9; box-shadow: inset 0 0 0 1px #334155; }
.dark .input[readonly] { background: #1e293b; color: #94a3b8; }

/* Section kicker label */
.section-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-brand);
}
.section-label-muted { color: var(--color-ink-faint); }

/* Phosphor inline icons */
.ph-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex-shrink: 0;
  vertical-align: -0.125em;
}
