/* tokens.css: the ONLY place a color, type size, space, radius, or shadow value is
   defined (contracts/theme.md §1). Custom properties on :root (light, default),
   dark scheme via @media (prefers-color-scheme: dark) and a [data-theme="dark"]
   attribute override (contract-frozen mechanism; no theme-toggle control exists
   yet, so the attribute path is unused today and the media query is what the
   Browser pane's dark-scheme emulation exercises).

   Derivation record: theme/BRAND-SPEC.md. Every hue below is either the sampled
   gold (72.55deg), the sampled charcoal (90.42deg, used as the one neutral ramp),
   or a documented deviation for the three semantic status colors (BRAND-SPEC.md
   "Assumptions"). Contrast proof: theme/tools/contrast_check.py. */

/* ---- self-hosted type (contracts/theme.md §1: no third-party stylesheet) ---- */
@font-face {
  font-family: "Libre Caslon Display";
  src: url("../fonts/LibreCaslonDisplay-Regular.3b6d3d56e4eb.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-Regular.9246d621d7f0.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-SemiBold.7ab89eedd1b0.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-Bold.8574a5d7eebc.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---- color: light scheme (default) ---- */
  /* neutral ramp, derived from the sampled charcoal hue (90.42deg) */
  --color-bg: oklch(0.9700 0.0040 90.42);
  --color-surface: oklch(0.9900 0.0060 90.42);
  --color-surface-raised: oklch(0.9960 0.0030 90.42);
  --color-ink: oklch(0.2200 0.0180 90.42);
  --color-ink-muted: oklch(0.4300 0.0150 90.42);
  --color-line: oklch(0.8500 0.0060 90.42);

  /* brand constants: hold across both schemes (see BRAND-SPEC.md) */
  /* sampled from brand/legends-collection-logo-wall.jpg at pixel (324,165): rgb(200,167,126) */
  --color-brand: oklch(0.7478 0.0675 72.55);
  --color-brand-ink: oklch(0.2200 0.0180 90.42);
  /* sampled from brand/legends-collection-logo-wall.jpg at pixel (20,20): rgb(37,33,22) */
  --color-charcoal: oklch(0.2486 0.0205 90.42);
  /* derived accent (gold hue, deepened and warmed) for bid/buy actions */
  --color-accent: oklch(0.5000 0.1150 72.55);
  --color-focus: oklch(0.6600 0.1300 72.55);

  /* semantic status: light-scheme text/icon tone, dark enough for AA on --color-bg.
     success/danger are a documented deviation from the two-hue rule (BRAND-SPEC.md);
     warning reuses the gold hue so it stays derived. */
  --color-success: oklch(0.4200 0.1500 145);
  --color-warning: oklch(0.4200 0.1500 72.55);
  --color-danger: oklch(0.4200 0.1500 25);

  /* ---- type ---- */
  --font-display: "Libre Caslon Display", Georgia, serif;
  --font-body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
  --text-xl: clamp(1.375rem, 1.25rem + 0.6vw, 1.625rem);
  --text-2xl: clamp(1.75rem, 1.5rem + 1.2vw, 2.25rem);
  --text-3xl: clamp(2.75rem, 2.2rem + 3vw, 4rem);
  --leading-tight: 1.15;
  --leading-body: 1.6;

  /* ---- space (4px base) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;

  /* ---- radius ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* ---- shadow (warm umbra from the sampled charcoal) ---- */
  --shadow-1: 0 1px 2px oklch(0.2486 0.0205 90.42 / 0.08);
  --shadow-2: 0 4px 12px oklch(0.2486 0.0205 90.42 / 0.12);
  --shadow-3: 0 12px 32px oklch(0.2486 0.0205 90.42 / 0.16);

  /* ---- motion (motion-intensity dial: 2, very restrained) ---- */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 240ms;
}

/* dark scheme: same names, surfaces and ink invert; brand/accent/status hold */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: oklch(0.2486 0.0040 90.42);
    --color-surface: oklch(0.3100 0.0060 90.42);
    --color-surface-raised: oklch(0.3700 0.0030 90.42);
    --color-ink: oklch(0.9500 0.0180 90.42);
    --color-ink-muted: oklch(0.7400 0.0150 90.42);
    --color-line: oklch(0.4000 0.0060 90.42);

    --color-success: oklch(0.7800 0.1500 145);
    --color-warning: oklch(0.7800 0.1500 72.55);
    --color-danger: oklch(0.7800 0.1500 25);
  }
}

:root[data-theme="dark"] {
  --color-bg: oklch(0.2486 0.0040 90.42);
  --color-surface: oklch(0.3100 0.0060 90.42);
  --color-surface-raised: oklch(0.3700 0.0030 90.42);
  --color-ink: oklch(0.9500 0.0180 90.42);
  --color-ink-muted: oklch(0.7400 0.0150 90.42);
  --color-line: oklch(0.4000 0.0060 90.42);

  --color-success: oklch(0.7800 0.1500 145);
  --color-warning: oklch(0.7800 0.1500 72.55);
  --color-danger: oklch(0.7800 0.1500 25);
}

/* motion: all animation/transition durations collapse to zero (contract §2) */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
  }
}
