/* ==========================================================================
   SIMBA FIELD GUIDES — "The Planetarium" (Plate I · /blockchains only)
   The constellation is no longer an illustration beside the text: the hero
   is a full-bleed night sky and the stars are the navigation. Each star is
   a real link into the catalog below. The headline sits in the sky as an
   engraved chart cartouche. The blockchain-specific styles remain isolated.
   Loaded only by blockchains.html, driven by chains.js.
   ========================================================================== */

.directory-page {
  --guide-accent: var(--gold);
  --guide-accent-rgb: 255, 185, 64;
  --guide-accent-hi: var(--gold-hi);
  --guide-secondary: var(--ember);
  --plate-line: rgba(244, 234, 217, 0.12);
}

.directory-page .site-header {
  background: var(--night);
}

/* --------------------------------------------------------------------------
   Hero — the planetarium sky
   -------------------------------------------------------------------------- */

.directory-hero {
  --px: 0;
  --py: 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(720px, 96vh, 960px);
  padding: 140px 0 84px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

/* True night at the zenith, warming to the Epoch Sun umber horizon where
   the page content begins. */
.directory-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(
      900px 600px at 76% 34%,
      rgba(92, 184, 255, 0.055),
      transparent 64%
    ),
    radial-gradient(
      840px 520px at 18% 96%,
      rgba(255, 122, 69, 0.1),
      transparent 70%
    ),
    linear-gradient(
      to bottom,
      #070502 0%,
      #0c0804 32%,
      #150e08 58%,
      #221510 82%,
      #32200f 100%
    );
}

