/* Content sections below the divider. Uses the tokens from style.css (--paper, --ink). */

:root {
  --navy: #1f2e42;
  --sand: #d7b593;
  --clay: #a8643d;
  --slate: #4f6a8a;
  --ochre: #b98a4e;
  --stone: #b2a799;
  --rule: #d8d4c9;
  --muted: #5d6573;
  --measure: 70ch;
}

/* The planets stay fixed in the hero and fade once the content arrives. */
body.deep .planet { opacity: 0; }

.content {
  position: relative;
  /* no z-index: it must not isolate the inverted arcs and bands from the paper */
  max-width: 1760px;
  margin: 0 auto;
  padding: 5vh 3.5vw 6vh;
  /* distance from the content column to the viewport edge, for bleeding images */
  --bleed: calc((100vw - min(100vw, 1760px)) / 2 + 3.5vw);
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.62;
  color: var(--ink);
}

/* Chillax for headings and labels, Manrope Light for reading text. */
.content h2, .content h3, .content h4 {
  font-family: 'Chillax', system-ui, sans-serif;
  font-weight: 400;
  margin: 0;
}
.content p { margin: 0 0 0.9em; max-width: var(--measure); }
.grid p, .grid ul, .grid ol { max-width: none; }
.content ul, .content ol { max-width: var(--measure); padding-left: 1.2em; margin: 0 0 1.2em; }
.content li { margin-bottom: 0.45em; }

/* 12-column grid; sections place their pieces on it asymmetrically and let
   images overlap. Sub-grids keep paired pieces on the same row. */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 2vw, 28px);
  align-items: start;
}
.grid > * { grid-column: 1 / -1; min-width: 0; }
.subg {
  display: grid;
  grid-template-columns: subgrid;
  align-items: start;
}
.subg > * { grid-column: 1 / -1; }

.kicker {
  font-family: 'Chillax', system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin: 0 0 0.35em;
}

.lede {
  font-size: clamp(20px, 2.1vw, 26px);
  line-height: 1.45;
  max-width: 34em;
  letter-spacing: 0.01em;
}

.section { padding: 7vh 0 0; }
.section > h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 0.7em;
  max-width: 22em;
}
.section h3 {
  font-size: 16px;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 2.4em 0 0.8em;
  padding-top: 0.9em;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}

/* Candidate header: a wide photo of the world with the planet drawing laid
   over its corner, and the names beside it */
.world { position: relative; margin: 0 0 3.6em; }
.world-photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.world-planet { position: absolute; width: 34%; max-width: 300px; background: none !important; height: auto; aspect-ratio: 1; object-fit: contain; pointer-events: none; }
.cand-head .kicker { margin-bottom: 0.15em; }
.cand-head .star { margin: 0 0 1.2em; color: var(--muted); font-size: 15px; letter-spacing: 0.04em; }
.cand-head .lede { margin: 0; }

/* Facts table */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0;
  margin: 0 0 1.6em;
  border-top: 1px solid var(--ink);
  font-size: 16px;
  line-height: 1.45;
}
.facts dt, .facts dd { margin: 0; padding: 0.65em 0; border-bottom: 1px solid var(--rule); }
.facts dt { padding-right: 2em; color: var(--muted); letter-spacing: 0.04em; }

/* Figures: paper cards with a hairline and a soft shadow so they can overlap */
figure { margin: 0 0 1.6em; }
figure img { display: block; width: 100%; height: auto; background: var(--paper); }
figure.zoomable img { cursor: zoom-in; }
figcaption {
  margin-top: 0.7em;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 58ch;
}
.sky img { background: var(--navy); }
.c-map img, .c-full img {
  border: 1px solid var(--rule);
  box-shadow: 0 28px 60px -34px rgba(26, 31, 43, 0.4);
}

/* Video bleeding off the page edge */
.vid { display: block; height: auto; object-fit: cover; }

