/* ── The home overture: a sticky stage, three panels, the middle one opens
   to the full width as the reader scrolls (CSS scroll-driven animation, no
   script). Without support, or with reduced motion, the stage is simply its
   finished state: the open horizon with the title and the list. */
.overture {
  position: relative;
  height: 100svh;
}
.overture-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  max-height: 100%;
  min-height: 560px;
  overflow: hidden;
  background: var(--earth);
}
.ov-side {
  position: absolute;
  inset-block: 0;
  width: 50%;
  visibility: hidden;
}
.ov-side-left {
  left: 0;
}
.ov-side-right {
  right: 0;
}
.ov-center {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  justify-items: center;
  padding-bottom: clamp(2.5rem, 7vh, 5.5rem);
  /* Sky and risen pixel sun hold the upper third cleanly above all text. */
  --horizon-at: 34%;
  --ov-end: 34%;
}
@supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
  @media (prefers-reduced-motion: no-preference) {
    /* While the stage plays, the middle starts on the line the sides meet. */
    .ov-center {
      --horizon-at: 64%;
    }
  }
}
.ov-intro {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
}
.ov-final {
  width: 100%;
  max-width: 1180px;
  padding-inline: 1rem;
  text-align: center;
}
/* On a phone the eyebrow lands on the light band of the sky: full colour
   and a soft shadow, not the muted second ink. */
.ov-eyebrow {
  color: var(--on-horizon);
  text-shadow: 0 1px 10px rgba(9, 10, 16, 0.55);
}
.ov-cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  translate: -50% 0;
  font-size: 13px;
  color: var(--on-horizon-2);
  opacity: 0;
}

@supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
  @media (prefers-reduced-motion: no-preference) {
    .overture {
      height: 260svh;
      view-timeline: --overture block;
      timeline-scope: --overture;
    }
    .ov-center {
      animation: ov-open linear both;
      animation-timeline: --overture;
      animation-range: contain 28% contain 62%;
    }
    .ov-side {
      visibility: visible;
      animation: ov-align linear both;
      animation-timeline: --overture;
      animation-range: contain 0% contain 30%;
    }
    .ov-intro {
      animation: ov-intro linear both;
      animation-timeline: --overture;
      animation-range: contain 20% contain 44%;
    }
    .ov-final {
      animation: ov-final linear both;
      animation-timeline: --overture;
      animation-range: contain 42% contain 72%;
    }
    .ov-cue {
      animation: ov-cue linear both;
      animation-timeline: --overture;
      animation-range: contain 0% contain 10%;
    }
  }
}

@keyframes ov-open {
  from {
    clip-path: inset(0 var(--ov-gap, 29%));
    --horizon-at: 64%;
    --sun: 0;
  }
  to {
    clip-path: inset(0 0);
    --horizon-at: var(--ov-end, 62%);
    --sun: 1;
  }
}
/* The side lines meet the middle's: the three horizons become one. */
@keyframes ov-align {
  to {
    --horizon-at: 64%;
  }
}
@keyframes ov-intro {
  0%,
  45% {
    opacity: 1;
    translate: 0 0;
  }
  to {
    opacity: 0;
    translate: 0 -3rem;
  }
}
@keyframes ov-final {
  from {
    opacity: 0;
    translate: 0 2.5rem;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes ov-cue {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (max-width: 767px) {
  .overture-stage {
    --ov-gap: 13%;
  }
  .ov-center {
    --horizon-at: 28%;
    --ov-end: 28%;
  }
}

/* The studio opening links to the two sections below it. */
.toc {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc a {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-block: 0.38rem;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.toc .toc-leader {
  flex: 1;
  min-width: 2rem;
  border-bottom: 1px solid var(--rule-soft);
  transform: translateY(-0.32em);
  transition: border-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.toc a:hover .toc-leader,
.toc a:focus-visible .toc-leader {
  border-bottom-color: var(--ink);
}

main:has(.overture) {
  padding-top: 0;
}

/* The front page: no bar over the opening stage; it comes once the stage
   has been scrolled and stays (BarClient). Only when scripts run, so the
   bar can never be lost. */
@media (scripting: enabled) {
  html:has(.overture):not([data-bar]) .site-bar {
    opacity: 0;
    translate: 0 -18px;
    visibility: hidden;
  }
}

[data-site='core'] .ov-side-left {
  --horizon-at: 34%;
}
[data-site='core'] .ov-side-right {
  --horizon-at: 76%;
}
[data-site='core'] .ov-side:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -5px;
}
[data-site='core'] .ov-center {
  align-content: center;
  --horizon-at: 62%;
  --ov-end: 62%;
  padding-bottom: 0;
}
[data-site='core'] .ov-center > .ov-intro,
[data-site='core'] .ov-center > .ov-cue {
  position: absolute;
  pointer-events: none;
}
[data-site='core'] .ov-final {
  background: radial-gradient(
    48% 46% at 50% 42%,
    rgba(9, 10, 16, 0.34),
    transparent 100%
  );
}
[data-site='core'] .toc a {
  padding-block: 0.3rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
}
[data-site='core'] .toc .toc-leader {
  border-bottom: 1px dotted var(--rule);
  transform: translateY(-0.28em);
  opacity: 0.7;
}
[data-site='core'] .toc a:hover .toc-leader,
[data-site='core'] .toc a:focus-visible .toc-leader {
  border-bottom-style: solid;
  opacity: 1;
}

/* Below the motion timeline, the two links are covered by the studio panel.
   Take them out of the tab order at the same time. A keyboard reader reaching
   the contents early sees the full headline and list immediately. */
@supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
  @media (prefers-reduced-motion: no-preference) {
    [data-site='core'] .ov-side {
      animation-name: ufuk-align;
      animation-range: contain 0% contain 62%;
    }
    [data-site='core'] .ov-center:focus-within,
    [data-site='core'] .ov-final:focus-within {
      animation: none;
    }
    [data-site='core'] .ov-center:focus-within .ov-intro,
    [data-site='core'] .ov-center:focus-within .ov-cue {
      visibility: hidden;
    }
  }
}
@keyframes ufuk-align {
  0% {
    visibility: visible;
  }
  48.4% {
    --horizon-at: 64%;
  }
  100% {
    --horizon-at: 64%;
    visibility: hidden;
  }
}
@media (max-width: 767px) {
  [data-site='core'] .ov-center {
    --horizon-at: 52%;
    --ov-end: 52%;
  }
}