/* Star dust, a faint milky band, and the survey grid fading at the horizon */
.directory-hero::after {
  content: "";
  position: absolute;
  inset: -16px;
  z-index: -1;
  opacity: 0.55;
  background-image:
    linear-gradient(
      115deg,
      transparent 42%,
      rgba(244, 234, 217, 0.035) 52%,
      transparent 62%
    ),
    linear-gradient(rgba(244, 234, 217, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 234, 217, 0.03) 1px, transparent 1px),
    radial-gradient(1px 1px at 9% 22%, rgba(244, 234, 217, 0.5), transparent),
    radial-gradient(1px 1px at 24% 44%, rgba(244, 234, 217, 0.3), transparent),
    radial-gradient(
      1.5px 1.5px at 37% 12%,
      rgba(244, 234, 217, 0.42),
      transparent
    ),
    radial-gradient(1px 1px at 46% 62%, rgba(244, 234, 217, 0.26), transparent),
    radial-gradient(1px 1px at 58% 40%, rgba(244, 234, 217, 0.34), transparent),
    radial-gradient(
      1.5px 1.5px at 69% 66%,
      rgba(255, 185, 64, 0.34),
      transparent
    ),
    radial-gradient(1px 1px at 78% 8%, rgba(244, 234, 217, 0.4), transparent),
    radial-gradient(1px 1px at 88% 52%, rgba(244, 234, 217, 0.3), transparent),
    radial-gradient(1px 1px at 96% 28%, rgba(244, 234, 217, 0.42), transparent),
    radial-gradient(1px 1px at 15% 74%, rgba(244, 234, 217, 0.24), transparent),
    radial-gradient(1px 1px at 52% 86%, rgba(244, 234, 217, 0.2), transparent);
  background-size:
    100% 100%,
    42px 42px,
    42px 42px,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%;
  mask-image: linear-gradient(to bottom, #000 44%, rgba(0, 0, 0, 0.22) 96%);
}

/* Plate frame — hairline rectangle with corner registration ticks,
   now framing the entire sky. */
.plate-frame {
  position: absolute;
  inset: 92px clamp(12px, 2vw, 30px) 22px;
  z-index: 0;
  border: 1px solid var(--plate-line);
  pointer-events: none;
}

.plate-frame i {
  position: absolute;
  width: 15px;
  height: 15px;
}

.plate-frame i::before,
.plate-frame i::after {
  content: "";
  position: absolute;
  background: rgba(var(--guide-accent-rgb), 0.7);
}

.plate-frame i::before {
  width: 15px;
  height: 1px;
}

.plate-frame i::after {
  width: 1px;
  height: 15px;
}

.plate-frame i:nth-child(1) {
  top: -1px;
  left: -1px;
}
.plate-frame i:nth-child(2) {
  top: -1px;
  right: -1px;
}
.plate-frame i:nth-child(2)::before,
.plate-frame i:nth-child(4)::before {
  right: 0;
}
.plate-frame i:nth-child(2)::after,
.plate-frame i:nth-child(4)::after {
  right: 0;
}
.plate-frame i:nth-child(3) {
  bottom: -1px;
  left: -1px;
}
.plate-frame i:nth-child(3)::before,
.plate-frame i:nth-child(4)::before {
  bottom: 0;
}
.plate-frame i:nth-child(3)::after,
.plate-frame i:nth-child(4)::after {
  bottom: 0;
}
.plate-frame i:nth-child(4) {
  bottom: -1px;
  right: -1px;
}

/* Plate annotation runs up the frame's right margin, the way a chart plate
   is titled — clear of the legend cards that ride the horizon. */
.plate-frame::after {
  content: attr(data-plate);
  white-space: nowrap;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  color: var(--grass-2);
  font: 500 0.6875rem var(--font-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* The sky itself — a nav whose links are stars. Constellation lines live
   inside it so parallax moves chart and stars as one instrument. */
.sky-field {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sky-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sky-lines path {
  fill: none;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.sky-lines .fam-settle {
  stroke: rgba(246, 168, 59, 0.3);
}
.sky-lines .fam-contracts {
  stroke: rgba(122, 184, 255, 0.24);
}
.sky-lines .fam-scale {
  stroke: rgba(139, 131, 255, 0.3);
}
.sky-lines .fam-infra {
  stroke: rgba(224, 140, 240, 0.24);
}
.sky-lines .fam-privacy {
  stroke: rgba(214, 213, 255, 0.32);
}
.sky-lines .ecliptic {
  stroke: rgba(244, 234, 217, 0.09);
  stroke-dasharray: 2 7;
}

.sky-lines--mobile {
  display: none;
}

/* A star: dot + ticker always visible; name + role rise on hover/focus */
.sky-star {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 9px;
  transform: translate(-50%, -50%);
  text-decoration: none;
  border-radius: 12px;
}

.sky-star:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.star-core {
  position: relative;
  width: var(--star-size, 9px);
  height: var(--star-size, 9px);
  border-radius: 50%;
  background: var(--star-color, var(--bone));
  box-shadow:
    0 0 10px rgba(var(--star-rgb), 0.9),
    0 0 26px rgba(var(--star-rgb), 0.32);
  transition:
    transform 240ms var(--ease),
    box-shadow 240ms var(--ease);
}

.sky-star:hover .star-core,
.sky-star:focus-visible .star-core {
  transform: scale(1.4);
  box-shadow:
    0 0 14px rgba(var(--star-rgb), 1),
    0 0 44px rgba(var(--star-rgb), 0.55);
}

/* Diffraction cross on first-magnitude stars */
.sky-star.is-bright .star-core::before,
.sky-star.is-bright .star-core::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--star-rgb), 0.55),
    transparent
  );
}

.sky-star.is-bright .star-core::before {
  width: 38px;
  height: 1px;
  transform: translate(-50%, -50%);
}

.sky-star.is-bright .star-core::after {
  width: 1px;
  height: 38px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(var(--star-rgb), 0.55),
    transparent
  );
  transform: translate(-50%, -50%);
}

.star-name {
  color: rgba(244, 234, 217, 0.6);
  font: 600 0.6875rem var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 200ms var(--ease);
}

.sky-star:hover .star-name,
.sky-star:focus-visible .star-name {
  color: var(--bone);
}

