/* ============================================================
   Zarco.uk — site stylesheet
   Imports design tokens, adds three direction modes
   (safe / editorial / bold), and global layout primitives.
   ============================================================ */

@import url('./zarco-tokens.css');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: var(--font-sans);
  overflow-x: clip;
}

/* Direction-mode CSS variables.
   Defaults = editorial. Bold and safe override below. */
:root {
  --display-scale: 1;           /* 1 = editorial baseline */
  --chapter-scale: 1;
  --ornament-opacity: 1;
  --section-pad-y: 96px;
  --hero-pad-y: 112px;
  --hero-bg: var(--paper);
  --hero-fg: var(--ink);
  --hero-magenta: var(--magenta);
  --display-weight: 300;        /* premium 2026-06: huge + light, not extrabold */
  --display-tracking: -0.02em;
  --hero-italic-color: var(--magenta);
}

[data-direction="safe"] {
  --display-scale: 0.78;
  --chapter-scale: 0.7;
  --ornament-opacity: 0;
  --section-pad-y: 80px;
  --hero-pad-y: 96px;
  --display-weight: 300;
  --display-tracking: -0.015em;
  --hero-italic-color: var(--ink);
}

[data-direction="bold"] {
  --display-scale: 1.18;
  --chapter-scale: 1.6;
  --ornament-opacity: 1;
  --section-pad-y: 128px;
  --hero-pad-y: 144px;
  --display-weight: 300;
  --display-tracking: -0.025em;
  --hero-bg: var(--paper);
  --hero-fg: var(--ink);
  --hero-italic-color: var(--magenta);
}

/* ----------------------------------------------------------
   Layout primitives
   ---------------------------------------------------------- */
.shell { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 800px) {
  .shell { padding: 0 var(--gutter-mobile); }
}

.section {
  padding: var(--section-pad-y) 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.section.inverted {
  background: var(--ink);
  color: var(--paper);
  border-bottom: none;
}
.section.inverted .eyebrow { color: var(--magenta); }
.section.inverted .muted   { color: rgba(250, 250, 247, 0.6); }
.section.inverted a        { color: var(--paper); }
.section.tinted { background: var(--ink-04); }

/* ----------------------------------------------------------
   Chapter mark — the numbered system
   ---------------------------------------------------------- */
/* Quiet sans kicker (was uppercase mono — retired 2026-06, read as AI-template) */
.chapter-mark {
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  color: var(--ink-40);
  font-size: 15px;
  text-transform: none;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.chapter-mark::after { content: none; }

/* Section eyebrow — quieter than chapter-mark */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink-40);
  font-weight: 500;
}

/* The slash separator used in breadcrumbs and section paths */
.slash { color: var(--ink-20); padding: 0 6px; }

/* ----------------------------------------------------------
   Typography
   ---------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-size: calc(80px * var(--display-scale));
  line-height: 1.0;
  letter-spacing: var(--display-tracking);
  font-weight: var(--display-weight);
  margin: 0;
  text-wrap: balance;
}
.display em {
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  color: var(--hero-italic-color);
  letter-spacing: inherit;
}
@media (max-width: 900px) {
  .display { font-size: calc(56px * var(--display-scale)); }
}
@media (max-width: 600px) {
  .display { font-size: calc(40px * var(--display-scale)); }
}

.h1 { font-family: var(--font-display); font-size: clamp(40px, 5.5vw, 64px); line-height: 1.02; letter-spacing: -0.02em; font-weight: 300; text-wrap: balance; margin: 0; }
.h2 { font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px); line-height: 1.06;  letter-spacing: -0.018em;  font-weight: 300; text-wrap: balance; margin: 0; }
.h3 { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; letter-spacing: -0.012em; font-weight: 400; margin: 0; }
.h4 { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.h1 em, .h2 em, .h3 em { font-family: inherit; font-style: normal; font-weight: 400; color: var(--magenta); letter-spacing: inherit; }

.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--ink-60); text-wrap: pretty; margin: 0; }
.body { font-size: 16px; line-height: 1.55; color: var(--ink-80); }
.muted { color: var(--ink-60); }
.subtle { color: var(--ink-40); }
.mono { font-family: var(--font-mono); }

/* ----------------------------------------------------------
   Ornaments
   ---------------------------------------------------------- */
.ornament {
  color: var(--magenta);
  font-family: var(--font-sans);
  opacity: var(--ornament-opacity);
  transition: opacity var(--dur-ui) var(--ease);
}

/* ----------------------------------------------------------
   Buttons & links
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease),
              border-color var(--dur-micro) var(--ease),
              transform 180ms var(--ease-out-quart), box-shadow 180ms var(--ease-out-quart);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(14, 14, 14, 0.35); }
.btn:active { transform: translateY(0) scale(0.985); box-shadow: 0 4px 12px -8px rgba(14, 14, 14, 0.3); transition-duration: 90ms; }
.btn-primary { background: var(--magenta); color: var(--paper); border-color: var(--magenta); }
.btn-primary:hover { background: var(--magenta-deep); border-color: var(--magenta-deep); color: var(--paper); text-decoration: none; box-shadow: 0 14px 30px -14px rgba(255, 0, 102, 0.5); }
.btn-ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-ink:hover { background: #1f1f1e; color: var(--paper); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink-20); }
.btn-ghost:hover { border-color: var(--ink); text-decoration: none; }
.btn-paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-paper:hover { background: var(--paper-pure); color: var(--ink); text-decoration: none; }
.btn:active { opacity: 0.88; }

.btn-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-text:hover { color: var(--magenta); text-decoration-color: var(--magenta); }
.section.inverted .btn-text { color: var(--paper); }
.section.inverted .btn-text:hover { color: var(--magenta); text-decoration-color: var(--magenta); }

/* ----------------------------------------------------------
   Section header row (chapter mark + title)
   ---------------------------------------------------------- */
.section-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 72px;
}
.section-head .meta { padding-top: 14px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 900px) {
  .section-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 48px; }
  .section-head .meta { padding-top: 0; }
}

/* ----------------------------------------------------------
   Hairlines & cards
   ---------------------------------------------------------- */
.hairline { border-top: 1px solid var(--ink-20); }
.hairline-strong { border-top: 1px solid var(--ink); }
.section.inverted .hairline { border-color: rgba(250,250,247,0.16); }

.card {
  border: 1px solid var(--ink-20);
  border-radius: var(--radius-md);
  background: var(--paper-pure);
  padding: 32px;
}

/* ----------------------------------------------------------
   Status pills
   ---------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 500;
  border: 1px solid var(--ink-20);
  background: var(--paper);
  color: var(--ink-60);
}
.pill.magenta { border-color: var(--magenta); color: var(--magenta); background: transparent; }
.pill.live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--magenta) 18%, transparent);
  animation: pill-live-pulse 1.6s var(--ease) infinite;
}
@keyframes pill-live-pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklch, var(--magenta) 18%, transparent); }
  50%      { box-shadow: 0 0 0 4px color-mix(in oklch, var(--magenta) 0%,  transparent); }
}

/* ----------------------------------------------------------
   Anchor scroll-margin (sticky nav offset)
   ---------------------------------------------------------- */
section[id], a[id] { scroll-margin-top: 88px; }

/* ----------------------------------------------------------
   Selection
   ---------------------------------------------------------- */
::selection { background: var(--magenta); color: var(--paper); }

/* ----------------------------------------------------------
   Reduced motion
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
