/* ============================================================
   Fireside Democracy — fireside-democracy.ai
   Painted civic editorial, motion edition.
   Cream paper, ink navy, ember, gold, teal, moss.
   Zodiak (display serif) + Sentient (reading serif) + General Sans (UI), self-hosted.
   Motion states only arm under html.has-motion (set pre-paint,
   removed if libraries fail or reduced motion is preferred).
   ============================================================ */

/* ---------- fonts (self-hosted, Fontshare/ITF: Zodiak, Sentient, General Sans) ---------- */

@font-face {
  font-family: "Zodiak";
  src: url("fonts/zodiak-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Zodiak";
  src: url("fonts/zodiak-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Zodiak";
  src: url("fonts/zodiak-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Zodiak";
  src: url("fonts/zodiak-700-italic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Sentient";
  src: url("fonts/sentient-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Sentient";
  src: url("fonts/sentient-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Sentient";
  src: url("fonts/sentient-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Sentient";
  src: url("fonts/sentient-500-italic.woff2") format("woff2");
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("fonts/generalsans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("fonts/generalsans-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("fonts/generalsans-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
/* metric-matched fallbacks to avoid layout shift during swap */
@font-face {
  font-family: "Zodiak-fallback";
  src: local("Georgia");
  size-adjust: 102%;
  ascent-override: 94%;
  descent-override: 24%;
}
@font-face {
  font-family: "Sentient-fallback";
  src: local("Georgia");
  size-adjust: 99%;
  ascent-override: 95%;
  descent-override: 25%;
}
@font-face {
  font-family: "GeneralSans-fallback";
  src: local("Arial");
  size-adjust: 99%;
  ascent-override: 96%;
  descent-override: 25%;
}

/* ---------- tokens ---------- */

:root {
  /* palette from the settled visual-language boards */
  --paper: #f9f2e3;
  --paper-soft: #fdf8ee;
  --paper-warm: #f6e8d2;
  --blush: #f3ddc8;
  --ash: #e3d8c4;
  --ink: #1d2b39;
  --ink-soft: #3c4a57;
  --ink-faint: #66727e;
  --night: #182438;
  --night-deep: #121b2c;
  --cobalt: #2d4d8e;
  --ember: #d96f32;
  --ember-deep: #bd5524;
  --flame: #e8893c;
  --gold: #e2a83d;
  --gold-soft: #f0c66a;
  --coral: #d9636a;
  --teal: #0b6168;
  --teal-soft: #7fb3ae;
  --moss: #5f7a3d;
  --moss-soft: #aebf8a;
  --line: rgba(29, 43, 57, 0.16);
  --line-soft: rgba(29, 43, 57, 0.09);
  --cream-line: rgba(249, 242, 227, 0.25);

  --serif: "Zodiak", "Zodiak-fallback", Georgia, serif;
  --reading: "Sentient", "Sentient-fallback", Georgia, serif;
  --sans: "General Sans", "GeneralSans-fallback", "Segoe UI", Arial, sans-serif;

  /* fluid type scale: rem + vw so browser zoom keeps working */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.92rem);
  --step-0: clamp(1rem, 0.95rem + 0.3vw, 1.13rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.55vw, 1.45rem);
  --step-2: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  --step-3: clamp(1.85rem, 1.5rem + 1.8vw, 2.9rem);
  --step-4: clamp(2.3rem, 1.7rem + 3vw, 4.1rem);
  --step-5: clamp(3rem, 2rem + 5vw, 6rem);
  --step-6: clamp(3.4rem, 2.6rem + 3.6vw, 6rem);

  /* fluid space scale */
  --space-xs: clamp(0.5rem, 0.45rem + 0.3vw, 0.75rem);
  --space-s: clamp(1rem, 0.9rem + 0.6vw, 1.5rem);
  --space-m: clamp(1.8rem, 1.4rem + 2vw, 3.2rem);
  --space-l: clamp(4rem, 3rem + 5vw, 7rem);
  --space-xl: clamp(6rem, 4rem + 10vh, 11rem);

  --wrap: min(1180px, calc(100vw - 2 * clamp(20px, 4vw, 52px)));
  --radius: 14px;
  --shadow: 0 18px 50px -18px rgba(29, 43, 57, 0.35);
  --header-h: 76px;
}

* { box-sizing: border-box; }

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* lenis (smooth scroll) required rules */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--reading);
  font-size: calc(var(--step-0) * 1.06);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* paper grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ember-deep); }

:focus-visible {
  outline: 2.5px solid var(--ember);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper-soft);
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-300%);
}
.skip-link:focus-visible { transform: none; }

.wrap { width: var(--wrap); margin-inline: auto; }

/* ---------- type ---------- */

h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.008em;
  line-height: 1.06;
  margin: 0;
}


section { position: relative; }
.section-pad { padding: var(--space-xl) 0; }
.sec-light { background: transparent; }

.h2 {
  font-size: var(--step-4);
  max-width: 21ch;
  text-wrap: balance;
}

.section-head { display: grid; gap: 1.2rem; margin-bottom: var(--space-m); }
.section-head p { max-width: 62ch; margin: 0; color: var(--ink-soft); font-size: var(--step-1); font-weight: 400; }

.note {
  margin: 0 0 0.8rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ember-deep);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
  padding: 0.9rem 1.55rem;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: translate 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), scale 0.25s ease, box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { translate: 0 -2px; scale: 1.02; }
.btn:active { translate: 0 0; scale: 0.99; }
.btn-primary {
  background: var(--ember);
  color: #fff7ec;
  box-shadow: 0 10px 24px -10px rgba(189, 85, 36, 0.55);
}
.btn-primary:hover { background: var(--ember-deep); color: #fff7ec; box-shadow: 0 14px 30px -10px rgba(189, 85, 36, 0.65); }
.btn-ghost {
  border-color: rgba(29, 43, 57, 0.5);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: rgba(29, 43, 57, 0.05); }
.on-dark .btn-ghost { border-color: rgba(249, 242, 227, 0.4); color: var(--paper); }
.on-dark .btn-ghost:hover { border-color: var(--paper); color: var(--paper); background: rgba(249, 242, 227, 0.08); }

/* ---------- header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  background: rgba(253, 248, 238, 0.96);
  box-shadow: 0 1px 0 var(--line-soft);
}
/* blur is per-frame paint work: only spend it on devices with a mouse */
@media (hover: hover) and (pointer: fine) {
  .site-header.scrolled {
    background: rgba(253, 248, 238, 0.86);
    backdrop-filter: blur(10px);
  }
  @supports not (backdrop-filter: blur(10px)) {
    .site-header.scrolled { background: rgba(253, 248, 238, 0.97); }
  }
}
.progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  pointer-events: none;
}
.progress-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--ember);
}
.nav {
  width: var(--wrap);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}