/* Rising tip: name + one-line role */
.star-tip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  z-index: 4;
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 9px 13px;
  border: 1px solid rgba(var(--star-rgb), 0.36);
  border-radius: 9px;
  background: var(--night);

  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 5px);
  transition:
    opacity 190ms var(--ease),
    visibility 190ms var(--ease),
    transform 190ms var(--ease);
  pointer-events: none;
}

.star-tip b {
  color: var(--bone);
  font: 500 0.8rem var(--font-display);
  letter-spacing: -0.01em;
}

.star-tip i {
  color: var(--star-color);
  font: 550 0.6875rem var(--font-mono);
  font-style: normal;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sky-star:hover .star-tip,
.sky-star:focus-visible .star-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Stars near the top edge open their tip downward */
.sky-star.tip-below .star-tip {
  bottom: auto;
  top: calc(100% + 4px);
  transform: translate(-50%, -5px);
}

.sky-star.tip-below:hover .star-tip,
.sky-star.tip-below:focus-visible .star-tip {
  transform: translate(-50%, 0);
}

/* Stars near the right edge open their tip to the left */
.sky-star.tip-left .star-tip {
  bottom: auto;
  left: auto;
  right: calc(100% + 8px);
  top: 50%;
  justify-items: end;
  transform: translate(5px, -50%);
}

.sky-star.tip-left:hover .star-tip,
.sky-star.tip-left:focus-visible .star-tip {
  transform: translate(0, -50%);
}

/* ADA — the ringed home star, first among equals */
.sky-star.is-home {
  z-index: 3;
}

.sky-star.is-home .star-core {
  width: 15px;
  height: 15px;
}

.star-ring {
  position: absolute;
  inset: -14px;
  border: 1px dashed rgba(92, 184, 255, 0.55);
  border-radius: 50%;
  pointer-events: none;
}

.star-pulse {
  position: absolute;
  inset: -14px;
  border: 1px solid rgba(92, 184, 255, 0.45);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.star-home-tag {
  margin-top: -3px;
  color: rgba(92, 184, 255, 0.85);
  font: 600 0.6875rem var(--font-mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Cartouche — the title plate, engraved into the sky
   -------------------------------------------------------------------------- */

.directory-hero .wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  /* The wrap spans the whole sky band; let clicks fall through to the
     stars everywhere except the cartouche itself. */
  pointer-events: none;
}

.cartouche {
  position: relative;
  pointer-events: auto;
  max-width: 620px;
  padding: clamp(24px, 2.6vw, 36px);
  border: 1px solid rgba(244, 234, 217, 0.15);
  background: var(--night);

}

.cartouche::before,
.cartouche::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.cartouche::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
}

.cartouche::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
}

.guide-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  white-space: nowrap;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--grass-2);
  font: 500 0.6875rem var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guide-breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.guide-breadcrumb a:hover {
  color: var(--guide-accent);
}

/* Same voice as the homepage .eyebrow */
.guide-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--guide-accent);
  font: 500 0.72rem var(--font-mono);
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.guide-kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--guide-secondary),
    var(--guide-accent)
  );
}

.directory-hero h1 {
  margin-top: 18px;
  font-size: clamp(2.7rem, 5.2vw, 4.8rem);
  font-weight: 300;
  line-height: 1.01;
  letter-spacing: -0.03em;
}

.directory-hero h1 em {
  color: var(--guide-accent);
  font-style: normal;
  font-weight: 600;
  background: linear-gradient(
    100deg,
    var(--guide-accent-hi) 10%,
    var(--guide-accent) 45%,
    var(--guide-secondary) 95%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.directory-hero .lede {
  max-width: 560px;
  margin-top: 16px;
  font-size: 1.05rem;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 24px;
  color: var(--grass-2);
  font: 500 0.72rem var(--font-mono);
}

.guide-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.guide-meta span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--guide-accent);
  box-shadow: 0 0 12px rgba(var(--guide-accent-rgb), 0.7);
}

