/* The `.tour` section: the ground everything below the hero sits in — the dark
   gradient and the light pools behind the closing band and the footer — and the
   site footer. The feature chapters have their own sheets (layout-chapters.css,
   widgets.css, stat-band.css) and the closing band has finale.css. Design
   tokens come from the shared tokens.css :root: the accent + font stacks are
   aliased to the local --t- and --a- names here, and the --sg- chrome vars
   resolve from :root.

   The section class is still `.tour` — it was a sticky scroll tour until
   2026-08-19, then seven stacked panels, and since 2026-10-12 three chapters of
   widgets. */

.tour {
  --t-ink: #ffffff;
  --t-ink-soft: rgb(255 255 255 / 64%);
  --t-ink-faint: rgb(255 255 255 / 45%);
  --t-accent: var(--accent);
  --t-surface-0: #090b0a;
  /* The shared .a-appwin chrome reads these; alias them to the shared
     tokens (tokens.css :root) so hero + tour render identically. */
  --a-font-display: var(--font-display);
  --a-font-mono: var(--font-mono);
  position: relative;
  /* `clip`, not `hidden`: `hidden` builds a scroll container, and one extra
     pixel of overflow in a scroll container is what moved the whole shell the
     last time (see AGENTS.md "Known traps"). Mirrors .direction-a. */
  overflow: clip;
  color: var(--t-ink);
  font-family: var(--a-font-display);
  background:
    radial-gradient(
      circle at 24% 30%,
      rgb(255 255 255 / 3.5%),
      transparent 30rem
    ),
    linear-gradient(180deg, #090b0a 0%, #0c0e0c 55%, #0a0c0b 100%);
}

/* Light pools rising behind the closing band + footer so the page does not end
   on flat black. Three overlapping pools at different sizes read as depth
   without reading as a colour. They used to drift on a 22s loop; that was the
   last moving background left after the two WebGL fields went, and it went
   with them (2026-08-19). Anchored to the bottom, faded out at the top. */
.tour::after {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: 130svh;
  background:
    radial-gradient(
      42rem 30rem at 16% 86%,
      rgb(255 255 255 / 6%),
      transparent 68%
    ),
    radial-gradient(
      40rem 30rem at 82% 96%,
      rgb(255 255 255 / 7%),
      transparent 70%
    ),
    radial-gradient(
      30rem 24rem at 52% 76%,
      rgb(255 255 255 / 4%),
      transparent 70%
    );
  content: "";
  mask-image: linear-gradient(180deg, transparent 0%, #000 26%);
  pointer-events: none;
}

/* ---------- site footer ---------- */

/* The rule above the footer moved onto `.site-footer__inner`, which is frame
   width — a full-bleed border here ran past the two verticals and broke the
   frame at the one place a viewer is looking straight at it. */
.site-footer {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: rgb(9 11 10 / 55%);
  backdrop-filter: blur(2px);
}

/* A soft pool anchored to the footer's own corner, gently pulsing. */
.site-footer__glow {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(
      36rem 22rem at 88% 120%,
      rgb(255 255 255 / 7%),
      transparent 70%
    ),
    radial-gradient(
      30rem 20rem at 8% -10%,
      rgb(255 255 255 / 5%),
      transparent 72%
    );
  pointer-events: none;
  animation: tour-footerpulse 9s ease-in-out infinite alternate;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  width: var(--frame-width);
  margin-inline: auto;
  padding-inline: var(--frame-pad);
  padding-block: clamp(3rem, 6vw, 5rem) 2.5rem;
  border-top: 1px solid var(--frame-line);
}

.site-footer__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.site-footer__tagline {
  max-width: 24rem;
  margin: 1rem 0 0;
  color: var(--t-ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.site-footer__coltitle {
  margin-bottom: 0.3rem;
  color: var(--t-ink-faint);
  font-family: var(--a-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer__col a,
.site-footer__link {
  width: fit-content;
  padding: 0;
  border: 0;
  background: none;
  color: var(--t-ink-soft);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease;
}

.site-footer__col a:hover,
.site-footer__link:hover {
  color: var(--t-accent);
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  width: var(--frame-width);
  margin-inline: auto;
  padding-inline: var(--frame-pad);
  padding-block: 1.4rem 2.2rem;
  border-top: 1px solid var(--frame-line);
  color: var(--t-ink-faint);
  font-size: 0.82rem;
}

.site-footer__built {
  font-family: var(--a-font-mono);
  font-size: 0.76rem;
}

/* ---------- narrow screens ---------- */

@media (max-width: 768px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .tour,
  .tour::before,
  .tour::after,
  .tour *,
  .tour *::before,
  .tour *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes tour-footerpulse {
  from {
    opacity: 0.7;
    transform: translateY(1.5%);
  }

  to {
    opacity: 1;
    transform: translateY(-1.5%);
  }
}
