/* Critical Point Vision Site: pages.css
 * The parts that only exist because the site is six pages instead of one:
 * the compact page top on every inner page, the "more" link that sends a
 * home section to its fuller page, the single next block at the foot of an
 * inner page, and the cross-fade between pages. Loads on every page.
 * Tokens only. No new button styles.
 */

/* ---------- page top ---------- */
/* Mockup P (Eric's pick, 2026-10-02 night): the page name is a small
   overline, the first section's claim is the h1 with its two-tone span, one
   lead sits under it, and the first section starts straight after with no
   intro of its own (its intro is a part the home page alone requests). */

.page-top {
  padding-top: calc(var(--nav-h) + clamp(3rem, 7vw, 5.5rem));
  padding-bottom: 0;
}

.page-top__over {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-caption);
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--primary);
}

html[data-theme="dark"] .page-top__over {
  color: var(--hl-on-ink);
}

.page-top h1 {
  margin-top: var(--space-250);
  font-size: clamp(2.25rem, 5.5vw, var(--text-display));
  max-width: 22ch;
}

.page-top .lead {
  margin-top: var(--space-300);
  max-width: 58ch;
}

/* the first section follows the top closely */
.page-top + section > .section-pad,
.page-top + .section-pad {
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

/* ---------- "more" link: one home section to its fuller page ---------- */

.more {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.more__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-100);
  min-height: var(--touch-target-min);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--text-lead);
  color: var(--link);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-enter);
}

.more__link:hover {
  border-bottom-color: currentColor;
}

.more__link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* on a rust or blue splash the link takes the splash's own white */
.splash .more__link {
  color: #fff;
}

/* ---------- next block ---------- */

.next > .container {
  border-top: 1px solid var(--border);
  padding-block: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  justify-content: flex-end;
}

.next__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-300);
  min-height: var(--touch-target-min);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  letter-spacing: var(--display-track);
  color: var(--foreground);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-enter);
}

.next__link:hover {
  color: var(--primary-900);
}

html[data-theme="dark"] .next__link:hover {
  color: var(--primary-400);
}

.next__link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-md);
}

.next__link svg {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  transition: transform var(--duration-base) var(--ease-enter);
}

.next__link:hover svg {
  transform: translateX(0.25rem);
}

@media (max-width: 640px) {
  .next > .container {
    justify-content: flex-start;
  }
}

/* ---------- cross-fade between pages ---------- */
/* Progressive enhancement. Browsers without cross-document view transitions
   navigate normally; nothing on the page depends on this running. */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 140ms;
  animation-timing-function: var(--ease-enter);
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}