.guide-switcher {
  display: inline-flex;
  gap: 4px;
  margin-top: 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.guide-switcher a {
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--grass);
  font-size: 0.82rem;
  font-weight: 650;
  transition: 180ms var(--ease);
}

.guide-switcher a:hover {
  color: var(--bone);
}

.guide-switcher a[aria-current="page"] {
  background: rgba(var(--guide-accent-rgb), 0.14);
  color: var(--guide-accent);
  box-shadow: inset 0 0 0 1px rgba(var(--guide-accent-rgb), 0.18);
}

/* Extended-sky index — mobile only; the condensed sky shows the core eight
   and the other twelve fold into these chips. */
.sky-index {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.sky-index a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--grass);
  font: 600 0.6875rem var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sky-index a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--star-color, var(--gold));
  box-shadow: 0 0 8px rgba(var(--star-rgb), 0.75);
}

.sky-index a:hover,
.sky-index a:focus-visible {
  border-color: rgba(var(--star-rgb), 0.45);
  color: var(--bone);
}

/* Hero motion: entrance, twinkle, home-star pulse, parallax.
   Reduced motion gets a static sky with hover/focus states intact. */
@media (prefers-reduced-motion: no-preference) {
  .cartouche > * {
    animation: plate-rise 0.7s var(--ease) both;
  }

  .cartouche > *:nth-child(2) {
    animation-delay: 0.07s;
  }
  .cartouche > *:nth-child(3) {
    animation-delay: 0.14s;
  }
  .cartouche > *:nth-child(4) {
    animation-delay: 0.21s;
  }
  .cartouche > *:nth-child(5) {
    animation-delay: 0.28s;
  }
  .cartouche > *:nth-child(6) {
    animation-delay: 0.35s;
  }

  .sky-field {
    animation: plate-fade 1.3s var(--ease) both 0.12s;
  }

  .star-core {
    animation: star-breathe 5.4s ease-in-out infinite alternate;
  }

  .sky-star:nth-child(2n) .star-core {
    animation-delay: -2.7s;
  }

  .sky-star:nth-child(3n) .star-core {
    animation-delay: -1.4s;
    animation-duration: 6.8s;
  }

  .sky-star.is-home .star-core {
    animation: none;
  }

  .star-ring {
    animation: ring-spin 42s linear infinite;
  }

  .star-pulse {
    animation: home-pulse 4.6s var(--ease) infinite;
  }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .sky-field {
    transform: translate3d(
      calc(var(--px) * 12px),
      calc(var(--py) * 9px),
      0
    );
    will-change: transform;
  }

  .directory-hero::after {
    transform: translate3d(calc(var(--px) * 5px), calc(var(--py) * 4px), 0);
  }
}

@keyframes plate-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes plate-fade {
  from {
    opacity: 0;
  }
}

@keyframes star-breathe {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.58;
  }
}

@keyframes ring-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes home-pulse {
  0% {
    opacity: 0.5;
    transform: scale(0.72);
  }
  70% {
    opacity: 0;
    transform: scale(1.75);
  }
  100% {
    opacity: 0;
    transform: scale(1.75);
  }
}

/* --------------------------------------------------------------------------
   Legend — rides the horizon line between sky and catalog
   -------------------------------------------------------------------------- */

.guide-principles {
  position: relative;
  z-index: 2;
  margin-top: -40px;
}

.principle-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);

}

.principle-grid::before {
  content: "LEGEND";
  position: absolute;
  top: -9px;
  left: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--night);
  color: var(--guide-accent);
  font: 600 0.6875rem var(--font-mono);
  letter-spacing: 0.3em;
}

.principle {
  padding: 27px 28px 25px;
}

.principle + .principle {
  border-left: 1px solid var(--line);
}

.principle span {
  display: block;
  margin-bottom: 8px;
  color: var(--guide-accent);
  font: 600 0.6875rem var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.principle strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
}

