/* Academy home, round 2 (Jesse 2026-10-09: "put them all at the top ... keep the category list header
   still animated"). Four animated subject headers sit together under the hero; each paints its own hub
   scene (subject-scene.js band mode, tile size) on a canvas behind a scrim. The world cards below stay
   grouped by subject under a slim divider. Motion is transform / canvas only. JS off and reduced motion:
   everything sits in its final place, fully opaque. Owner notes: ~/MOTHER/HANDOFFS/SITE-NAV.md. */

/* ---------- the four headers ---------- */
.subject-heads {
  max-width: var(--maxw, 1180px);
  margin: 0 auto 34px;
  padding: 0 clamp(18px, 5vw, 54px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  /* A header waiting to slide in sits up to 40px past the edge: clip, never a sideways scroll. */
  overflow-x: clip;
}

.subject-head {
  --tx: -40px;
  position: relative;
  isolation: isolate;
  min-height: 172px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(90% 140% at 82% 50%, color-mix(in srgb, var(--accent) 18%, #0b0f22), #070915 72%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 46%, transparent),
    0 18px 50px rgba(0, 0, 0, .28);
  transition: box-shadow .25s ease;
}
.subject-head[data-from="right"] { --tx: 40px; }

/* The scene: painted by academy-bands.js. Blank with JS off — the gradient above is the still. */
.subject-head-scene {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
/* Scrim: the words sit on near-black, the scene shows on the open right side. */
.subject-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 8, 20, .94) 0%, rgba(6, 8, 20, .88) 34%, rgba(6, 8, 20, .42) 62%, rgba(6, 8, 20, .08) 100%);
}

.subject-head:hover,
.subject-head:focus-within,
.subject-head.is-live {
  box-shadow:
    inset 6px 0 0 var(--accent),
    0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent),
    0 18px 50px rgba(0, 0, 0, .32);
}
.subject-head[data-from="right"]:hover,
.subject-head[data-from="right"]:focus-within,
.subject-head[data-from="right"].is-live {
  box-shadow:
    inset -6px 0 0 var(--accent),
    0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent),
    0 18px 50px rgba(0, 0, 0, .32);
}

.band-emblem {
  flex: none;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  color: var(--accent);
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
    rgba(6, 8, 20, .7);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.band-mark {
  font-family: Michroma, sans-serif;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--accent);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 65%, transparent);
}
.band-mark-serif {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0;
}
.band-emblem svg { width: 44px; height: 44px; display: block; pointer-events: none; }

.subject-head-text { min-width: 0; max-width: 62%; }

.subject-head-name {
  margin: 0;
  color: #f7f8ff;
  font: 400 clamp(20px, 2.3vw, 28px)/1.15 Michroma, sans-serif;
  letter-spacing: .04em;
  text-transform: none;
}
.subject-head-go {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #f7f8ff;
  text-decoration: none;
  border-radius: 8px;
}
/* The whole header is the jump link (to that subject's worlds on this page). */
.subject-head-go::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 22px; }
.subject-head-go:focus-visible { outline: none; }
.subject-head-go:focus-visible::after { outline: 3px solid #fff1b7; outline-offset: -3px; }

.subject-head-meta {
  margin: 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  color: #d7e0f7;
  font: 500 14px/1.35 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: .03em;
}
.subject-head-count::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  vertical-align: middle;
}
/* Secondary link, above the jump link. */
.subject-head-hub {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .35em;
  min-height: 44px;
  padding: 0 2px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}
.subject-head-hub:hover { text-decoration: underline; text-underline-offset: 3px; }
.subject-head-hub:focus-visible { outline: 3px solid #fff1b7; outline-offset: 2px; }

.subject-head-fact {
  margin: 0;
  overflow: hidden;
  color: #f7f8ff;
  font: 600 16px/1.35 "Space Grotesk", system-ui, sans-serif;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Entrance: each header slides in from its subject's side, staggered. CSS only, so it plays on the
   first paint with no script, and the header is never invisible (transform, no opacity). */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="off"]) .subject-head {
    animation: subjectHeadIn .75s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 90ms);
  }
}
@keyframes subjectHeadIn {
  from { transform: translate3d(var(--tx), 0, 0); }
  to { transform: none; }
}

/* ---------- the world cards below, grouped by subject ---------- */
.academy-bands {
  position: relative;
  margin: 0;
  padding: 0 0 24px;
  overflow-x: clip;
}
.subject-group { scroll-margin-top: calc(var(--navh, 122px) + 14px); }

