/* ==========================================================================
   EDITORIAL INK — 1. Foundations
   Tokens, reset, typography scale, shared utilities.

   The palette is defined as *semantic* tokens (--bg, --fg, --accent…) rather
   than literal colours. Any block can flip to the dark treatment by carrying
   .section--ink, which reassigns those same tokens — so every component below
   works on paper and on ink without a single duplicated rule.
   ========================================================================== */

:root {
  /* -- Raw palette ------------------------------------------------------- */
  --paper:       #F7F4EF;   /* warm off-white, the default ground */
  --paper-2:     #EFEAE1;   /* recessed panels, input wells */
  --ink:         #12100E;   /* near-black, warmed so it never reads blue */
  --ink-2:       #37312B;
  --coral:       #FF4D2E;   /* the single accent — used sparingly, on purpose */
  --coral-deep:  #D63417;

  /* -- Semantic tokens (light / paper) ----------------------------------- */
  --bg:          var(--paper);
  --bg-raised:   #FFFFFF;
  --bg-sunken:   var(--paper-2);
  --fg:          var(--ink);
  --fg-muted:    rgba(18, 16, 14, .68);
  --fg-subtle:   rgba(18, 16, 14, .44);
  --rule:        rgba(18, 16, 14, .14);
  --rule-strong: rgba(18, 16, 14, .28);
  --accent:      var(--coral);
  --accent-ink:  #FFFFFF;
  --accent-wash: rgba(255, 77, 46, .10);
  --shadow:      0 24px 60px -28px rgba(18, 16, 14, .38);

  /* -- Type ------------------------------------------------------------- */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* -- Rhythm ----------------------------------------------------------- */
  --gutter:      clamp(20px, 5vw, 92px);
  --section-y:   clamp(88px, 12vh, 168px);
  --maxw:        1320px;

  /* -- Motion ----------------------------------------------------------- */
  --ease-out:    cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur:         .6s;
}

/* Dark treatment. Same token names, inverted values — nothing else changes. */
.section--ink,
.foot,
.preloader {
  --bg:          var(--ink);
  --bg-raised:   #1C1916;
  --bg-sunken:   #0C0A09;
  --fg:          var(--paper);
  --fg-muted:    rgba(247, 244, 239, .68);
  --fg-subtle:   rgba(247, 244, 239, .40);
  --rule:        rgba(247, 244, 239, .16);
  --rule-strong: rgba(247, 244, 239, .32);
  --accent:      #FF6647;
  --accent-ink:  var(--ink);
  --accent-wash: rgba(255, 102, 71, .14);
  --shadow:      0 24px 60px -28px rgba(0, 0, 0, .8);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Locked while the preloader, mobile menu or lightbox owns the screen */
body.is-locked { overflow: hidden; }

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

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}
button { cursor: pointer; }

ul, ol { list-style: none; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Type helpers ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'opsz' 100, 'SOFT' 20;
  letter-spacing: -.022em;
  line-height: 1.02;
}
.display em {
  font-style: italic;
  font-variation-settings: 'opsz' 100, 'SOFT' 40, 'WONK' 1;
  color: var(--accent);
}

.mono {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
}

/* ---------- Section furniture ---------- */
.section__num {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--accent);
}
.section__num::before {
  content: '';
  display: inline-block;
  width: 26px;
  height: 1px;
  margin-right: 10px;
  vertical-align: middle;
  background: currentColor;
}

.section__title {
  font-size: clamp(2.3rem, 6vw, 5rem);
  max-width: 16ch;
}

.section__lede {
  max-width: 46ch;
  margin-top: 22px;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--fg-muted);
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1200;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  transform: translateY(-160%);
  transition: transform .25s var(--ease-out);
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