.principle p {
  color: var(--grass-2);
  font-size: 0.84rem;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Catalog
   -------------------------------------------------------------------------- */

.directory-catalog {
  padding: 100px 0 112px;
}

.directory-intro {
  display: flex;
  justify-content: space-between;
  gap: 34px;
  align-items: end;
  margin-bottom: 36px;
}

.directory-intro h2 {
  margin-top: 13px;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  letter-spacing: -0.03em;
}

.directory-intro p {
  max-width: 430px;
  color: var(--grass);
  font-size: 0.94rem;
}

/* Toolbar — the instrument bar */
.directory-toolbar {
  position: sticky;
  top: 82px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 58px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--night);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26);

}

.directory-search {
  position: relative;
}

.directory-search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--grass-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.directory-search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 42px 10px 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: rgba(244, 234, 217, 0.035);
  color: var(--bone);
  font: 500 0.9rem var(--font-body);
  transition:
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.directory-search input::placeholder {
  color: var(--grass-2);
}

.directory-search input:focus {
  border-color: rgba(var(--guide-accent-rgb), 0.54);
  box-shadow: 0 0 0 3px rgba(var(--guide-accent-rgb), 0.1);
}

.directory-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--grass-2);
  cursor: pointer;
  transform: translateY(-50%);
}

.search-clear:hover {
  background: rgba(244, 234, 217, 0.06);
  color: var(--bone);
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.filter-chip {
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--grass);
  font: 650 0.72rem var(--font-body);
  cursor: pointer;
  transition: 170ms var(--ease);
}

.filter-chip:hover {
  border-color: rgba(var(--guide-accent-rgb), 0.32);
  color: var(--bone);
}

.filter-chip[aria-pressed="true"] {
  border-color: rgba(var(--guide-accent-rgb), 0.44);
  background: rgba(var(--guide-accent-rgb), 0.12);
  color: var(--guide-accent);
}

.directory-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: -36px 2px 54px;
  color: var(--grass-2);
  font: 500 0.72rem var(--font-mono);
}

.directory-status-row a {
  color: var(--guide-accent);
}

/* Sections — ghost numerals like plate indices */
.directory-section + .directory-section {
  margin-top: 92px;
  padding-top: 76px;
  border-top: 1px solid var(--line);
}

.directory-section-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
  gap: 40px;
  align-items: end;
  margin-bottom: 30px;
}

.directory-section-head::before {
  content: attr(data-ghost);
  position: absolute;
  right: -6px;
  bottom: -18px;
  z-index: -1;
  color: rgba(var(--guide-accent-rgb), 0.025);
  font-family: var(--font-display);
  font-size: clamp(5rem, 11vw, 8.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  pointer-events: none;
}

.directory-section-index {
  display: block;
  margin-bottom: 10px;
  color: var(--guide-accent);
  font: 600 0.6875rem var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.directory-section-head h2 {
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.directory-section-head p {
  color: var(--grass);
  font-size: 0.92rem;
}

/* --------------------------------------------------------------------------
   Catalog cards — star-chart entries under the sky
   -------------------------------------------------------------------------- */

.directory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.directory-card {
  --card-accent: var(--guide-accent);
  --card-accent-rgb: var(--guide-accent-rgb);
  --mx: 50%;
  --my: 0%;
  position: relative;
  min-height: 354px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: 150px;
  transition:
    transform 240ms var(--ease),
    border-color 240ms var(--ease),
    box-shadow 240ms var(--ease);
}

/* Accent tick — top-left registration mark */
.directory-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  width: 34px;
  height: 2px;
  background: var(--card-accent);
  opacity: 0.85;
}

/* Pointer-tracked starlight (coordinates set by chains.js; same recipe
   as the site.js card spotlight) */
.directory-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    260px circle at var(--mx) var(--my),
    rgba(var(--card-accent-rgb), 0.09),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 260ms var(--ease);
  pointer-events: none;
}

.directory-card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--card-accent-rgb), 0.34);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.32);
}

.directory-card:hover::after {
  opacity: 1;
}

.directory-card:focus-within {
  border-color: rgba(var(--card-accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--card-accent-rgb), 0.09);
}

