/*
 * Bene Gesserit orbital homepage
 *
 * The interface is organized as one continuous ceremonial field. Texture and
 * celestial geometry live in a generated raster asset; CSS is responsible only
 * for responsive editorial composition, interaction, and legibility. No card,
 * panel, fixed-width shell, or square container is used to partition the page.
 * This stylesheet is intentionally homepage-specific so the established article,
 * library, and protocol layouts can continue using `styles.css` unchanged.
 */
:root {
  color: #eee8dc;
  background: #070706;
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Garamond, serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  --soot: #070706;
  --bone: #eee8dc;
  --bone-muted: rgba(238, 232, 220, 0.68);
  --bone-faint: rgba(238, 232, 220, 0.42);
  --old-gold: #c6a047;
  --old-gold-bright: #e0bb59;
  --old-gold-dim: rgba(198, 160, 71, 0.42);
  --umber: #6f5332;
  --meta: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--soot);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  color: var(--soot);
  background: var(--old-gold-bright);
}

/*
 * The page background remains full bleed at every viewport width. Background
 * positioning moves the seal toward the right on desktop and brings part of it
 * behind the heading on narrow screens, preserving atmosphere without allowing
 * the brighter metal to compromise body-copy contrast.
 */
.ceremonial-page {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(1.6rem, 3.8vw, 3.8rem) clamp(1.25rem, 4.8vw, 5rem) clamp(2.2rem, 3vw, 3.5rem);
  background: var(--soot);
}

.background-art,
.seal-dust,
.atmospheric-wash,
.timeline-particle-field {
  position: absolute;
  pointer-events: none;
}

