/*
 * Assurcast theme — Bootstrap 5.3 variable overrides.
 *
 * Card #132. Output of /impeccable craft. Loaded after the Bootstrap CDN
 * stylesheet in every layout that imports Bootstrap. Aesthetic anchor:
 * Stripe Press / Posthog blog (warm paper + ink + restrained terracotta).
 *
 * Design brief: kanban/tasks/132-bootstrap-theme-refresh-not-bulma-migration.md
 */

/* ----- Inter v4 variable font, self-hosted (privacy / GDPR / no third-party) ----- */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter/InterVariable.woff2') format('woff2-variations'),
       url('/fonts/inter/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter/InterVariable-Italic.woff2') format('woff2-variations'),
       url('/fonts/inter/InterVariable-Italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ----- Light mode (default) ----- */

:root {
  /* Surfaces — warm paper with a 2% lightness step between layers */
  --bs-body-bg: oklch(98% 0.005 85);
  --bs-body-bg-rgb: 250, 250, 246;
  --bs-body-color: oklch(20% 0.02 250);
  --bs-body-color-rgb: 45, 48, 57;
  --bs-body-secondary-color: oklch(45% 0.015 250);
  --bs-body-secondary-bg: oklch(96% 0.006 85);
  --bs-body-tertiary-color: oklch(60% 0.012 250);
  --bs-body-tertiary-bg: oklch(94% 0.007 85);
  --bs-emphasis-color: oklch(15% 0.02 250);
  --bs-emphasis-color-rgb: 33, 36, 44;
  --bs-secondary-color: oklch(45% 0.015 250);
  --bs-secondary-color-rgb: 102, 109, 122;
  --bs-secondary-bg: oklch(96% 0.006 85);
  --bs-secondary-bg-rgb: 244, 244, 240;
  --bs-tertiary-color: oklch(60% 0.012 250);
  --bs-tertiary-bg: oklch(94% 0.007 85);
  --bs-tertiary-bg-rgb: 238, 238, 234;

  /* Borders — paper-tinted, calmer than Bootstrap's cool grey */
  --bs-border-color: oklch(92% 0.005 85);
  --bs-border-color-translucent: oklch(20% 0.02 250 / 0.1);

  /* Primary — muted terracotta. Used for primary buttons, links, focus, active state. */
  --bs-primary: oklch(55% 0.15 25);
  --bs-primary-rgb: 182, 95, 67;
  --bs-primary-bg-subtle: oklch(95% 0.03 30);
  --bs-primary-border-subtle: oklch(85% 0.08 28);
  --bs-primary-text-emphasis: oklch(40% 0.16 25);

  /* Links — slightly darker than primary so body-text contrast stays comfortable */
  --bs-link-color: oklch(50% 0.15 25);
  --bs-link-color-rgb: 163, 85, 56;
  --bs-link-hover-color: oklch(38% 0.16 25);
  --bs-link-hover-color-rgb: 122, 60, 36;

  /* Semantic colors — retuned for harmony with the warm body */
  --bs-success: oklch(55% 0.13 145);
  --bs-success-rgb: 86, 136, 78;
  --bs-success-bg-subtle: oklch(94% 0.04 145);
  --bs-success-border-subtle: oklch(82% 0.08 145);
  --bs-success-text-emphasis: oklch(38% 0.13 145);

  --bs-info: oklch(60% 0.10 220);
  --bs-info-rgb: 89, 137, 168;
  --bs-info-bg-subtle: oklch(95% 0.025 220);
  --bs-info-border-subtle: oklch(82% 0.06 220);
  --bs-info-text-emphasis: oklch(40% 0.10 220);

  --bs-warning: oklch(85% 0.13 85);
  --bs-warning-rgb: 221, 192, 77;
  --bs-warning-bg-subtle: oklch(96% 0.05 85);
  --bs-warning-border-subtle: oklch(88% 0.10 85);
  --bs-warning-text-emphasis: oklch(45% 0.10 85);

  /* Danger — distinct from terracotta accent (deeper, more saturated red) */
  --bs-danger: oklch(48% 0.20 18);
  --bs-danger-rgb: 178, 53, 41;
  --bs-danger-bg-subtle: oklch(95% 0.04 18);
  --bs-danger-border-subtle: oklch(85% 0.10 18);
  --bs-danger-text-emphasis: oklch(35% 0.20 18);

  /* Radius — softer than Bootstrap default (0.375rem), shy of Bulma (0.5rem) */
  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.375rem;
  --bs-border-radius-lg: 0.75rem;
  --bs-border-radius-xl: 1rem;
  --bs-border-radius-xxl: 1.5rem;

  /* Type — Inter, self-hosted */
  --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Cards — softer header bg reduces the "Bootstrap card stamp" feeling */
  --bs-card-bg: oklch(99% 0.003 85);
  --bs-card-cap-bg: oklch(96% 0.007 85);

  /* Focus ring — terracotta @ 0.25 alpha, WCAG 2.2 AA non-text contrast */
  --bs-focus-ring-color: rgba(182, 95, 67, 0.25);
}

/* ----- Dark mode (peer-tuned, not minimum-viable) ----- */

[data-bs-theme="dark"] {
  /* Surfaces — warm charcoal carrying the paper hue, low-glare for evening reading */
  --bs-body-bg: oklch(20% 0.012 80);
  --bs-body-bg-rgb: 46, 44, 37;
  --bs-body-color: oklch(90% 0.005 85);
  --bs-body-color-rgb: 229, 227, 220;
  --bs-body-secondary-color: oklch(70% 0.008 85);
  --bs-body-secondary-bg: oklch(24% 0.012 80);
  --bs-body-tertiary-color: oklch(55% 0.012 85);
  --bs-body-tertiary-bg: oklch(28% 0.012 80);
  --bs-emphasis-color: oklch(98% 0.005 85);
  --bs-emphasis-color-rgb: 250, 248, 240;
  --bs-secondary-color: oklch(70% 0.008 85);
  --bs-secondary-color-rgb: 169, 165, 156;
  --bs-secondary-bg: oklch(24% 0.012 80);
  --bs-secondary-bg-rgb: 56, 53, 46;
  --bs-tertiary-color: oklch(55% 0.012 85);
  --bs-tertiary-bg: oklch(28% 0.012 80);
  --bs-tertiary-bg-rgb: 65, 62, 54;

  --bs-border-color: oklch(32% 0.012 80);
  --bs-border-color-translucent: oklch(98% 0.005 85 / 0.15);

  /* Primary — terracotta retuned brighter for OKLCH contrast against dark surface */
  --bs-primary: oklch(70% 0.16 30);
  --bs-primary-rgb: 214, 139, 111;
  --bs-primary-bg-subtle: oklch(28% 0.10 28);
  --bs-primary-border-subtle: oklch(45% 0.13 28);
  --bs-primary-text-emphasis: oklch(80% 0.13 30);

  --bs-link-color: oklch(72% 0.16 30);
  --bs-link-color-rgb: 220, 144, 116;
  --bs-link-hover-color: oklch(82% 0.13 30);
  --bs-link-hover-color-rgb: 240, 175, 150;

  --bs-success: oklch(70% 0.14 145);
  --bs-success-rgb: 124, 179, 100;
  --bs-info: oklch(72% 0.10 220);
  --bs-info-rgb: 132, 173, 205;
  --bs-warning: oklch(80% 0.13 85);
  --bs-warning-rgb: 207, 178, 67;
  --bs-danger: oklch(65% 0.20 18);
  --bs-danger-rgb: 217, 106, 89;

  --bs-card-bg: oklch(22% 0.012 80);
  --bs-card-cap-bg: oklch(25% 0.012 80);

  --bs-focus-ring-color: rgba(214, 139, 111, 0.4);
}

/* ----- Typography polish ----- */

body {
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tighten heading tracking — Inter at large sizes benefits from a small negative letter-spacing.
   Reject during craft if it reads too design-y. */
h1, .h1 { letter-spacing: -0.02em; }
h2, .h2 { letter-spacing: -0.018em; }
h3, .h3 { letter-spacing: -0.015em; }
h4, .h4,
h5, .h5 { letter-spacing: -0.01em; }

/* Tabular numbers in admin tables — keeps numeric columns aligned regardless of digit width */
.table tbody td { font-variant-numeric: tabular-nums; }