/* Landing flash after arriving from a star */
.directory-card.is-landed {
  border-color: rgba(var(--card-accent-rgb), 0.65);
  box-shadow:
    0 0 0 3px rgba(var(--card-accent-rgb), 0.16),
    0 18px 50px rgba(0, 0, 0, 0.3);
}

.directory-card.is-landed:focus {
  outline: none;
}

@media (prefers-reduced-motion: no-preference) {
  .directory-card.is-landed {
    animation: card-land 1.9s var(--ease) both;
  }

  @supports (animation-timeline: view()) {
    .directory-card {
      animation: card-ascend linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }

    .directory-card.is-landed {
      animation: card-land 1.9s var(--ease) both;
    }
  }
}

@keyframes card-ascend {
  from {
    opacity: 0.2;
    transform: translateY(22px);
  }
}

@keyframes card-land {
  0% {
    box-shadow:
      0 0 0 6px rgba(var(--card-accent-rgb), 0.34),
      0 18px 50px rgba(0, 0, 0, 0.3);
  }
  100% {
    box-shadow:
      0 0 0 3px rgba(var(--card-accent-rgb), 0.16),
      0 18px 50px rgba(0, 0, 0, 0.3);
  }
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

/* Same treatment as the homepage .card .icon */
.directory-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--card-accent-rgb), 0.3);
  border-radius: 8px;
  background: rgba(var(--card-accent-rgb), 0.08);
  color: var(--card-accent);
  font: 750 0.74rem var(--font-mono);
  letter-spacing: -0.04em;
}

/* The role label carries its plotted star from the sky */
.directory-rank {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--grass-2);
  font: 500 0.6875rem var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.directory-rank::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--card-accent);
  box-shadow: 0 0 9px rgba(var(--card-accent-rgb), 0.8);
}

.directory-card h3 {
  margin: 0;
  font-size: 1.13rem;
  letter-spacing: -0.02em;
}

.directory-subtitle {
  margin-top: 5px;
  color: var(--card-accent);
  font: 600 0.6875rem var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.directory-description {
  margin-top: 15px;
  color: var(--grass);
  font-size: 0.87rem;
  line-height: 1.58;
}

.directory-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.directory-facts span {
  display: block;
  color: var(--grass-2);
  font: 500 0.6875rem var(--font-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.directory-facts strong {
  display: block;
  margin-top: 4px;
  color: var(--bone);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.4;
}

.directory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 20px;
}

.directory-tags span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--grass-2);
  font: 550 0.6875rem var(--font-mono);
}

.directory-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--card-accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.directory-link:hover {
  color: var(--bone);
}

.directory-link span {
  transition: transform 170ms var(--ease);
}

.directory-link:hover span {
  transform: translate(2px, -2px);
}

.directory-empty {
  padding: 68px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--grass);
}

.directory-empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--bone);
  font-family: var(--font-display);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Method — observatory notes
   -------------------------------------------------------------------------- */

.guide-method {
  padding: 100px 0;
  border-top: 1px solid var(--line);
  background: var(--night);
}

.guide-method-grid {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 76px;
  align-items: start;
}

