/* Page sections: homepage, About and Philosophy. */

/* Homepage --------------------------------------------------------------------------------- */
.home { padding: 0 var(--space-gutter); }
.home p { margin: 0; }
.home > * + * { border-top: 1px solid var(--color-rule); }

/* 1. Hero */
.hero { padding: clamp(28px, 5vw, 56px) 0 clamp(28px, 4vw, 44px); }
.hero h1 { margin: 14px 0 0; max-width: 13em; }
.hero .lede { margin-top: 20px; }

/* 2. Facts: four columns */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 20px 0; }
.facts > div { padding: 2px 24px; }
.facts > div:first-child { padding-left: 0; }
.facts dt { margin-bottom: 8px; }
.facts dd { margin: 0; font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: clamp(19px, 1.8vw, 23px); line-height: 1.25; }

/* 3. Approach: the matrix and the three ideas, both headed by a label and a heading */
.approach { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4.5vw, 64px); padding: var(--space-section) 0; }
.matrix { display: grid; gap: 12px; width: 100%; max-width: 420px; margin: 0; }
.matrix-head { margin-bottom: 8px; }
.matrix-head h2 { margin: 14px 0 0; font-size: clamp(22px, 2.3vw, 28px); line-height: 1.25; }
.matrix [hidden] { display: none; }
.matrix-plot { position: relative; }
.matrix-plot svg { width: 100%; cursor: crosshair; }
/* One group per event, each on an opaque background (so the gaps between blocks don't show the previous event):
   the shown one fades in on top, the previous one disappears once covered */
.matrix-plot g { opacity: 0; pointer-events: none; transition: opacity 0s 0.4s; }
.matrix-plot g.on { opacity: 1; pointer-events: auto; transition: opacity 0.4s ease-in-out; }
.matrix-bg { fill: var(--color-background); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .matrix-plot g { transition: none; } }
.matrix-tip {
  position: absolute; z-index: 1; display: grid; gap: 2px; max-width: 320px; padding: 8px 10px;
  background: var(--color-background); border: 1px solid var(--color-rule); box-shadow: 0 4px 16px rgb(24 57 84 / 12%);
  font-size: 0.6875rem; line-height: 1.4; pointer-events: none;
}
.matrix-tip span { color: var(--color-text-muted); }
.matrix-rail { display: flex; justify-content: space-between; border-top: 1px solid var(--color-rule); }
.matrix-rail button {
  padding: 8px 0 0; border: 0; border-top: 2px solid transparent; margin-top: -1px; background: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; color: var(--color-text-subtle);
}
.matrix-rail button:hover { color: var(--color-text); }
.matrix-rail button[aria-pressed="true"] { border-top-color: var(--color-accent); color: var(--color-text); }
.matrix-event { min-height: 3em; margin: 0; font-size: 0.875rem; line-height: 1.5; }
.matrix-date { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--color-text-subtle); }
.matrix figcaption { display: grid; gap: 8px; font-size: 0.75rem; line-height: 1.5; }
.matrix-legend { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); }
.matrix-scale { width: 130px; height: 6px; background: var(--correlation-scale); }
.approach-text { display: flex; flex-direction: column; gap: 22px; }
.approach-text h2 { margin: 14px 0 0; max-width: 16em; }
.idea h3 { margin: 0 0 6px; font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: 1.25rem; letter-spacing: 0; text-transform: none; line-height: 1.3; }
.idea .num { margin-right: 10px; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--color-accent); }
.idea p { max-width: 30em; color: var(--color-text-muted); }

/* 4. Story: one sentence across the page */
.story { padding: var(--space-section) 0; }
.story .big { max-width: 28em; margin: 12px 0 16px; font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: clamp(24px, 2.8vw, 34px); line-height: 1.3; }
.story .story-copy { max-width: 46em; margin-bottom: 16px; color: var(--color-text-muted); }

@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .facts > div:nth-child(3) { padding-left: 0; }
  .approach { grid-template-columns: 1fr; }
  .matrix-rail button { font-size: 10px; }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; }
  .facts > div { padding: 0; }
}

/* Wide pages (About, Philosophy) ------------------------------------------------------------ */
.wide .lede:has(+ .film) { margin-bottom: 12px; }
.film { margin: 0 0 clamp(24px, 3vw, 40px); }

/* Section: label and heading on the left (1/3), content on the right (2/3) */
.section, .team-section { padding: var(--space-section) 0; border-top: 1px solid var(--color-rule); }
.section { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(28px, 4.5vw, 64px); }
.section h2 { margin: 14px 0 0; font-size: clamp(22px, 2.3vw, 28px); line-height: 1.25; }
.section > div:last-child > p { max-width: 36em; color: var(--color-text-muted); }
.section > div:first-child p { margin: 0; }

@media (max-width: 780px) {
  .section { grid-template-columns: 1fr; }
}

/* Timeline */
.timeline { margin: 0 0 10px; }
.timeline > div { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 6px 0; }
.timeline > div:first-child { padding-top: 0; }
.timeline dt { padding-top: 2px; font-family: var(--font-mono); font-size: 0.875rem; color: var(--color-accent); }
.timeline dd { margin: 0; }

/* Team */
.team-section > h2 { margin: 0 0 clamp(20px, 3vw, 32px); }
.team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px) clamp(24px, 3vw, 40px); }
.person p { margin: 0; }
.person img { width: 120px; height: 120px; object-fit: cover; margin-bottom: 12px; }
.person-name { font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: 1.375rem; line-height: 1.25; }
.person .label { margin: 4px 0 8px; line-height: 1.5; }
.person-bio { font-size: 0.9375rem; color: var(--color-text-muted); }
.person-bio + p { margin-top: 12px; }

@media (max-width: 860px) { .team { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .team { grid-template-columns: 1fr; } }

/* Philosophy: a subtitle between the page title and the lede */
.wide .page-title + h2 { margin: 28px 0 0; }
.wide h2 + .lede { margin-top: 20px; }

/* 404 page: a short message and the main pages, as a ruled list */
.not-found .page-title { padding-top: 14px; }
.not-found > .label { margin: 0; padding-top: clamp(48px, 8vw, 96px); }
.not-found-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--color-rule); }
.not-found .not-found-links a { display: block; text-decoration: none; height: 100%; padding: 24px 24px 24px 0; font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: 1.25rem; line-height: 1.3; }
.not-found .not-found-links li + li a { padding-left: 24px; border-left: 1px solid var(--color-rule); }
.not-found-links .label { display: block; margin-bottom: 8px; }
.not-found-links a:hover .label { color: var(--color-accent); }

@media (max-width: 860px) {
  .not-found-links { grid-template-columns: 1fr 1fr; }
  .not-found .not-found-links li:nth-child(3) a { padding-left: 0; border-left: 0; }
  .not-found-links li:nth-child(n+3) { border-top: 1px solid var(--color-rule); }
}
@media (max-width: 520px) {
  .not-found-links { grid-template-columns: 1fr; }
  .not-found .not-found-links li + li a { padding-left: 0; border-left: 0; }
  .not-found-links li + li { border-top: 1px solid var(--color-rule); }
}
