/* ============================================
   Diskin v. Shelley — Design Tokens + Base
   Editorial archive aesthetic
   ============================================ */

:root,
[data-theme='light'] {
  /* Surfaces — paper white, warm off-white, charcoal */
  --color-bg: #fafaf7;
  --color-surface: #ffffff;
  --color-surface-2: #f5f4ef;
  --color-surface-offset: #eeece5;
  --color-surface-offset-2: #e4e1d8;
  --color-surface-dynamic: #dcd9ce;
  --color-divider: #d7d4c9;
  --color-border: #c9c5b8;

  /* Text — deep charcoal, not pure black */
  --color-text: #1a1c1f;
  --color-text-muted: #5e6268;
  --color-text-faint: #9a9e9f;
  --color-text-inverse: #fafaf7;

  /* Primary accent — deep slate navy */
  --color-primary: #1e2f4d;
  --color-primary-hover: #172540;
  --color-primary-active: #0f1b30;
  --color-primary-highlight: #d6dce6;

  /* Muted taxonomy colors for tag chips (restrained) */
  --color-tag-filing: #1e2f4d;
  --color-tag-filing-bg: #e2e6ee;
  --color-tag-finance: #4a4120;
  --color-tag-finance-bg: #ece8d8;
  --color-tag-governance: #3b3342;
  --color-tag-governance-bg: #e8e4eb;
  --color-tag-property: #2d4531;
  --color-tag-property-bg: #dee7df;
  --color-tag-default: #3d3d3d;
  --color-tag-default-bg: #e6e4dc;

  /* Warning/success minimal */
  --color-warning: #7a4a15;
  --color-error: #7a2436;
  --color-success: #31562a;

  /* Radius — minimal, archival */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 10px;
  --radius-full: 9999px;

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

  /* Shadows — tone-matched, soft */
  --shadow-sm: 0 1px 2px rgba(25, 28, 30, 0.05);
  --shadow-md: 0 4px 14px rgba(25, 28, 30, 0.07);
  --shadow-lg: 0 14px 36px rgba(25, 28, 30, 0.10);

  /* Content widths */
  --content-narrow: 680px;
  --content-default: 980px;
  --content-wide: 1240px;
  --content-full: 100%;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  --text-3xl: clamp(2.5rem, 1.4rem + 3.4vw, 4rem);
  --text-hero: clamp(2.75rem, 1.2rem + 5.5vw, 5.25rem);

  /* Spacing */
  --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;

  /* Fonts */
  --font-display: 'Source Serif 4', 'Source Serif Pro', 'Iowan Old Style', 'Georgia', serif;
  --font-body: 'Inter', 'Helvetica Neue', 'Arial', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
}

[data-theme='dark'] {
  --color-bg: #14161a;
  --color-surface: #1a1d22;
  --color-surface-2: #1f2228;
  --color-surface-offset: #25292f;
  --color-surface-offset-2: #2c3037;
  --color-surface-dynamic: #343841;
  --color-divider: #2a2e35;
  --color-border: #3a3f47;

  --color-text: #e8e6df;
  --color-text-muted: #9ba1a8;
  --color-text-faint: #5f646b;
  --color-text-inverse: #14161a;

  --color-primary: #8fa4c9;
  --color-primary-hover: #a5b8d9;
  --color-primary-active: #b8c8e3;
  --color-primary-highlight: #2a354d;

  --color-tag-filing: #a5b8d9;
  --color-tag-filing-bg: #24304a;
  --color-tag-finance: #d4c78a;
  --color-tag-finance-bg: #3a3420;
  --color-tag-governance: #c9b8d4;
  --color-tag-governance-bg: #2f2838;
  --color-tag-property: #a8c4a8;
  --color-tag-property-bg: #1f2e21;
  --color-tag-default: #c9c6bd;
  --color-tag-default-bg: #2b2d30;

  --color-warning: #d4a46a;
  --color-error: #d4829b;
  --color-success: #8aaf7e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.55);
}

/* ================================================
   Base reset
================================================ */
*,
*::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: var(--space-16);
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  font-feature-settings: 'ss01', 'cv11';
}

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 {
  font-family: var(--font-display);
  font-weight: 400;
  text-wrap: balance;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

p, li, figcaption {
  text-wrap: pretty;
  max-width: 68ch;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-primary-hover);
}

::selection {
  background: rgba(30, 47, 77, 0.2);
  color: var(--color-text);
}

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

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),
    opacity 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;
}