.brand svg { width: 36px; height: 36px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.4vw, 1.7rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a:not(.btn) {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 3px;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:not(.btn):hover { color: var(--ember-deep); }
.nav-links a:not(.btn):hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav .btn { padding: 0.55rem 1.15rem; font-size: 0.88rem; transition: opacity 0.35s ease, visibility 0.35s ease; }
.site-header.at-hero .nav .btn { opacity: 0; visibility: hidden; pointer-events: none; }
.nav-links .lang {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--sans);
  font-size: 0.8rem;
}
.nav-links .lang a {
  color: var(--ink-faint);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.35rem;
}
.nav-links .lang a::after { content: none; }
.nav-links .lang a:hover { color: var(--ember-deep); }
.nav-links .lang a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }

/* ---------- hero ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + clamp(1.5rem, 4vh, 3rem)) 0 clamp(4rem, 9vh, 6rem);
  position: relative;
  overflow: clip;
}
.hero::before {
  content: "";
  position: absolute;
  top: -28vw;
  right: -18vw;
  width: 64vw;
  height: 64vw;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(240, 198, 106, 0.5), rgba(240, 198, 106, 0));
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero-copy { container-type: inline-size; }
.hero h1 {
  font-size: var(--step-6);
  /* never wider than the column: 'Democracy' in Zodiak italic ≈ 5.85x the font size */
  font-size: min(var(--step-6), 16.5cqw);
  font-weight: 700;
  line-height: 0.96;
  margin: 1.3rem 0 0;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--ember-deep);
}
.hero-subtitle {
  margin: 1.3rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.25;
  color: var(--ink-soft);
  max-width: 26ch;
}
.hero-sub {
  margin: 1.5rem 0 0;
  max-width: 48ch;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-soft);
}
.hero-byline {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 1.02rem;
  color: var(--ink-soft);
}
.hero-byline em { color: var(--ember-deep); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.2rem; }

