/* =============================================================================
   Loukoum Design System — Colors & Type
   Atelier v8, "lighter still"
   Source of truth. Reference these vars; never hard-code palette/type.
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400;1,8..60,500&family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;1,400&family=Architects+Daughter&display=swap');

:root {
  /* ---------- Palette ---------- */
  --cream:    #FCFAF2;   /* page — near-white, gently warm */
  --paper:    #F4F0E2;   /* card surface — warm light, lightly yellow */
  --bone:     #E8E2CC;   /* sunken surface, soft fields */
  --stone:    #B4AC95;   /* mid neutral, captions, disabled */
  --slate:    #4A463E;   /* secondary text */
  --ink:      #14110D;   /* primary text, lines */
  --jet:      #0A0807;   /* dark-mode root */
  --etruscan: #157F49;   /* THE accent (Sequoia green) — margin rule, ribbons, mark-ups */

  /* ---------- Semantic surfaces ---------- */
  --surface-page:    var(--cream);
  --surface-raised:  var(--paper);
  --surface-sunken:  var(--bone);

  /* ---------- Semantic text ---------- */
  --fg-1: var(--ink);
  --fg-2: var(--slate);
  --fg-3: var(--stone);
  --fg-accent:    var(--etruscan);
  --fg-on-accent: var(--cream);

  /* ---------- Rules (hairlines) ---------- */
  --rule:        color-mix(in oklab, var(--ink) 10%, transparent);
  --rule-mid:    color-mix(in oklab, var(--ink) 20%, transparent);
  --rule-strong: var(--ink);
  --rule-accent: color-mix(in oklab, var(--etruscan) 50%, transparent);

  /* ---------- Type families ---------- */
  --font-serif:   'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;
  --font-hand:    'Architects Daughter', cursive;
  --font-sans:    var(--font-serif);     /* atelier has no sans body */

  /* ---------- Type scale (px) ---------- */
  --fs-jumbo:    96px;
  --fs-display:  56px;
  --fs-h1:       40px;
  --fs-h2:       28px;
  --fs-h3:       21px;
  --fs-body:     17px;
  --fs-small:    14px;
  --fs-caption:  12px;
  --fs-meta:     10.5px;   /* mono meta lines */

  --lh-tight:    1.08;
  --lh-snug:     1.25;
  --lh-normal:   1.5;
  --lh-loose:    1.65;

  --tr-tight:   -0.02em;
  --tr-normal:   0em;
  --tr-meta:     0.18em;
  --tr-wide:     0.22em;

  /* ---------- Spacing (8px base) ---------- */
  --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;

  /* ---------- Radii (sparing — atelier is square) ---------- */
  --radius-0:  0;
  --radius-sm: 2px;
  --radius-md: 6px;

  /* ---------- Elevation (almost never) ---------- */
  --shadow-floating: 0 12px 32px -10px rgba(26, 22, 16, 0.10);

  /* ---------- Page geometry ---------- */
  --gutter-l:    110px;
  --gutter-r:    96px;
  --red-rule-x:  84px;
  --measure:     62ch;

  /* ---------- Motion ---------- */
  --ease-out:      cubic-bezier(0.2, 0, 0, 1);
  --dur-instant:   120ms;
  --dur-default:   200ms;
  --dur-deliberate:320ms;
}

/* =============================================================================
   Base
   ============================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--surface-page);
  color: var(--fg-1);
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }

/* =============================================================================
   Semantic type primitives
   ============================================================================= */
h1, .l-h1 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: var(--fs-h1); line-height: var(--lh-snug);
  letter-spacing: -0.012em; text-wrap: balance; margin: 0;
}
h2, .l-h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: var(--fs-h2); line-height: var(--lh-snug);
  letter-spacing: -0.008em; margin: 0;
}
h3, .l-h3 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: var(--fs-h3); line-height: var(--lh-snug); margin: 0;
}
p, .l-body  { font-size: var(--fs-body); line-height: var(--lh-normal); margin: 0; }
.l-jumbo    { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-jumbo); line-height: var(--lh-tight); letter-spacing: var(--tr-tight); text-wrap: balance; }
.l-display  { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-display); line-height: var(--lh-tight); letter-spacing: var(--tr-tight); text-wrap: balance; }
.l-prose    { font-size: var(--fs-body); line-height: var(--lh-loose); max-width: var(--measure); text-wrap: pretty; }
.l-small    { font-size: var(--fs-small); color: var(--fg-2); }
.l-caption  { font-size: var(--fs-caption); color: var(--fg-3); }

.l-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--fg-2);
  line-height: 1.6;
}
.l-mono   { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }
.l-hand   { font-family: var(--font-hand); line-height: 1.4; color: var(--fg-2); }
.l-italic { font-style: italic; }

code, pre, .l-code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-sunken);
  padding: 2px 6px;
  border: 1px solid var(--rule);
}

a, .l-link {
  color: inherit; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: text-decoration-thickness var(--dur-instant) var(--ease-out),
              color var(--dur-instant) var(--ease-out);
}
a:hover, .l-link:hover { text-decoration-thickness: 2px; color: var(--fg-accent); }
