/* Meridian Desk — design tokens, reset, typography.
   Loaded first by every page. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Surfaces — cool near-white, chroma kept under 0.004 so nothing reads cream. */
  --bg: oklch(0.972 0.0025 250);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.986 0.002 250);
  --surface-3: oklch(0.962 0.003 250);

  --border: oklch(0.906 0.004 250);
  --border-strong: oklch(0.842 0.006 250);

  /* Ink. Measured, not estimated. Against --surface / --surface-3 (the darkest
     background any of them sits on): ink 15.4:1 / 13.6:1, ink-2 7.1:1 / 6.3:1,
     ink-3 5.1:1 / 4.5:1. ink-3 carries meta text, timestamps and placeholders,
     which are body-sized, so it holds the full 4.5:1 bar rather than the 3:1
     large-text one. */
  --ink: oklch(0.262 0.012 254);
  --ink-2: oklch(0.462 0.013 254);
  --ink-3: oklch(0.54 0.012 254);
  --ink-inverse: oklch(1 0 0);

  /* Application chrome. The dark band is structural, not decorative: it is the
     second neutral layer that separates navigation from content. */
  --chrome: oklch(0.278 0.031 213);
  --chrome-raised: oklch(0.332 0.034 213);
  --chrome-line: oklch(0.372 0.032 213);
  --chrome-ink: oklch(0.955 0.006 213);
  --chrome-ink-dim: oklch(0.762 0.017 213);

  /* Primary action. Corporate blue, not the scaffold indigo. */
  --accent: oklch(0.508 0.128 251);
  --accent-hover: oklch(0.452 0.126 251);
  --accent-ink: oklch(0.44 0.13 251);
  --accent-soft: oklch(0.958 0.021 251);
  --accent-line: oklch(0.858 0.055 251);

  --danger: oklch(0.52 0.192 27);
  --danger-soft: oklch(0.962 0.022 27);
  --danger-line: oklch(0.868 0.062 27);
  --warn: oklch(0.522 0.128 63);
  --warn-soft: oklch(0.968 0.03 78);
  --warn-line: oklch(0.878 0.078 78);
  --ok: oklch(0.492 0.108 156);
  --ok-soft: oklch(0.962 0.032 156);
  --ok-line: oklch(0.862 0.062 156);

  /* Type scale — fixed rem, 1.125 ratio. No clamp: product UI is read at a
     consistent size, and fluid headings shrink badly inside panels. */
  --text-xs: 0.6875rem;   /* 11px  — table heads, tags */
  --text-sm: 0.75rem;     /* 12px  — meta, timestamps */
  --text-md: 0.8125rem;   /* 13px  — UI default */
  --text-base: 0.875rem;  /* 14px  — body, thread */
  --text-lg: 1rem;        /* 16px  — card titles */
  --text-xl: 1.125rem;    /* 18px  — page title */
  --text-2xl: 1.375rem;   /* 22px  — metrics */
  --text-3xl: 1.75rem;    /* 28px  — marketing sub-heads */

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-16: 64px;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 2px oklch(0.28 0.02 254 / 0.07);
  --shadow-md: 0 4px 12px oklch(0.28 0.02 254 / 0.09), 0 1px 3px oklch(0.28 0.02 254 / 0.05);
  --shadow-lg: 0 12px 32px oklch(0.28 0.02 254 / 0.14), 0 2px 6px oklch(0.28 0.02 254 / 0.06);

  /* Semantic stacking order. Never arbitrary values. */
  --z-base: 1;
  --z-sticky: 10;
  --z-dropdown: 20;
  --z-overlay: 30;
  --z-toast: 40;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms;
  --dur: 180ms;

  --rail-w: 56px;
  --views-w: 236px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05" 1, "ss03" 1;
}

h1,
h2,
h3,
h4,
p,
figure,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

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

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

img,
svg {
  display: block;
  max-width: 100%;
}

/* One focus treatment for the whole application. Visible on every control. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: var(--z-toast);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-4);
  box-shadow: var(--shadow-md);
  font-weight: 600;
  transition: top var(--dur) var(--ease-out);
}
.skip-link:focus {
  top: var(--space-2);
}

.mono {
  font-family: var(--mono);
  font-variant-ligatures: none;
}
.tnum {
  font-variant-numeric: tabular-nums;
}

@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;
  }
}
