/* ============================================================
   LedgerBrick — Design Tokens & Base
   Brand v1.2 — Institutional fintech: deep ink, paper/stone, capital green accent.
   ============================================================ */

:root,
[data-theme='light'] {
  /* Brand v1.2 palette — paper, stone, ink */
  --color-bg: #ffffff;          /* paper */
  --color-surface: #f5f4ef;     /* warm stone */
  --color-surface-2: #ffffff;
  --color-surface-offset: #f5f4ef;
  --color-surface-offset-2: #ecebe4;
  --color-divider: #d8d6cc;     /* stone line */
  --color-border: #d8d6cc;

  /* Text — deep ink */
  --color-text: #0b1b2e;        /* ink */
  --color-text-muted: #475569;  /* ledger slate */
  --color-text-faint: #94a3b8;  /* muted */
  --color-text-inverse: #ffffff;

  /* Primary — deep ink (structure/headlines) */
  --color-primary: #0b1b2e;
  --color-primary-hover: #142c4a;
  --color-primary-active: #07111e;

  /* Accent — Capital Green (visible public accent) */
  --color-accent: #4b7a55;          /* capital_green */
  --color-accent-hover: #3a6344;    /* capital_green_deep */
  --color-accent-faint: #e6efe8;    /* capital_green_soft */

  /* State colors — reserved for state, not decoration */
  --color-warning: #b8860b;     /* compliance_amber (compliance only, semantic) */
  --color-success: #4b7a55;     /* capital_green */
  --color-error: #9e3d35;       /* risk_red (semantic only) */

  /* Dark surface (used for the workflow section) */
  --color-ink-bg: #0b1b2e;
  --color-ink-surface: #122642;
  --color-ink-border: #1d3052;
  --color-ink-text: #ffffff;
  --color-ink-muted: #a3afc5;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.375rem, 1.15rem + 1vw, 1.875rem);
  --text-2xl: clamp(1.875rem, 1.3rem + 1.8vw, 2.625rem);
  --text-3xl: clamp(2.25rem, 1.4rem + 2.6vw, 3.5rem);
  --text-hero: clamp(2.125rem, 1.3rem + 2.8vw, 3.625rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

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

  /* Transitions */
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, 0.06);
  --shadow-md: 0 6px 18px rgba(11, 31, 58, 0.08);
  --shadow-lg: 0 18px 42px rgba(11, 31, 58, 0.12);

  /* Content widths */
  --content-narrow: 720px;
  --content-default: 1080px;
  --content-wide: 1240px;

  /* Fonts — Brand v1
     Display: institutional serif fallback stack until v2 licensing. */
  --font-display: 'GT Sectra', 'Tiempos Headline', 'Source Serif 4', 'Georgia',
    ui-serif, serif;
  --font-body: 'Inter', 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  scroll-padding-top: 88px;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: -0.01em;
}

p,
li,
figcaption {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--color-accent-faint);
  color: var(--color-text);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

a,
button,
[role='button'],
input,
textarea,
select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 999;
}
.skip-link:focus {
  top: var(--space-4);
}
