/* =============================================================
   Oom Design System — Tokens
   ============================================================= */

/* Brand serif: Source Serif 4 (variable, with optical sizes) */
@font-face {
  font-family: 'Source Serif 4';
  src: url('fonts/SourceSerif4-VariableFont_opsz_wght.ttf') format('truetype-variations');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('fonts/SourceSerif4-Italic-VariableFont_opsz_wght.ttf') format('truetype-variations');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* Sans + mono still loaded from Google as substitutes (no files supplied) */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---------- Color: core palette ---------- */
  --paper:        #F4EFE6;
  --paper-deep:   #ECE4D5;
  --ink:          #1A1A1A;
  --ink-soft:     #2E2E2D;

  /* Brand accent: Oom Tide — bright turquoise blue, legible on Paper and Ink */
  --tide:         #12A0BC;
  --tide-deep:    #0C7888;
  --tide-wash:    #D3ECF1;

  --sage:         #6B7F6A;
  --sage-deep:    #4F6250;
  --sage-wash:    #DDE3D6;

  --clay:         #A84E32;
  --clay-deep:    #873D27;
  --clay-wash:    #EFD6CC;

  /* ---------- Stone neutrals ---------- */
  --stone-05:     #EDE6D8;
  --stone-10:     #E0D8C7;
  --stone-20:     #C9C0AD;
  --stone-30:     #B0A693;
  --stone-50:     #7D7563;
  --stone-70:     #4E4A40;
  --stone-90:     #2A2823;

  /* ---------- Semantic roles ---------- */
  --bg:           var(--paper);
  --bg-sunk:      var(--paper-deep);
  --bg-raised:    var(--paper);
  --fg:           var(--ink);
  --fg-muted:     var(--stone-70);
  --fg-subtle:    var(--stone-50);
  --fg-on-accent: var(--paper);

  --border:       var(--stone-30);
  --border-soft:  var(--stone-20);
  --border-strong:var(--stone-50);

  --accent:       var(--tide);
  --accent-hover: var(--tide-deep);
  --accent-wash:  var(--tide-wash);

  --success:      var(--sage);
  --success-wash: var(--sage-wash);

  --danger:       var(--clay);
  --danger-wash:  var(--clay-wash);

  --focus-ring:   var(--tide);

  /* ---------- Type families ---------- */
  --font-serif:   'Source Serif 4', 'Iowan Old Style', 'Georgia', serif;
  --font-sans:    'Instrument Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* ---------- Type scale ---------- */
  --text-xs:      12px;
  --text-sm:      14px;
  --text-base:    16px;
  --text-md:      18px;
  --text-lg:      22px;
  --text-xl:      28px;
  --text-2xl:     36px;
  --text-3xl:     48px;
  --text-4xl:     64px;
  --text-5xl:     88px;

  --leading-tight:   1.1;
  --leading-snug:    1.25;
  --leading-normal:  1.55;
  --leading-ui:      1.4;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-caps:   0.08em;

  /* ---------- Spacing ---------- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-1: 0 1px 2px rgba(26, 26, 26, 0.04), 0 2px 8px rgba(26, 26, 26, 0.06);
  --shadow-2: 0 4px 12px rgba(26, 26, 26, 0.08), 0 12px 32px rgba(26, 26, 26, 0.08);
  --shadow-focus: 0 0 0 3px rgba(58, 111, 168, 0.28);

  --ease:         cubic-bezier(0.2, 0, 0, 1);
  --dur-fast:     120ms;
  --dur-base:     160ms;
  --dur-medium:   240ms;
  --dur-slow:     320ms;

  --content-prose:   720px;
  --content-app:    1200px;
  --content-wide:   1440px;
  --gutter:           24px;
  --margin-outer:     64px;
}

/* =============================================================
   Element styles
   ============================================================= */

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, .h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
h2, .h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
h3, .h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  margin: 0;
}
h4, .h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  margin: 0;
}

.display {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.display-hero {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: var(--text-5xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.03em;
}

p, .p {
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  margin: 0;
  text-wrap: pretty;
}
.lead {
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--fg-muted);
}
.small {
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
}
.caption {
  font-size: var(--text-xs);
  line-height: var(--leading-ui);
  color: var(--fg-subtle);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-muted);
}

code, .code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--paper-deep);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--stone-30);
  transition: text-decoration-color var(--dur-base) var(--ease);
}
a:hover { text-decoration-color: var(--ink); }

hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: var(--space-7) 0;
}

::selection { background: var(--tide-wash); color: var(--ink); }

*:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}