.hero-art { position: relative; }
.hero-art .frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(1.4deg);
  border: 10px solid var(--paper-soft);
  outline: 1px solid var(--line-soft);
}
.hero-art .frame img { width: 100%; }
.hero-art .motif {
  position: absolute;
  z-index: -1;
}
.hero-art .motif.m1 { top: -42px; left: -54px; width: clamp(70px, 8vw, 110px); opacity: 0.9; transform: rotate(-8deg); }
.hero-art .motif.m2 { bottom: -38px; right: -40px; width: clamp(56px, 6.5vw, 88px); opacity: 0.85; transform: rotate(10deg); }


/* ---------- embers canvas ---------- */

.embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ---------- quote band ---------- */

.quote-band {
  padding: calc(var(--space-xl) * 0.8) 0;
}
.quote-band blockquote {
  margin: 0 auto;
  max-width: 26ch;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: var(--step-3);
  line-height: 1.32;
  text-align: center;
  color: var(--ink);
  text-wrap: balance;
}
.quote-band blockquote strong { color: var(--ember-deep); font-weight: 700; }
.quote-band .qword { display: inline-block; }
.quote-band cite {
  display: block;
  margin-top: 1.6rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 400;
  color: rgba(29, 43, 57, 0.7);
}
.quote-band cite::before { content: "— "; }

/* ---------- the arc (dark band) ---------- */

.arc {
  background: linear-gradient(180deg, var(--night) 0%, var(--night-deep) 100%);
  color: var(--paper);
}
.arc .h2 { color: var(--paper-soft); }
.arc .section-head p { color: #c2cbdb; }
.arc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2.4rem, 6vw, 5rem);
  align-items: start;
}
.timeline { position: relative; padding-left: 2.1rem; display: grid; gap: clamp(2rem, 4vh, 3rem); }
.t-line {
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), var(--ember) 55%, var(--coral));
  border-radius: 2px;
  opacity: 0.7;
  transform-origin: 50% 0;
}
.moment { position: relative; transition: opacity 0.5s ease; }
.moment::before {
  content: "";
  position: absolute;
  left: calc(-2.1rem + 1px);
  top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(226, 168, 61, 0.18);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.45s ease;
}
.moment.flare::before { background: var(--ember); box-shadow: 0 0 0 5px rgba(217, 111, 50, 0.22); }
.moment .when {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--gold-soft);
}
.moment h3 {
  font-size: var(--step-2);
  margin: 0.35rem 0 0.5rem;
  color: var(--paper-soft);
}
.moment p { margin: 0; color: #ccd5e3; font-size: 1.05rem; line-height: 1.66; max-width: 58ch; }
.moment.flare h3 { color: var(--gold-soft); }

/* stepper states (desktop, motion only) */
html.has-motion .arc-stepping .moment { opacity: 0.38; }
html.has-motion .arc-stepping .moment.active { opacity: 1; }
html.has-motion .arc-stepping .moment.active::before {
  transform: scale(1.45);
  box-shadow: 0 0 0 7px rgba(240, 198, 106, 0.28), 0 0 22px 4px rgba(232, 137, 60, 0.5);
}

.arc-art { position: sticky; top: calc(var(--header-h) + 24px); }
.arc-art .frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 8px solid rgba(249, 242, 227, 0.12);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.6);
  transform: rotate(-1.2deg);
}
.arc-art figcaption {
  margin-top: 0.9rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(249, 242, 227, 0.7);
}