.guide-method h2 {
  margin-top: 15px;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.guide-method-copy {
  display: grid;
  gap: 14px;
}

.method-note {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.method-note > span {
  color: var(--guide-accent);
  font: 600 0.7rem var(--font-mono);
}

.method-note strong {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
}

.method-note p {
  color: var(--grass);
  font-size: 0.86rem;
}

/* --------------------------------------------------------------------------
   Next plate
   -------------------------------------------------------------------------- */

.guide-next {
  padding: 0 0 104px;
}

/* Same surface family as the homepage field-guide cards */
.guide-next-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
  padding: 40px 44px;
  overflow: hidden;
  border: 1px solid rgba(var(--guide-accent-rgb), 0.26);
  border-radius: 20px;
  background: var(--surface);
}

.guide-next-card h2 {
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.guide-next-card p {
  max-width: 650px;
  margin-top: 9px;
  color: var(--grass);
}

.guide-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.directory-page .btn-guide {
  border-color: rgba(var(--guide-accent-rgb), 0.34);
  background: rgba(var(--guide-accent-rgb), 0.12);
  color: var(--guide-accent);
}

.directory-page .btn-guide:hover {
  border-color: rgba(var(--guide-accent-rgb), 0.58);
  background: rgba(var(--guide-accent-rgb), 0.18);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .directory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .directory-toolbar {
    position: relative;
    top: auto;
    grid-template-columns: 1fr;
  }

  .directory-card {
    scroll-margin-top: 24px;
  }

  .filter-list {
    justify-content: flex-start;
  }
}

/* Condensed sky: below 1120px the full chart no longer clears the
   cartouche, so the core eight re-plot into a fixed-height sky band with
   their own line geometry, and the extended twelve fold into the
   cartouche index chips. */
@media (max-width: 1120px) {
  .directory-hero {
    display: block;
    min-height: 0;
    padding: 112px 0 64px;
  }

  .directory-hero .wrap {
    margin-top: clamp(300px, 40vh, 400px);
  }

  .plate-frame {
    inset: 88px 12px 20px;
  }

  /* The condensed sky runs close to the frame; drop the margin annotation. */
  .plate-frame::after {
    display: none;
  }

  /* The sky becomes a band of fixed height above the cartouche, so star
     coordinates stay honest regardless of how tall the text runs. */
  .sky-field {
    inset: auto;
    top: 0;
    left: 0;
    right: 0;
    height: calc(112px + clamp(300px, 40vh, 400px));
  }

  .sky-lines--desktop {
    display: none;
  }

  .sky-lines--mobile {
    display: block;
  }

  .sky-star {
    left: var(--sxm, var(--sx));
    top: var(--sym, var(--sy));
  }

  .sky-star.star-ext {
    display: none;
  }

  .sky-star.is-bright .star-core::before {
    width: 28px;
  }

  .sky-star.is-bright .star-core::after {
    height: 28px;
  }

  .cartouche {
    max-width: none;
  }

  .sky-index {
    display: flex;
  }
}

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

  .principle + .principle {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .directory-intro,
  .directory-section-head {
    display: block;
  }

  .directory-intro p,
  .directory-section-head p {
    margin-top: 13px;
  }

  .directory-section-head::before {
    right: 0;
    bottom: auto;
    top: -30px;
    font-size: 4.6rem;
  }

  .directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-method-grid,
  .guide-next-card {
    grid-template-columns: 1fr;
  }

  .guide-method-grid {
    gap: 38px;
  }

  .guide-next-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .directory-hero h1 {
    font-size: clamp(2.5rem, 12.5vw, 3.6rem);
  }

  .plate-frame::after {
    display: none;
  }

  .cartouche {
    padding: 24px 20px;
  }

  .guide-switcher {
    width: 100%;
  }

  .guide-switcher a {
    flex: 1;
    text-align: center;
  }

  /* A full-width frame leaves no horizon to ride; sit the legend clear of it. */
  .guide-principles {
    margin-top: 28px;
  }

  .directory-catalog {
    padding: 76px 0 86px;
  }

  .directory-toolbar {
    margin-bottom: 48px;
  }

  .filter-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .directory-status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .directory-grid {
    grid-template-columns: 1fr;
  }

  .directory-card {
    min-height: 0;
  }

  .directory-section + .directory-section {
    margin-top: 64px;
    padding-top: 56px;
  }

  .guide-method {
    padding: 78px 0;
  }

  .guide-next-card {
    padding: 30px 24px;
  }

  .guide-next-actions .btn {
    width: 100%;
  }
}

@media (max-width: 720px), (pointer: coarse) {
  .filter-chip,
  .directory-link,
  .directory-status-row a,
  .sky-index a {
    min-height: 40px;
  }

  .guide-breadcrumb a {
    min-height: 32px;
  }

  .directory-status-row a {
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 560px) {
  .method-note {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}