.subject-divider {
  max-width: var(--maxw, 1180px);
  margin: 26px auto 0;
  padding: 0 clamp(18px, 5vw, 40px);
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f7f8ff;
  font: 400 clamp(17px, 2vw, 22px)/1.2 Michroma, sans-serif;
  letter-spacing: .05em;
  text-transform: none;
}
.subject-divider::before {
  content: "";
  flex: none;
  width: 34px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.subject-divider::after {
  content: "";
  flex: 1;
  min-width: 24px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, transparent), transparent);
}
.subject-divider a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}
.subject-divider a:hover { color: var(--accent); }
.subject-divider a:focus-visible { outline: 3px solid #fff1b7; outline-offset: 3px; }
.subject-divider-count {
  flex: none;
  color: #c9d3ee;
  font: 500 13px/1.3 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: .03em;
}

.band-cards {
  max-width: var(--maxw, 1180px);
  margin: 0 auto;
  padding: 12px clamp(18px, 5vw, 40px) 30px;
}
.subject-group-more .band-cards > .subject:first-child { margin-top: 10px; }

/* The page's reveal rule hides cards until .in. Groups keep them readable at rest.
   The entrance itself is a 16px rise on the article, never an opacity fade. */
html.js .subject-group .reveal { opacity: 1; transform: none; }
/* Round 3: a bigger rise that settles with a little overshoot; the art then drifts with scroll (JS). */
html.bands-live .subject-group .band-cards > .app:not(.is-in) { transform: translate3d(0, 30px, 0) scale(.985); }
html.bands-live .subject-group .band-cards > .app.is-in {
  transform: none;
  transition: transform .8s cubic-bezier(.2, .9, .25, 1.12);
  transition-delay: calc(var(--rise, 0) * 60ms);
}
.subject-group .band-cards > .app > .art { will-change: transform; }

/* Group backdrop: the subject's scene, low intensity, behind its own cards only (clip set by JS). */
.academy-bands { isolation: isolate; }
.groups-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  clip-path: inset(100% 0 0 0);
}
.groups-layer canvas { display: block; width: 100%; height: 100%; }
html:not(.js) .groups-layer { display: none; }
/* Card copy sits on a scrim so the scene can show in the gutters without dropping contrast. */
.subject-group .app-copy { position: relative; isolation: isolate; }
.subject-group .app-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -10px -16px -6px;
  border-radius: 18px;
  background: rgba(6, 8, 20, .84);
  pointer-events: none;
}

/* Quiet reveal for the discovery panels, the order note and the footer. */
html.bands-live .discovery-wrap:not(.is-in),
html.bands-live .order-note:not(.is-in),
html.bands-live footer:not(.is-in) { transform: translate3d(0, 14px, 0); }
html.bands-live .discovery-wrap.is-in,
html.bands-live .order-note.is-in,
html.bands-live footer.is-in { transform: none; transition: transform .9s cubic-bezier(.16, 1, .3, 1); }