/* Open alternatives list */
ol.open-list { counter-reset: o; list-style: none; padding: 0; }
ol.open-list li { counter-increment: o; position: relative; padding-left: 2.4em; }
ol.open-list li::before {
  content: counter(o);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 13px;
  line-height: 1.45em;
  text-align: center;
}

/* Method steps: a row of panels, one open at a time. The open one widens and
   shows its diagram; the others fold down to a number and a title. */
.steps {
  --ease: cubic-bezier(0.44, 0, 0.56, 1);
  display: flex;
  height: clamp(380px, 33vw, 500px);
  background: var(--paper);
}
.step {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin-left: -1px;
  border: 1px solid var(--rule);
  overflow: hidden;
  cursor: pointer;
  transition: flex-grow 0.55s var(--ease), border-color 0.3s ease;
}
.step:first-child { margin-left: 0; }
.step:hover { border-color: var(--stone); }
.step.is-open { flex-grow: 3.4; border-color: var(--ink); z-index: 1; cursor: default; }

.step-head {
  all: unset;
  position: absolute;
  inset: 0 0 auto 0;
  height: 3.4rem;
  box-sizing: border-box;
  padding: 1.1rem 1.2rem 0;
  display: flex;
  gap: 1.1rem;
  align-items: baseline;
  font-family: 'Chillax', system-ui, sans-serif;
  cursor: inherit;
}
.step:not(.is-open) .step-head { inset: 0; height: auto; cursor: pointer; }
.step-head:focus-visible { outline: 1px solid var(--ink); outline-offset: -4px; }
.step-n { font-size: 13px; letter-spacing: 0.14em; color: var(--muted); }
.step-t { font-size: 17px; letter-spacing: 0.02em; color: var(--ink); }
.t-v { position: absolute; left: 1.2rem; bottom: 1.2rem; writing-mode: vertical-rl; transform: rotate(180deg); opacity: 0; transition: opacity 0.3s ease 0.25s; }
.t-h { opacity: 0; transition: opacity 0.25s ease; }
.step.is-open .t-h { opacity: 1; transition-delay: 0.3s; }
.step:not(.is-open) .t-v { opacity: 1; }