/* ---------- the idea ---------- */

.idea-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(2.4rem, 6vw, 4.5rem);
  align-items: start;
  margin-top: var(--space-m);
}
.idea-art {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.idea-art .frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 10px solid var(--paper-soft);
  outline: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  transform: rotate(-1.6deg);
}
.idea-art figcaption { margin-top: 1rem; font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--ink-soft); }

.conditions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.9rem;
  max-width: 560px;
}
.condition {
  border-top: 2px solid var(--line);
  padding-top: 1rem;
}
.condition .icon { width: 42px; height: 42px; margin-bottom: 0.7rem; }
.condition h3 { font-size: 1.34rem; margin: 0 0 0.35rem; }
.condition .q {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ember-deep);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}
.condition p { margin: 0; font-size: 0.93rem; color: var(--ink-soft); }

/* ---------- spectrum ---------- */

.spectrum-wrap {
  margin-top: var(--space-l);
  background: var(--paper-soft);
  border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.6rem, 4vw, 2.8rem);
  box-shadow: 0 14px 40px -24px rgba(29, 43, 57, 0.3);
}
.spectrum-bar {
  height: 64px;
  border-radius: 999px;
  background:
    radial-gradient(ellipse 30% 120% at 50% 50%, rgba(240, 198, 106, 0.95), rgba(240, 198, 106, 0) 70%),
    linear-gradient(90deg, #44586e 0%, #7c93a6 22%, #f0c66a 50%, #e8893c 72%, #b03a24 100%);
  position: relative;
  overflow: hidden;
}
.flame-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  background: radial-gradient(circle at 50% 65%, #fff3d6 0%, var(--gold) 45%, var(--ember) 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  box-shadow: 0 0 22px 6px rgba(240, 198, 106, 0.65);
}
html.has-motion .flame-marker { left: 10%; }
.spectrum-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.3rem;
}
.spectrum-labels h3 { font-size: 1.05rem; margin: 0 0 0.25rem; }
.spectrum-labels div:nth-child(2) { text-align: center; }
.spectrum-labels div:nth-child(3) { text-align: right; }
.spectrum-labels p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); max-width: 34ch; }
.spectrum-labels div:nth-child(2) p { margin-inline: auto; }
.spectrum-labels div:nth-child(3) p { margin-left: auto; }
.t-cold { color: #44586e; }
.t-warm { color: var(--ember-deep); }
.t-fire { color: #b03a24; }
.spectrum-note {
  margin: 1.6rem auto 0;
  max-width: 60ch;
  text-align: center;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- infrastructure ---------- */

.infra-art {
  margin-bottom: var(--space-m);
}
.full-bleed {
  width: 100%;
}
.full-bleed img { width: 100%; }

.ground {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
}
.ground-strip {
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.ground-strip.stack { background: var(--paper-soft); border: 1px solid var(--line-soft); border-left: 4px solid var(--ink-soft); }
.ground-strip.eco { background: var(--paper-soft); border: 1px solid var(--line-soft); border-left: 4px solid var(--moss); }
.ground-strip svg { flex: 0 0 34px; margin-top: 0.2rem; }
.ground-strip h3 { font-size: 1.08rem; margin: 0 0 0.3rem; }
.ground-strip p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- human / red lines ---------- */

.human { background: var(--night); color: var(--paper); overflow: clip; }
.human .wrap { position: relative; z-index: 2; }
.human .h2 { color: var(--paper-soft); }
.human .section-head p { color: #c2cbdb; }
.human-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.2rem, 5vw, 4rem);
  margin-top: var(--space-m);
}
.human h3 {
  font-size: 1.3rem;
  color: var(--gold-soft);
  margin-bottom: 1.1rem;
}
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.plist li {
  position: relative;
  padding-left: 1.7rem;
  color: #ccd5e3;
  font-size: 1rem;
}
.plist li strong { color: var(--paper-soft); }
.plist.keep li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.42em;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #fff3d6, var(--gold) 60%, var(--ember));
}
.plist.lines li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.5em;
  width: 15px; height: 3.5px;
  border-radius: 2px;
  background: var(--coral);
}
.human-grid > div:last-child {
  border: 1px solid rgba(217, 99, 106, 0.45);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  background: rgba(217, 99, 106, 0.06);
}
.human.section-pad { padding-bottom: var(--space-l); }
.human-quote cite {
  display: block;
  margin-top: 1.1rem;
  font-size: 1rem;
  font-style: italic;
  color: rgba(249, 242, 227, 0.6);
}
.human-quote cite::before { content: "— "; }
.human-quote {
  margin: var(--space-l) auto 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--step-3);
  color: var(--gold-soft);
  max-width: 24ch;
  line-height: 1.3;
}

