/* ============================================================
   Orka Design System — colors & type foundations
   Load this first on every Orka page.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,300..900,0..100&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=Inter+Tight:wght@500;600;700&family=Caveat:wght@500;600&display=swap');

:root {
  /* ---------- Brand palette ---------- */
  --ocean-ink:   #0E2A3A; /* primary text, logo */
  --ocean-deep:  #12405B; /* headings on cream */
  --ocean-wave:  #3E7C9A; /* links, primary accent */
  --sea-glass:   #A8C9C5; /* quiet surfaces, dividers */
  --cream:       #F6EEDC; /* primary canvas */
  --sand:        #E8DBC1; /* alt surfaces */
  --coral:       #1F6F8B; /* CTA, child accent */
  --coral-deep:  #C55F3F; /* CTA hover */
  --sun:         #E8B04B; /* badges, warm emphasis */
  --paper-white: #FBF8F0; /* the "white" of this system */
  --ink-50:  rgba(14,42,58,.5);
  --ink-20:  rgba(14,42,58,.2);
  --ink-12:  rgba(14,42,58,.12);
  --ink-06:  rgba(14,42,58,.06);

  /* ---------- Semantic tokens ---------- */
  --bg:        var(--cream);
  --bg-alt:    var(--sand);
  --bg-card:   var(--paper-white);
  --fg:        var(--ocean-ink);
  --fg-muted:  #4C5D6A;
  --fg-faint:  #7A8894;
  --accent:    var(--ocean-wave);
  --cta:       var(--coral);
  --cta-hover: var(--coral-deep);
  --link:      var(--ocean-wave);
  --link-hover:var(--ocean-deep);
  --border:    var(--ink-12);
  --border-strong: var(--ocean-ink);
  --success:   #4C8A5C;
  --warning:   var(--sun);
  --danger:    #B24A3A;

  /* ---------- Type families ---------- */
  --font-display: 'Fraunces', 'Cambria', Georgia, serif;
  --font-body:    'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --font-ui:      'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-hand:    'Caveat', 'Bradley Hand', cursive;
  --font-mono:    ui-monospace, 'JetBrains Mono', 'Menlo', monospace;

  /* ---------- Spacing (4px base, with soft steps) ---------- */
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* ---------- Radii ---------- */
  --r-0: 0;
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 16px;
  --r-4: 24px;
  --r-pill: 999px;
  --r-organic: 22% 78% 70% 30% / 30% 30% 70% 70%;

  /* ---------- Shadows (warm-tinted) ---------- */
  --shadow-paper:  0 1px 2px rgba(40,25,10,.06), 0 8px 24px rgba(40,25,10,.08);
  --shadow-lifted: 0 2px 4px rgba(40,25,10,.08), 0 16px 36px rgba(40,25,10,.12);
  --shadow-inset:  inset 0 1px 0 rgba(255,255,255,.6);
  --shadow-focus:  0 0 0 3px rgba(224,120,86,.35);

  /* ---------- Motion ---------- */
  --ease-soft:    cubic-bezier(.22,.68,.28,1);
  --ease-gentle:  cubic-bezier(.4,.1,.2,1);
  --dur-micro:    120ms;
  --dur-std:      240ms;
  --dur-section:  420ms;

  /* ---------- Layout ---------- */
  --content-max: 1120px;
  --read-max:    640px;
  --nav-h:       72px;
}

/* ============================================================
   Base typography — semantic element defaults
   ============================================================ */

html {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { margin: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72, "SOFT" 30;
  color: var(--ocean-deep);
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 4.4vw, 4rem); font-weight: 500; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 500; }
h3 { font-size: clamp(1.3rem, 1.8vw, 1.6rem); font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-ui); color: var(--fg-muted); }

p  { margin: 0 0 var(--sp-4); max-width: var(--read-max); text-wrap: pretty; }
p.lead { font-size: 1.2rem; color: var(--fg); font-family: var(--font-body); font-style: italic; }

small, .small { font-size: .85rem; color: var(--fg-muted); }

a {
  color: var(--link);
  text-decoration: none;
  background-image: linear-gradient(var(--link), var(--link));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 100%;
  transition: color var(--dur-std) var(--ease-soft),
              background-size var(--dur-std) var(--ease-soft);
}
a:hover {
  color: var(--link-hover);
  background-size: 100% 2px;
}

ul, ol { padding-left: 1.25em; margin: 0 0 var(--sp-4); }
li { margin-bottom: var(--sp-2); }
li::marker { color: var(--ocean-wave); }

blockquote {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--ocean-deep);
  border-left: 3px solid var(--coral);
  padding: var(--sp-3) var(--sp-5);
  margin: var(--sp-6) 0;
  max-width: var(--read-max);
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: .92em;
  background: var(--sand);
  padding: 0.1em 0.35em;
  border-radius: var(--r-1);
}
pre { padding: var(--sp-4); overflow-x: auto; }

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--sp-7) 0;
}

/* UI primitives */
.eyebrow {
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--coral);
  display: inline-block;
  margin-bottom: var(--sp-3);
}
.label {
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 500;
  color: var(--fg-muted);
}
.hand {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--coral);
  line-height: 1.1;
}

/* Selection */
::selection { background: var(--coral); color: var(--cream); }