.step-body {
  position: absolute;
  inset: 3.4rem 0 0 0;
  min-width: 560px;
  margin: 0;
  padding: 0 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.step.is-open .step-body { opacity: 1; pointer-events: auto; transition: opacity 0.4s ease 0.3s; }
.step-body svg { flex: 1 1 0; min-height: 0; width: 100%; display: block; }
.step-body figcaption { margin: 0.8em 0 0; max-width: 52ch; }

/* Diagram drawing: hairlines in the site ink, one sand and one clay accent */
.step svg text { font-family: 'Chillax', system-ui, sans-serif; fill: var(--muted); }
.s-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.s-note { font-size: 13px; letter-spacing: 0.02em; }
.s-line { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.s-axis, .s-grid { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.s-grid { stroke: var(--stone); }
.s-guide { fill: none; stroke: var(--stone); stroke-width: 1; stroke-dasharray: 2 4; }
.s-fill-sand { fill: var(--sand); }
.s-fill-navy { fill: var(--navy); }
.s-ring { fill: none; stroke: var(--ink); stroke-width: 1; }
.s-ring-solid { fill: var(--navy); stroke: var(--paper); stroke-width: 1.5; }
.s-bars rect { fill: var(--navy); }
.s-bars-open rect { fill: none; stroke: var(--clay); stroke-width: 1.2; }

/* Question for experts */
.ask {
  margin: 2.6em 0 0;
  padding: 1.4em 1.6em;
  background: var(--navy);
  color: var(--paper);
}
.ask .label { font-size: 15px; letter-spacing: 0.03em; opacity: 0.7; display: block; margin-bottom: 0.6em; }
.ask p { margin: 0; max-width: none; font-size: 19px; line-height: 1.5; }

/* Status */
.status-list { list-style: none; padding: 0; font-family: 'Chillax', system-ui, sans-serif; font-size: clamp(20px, 2vw, 27px); line-height: 1.38; letter-spacing: 0.01em; }
.status-list li { padding: 0.8em 0; border-top: 1px solid var(--rule); margin: 0; }
.status-list li:first-child { border-top: 1px solid var(--ink); }

/* Code and data: not linked yet */
.coming {
  margin-top: 1.4em;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.link-off {
  display: inline-block;
  padding: 0.55em 1.1em;
  border: 1px dashed var(--stone);
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.04em;
  cursor: not-allowed;
  user-select: none;
}
.coming-note { font-size: 15px; color: var(--muted); max-width: 52ch; }

/* Footer */
.site-foot {
  margin-top: 14vh;
  padding-top: 2em;
  border-top: 1px solid var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
.site-foot p { margin: 0; max-width: 56ch; }
.site-foot .credits { color: var(--muted); font-size: 13.5px; }
.site-foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--clay); font-size: clamp(18px, 2vw, 26px); letter-spacing: 0.03em; }
.site-foot a:hover { color: var(--clay); }

/* Zoom overlay */
#zoom {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: rgba(244, 241, 234, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 3vw;
  cursor: zoom-out;
}
#zoom[hidden] { display: none; }
#zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Reveal */
.reveal-on .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal-on .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal-on .reveal { opacity: 1; transform: none; transition: none; }
}

@media (min-width: 900px) {
  .subg > * { grid-row: 1; }

  /* Intro: headline left, lede on the same row, right */
  .intro { align-items: end; }
  .intro .kicker { grid-column: 1 / 8; font-size: clamp(44px, 6.4vw, 104px); line-height: 1.04; margin: 0; }
  .intro .lede { grid-column: 8 / 13; margin: 0 0 0.5em; padding-top: 1em; border-top: 1px solid var(--ink); }

  /* Method: video bleeds off the left with the text beside it, the two
     diagrams overlap the video and each other, the wide one follows */
  #method { padding-top: 9vh; }
  #method .vid-ink {
    grid-column: 1 / 7; grid-row: 1 / span 2;
    width: calc(100% + var(--bleed)); margin-left: calc(-1 * var(--bleed));
    aspect-ratio: 4 / 3;
  }
  #method > h2 { grid-column: 7 / 13; grid-row: 1; align-self: end; margin: 0 0 0.5em; padding-left: 2vw; }
  #method > p { grid-column: 7 / 13; grid-row: 2; padding-left: 2vw; }
  .steps { grid-column: 3 / 13; grid-row: 3; margin: -10vh 0 0; position: relative; z-index: 2; }

  /* Candidates share one set of rows; A and B mirror each other */
  .cand .world { grid-row: 1; }
  .cand .cand-head { grid-row: 1; align-self: center; }
  .cand .spec { grid-row: 2; }
  .cand .found-wrap { grid-row: 3; }
  .cand .open-wrap { grid-row: 4; }
  .cand .figs { grid-row: 3 / span 2; }
  .cand .c-full { grid-row: 5; margin: 0; }
  .cand .c-ask { grid-row: 5; margin: 0; align-self: start; }
  .cand .found-wrap > *, .cand .open-wrap > * { grid-column: 1 / -1; grid-row: auto; }
  .cand .found-wrap > h3, .cand .open-wrap > h3 { margin-top: 1.2em; }
  .cand .found-wrap { margin-top: 1.4em; }
  .cand .figs { margin-top: 2.2em; }
  .cand .figs > * { grid-row: 1; }
  .cand .c-map { margin-top: 12vh; position: relative; z-index: 2; }

  /* A: photo bleeds off the left, planet overlaps its right edge */
  .cand-a .world { grid-column: 1 / 8; margin-left: calc(-1 * var(--bleed)); }
  .cand-a .orb { right: -8%; bottom: -11%; }
  .cand-a .cand-head { grid-column: 8 / 13; padding-left: 4vw; }
  .cand-a .spec .about { grid-column: 1 / 7; }
  .cand-a .spec .facts { grid-column: 8 / 13; margin-top: 0; }
  .cand-a .found-wrap, .cand-a .open-wrap { grid-column: 1 / 6; }
  .cand-a .figs { grid-column: 6 / 13; }
  .cand-a .c-sky { grid-column: 1 / 5; }
  .cand-a .c-map { grid-column: 4 / 8; }
  .cand-a .c-full { grid-column: 5 / 12; }
  .cand-a .c-ask { grid-column: 1 / 4; }

  /* B: photo bleeds off the right, planet overlaps its left edge */
  #candidate-b { padding-top: 9vh; }
  .cand-b .world { grid-column: 6 / 13; margin-right: calc(-1 * var(--bleed)); }
  .cand-b .orb { left: -8%; bottom: -11%; }
  .cand-b .cand-head { grid-column: 1 / 6; padding-right: 4vw; }
  .cand-b .spec .facts { grid-column: 1 / 6; margin-top: 0; }
  .cand-b .spec .about { grid-column: 7 / 13; }
  .cand-b .found-wrap, .cand-b .open-wrap { grid-column: 8 / 13; }
  .cand-b .figs { grid-column: 1 / 8; }
  .cand-b .c-sky { grid-column: 4 / 8; }
  .cand-b .c-map { grid-column: 1 / 5; }
  .cand-b .c-full { grid-column: 2 / 9; }
  .cand-b .c-ask { grid-column: 10 / 13; }
  .cand-a .c-sky figcaption { max-width: 72%; }
  .cand-b .c-sky figcaption { margin-left: 28%; }

  /* Status and footer */
  #status { padding-top: 9vh; }
  #status > h2 { grid-column: 1 / 5; grid-row: 1; margin: 0; }
  #status > .status-list { grid-column: 5 / 13; grid-row: 1; margin: 0; }
  #status .vid-bubble {
    grid-column: 1 / 7; grid-row: 2;
    width: calc(100% + var(--bleed)); margin: 3vh 0 0 calc(-1 * var(--bleed));
    aspect-ratio: 8 / 3;
  }
  #status > .coming-wrap { grid-column: 7 / 13; grid-row: 2; margin-top: 3vh; padding-left: 2vw; }
  .site-foot { margin-top: 8vh; }
  .site-foot > div { grid-column: 1 / 7; }
  .site-foot > .credits { grid-column: 8 / 13; }
}

@media (max-width: 1000px) {
  .steps { flex-direction: column; height: auto; }
  .step, .step.is-open { flex: none; margin-left: 0; margin-top: -1px; cursor: default; border-color: var(--rule); }
  .step:first-child { margin-top: 0; }
  .step-head, .step:not(.is-open) .step-head { position: static; height: auto; padding: 1.1rem 1.2rem 0.4rem; cursor: default; }
  .t-v { display: none; }
  .t-h { opacity: 1; }
  .step-body { position: static; min-width: 0; opacity: 1; pointer-events: auto; padding-bottom: 1.4rem; }
  .step-body svg { flex: none; height: auto; }
  .s-label { font-size: 17px; }
  .s-note { font-size: 19px; }
}

@media (max-width: 899px) {
  .intro .lede { margin-top: 1.2em; }
  .vid-ink, .vid-bubble { width: 100%; margin-bottom: 2em; aspect-ratio: 16 / 9; }
  .cand-head { margin-top: 1em; margin-bottom: 1.4em; }
  .site-foot > * + * { margin-top: 1.4em; }
}

@media (max-width: 820px) {
  .content { font-size: 17px; padding-top: 12vh; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding: 0.7em 0 0; }
  .facts dd { padding-top: 0.15em; }
}