/* ---------- breather ---------- */

.breather {
  min-height: 64svh;
  display: grid;
  place-items: center;
  padding: var(--space-l) 0;
  text-align: center;
}
.breather-mark { width: 56px; height: 56px; margin: 0 auto 1.6rem; display: block; }
.breather-line {
  margin: 0 auto;
  max-width: 22ch;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--step-4);
  line-height: 1.22;
  color: var(--ink);
  text-wrap: balance;
}
.breather-line .qword { display: inline-block; }
.breather-cite {
  margin: 1.6rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-faint);
}
.breather-cite::before { content: "— "; }

/* ---------- roadmap ---------- */

.roadmap-list {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 2.6rem;
}
.roadmap-list li {
  counter-increment: step;
  position: relative;
  padding: 1.2rem 0 1.2rem 3.8rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.97rem;
  color: var(--ink-soft);
}
.roadmap-list li strong { color: var(--ink); display: block; font-size: 1.06rem; margin-bottom: 0.15rem; }
.roadmap-list li:last-child { grid-column: 1 / -1; }
.roadmap-list li:last-child strong { font-size: 1.18rem; }
.roadmap-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ember);
}

/* ---------- paper ---------- */

.paper-card {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(2.2rem, 5vw, 4rem);
  align-items: start;
}
/* paper cover: the real PDF cover page, clickable to download */
.cover {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(29, 43, 57, 0.14);
  position: sticky;
  top: calc(var(--header-h) + 24px);
  line-height: 0;
  background: var(--night-deep);
}
.cover-link {
  display: block;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cover-link:focus-visible { outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
  .cover-link:hover { transform: scale(1.015); }
}
.cover img { width: 100%; height: auto; display: block; }

.paper-info .abstract { max-width: 62ch; }
.paper-info .abstract p {
  margin: 0 0 1.1rem;
  font-size: 1.02rem;
  line-height: 1.66;
  color: var(--ink-soft);
}
.paper-info .abstract p:last-child { margin-bottom: 0; }
.paper-info .abstract strong { color: var(--ink); font-weight: 500; }
.abstract-lede {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--step-2) !important;
  line-height: 1.4 !important;
  color: var(--ink) !important;
}
.paper-meta {
  margin: 0 0 1.3rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--ember-deep);
}
.toc {
  margin-top: 1.8rem;
  border-top: 2px solid var(--line);
}
.toc details { border-bottom: 1px solid var(--line-soft); }
.toc summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 1rem 0.4rem;
  min-height: 48px;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s ease, background 0.2s ease;
}
.toc summary:hover { background: rgba(29, 43, 57, 0.04); }
.toc summary:hover { color: var(--ember-deep); }
.toc summary::-webkit-details-marker { display: none; }
.toc summary .no {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ember);
  font-size: 0.98rem;
  min-width: 1.7rem;
}
.toc summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--serif);
  color: var(--ember);
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.toc details[open] summary::after { content: "+"; transform: rotate(45deg); }
.toc details p {
  margin: 0 0 1rem 2.6rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 60ch;
}
.paper-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
.cite-line {
  margin: 1.3rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-faint);
  max-width: 72ch;
}
.cite-line em { color: var(--ink-soft); }