/* ---------- the Avatar Bay band (round 3): the real avatar frames climb Starwalker → Celestial ---------- */
.ab-epic { position: relative; overflow-x: clip; } /* queued frames past the edge never widen the page */
.ab-stage {
  position: relative;
  max-width: 880px;
  height: 300px;
  margin: 10px auto -18px;
  overflow: visible;
}
html:not(.js) .ab-stage { display: none; }
.ab-motes {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.ab-glow {
  position: absolute;
  left: 34%;
  top: 46%;
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(246, 249, 255, .26), rgba(167, 139, 250, .14) 55%, transparent 72%);
  pointer-events: none;
}
.ab-ladder { position: absolute; inset: 0; }
.ab-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 190px;
  height: 228px;
  margin: -114px 0 0 -95px;
  transform-origin: 50% 60%;
  transition: transform .7s cubic-bezier(.2, .9, .25, 1.1), opacity .5s ease;
  will-change: transform, opacity;
}
.ab-frame svg { display: block; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
/* Glow on the same promoted layer as the bob, so the compositor moves it without repainting the filter. */
.ab-frame.is-now svg { filter: drop-shadow(0 0 18px rgba(246, 249, 255, .55)) drop-shadow(0 0 40px rgba(167, 139, 250, .35)); will-change: transform; }
/* The live frame breathes with one compositor bob (the avatar's own SVG animations stay off: they cost a
   style + paint pass on the main thread every frame). */
@media (prefers-reduced-motion: no-preference) {
  .ab-frame.is-now svg { animation: abBob 3.6s ease-in-out infinite; will-change: transform; }
}
@keyframes abBob {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -7px, 0); }
}
.ab-frame.is-you::after {
  content: "YOU";
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffd97a;
  color: #1a1404;
  font: 800 11px/1.4 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: .08em;
}
.ab-caption {
  position: absolute;
  left: 34%;
  bottom: 30px;
  transform: translateX(-50%);
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
  color: #d7e0f7;
  font: 500 13px/1.3 "Space Grotesk", system-ui, sans-serif;
}
.ab-tier { color: #f6f9ff; font: 700 11px/1 Michroma, sans-serif; letter-spacing: .12em; padding: 3px 7px; border: 1px solid rgba(246, 249, 255, .45); border-radius: 999px; }
.ab-name { color: #ffd97a; font: 400 16px/1.1 Michroma, sans-serif; letter-spacing: .1em; }
.ab-kind { color: #b9c4e4; }
.ab-you {
  position: absolute;
  right: 8px;
  top: 4px;
  margin: 0;
  color: #f6f9ff;
  font: 600 13px/1.3 "Space Grotesk", system-ui, sans-serif;
}
.ab-you:empty { display: none; }
.ab-you b { color: #ffd97a; letter-spacing: .06em; }
.ab-rail {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 6px;
  height: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ab-rail::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgba(246, 249, 255, .55) var(--lit, 0%), rgba(154, 164, 200, .25) var(--lit, 0%));
}
.ab-rail li {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a2140;
  box-shadow: inset 0 0 0 1px rgba(154, 164, 200, .55);
  transition: background .35s ease, box-shadow .35s ease, transform .35s ease;
}
.ab-rail li.is-lit { background: #f6f9ff; box-shadow: 0 0 10px rgba(246, 249, 255, .8); }
.ab-rail li.is-now { transform: scale(1.5); }
.ab-rail li.is-you { box-shadow: 0 0 0 3px #ffd97a, 0 0 10px rgba(255, 217, 122, .8); }
.ab-burst {
  position: absolute;
  left: 34%;
  top: 46%;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  border-radius: 50%;
  border: 3px solid rgba(246, 249, 255, .9);
  box-shadow: 0 0 30px rgba(246, 249, 255, .7), inset 0 0 30px rgba(167, 139, 250, .6);
  transform: scale(.2);
  opacity: 0;
  pointer-events: none;
}
.ab-burst.is-on { animation: abBurst 1.1s cubic-bezier(.16, 1, .3, 1) 1; }
@keyframes abBurst {
  0% { transform: scale(.2); opacity: .95; }
  100% { transform: scale(1.9); opacity: 0; }
}
.ab-epic .ab-go { position: relative; overflow: hidden; }
.ab-epic .ab-go::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .85), transparent);
  transform: translateX(-180%) skewX(-18deg);
  pointer-events: none;
}
.ab-epic.is-shimmer .ab-go::after { animation: abShimmer 1.3s cubic-bezier(.4, 0, .2, 1) .35s 1 both; }
@keyframes abShimmer {
  from { transform: translateX(-180%) skewX(-18deg); }
  to { transform: translateX(260%) skewX(-18deg); }
}


/* ---------- phones ---------- */
@media (max-width: 760px) {
  .subject-heads { grid-template-columns: 1fr; gap: 10px; }
  .subject-head { --tx: -16px; min-height: 104px; max-height: 120px; gap: 12px; padding: 10px 12px; border-radius: 18px; }
  .subject-head[data-from="right"] { --tx: 16px; }
  .subject-head-go::after { border-radius: 18px; }
  .subject-head::before { background: linear-gradient(90deg, rgba(6, 8, 20, .93) 0%, rgba(6, 8, 20, .86) 55%, rgba(6, 8, 20, .5) 82%, rgba(6, 8, 20, .25) 100%); }
  .band-emblem { width: 50px; height: 50px; border-radius: 15px; }
  .band-mark { font-size: 24px; }
  .band-mark-serif { font-size: 23px; }
  .band-emblem svg { width: 32px; height: 32px; }
  .subject-head-text { max-width: none; flex: 1; }
  .subject-head-name { font-size: 17px; }
  .subject-head-go { min-height: 30px; }
  .subject-head-meta { font-size: 13px; column-gap: 10px; }
  .subject-head-hub { min-height: 36px; }
  .subject-head-hub::after { content: ""; position: absolute; inset: -4px -6px; }
  .subject-head-fact { font-size: 14px; }
  .subject-divider { margin-top: 18px; }
  .band-cards { padding-bottom: 18px; }
  .ab-stage { height: 330px; margin: 4px 16px -14px; }
  .ab-frame { width: 140px; height: 168px; margin: -84px 0 0 -70px; }
  .ab-glow, .ab-burst { left: 42%; top: 40%; }
  .ab-glow { width: 230px; height: 230px; margin: -115px 0 0 -115px; }
  .ab-burst { width: 200px; height: 200px; margin: -100px 0 0 -100px; }
  .ab-caption { left: 50%; bottom: 30px; gap: 8px; font-size: 12px; }
  .ab-name { font-size: 13px; }
  .ab-kind { display: none; }
  .ab-you { left: 0; right: auto; top: 0; font-size: 12px; }
  .ab-rail { left: 2%; right: 2%; }
}

@media (prefers-reduced-motion: reduce) {
  .ab-frame, .ab-rail li { transition: none !important; }
  .ab-burst, .ab-epic .ab-go::after { animation: none !important; display: none; }
  .ab-frame svg { animation: none !important; }
  .subject-group .band-cards > .app > .art { transform: none !important; }
  html.bands-live .discovery-wrap, html.bands-live .order-note, html.bands-live footer { transform: none !important; transition: none !important; }
  .subject-head { animation: none !important; transform: none !important; }
  .subject-head .band-emblem { transform: none !important; }
  html.bands-live .subject-group .band-cards > .app,
  html.bands-live .subject-group .band-cards > .app.is-in,
  html.bands-live .subject-group .band-cards > .app:not(.is-in) { transform: none; transition: none; }
}