.background-art {
  inset: -3.5rem;
  z-index: -3;
  background-image: url("/assets/ceremonial-orbit-background.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  opacity: 0.96;
}

/*
 * The bronze seal itself belongs to the unmoving raster background. This round
 * viewport holds a small canvas whose particles turn independently above that
 * image. Keeping the two layers separate makes the lock feel mechanical: the
 * engraved metal remains fixed while concentric rings of luminous dust acquire
 * momentum, counter-rotate, and settle at each new chronological position.
 */
.seal-dust {
  top: -5vw;
  left: 54vw;
  z-index: 0;
  width: min(58rem, 54vw);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.96;
}

.seal-dust canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.vault-awakened .seal-dust {
  animation: seal-dust-awakening 840ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

@keyframes seal-dust-awakening {
  0%,
  100% {
    opacity: 0.96;
    filter: none;
  }

  42% {
    opacity: 1;
    filter: drop-shadow(0 0 0.72rem rgba(255, 218, 116, 0.56));
  }
}

.atmospheric-wash {
  inset: 0;
  z-index: -1;
  background: rgba(2, 2, 2, 0.08);
}

/*
 * Timeline motes are painted into one viewport-sized canvas instead of dozens
 * of independently composited DOM nodes. JavaScript clips every mote to the
 * visible chronology and derives its position from the same curve constants as
 * the article markers. The canvas therefore remains cheap, cannot intercept a
 * link, and never lets the dust wander away from the line it is illuminating.
 */
.timeline-particle-field {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  opacity: 0.9;
  mix-blend-mode: screen;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: var(--soot);
  background: var(--bone);
  border-radius: 999px;
  transform: translateY(-180%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Preserve a semantic archive heading without adding another visible label to
 * the open composition. The Earlier control occupies that former visual place. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/*
 * The masthead and navigation are purposely small compared with the featured
 * title. The navigation and its visible ellipse share one responsive geometry:
 * the three inline stations in `index.html` use exact ellipse percentages while
 * CSS stretches both the track and those points together. The marker centers
 * therefore cannot drift off the line when viewport proportions change.
 */
.masthead {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: clamp(12.5rem, 18vw, 15rem);
}

.identity {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  width: max-content;
  color: #e6d7bd;
  font-size: clamp(0.92rem, 1.35vw, 1.22rem);
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
}

.wordmark-point {
  width: 0.42rem;
  height: 0.42rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--old-gold);
  box-shadow: 0 0 1rem rgba(224, 187, 89, 0.35);
}

.motto {
  margin: 0;
  color: var(--bone-muted);
  font-size: clamp(0.88rem, 1.25vw, 1.08rem);
  font-style: italic;
  letter-spacing: 0.08em;
}

.nav-orbit-system {
  position: absolute;
  /*
   * The masthead sits inside fluid page padding, while this orbit belongs to the
   * viewport itself. Negating that same padding places both upper endpoints on
   * the physical top edge of the page. A full viewport width then lets the arc
   * enter at the upper-left corner, descend through the navigation, and return
   * to the upper-right corner without relying on the background image.
   */
  top: calc(clamp(1.6rem, 3.8vw, 3.8rem) * -1);
  left: 50%;
  width: 100vw;
  height: clamp(9rem, 13vw, 12rem);
  overflow: visible;
  pointer-events: none;
  transform: translateX(-50%);
}

.nav-orbit-track,
.orbital-nav {
  position: absolute;
  inset: 0;
}

.nav-orbit-track {
  overflow: hidden;
}

/*
 * The navigation path is the lower half of one ellipse. Its border box is twice
 * the visible height and is centered on the viewport's top edge; clipping keeps
 * only the descending half. The inline marker coordinates in `index.html` use
 * the identical ellipse equation, preventing dot-to-line drift at every width.
 */
.nav-orbit-track::before {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 200%;
  border: 1px solid rgba(198, 160, 71, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 2rem rgba(198, 160, 71, 0.045);
  content: "";
}

.orbital-nav {
  pointer-events: none;
}

.orbital-nav a {
  --nav-orb-radius: 0.29rem;

  position: absolute;
  top: var(--nav-y);
  left: var(--nav-x);
  display: inline-flex;
  min-width: 6.5rem;
  flex-direction: column;
  align-items: center;
  gap: 0.62rem;
  color: rgba(255, 249, 236, 0.95);
  font-size: clamp(1.02rem, 1.48vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.035em;
  text-align: center;
  white-space: nowrap;
  pointer-events: auto;
  /* Center the label on its station, then raise the link by exactly one marker
   * radius. The marker center—not the label's line box—therefore owns the path. */
  transform: translate(-50%, calc(var(--nav-orb-radius) * -1));
  text-shadow: 0 0.12rem 1rem rgba(0, 0, 0, 0.88);
  transition: color 180ms ease, letter-spacing 180ms ease, text-shadow 180ms ease;
}

.orbital-nav a:nth-child(3) {
  flex-direction: column;
}

.nav-orb {
  position: relative;
  width: 0.58rem;
  height: 0.58rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--old-gold);
  box-shadow: 0 0 0.8rem rgba(224, 187, 89, 0.28);
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

/* A circular wake makes each orbital destination feel physically attached to
 * the seal without introducing a rectangular hover treatment. */
.nav-orb::after {
  position: absolute;
  inset: -0.42rem;
  border: 1px solid rgba(224, 187, 89, 0.58);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: scale(0.46);
  transition: opacity 180ms ease, transform 220ms ease;
}

.orbital-nav a:hover,
.orbital-nav a:focus-visible {
  color: var(--old-gold-bright);
  letter-spacing: 0.07em;
  text-shadow: 0 0 1rem rgba(224, 187, 89, 0.24);
}

.orbital-nav a:hover .nav-orb,
.orbital-nav a:focus-visible .nav-orb {
  background: #ffe6a3;
  box-shadow: 0 0 0.9rem rgba(255, 220, 126, 0.66);
  transform: scale(1.28);
}

.orbital-nav a:hover .nav-orb::after,
.orbital-nav a:focus-visible .nav-orb::after {
  opacity: 0.82;
  transform: scale(1.3);
}

/*
 * The hero is a fluid two-column relationship, never a centered fixed-width
 * wrapper. Its left column owns the dominant article title; the right column
 * leaves the seal visible and carries only the brief guiding principle beneath
 * it. A dynamic title class from `home.js` protects arbitrary title lengths.
 */
.hero {
  position: relative;
  z-index: 2;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(15rem, 1fr);
  align-items: center;
  min-height: clamp(28rem, 52vh, 34rem);
}

/*
 * Selecting a chronology entry briefly opens a diffuse aureole behind the new
 * feature. The effect is bounded, non-looping, and circular; it reads as a vault
 * admitting light rather than a panel appearing around the article.
 */
.hero::after {
  position: absolute;
  inset: 5% 30% 8% -8%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 38% 45%,
    rgba(215, 169, 68, 0.2) 0%,
    rgba(150, 99, 33, 0.08) 42%,
    transparent 72%
  );
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: scale(0.78);
}

.hero.feature-awakened::after {
  animation: feature-aureole 760ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

@keyframes feature-aureole {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  36% {
    opacity: 0.88;
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

.featured-copy {
  display: block;
  width: 88%;
  margin-left: clamp(0rem, 3vw, 3.2rem);
  padding-bottom: clamp(1rem, 4vh, 3rem);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/*
 * The entire editorial feature is the article link. Focus remains visibly tied
 * to the open composition through color and light rather than a rectangular box.
 */
.featured-copy:hover #featured-title,
.featured-copy:focus-visible #featured-title {
  color: #fffaf0;
  text-shadow: 0 0.12rem 1.8rem rgba(224, 187, 89, 0.14);
}

.featured-copy:focus-visible {
  outline: none;
}

.article-date,
.archive-heading h2,
.timeline-date,
.timeline-action {
  font-family: var(--meta);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.article-date {
  margin: 0 0 clamp(0.8rem, 1.8vh, 1.25rem);
  color: var(--old-gold-bright);
  font-size: clamp(0.65rem, 0.85vw, 0.78rem);
}

#featured-title,
.reading-preview h2 {
  margin: 0;
  max-width: 100%;
  color: var(--bone);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.86;
  text-wrap: balance;
  text-shadow: 0 0.12rem 1.5rem rgba(0, 0, 0, 0.44);
}

.title-scale-short {
  font-size: clamp(5rem, 9vw, 9.3rem);
}

.title-scale-medium {
  font-size: clamp(4.1rem, 7.4vw, 7.7rem);
}

.title-scale-long {
  font-size: clamp(3.1rem, 5.2vw, 5.4rem);
}

.title-scale-extended {
  font-size: clamp(2.45rem, 4.15vw, 4.35rem);
  line-height: 0.94;
}

.article-dek {
  max-width: 37rem;
  margin: clamp(1.25rem, 2.7vh, 2rem) 0 0;
  color: rgba(238, 232, 220, 0.78);
  font-size: clamp(1.05rem, 1.55vw, 1.34rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.reading-action {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: clamp(1.35rem, 3vh, 2.15rem);
  padding: 0;
  border: 0;
  color: var(--old-gold-bright);
  background: transparent;
  font-family: var(--meta);
  font-size: clamp(0.66rem, 0.82vw, 0.77rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
}

.preview-close:focus-visible,
.wordmark:focus-visible,
.orbital-nav a:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-color: var(--old-gold-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.38rem;
}

/* The focused archive item is identified by its enlarged luminous marker; a
 * text underline would spread through the entire nested editorial block. */
.timeline-select:focus-visible {
  outline: none;
}

.principle {
  align-self: end;
  width: min(32rem, 92%);
  margin: 0 clamp(0rem, 2vw, 2.4rem) clamp(2rem, 5vh, 4rem) auto;
  color: rgba(250, 226, 168, 0.95);
  text-shadow: 0 0.12rem 1rem rgba(0, 0, 0, 0.9), 0 0 1.4rem rgba(198, 160, 71, 0.12);
}

.quotation-mark {
  float: left;
  margin: -0.6rem 0.75rem 0 -0.1rem;
  color: rgba(244, 197, 91, 0.96);
  font-size: 4.9rem;
  font-weight: 700;
  line-height: 1;
}

.principle blockquote {
  margin: 0;
}

.principle p {
  margin: 0;
  font-size: clamp(1.08rem, 1.55vw, 1.38rem);
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.012em;
  line-height: 1.52;
}

/*
 * The desktop chronology is a horizontally scrollable celestial track rather
 * than a row of cards. Alternating clipped half-ellipses and marker coordinates
 * share the same interval, midline, and amplitude values from `home.js`. The
 * canvas moves under touchpad, horizontal-wheel, touch, or button input while
 * every dot remains physically attached to its curve.
 */
.archive {
  position: relative;
  z-index: 2;
  min-height: clamp(21rem, 36vh, 25rem);
}

.archive-heading {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.72rem;
  padding-inline: clamp(0rem, 0.8vw, 0.75rem);
}

.mobile-time-direction,
.timeline-list-mobile,
.mobile-orbit-geometry {
  display: none;
}

.mobile-time-direction {
  margin: 0;
  color: var(--bone-faint);
  font-size: 0.9rem;
  font-style: italic;
}

.timeline-controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.timeline-controls button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.72rem;
  padding: 0.58rem 0.24rem;
  border: 0;
  color: var(--old-gold-bright);
  background: transparent;
  font-family: var(--meta);
  font-size: clamp(0.72rem, 0.9vw, 0.86rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 0.1rem 0.9rem rgba(0, 0, 0, 0.82);
  transition: color 160ms ease, letter-spacing 160ms ease, opacity 160ms ease;
}

.timeline-controls button span {
  width: 0.64rem;
  height: 0.64rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0.65rem rgba(224, 187, 89, 0.16);
}

.timeline-controls button:hover,
.timeline-controls button:focus-visible {
  color: var(--bone);
  letter-spacing: 0.22em;
  outline: none;
}

.timeline-controls button:disabled {
  color: rgba(238, 232, 220, 0.25);
  cursor: default;
  opacity: 0.58;
}

.timeline-scroll {
  margin-inline: calc(clamp(1.25rem, 4.8vw, 5rem) * -1);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.timeline-scroll::-webkit-scrollbar {
  display: none;
}

.timeline-stage {
  position: relative;
  width: max(100vw, var(--desktop-stage-width, 132rem));
  min-height: var(--desktop-stage-height, 29rem);
}

.timeline-list-desktop {
  position: absolute;
  inset: 0;
}

.timeline-geometry {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100vw;
  height: var(--desktop-stage-height, 29rem);
  pointer-events: none;
}

/*
 * One fixed horizon replaces the former sequence of waves. The visible line is
 * the upper half of a deep ellipse: it begins at the lower-left edge, rises close
 * to the top through the center, and returns to the lower-right edge. Its top and
 * vertical radius sum to the stage height, making both ends physically touch the
 * bottom boundary instead of stopping partway down the page.
 */
.desktop-orbit-clip {
  position: absolute;
  top: var(--desktop-orbit-top, 1.5rem);
  left: var(--desktop-orbit-inset, 0);
  width: var(--desktop-orbit-width, 100%);
  height: var(--desktop-orbit-amplitude, 27.5rem);
  overflow: hidden;
}

.desktop-orbit {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--desktop-orbit-diameter, 55rem);
  border: 1px solid rgba(198, 160, 71, 0.56);
  border-radius: 50%;
  box-shadow: 0 0 2rem rgba(198, 160, 71, 0.035);
}

.timeline-list {
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-stop {
  position: absolute;
  top: var(--timeline-y);
  left: var(--timeline-x);
  width: min(16rem, calc(100vw - 3rem));
  transform: translate(-50%, 0);
  scroll-snap-align: center;
}

.timeline-entry {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  color: var(--bone-muted);
  text-align: left;
}

/*
 * The selection surface owns the marker, date, title, and excerpt. It fills the
 * whole editorial block above the reading link, giving each visible word and the
 * orbital dot the same feature-selection behavior without enclosing them in a
 * card or nesting a link inside a button.
 */
.timeline-select {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

/*
 * Production markup groups the desktop text spans so the same safe DOM-building
 * function can serve both responsive lists. This wrapper restores the direct-child
 * flex behavior used by the selected prototype without changing marker geometry.
 */
.timeline-copy {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  transition: filter 200ms ease, transform 200ms ease;
}

.timeline-marker {
  position: relative;
  display: grid;
  width: 1.14rem;
  height: 1.14rem;
  place-items: center;
  /* Global border-box sizing keeps the complete marker at 1.14rem. Raising it by
   * exactly half that dimension seats its center, rather than its top edge, on
   * the mathematical orbit supplied by JavaScript. */
  margin: -0.57rem 0 1rem;
  border: 1px solid rgba(224, 187, 89, 0.74);
  border-radius: 50%;
  background: rgba(18, 15, 10, 0.86);
  box-shadow: 0 0 0 0.27rem rgba(198, 160, 71, 0.08), 0 0 1.1rem rgba(224, 187, 89, 0.16);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

/* The halo expands from the orbital point itself. It responds to hover, keyboard
 * focus, selection, and scroll proximity without changing layout dimensions. */
.timeline-marker::after {
  position: absolute;
  inset: -0.65rem;
  border: 1px solid rgba(224, 187, 89, 0.52);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: scale(0.48);
  transition: opacity 200ms ease, transform 240ms ease;
}

.timeline-stop .timeline-marker {
  margin-right: auto;
  margin-left: auto;
}

.timeline-marker-core {
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 50%;
  background: var(--old-gold-bright);
}

.timeline-date {
  color: var(--old-gold);
  font-size: clamp(0.52rem, 0.64vw, 0.63rem);
  line-height: 1.45;
}

.timeline-title {
  display: block;
  margin-top: 0.55rem;
  color: rgba(238, 232, 220, 0.88);
  font-size: clamp(1rem, 1.48vw, 1.32rem);
  line-height: 1.12;
  text-wrap: balance;
}

.timeline-excerpt {
  display: block;
  margin-top: 0.72rem;
  color: var(--bone-faint);
  font-size: clamp(0.79rem, 0.98vw, 0.94rem);
  font-style: italic;
  line-height: 1.45;
  text-wrap: pretty;
}

.timeline-action {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 0.48rem;
  padding-block: 0.34rem;
  color: var(--old-gold);
  font-size: clamp(0.51rem, 0.62vw, 0.6rem);
  line-height: 1.4;
  transition: color 180ms ease, letter-spacing 180ms ease, text-shadow 180ms ease;
}

.timeline-entry:hover .timeline-marker,
.timeline-select:focus-visible .timeline-marker,
.timeline-entry.is-near .timeline-marker,
.timeline-entry[aria-pressed="true"] .timeline-marker,
.timeline-entry[aria-current="page"] .timeline-marker {
  transform: scale(1.28);
  box-shadow: 0 0 0 0.33rem rgba(198, 160, 71, 0.14), 0 0 1.4rem rgba(224, 187, 89, 0.34);
}

.timeline-entry:hover .timeline-title,
.timeline-select:focus-visible .timeline-title,
.timeline-entry.is-near .timeline-title,
.timeline-entry[aria-pressed="true"] .timeline-title,
.timeline-entry[aria-current="page"] .timeline-title {
  color: var(--bone);
}

.timeline-entry:hover .timeline-marker::after,
.timeline-select:focus-visible .timeline-marker::after,
.timeline-entry.is-near .timeline-marker::after,
.timeline-entry[aria-current="page"] .timeline-marker::after {
  opacity: 0.76;
  transform: scale(1.08);
}

.timeline-entry:hover .timeline-copy,
.timeline-select:focus-visible .timeline-copy {
  filter: drop-shadow(0 0 0.65rem rgba(224, 187, 89, 0.12));
  transform: translate3d(0, -0.18rem, 0);
}

.timeline-entry:hover .timeline-action,
.timeline-action:focus-visible {
  color: var(--old-gold-bright);
  letter-spacing: 0.25em;
  outline: none;
  text-shadow: 0 0 0.8rem rgba(224, 187, 89, 0.28);
}

.timeline-entry[aria-pressed="true"] .timeline-date,
.timeline-entry[aria-pressed="true"] .timeline-action,
.timeline-entry[aria-current="page"] .timeline-date,
.timeline-entry[aria-current="page"] .timeline-action {
  color: var(--old-gold-bright);
}

/* Mobile-only structures are declared here so their breakpoint implementation
 * can override visibility without carrying desktop layout assumptions. */
.mobile-timeline-stop,
.mobile-timeline-entry,
.mobile-timeline-copy,
.mobile-orbit-clip,
.mobile-orbit {
  position: absolute;
}

/*
 * Native dialog behavior supplies robust modal interaction. All browser default
 * panel styling is removed, and the same background asset extends edge to edge,
 * so opening an article feels like entering more deeply into the page rather than
 * summoning a detached rectangular object.
 */
.reading-preview {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: clamp(2rem, 6vw, 6rem);
  overflow-y: auto;
  border: 0;
  color: var(--bone);
  background-color: var(--soot);
  background-image: url("/assets/ceremonial-orbit-background.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

.reading-preview::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.preview-close {
  position: relative;
  z-index: 1;
  padding: 0;
  border: 0;
  color: var(--old-gold-bright);
  background: transparent;
  font-family: var(--meta);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.preview-copy {
  position: relative;
  z-index: 1;
  width: min(62vw, 58rem);
  margin: clamp(5rem, 13vh, 9rem) 0 0 clamp(0rem, 3vw, 3rem);
}

.preview-copy p:not(.article-date) {
  max-width: 38rem;
  color: rgba(238, 232, 220, 0.8);
  font-size: clamp(1.08rem, 1.7vw, 1.42rem);
  line-height: 1.62;
}

.preview-note {
  font-style: italic;
}

/*
 * Tablet layouts move the navigation away from the seal and reduce the hero to
 * a balanced single editorial column. The archive still reads left-to-right.
 */
@media (max-width: 980px) {
  .masthead {
    min-height: 13rem;
  }

  .nav-orbit-system {
    top: calc(clamp(1.6rem, 3.8vw, 3.8rem) * -1);
    left: 50%;
    width: 100vw;
    min-width: 0;
    max-width: none;
    height: 9.5rem;
  }

  .orbital-nav a {
    top: var(--nav-y);
    left: var(--nav-x);
    transform: translate(-50%, calc(var(--nav-orb-radius) * -1));
  }

  .orbital-nav a:nth-child(3) {
    flex-direction: column;
    transform: translate(-50%, calc(var(--nav-orb-radius) * -1));
  }

  .hero {
    grid-template-columns: minmax(0, 68%) minmax(12rem, 1fr);
    min-height: 32rem;
  }

  .featured-copy {
    width: 95%;
    margin-left: 0;
  }

}

/*
 * On a narrow screen chronology becomes a vertical act of recollection. The
 * newest article begins at the top; ordinary downward page scrolling returns the
 * reader through older records. A single stationary right half-ellipse rises
 * from the upper left, reaches the center, and returns to the lower left while
 * writings move along it.
 */
@media (max-width: 720px) {
  .ceremonial-page {
    /*
     * A sticky descendant must see the document viewport as its scrolling
     * ancestor. `overflow: hidden` would make this page wrapper the nearest
     * scrolling box even though the wrapper itself never scrolls, preventing
     * the feature from holding its position. `clip` retains the intentional
     * horizontal crop without creating that false scrolling ancestor.
     */
    overflow-x: clip;
    overflow-y: visible;
    padding: 1.35rem 1.25rem 2.5rem;
  }

  .background-art {
    background-position: 62% top;
    background-size: auto 72rem;
    opacity: 0.78;
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 46rem, transparent 72rem);
    mask-image: linear-gradient(to bottom, #000 0, #000 46rem, transparent 72rem);
  }

  /* The mobile seal occupies a different crop of the background. Its dust ring
   * follows that crop and turns more slowly so vertical reading remains calm. */
  .seal-dust {
    top: 1.5rem;
    left: 16vw;
    width: 92vw;
    opacity: 0.82;
  }

  .wordmark {
    font-size: 0.83rem;
    letter-spacing: 0.29em;
  }

  .motto {
    font-size: 0.88rem;
  }

  .masthead {
    z-index: 7;
    min-height: 11rem;
  }

  .nav-orbit-system {
    top: -1.35rem;
    width: 100vw;
    height: 7.5rem;
  }

  .orbital-nav a {
    --nav-orb-radius: 0.21rem;

    min-width: 5.4rem;
    gap: 0.5rem;
    font-size: 0.88rem;
  }

  .nav-orb {
    width: 0.42rem;
    height: 0.42rem;
  }

  .hero {
    /*
     * The feature travels normally until its date reaches the safe top edge,
     * then remains in view while the document continues through the ancestral
     * timeline. JavaScript measures the date's actual offset after every title
     * change, so titles of different lengths cannot shift the resting point.
     * The negative portion of `top` permits the upper, empty part of the hero to
     * leave the viewport; the date itself stops at the positive inset.
     */
    --mobile-feature-date-offset: 7rem;
    --mobile-feature-top-inset: max(0.85rem, env(safe-area-inset-top));

    position: sticky;
    top: calc(var(--mobile-feature-top-inset) - var(--mobile-feature-date-offset));
    z-index: 5;
    display: flex;
    min-height: 36rem;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding-top: 1.5rem;
  }

  /*
   * Once the timeline passes beneath the held feature, a soft field of soot
   * prevents two passages from becoming visually superimposed. Its elliptical
   * falloff preserves the page's continuous celestial atmosphere: there is no
   * panel edge, border, rectangle, or straight dividing rule.
   */
  .hero::before {
    position: absolute;
    /* Overscan on every side keeps the radial falloff beyond the viewport and
     * prevents the pseudo-element's rectangular bounds from becoming visible. */
    inset: -8rem -4rem -5rem;
    z-index: -1;
    background: radial-gradient(
      ellipse 105% 82% at 32% 34%,
      rgba(7, 7, 6, 0.98) 0%,
      rgba(7, 7, 6, 0.9) 54%,
      rgba(7, 7, 6, 0.58) 76%,
      transparent 100%
    );
    content: "";
    pointer-events: none;
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 10%,
      #000 28%,
      #000 76%,
      transparent 100%
    );
    mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 10%,
      #000 28%,
      #000 76%,
      transparent 100%
    );
  }

  .featured-copy {
    width: 100%;
    padding-bottom: 2.25rem;
  }

  .title-scale-short {
    font-size: clamp(4rem, 20vw, 6rem);
  }

  .title-scale-medium {
    font-size: clamp(3.35rem, 16vw, 5rem);
  }

  .title-scale-long {
    font-size: clamp(2.75rem, 12vw, 4rem);
  }

  .title-scale-extended {
    font-size: clamp(2.2rem, 9.8vw, 3.25rem);
  }

  .article-dek {
    max-width: 31rem;
    font-size: 1.05rem;
  }

  .principle {
    align-self: flex-end;
    width: min(92%, 25rem);
    margin: 1rem 0 0;
  }

  .archive {
    min-height: 0;
  }

  .mobile-time-direction {
    display: block;
  }

  .timeline-controls {
    display: none;
  }

  .timeline-scroll {
    margin-inline: -1.25rem;
    overflow: visible;
    scroll-snap-type: none;
  }

  .timeline-stage {
    width: 100%;
    min-height: var(--mobile-stage-height, 88rem);
  }

  .timeline-geometry,
  .timeline-list-desktop {
    display: none;
  }

  .mobile-orbit-geometry {
    position: sticky;
    top: 0;
    left: 0;
    display: block;
    z-index: 0;
    width: 100%;
    height: 100svh;
    margin-bottom: -100svh;
    pointer-events: none;
  }

  .mobile-orbit-clip {
    position: absolute;
    top: var(--mobile-orbit-inset, 0);
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .mobile-orbit {
    top: 0;
    /* The ellipse center is exactly x=0. Its visible right half therefore meets
     * the physical left border at both the upper and lower viewport edges. */
    left: -50%;
    display: block;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(198, 160, 71, 0.56);
    border-radius: 50%;
    box-shadow: 0 0 1.5rem rgba(198, 160, 71, 0.035);
    clip-path: inset(0 0 0 50%);
  }

  .timeline-list-mobile {
    position: absolute;
    top: 2rem;
    left: 0;
    display: block;
    width: 100%;
    height: var(--mobile-stage-height, 84rem);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mobile-timeline-stop {
    top: var(--mobile-y);
    left: var(--mobile-x);
    width: 0;
    height: 0;
  }

  .mobile-timeline-entry {
    position: absolute;
    top: -0.6rem;
    display: block;
    overflow: visible;
  }

  .mobile-timeline-entry .timeline-select {
    display: block;
  }

  .mobile-timeline-entry .timeline-marker {
    position: absolute;
    top: 0.6rem;
    margin: 0;
  }

  .mobile-copy-right .mobile-timeline-entry .timeline-marker {
    left: -1.35rem;
    transform: translate(-50%, -50%);
  }

  .mobile-copy-left .mobile-timeline-entry .timeline-marker {
    right: -1.35rem;
    transform: translate(50%, -50%);
  }

  .mobile-copy-right .mobile-timeline-entry:hover .timeline-marker,
  .mobile-copy-right .mobile-timeline-entry:focus-within .timeline-marker,
  .mobile-copy-right .mobile-timeline-entry.is-near .timeline-marker,
  .mobile-copy-right .mobile-timeline-entry[aria-pressed="true"] .timeline-marker,
  .mobile-copy-right .mobile-timeline-entry[aria-current="page"] .timeline-marker {
    transform: translate(-50%, -50%) scale(1.28);
  }

  .mobile-copy-left .mobile-timeline-entry:hover .timeline-marker,
  .mobile-copy-left .mobile-timeline-entry:focus-within .timeline-marker,
  .mobile-copy-left .mobile-timeline-entry.is-near .timeline-marker,
  .mobile-copy-left .mobile-timeline-entry[aria-pressed="true"] .timeline-marker,
  .mobile-copy-left .mobile-timeline-entry[aria-current="page"] .timeline-marker {
    transform: translate(50%, -50%) scale(1.28);
  }

  .mobile-timeline-copy {
    position: static;
    display: flex;
    flex-direction: column;
    transition: filter 200ms ease, transform 200ms ease;
  }

  .mobile-timeline-entry:hover .mobile-timeline-copy,
  .mobile-timeline-entry:focus-within .mobile-timeline-copy,
  .mobile-timeline-entry.is-near .mobile-timeline-copy {
    filter: drop-shadow(0 0 0.7rem rgba(224, 187, 89, 0.14));
    transform: translate3d(0, -0.16rem, 0);
  }

  .mobile-copy-narrow .mobile-timeline-entry {
    width: min(42vw, 10.25rem);
  }

  .mobile-copy-wide .mobile-timeline-entry {
    width: min(58vw, 14rem);
  }

  .mobile-copy-right .mobile-timeline-entry {
    left: 1.35rem;
  }

  .mobile-copy-right .mobile-timeline-copy {
    align-items: flex-start;
    text-align: left;
  }

  .mobile-copy-left .mobile-timeline-entry {
    right: 1.35rem;
  }

  .mobile-copy-left .mobile-timeline-copy {
    align-items: flex-end;
    text-align: right;
  }

  .mobile-timeline-entry > .timeline-action {
    width: 100%;
    margin-top: 0.35rem;
  }

  .mobile-copy-left .mobile-timeline-entry > .timeline-action {
    text-align: right;
  }

  .mobile-timeline-copy .timeline-title {
    font-size: 1.22rem;
  }

  .mobile-timeline-copy .timeline-excerpt {
    display: block;
    font-size: 0.86rem;
  }

  .mobile-timeline-copy .timeline-action {
    font-size: 0.55rem;
  }

  .preview-copy {
    width: 100%;
    margin: 5rem 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .background-art,
  .seal-dust,
  .timeline-particle-field {
    will-change: auto;
  }

  .timeline-particle-field {
    opacity: 0.72;
  }
}