/* ---------- media ---------- */

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}
.media-card {
  background: var(--paper-soft);
  border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 38px -24px rgba(29, 43, 57, 0.35);
  transition: box-shadow 0.35s ease;
}
.media-card:hover { box-shadow: 0 26px 52px -24px rgba(29, 43, 57, 0.5); }
.media-card .thumb { aspect-ratio: 16 / 10; overflow: hidden; position: relative; }
.media-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.media-card:hover .thumb img { transform: scale(1.06); }
.media-card .thumb.placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 8;
  background: linear-gradient(160deg, var(--blush), #f4e4c6);
}
.media-card .thumb.placeholder.cool { background: linear-gradient(160deg, #dde6e4, var(--paper-warm)); }
.media-card .thumb.placeholder svg {
  width: 88px; height: 88px; opacity: 0.95;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.media-card:hover .thumb.placeholder svg { transform: scale(1.1) rotate(-2deg); }
.media-body { padding: 1.4rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.media-body .note { margin-bottom: 0.6rem; }
.media-body h3 { font-size: 1.32rem; margin: 0 0 0.45rem; }
.media-body p { margin: 0 0 1.2rem; font-size: 0.93rem; color: var(--ink-soft); }
.media-body .link {
  margin-top: auto;
  font-weight: 600;
  font-family: var(--sans);
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ember-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  border: 1.5px solid rgba(189, 85, 36, 0.45);
  border-radius: 10px;
  padding: 0.65rem 1.05rem;
  min-height: 44px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.media-body .link:hover { border-color: var(--ember-deep); background: rgba(217, 111, 50, 0.07); }
.media-body .link .arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.media-body .link:hover .arrow { transform: translateX(5px); }


/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about-mark {
  background: linear-gradient(165deg, var(--blush), var(--paper-warm));
  border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.8rem;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 38px -26px rgba(29, 43, 57, 0.4);
}
.about-mark svg { width: min(190px, 60%); height: auto; }
.about-text p { max-width: 62ch; color: var(--ink-soft); }
.about-text .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--night-deep);
  color: rgba(249, 242, 227, 0.75);
  padding: 3.4rem 0 2.4rem;
  position: relative;
  overflow: clip;
}
.site-footer .wrap { position: relative; z-index: 2; }
.footer-motifs {
  display: flex;
  justify-content: center;
  gap: clamp(1.2rem, 4vw, 2.6rem);
  margin-bottom: 2.4rem;
  opacity: 0.9;
}
.footer-motifs svg { width: 40px; height: 40px; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.footer-motifs svg:hover { transform: translateY(-4px) scale(1.08); }
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(249, 242, 227, 0.14);
  padding-top: 1.6rem;
  font-size: 0.88rem;
}
.site-footer a { color: var(--gold-soft); }
.footer-note { font-size: 0.85rem; color: rgba(249, 242, 227, 0.62); margin-top: 0.9rem; max-width: 56ch; }

/* ---------- flame flicker ---------- */

@media (prefers-reduced-motion: no-preference) {
  .flame-anim { transform-origin: 50% 85%; animation: flicker 2.8s ease-in-out infinite; }
  @keyframes flicker {
    0%, 100% { transform: scale(1) rotate(0deg); }
    30% { transform: scale(1.06) rotate(-1.4deg); }
    60% { transform: scale(0.97) rotate(1.2deg); }
  }
}


/* ---------- pinned pan scene (the infrastructure) ----------
   Base styles are the stacked, motion-free layout; the pinned
   camera-pan layout is applied by JS adding .pan-pinned on
   capable desktop devices. */

.pan-scene { position: relative; }
.pan-frame img { width: 100%; height: auto; }
@media (max-width: 767px) {
  /* the painting's whole point is its detail: let phones pan across it */
  .pan-scene:not(.pan-pinned) .pan-frame { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pan-scene:not(.pan-pinned) .pan-frame img { width: 200vw; max-width: none; }
}
.pan-captions { width: var(--wrap); margin-inline: auto; }
.pan-caption {
  max-width: 460px;
  background: var(--paper-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 16px 44px -22px rgba(29, 43, 57, 0.45);
  padding: 1.5rem 1.6rem;
  margin: 1.2rem 0;
}
.pan-num {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ember-deep);
}
.pan-caption h3 { font-size: 1.5rem; margin: 0 0 0.5rem; }
.pan-caption p:last-child { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--ink); }
.pan-dots { display: none; }

.pan-pinned .pan-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: clip;
}
.pan-pinned .pan-frame {
  position: absolute;
  inset: 0;
}
.pan-pinned .pan-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}
.pan-pinned .pan-captions {
  position: absolute;
  inset: auto auto 9svh clamp(1.5rem, 6vw, 7rem);
  width: auto;
  margin: 0;
}
.pan-pinned .pan-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: min(440px, calc(100vw - 3rem));
  margin: 0;
  background: rgba(253, 248, 238, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(29, 43, 57, 0.14);
  box-shadow: 0 22px 50px -20px rgba(18, 27, 44, 0.55);
}
.pan-pinned .pan-dots {
  display: flex;
  gap: 0.6rem;
  position: absolute;
  right: clamp(1.5rem, 5vw, 5rem);
  bottom: 9svh;
  background: rgba(253, 248, 238, 0.9);
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(29, 43, 57, 0.12);
}
.pan-pinned .pan-dots i {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(29, 43, 57, 0.5);
  background: transparent;
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.pan-pinned .pan-dots i.on {
  background: var(--ember);
  border-color: var(--ember);
  transform: scale(1.2);
}

/* ---------- idea conditions stepper ---------- */

html.has-motion .conditions-stepping .condition {
  opacity: 0.42;
  transition: opacity 0.5s ease;
}
html.has-motion .conditions-stepping .condition.active { opacity: 1; }
.condition .icon { transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
html.has-motion .conditions-stepping .condition.active .icon { transform: scale(1.18) rotate(-3deg); }

/* ---------- static fallbacks (no JS / reduced motion) ----------
   Without motion, the chapter background tweens never run, so the
   key bands keep their own colours. */

html:not(.has-motion) .quote-band { background: linear-gradient(180deg, var(--blush), var(--paper-warm)); }
html:not(.has-motion) .infra { background: var(--paper-warm); }
html:not(.has-motion) .paper-sec { background: linear-gradient(180deg, var(--paper-warm), var(--paper)); }

/* ---------- motion-armed initial states ----------
   These only apply under html.has-motion (added pre-paint when
   reduced motion is NOT requested; removed if GSAP fails to load),
   so content is always visible without JavaScript. */

html.has-motion .reveal { opacity: 0; transform: translateY(34px); }

html.has-motion [data-hero] { opacity: 0; }
html.has-motion [data-hero="actions"] { opacity: 0; visibility: hidden; }
html.has-motion [data-hero="art"] { opacity: 1; }
html.has-motion [data-hero-frame] { opacity: 0; }
html.has-motion [data-hero-motif] { opacity: 0; }
html.has-motion [data-split] { visibility: hidden; }
html.has-motion [data-split-words] { visibility: hidden; }
html.has-motion [data-hero-title] { visibility: hidden; }
html.has-motion .img-reveal img { transform: scale(1.14); }
.img-reveal { overflow: clip; }

/* ---------- cursor glow (fine pointers only) ---------- */

.cursor-dot, .cursor-glow { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.has-motion .cursor-dot {
    display: block;
    position: fixed;
    z-index: 120;
    top: 0; left: 0;
    width: 8px; height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--ember);
    pointer-events: none;
  }
  html.has-motion .cursor-glow {
    display: block;
    position: fixed;
    z-index: 119;
    top: 0; left: 0;
    width: 170px; height: 170px;
    margin: -85px 0 0 -85px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 198, 106, 0.16), rgba(240, 198, 106, 0) 65%);
    pointer-events: none;
    transition: transform 0.3s ease;
  }
  html.has-motion .cursor-glow.is-active { transform: scale(1.6); }
  html.has-motion .cursor-dot.is-active { transform: scale(2.2); background: var(--gold); }
}

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .hero { min-height: auto; padding-top: calc(var(--header-h) + clamp(2rem, 6vh, 4rem)); }
  .hero-grid, .arc-grid, .idea-grid, .paper-card, .about-grid { grid-template-columns: 1fr; }
  .arc-art { position: static; max-width: 440px; }
  .idea-art { position: static; max-width: 440px; }
  .cover { position: static; max-width: 340px; }
  .layers { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
  .human-grid { grid-template-columns: 1fr; }
  .roadmap-list { grid-template-columns: 1fr; }
  .ground { grid-template-columns: 1fr; }
  .nav-links li.hide-m { display: none; }
  .hero-art .frame { transform: rotate(0.8deg); }
  .hero-art .motif.m1 { top: -28px; left: -16px; }
  .hero-art .motif.m2 { bottom: -24px; right: -12px; }
  .ghost-no { font-size: clamp(6rem, 26vw, 11rem); opacity: 0.05; }
}

@media (max-width: 620px) {
  .section-pad { padding: var(--space-l) 0; }
  .quote-band { padding: calc(var(--space-l) * 0.8) 0 var(--space-l); }
  .breather { min-height: 46svh; padding: var(--space-m) 0; }
  .brand { white-space: nowrap; }
  .brand span { display: none; }
  .nav { gap: 0.6rem; }
  .nav-links { gap: 0.7rem; }
  .nav-links .lang { gap: 0.45rem; font-size: 0.76rem; }
  .nav .btn { padding: 0.5rem 0.85rem; font-size: 0.8rem; }
  .spectrum-labels { grid-template-columns: 1fr; }
  .spectrum-labels div:nth-child(2), .spectrum-labels div:nth-child(3) { text-align: left; }
  .spectrum-labels div:nth-child(2) p, .spectrum-labels div:nth-child(3) p { margin: 0; }
  .spectrum-note { text-align: left; font-size: 1rem; }
  .roadmap-list li { padding-left: 2.8rem; }
  .footer-row span:last-child { display: flex; flex-wrap: wrap; gap: 0 1.2rem; }
  .footer-row span:last-child a { padding: 0.55rem 0; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .footer-row { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 1700px) {
  :root {
    --wrap: min(1340px, calc(100vw - 160px));
    --step-6: clamp(3.4rem, 2.6rem + 3.6vw, 6.85rem);
    --step-4: clamp(2.3rem, 1.7rem + 3vw, 4.6rem);
  }
  .hero-sub { font-size: 1.4rem; }
}

/* ---------- legal pages (imprint / privacy) ---------- */

.legal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 248, 238, 0.95);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
}
.legal-header .nav { padding: 0.8rem 0; }
.legal-back {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.legal-back:hover { color: var(--ember-deep); }
.legal-page { padding: clamp(2.5rem, 7vh, 5rem) 0 var(--space-l); }
.legal { max-width: 70ch; }
.legal h1 { font-size: var(--step-4); margin-bottom: 0.5rem; line-height: 1.05; }
.legal .legal-updated {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-faint);
  margin: 0 0 2.2rem;
}
.legal h2 { font-size: var(--step-2); margin: 2.5rem 0 0.7rem; line-height: 1.15; }
.legal p, .legal li { font-size: 1.04rem; line-height: 1.7; color: var(--ink-soft); margin: 0 0 1rem; }
.legal address { font-style: normal; color: var(--ink); margin: 0 0 1.2rem; line-height: 1.75; }
.legal a { color: var(--teal); }
.legal a:hover { color: var(--ember-deep); }
.legal ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.legal li { margin-bottom: 0.4rem; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal-note {
  background: var(--blush);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.96rem;
  color: var(--ink-soft);
  margin: 0 0 2.2rem;
}
.legal-footer {
  background: var(--night-deep);
  color: rgba(249, 242, 227, 0.7);
  padding: 2.4rem 0;
  font-size: 0.88rem;
}
.legal-footer a { color: var(--gold-soft); }
