/* ==========================================================================
   home.css — the front door. Hero transmutation, recipe, constellation,
   glowing ledger, trusted marquee, final CTA.
   ========================================================================== */

/* ==========================================================================
   1 · HERO
   ========================================================================== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  padding: calc(var(--nav-h) + 3.5rem) 1.5rem 5rem;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-title {
  font-size: clamp(2.9rem, 7.2vw, 5.7rem);
  margin-top: 1.4rem;
  line-height: 1.04;
}

.hero-sub {
  margin-top: 1.6rem;
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
  color: var(--star-3);
  max-width: 46ch;
}

.hero-ctas {
  margin-top: 2.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* -- Scroll cue -- */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--star-3);
  transition: color 0.3s;
}
.scroll-cue:hover { color: var(--gold); }
.scroll-cue svg { animation: cue-bob 2.4s ease-in-out infinite; }

@keyframes cue-bob {
  0%, 100% { transform: translateY(0); opacity: 0.65; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* ==========================================================================
   THE TRANSMUTATION — alchemical circle
   ========================================================================== */
/* anchors the moon popup + athanor hint, and carries the scroll parallax */
.transmutation-wrap { position: relative; }

.transmutation {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 560px);
  margin-inline: auto;
}

/* soft ambient glow behind the whole apparatus */
.transmutation::before {
  content: '';
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 46%, rgba(242, 193, 78, 0.10), transparent 58%),
    radial-gradient(circle at 54% 56%, rgba(139, 92, 246, 0.09), transparent 62%);
  pointer-events: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ring--outer { animation: spin 120s linear infinite; }
.ring--mid   { animation: spin 84s linear infinite reverse; }
.ring--inner { animation: spin 58s linear infinite; }

.rune-text {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 74px;
  fill: rgba(143, 135, 179, 0.55);
}

/* -- The core orb — now a real link into the Athanor -- */
.orb {
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 36% 30%,
    rgba(255, 255, 255, 0.95),
    rgba(255, 221, 135, 0.9) 16%,
    rgba(242, 193, 78, 0.8) 36%,
    rgba(240, 119, 74, 0.55) 56%,
    rgba(139, 92, 246, 0.38) 78%,
    rgba(139, 92, 246, 0.05) 100%);
  box-shadow:
    0 0 55px rgba(242, 193, 78, 0.5),
    0 0 130px rgba(139, 92, 246, 0.35),
    inset 0 0 34px rgba(255, 255, 255, 0.28);
  animation: orb-pulse 5.5s ease-in-out infinite;
}

/* aurora halo slowly wheeling behind the orb */
.orb-halo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(242, 193, 78, 0.35),
    rgba(240, 119, 74, 0.22),
    rgba(239, 107, 168, 0.3),
    rgba(139, 92, 246, 0.32),
    rgba(52, 211, 200, 0.24),
    rgba(242, 193, 78, 0.35));
  filter: blur(26px);
  opacity: 0.85;
  animation: spin 22s linear infinite;
}

@keyframes orb-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.06); filter: brightness(1.18); }
}

/* -- The orbit wheel (moons or fallback element chips ride it) -- */
.orbits {
  position: absolute;
  inset: 0;
  animation: spin 46s linear infinite;
  pointer-events: none; /* the wheel spans the circle — never block the core link; moons opt back in */
}
.orbiter-arm {
  position: absolute;
  inset: 0;
  transform: rotate(var(--angle));
  pointer-events: none;
}
.orbiter {
  position: absolute;
  top: 50%;
  right: 17.5%;
  width: clamp(34px, 7.5%, 44px);
  aspect-ratio: 1;
  transform: translate(50%, -50%) rotate(calc(-1 * var(--angle)));
}
.orbiter-core {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-hot);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.08), transparent 60%), var(--void-glass);
  border: 1px solid var(--accent-dim);
  box-shadow: 0 0 18px -4px var(--accent), inset 0 0 12px var(--accent-dim);
  backdrop-filter: blur(6px);
  animation: spin 46s linear infinite reverse; /* stays upright inside the wheel */
}

/* -- FX layer: raw glyphs in, gold sparks out (spawned by home.js) -- */
.fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.raw-glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--star-3);
  text-shadow: 0 0 12px rgba(143, 135, 179, 0.6);
  opacity: 0;
  white-space: nowrap;
  will-change: transform, opacity;
}
.gold-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--gold-hot) 40%, transparent 75%);
  box-shadow: 0 0 12px 2px rgba(242, 193, 78, 0.75);
  opacity: 0;
  will-change: transform, opacity;
}

/* ==========================================================================
   THE PRODUCT ORRERY — six featured products riding the wheel as moons.
   Structure: .orbiter-arm (static rotate to its station)
              > a.moon (counter-rotate so the medallion stays upright at rest,
                        carries the accessible name + focus ring)
              > .moon-disc (animated reverse spin cancelling the wheel)
              > .moon-face (arcana art, accent ring, hover swell).
   ========================================================================== */
.moon {
  position: absolute;
  top: 50%;
  right: 17.5%;
  width: clamp(40px, 8.6%, 50px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(50%, -50%) rotate(calc(-1 * var(--angle)));
  pointer-events: auto; /* the arm is pointer-events:none */
}
.moon:focus-visible {
  outline: 2px solid var(--accent-hot);
  outline-offset: 4px;
}
.moon-disc {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: spin 46s linear infinite reverse; /* stays upright inside the wheel */
}
.moon-face {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.1), transparent 60%),
    var(--void-2);
  border: 1.5px solid color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow:
    0 0 0 3px rgba(6, 4, 15, 0.55),
    0 0 20px -4px var(--accent),
    inset 0 0 10px rgba(6, 4, 15, 0.5);
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s;
}
.moon-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.moon:hover .moon-face,
.moon:focus-visible .moon-face {
  transform: scale(1.14);
  box-shadow:
    0 0 0 3px rgba(6, 4, 15, 0.55),
    0 0 30px -2px var(--accent),
    inset 0 0 10px rgba(6, 4, 15, 0.4);
}

/* -- Holding the wheel: home.js flips .is-held while a moon is hovered or
      focused; :has() covers the same ground as a CSS-only enhancement. -- */
.transmutation.is-held .orbits,
.transmutation.is-held .moon-disc,
.transmutation.is-held .orbiter-core { animation-play-state: paused; }

.transmutation:has(.moon:hover) .orbits,
.transmutation:has(.moon:hover) .moon-disc,
.transmutation:has(.moon:focus-visible) .orbits,
.transmutation:has(.moon:focus-visible) .moon-disc { animation-play-state: paused; }

/* -- Popup card: glass, accent-tinted, floated by home.js just outside the
      circle in the moon's quadrant. Never interactive — never traps. -- */
.moon-popup {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 264px;
  padding: 0.85rem 0.95rem;
  border-color: color-mix(in srgb, var(--accent, var(--gold)) 42%, transparent);
  box-shadow: 0 0 36px -12px var(--accent, var(--gold)), var(--shadow-deep);
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.15s ease-in, transform 0.15s ease-in; /* exit */
  will-change: transform, opacity;
}
.moon-popup.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.22s var(--ease-spring), transform 0.22s var(--ease-spring); /* entrance */
}
.moon-popup-art {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center 30%;
  border: 1px solid color-mix(in srgb, var(--accent, var(--gold)) 45%, transparent);
  background: var(--void-2);
}
.moon-popup-body { display: block; min-width: 0; }
.moon-popup-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.02rem;
  line-height: 1.2;
  color: var(--star-1);
}
.moon-popup-tagline {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--accent-hot, var(--gold-hot));
}
.moon-popup-cta {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--star-3);
}

/* ==========================================================================
   THE SUPERNOVA GATEWAY — core affordance + burst layers
   ========================================================================== */

/* quiet mono caption under the circle, revealed while the core is hot */
.athanor-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.5rem);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease-spring);
  pointer-events: none;
}
.transmutation-wrap.core-hot .athanor-hint {
  opacity: 0.9;
  transform: translateY(0);
}

/* core brightens under the pointer / focus (overlay so it never fights
   the orb-pulse animation's filter) */
.orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 36%, rgba(255, 255, 255, 0.85), rgba(255, 236, 190, 0.4) 55%, transparent 78%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.transmutation-wrap.core-hot .orb::after { opacity: 0.5; }
.orb:focus-visible {
  outline: 2px solid var(--gold-hot);
  outline-offset: 8px;
}

/* expanding shockwave ring (spawned + animated by home.js, WAAPI) */
.nova-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 221, 135, 0.85);
  box-shadow:
    0 0 40px rgba(242, 193, 78, 0.6),
    inset 0 0 30px rgba(242, 193, 78, 0.35);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ember-tinted variant of the burst particles */
.nova-spark--ember {
  background: radial-gradient(circle, #fff, var(--ember-hot) 40%, transparent 75%);
  box-shadow: 0 0 12px 2px rgba(240, 119, 74, 0.75);
}

/* brief full-viewport gold flash (spawned by home.js, removed on navigate) */
.nova-flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 45%,
    rgba(255, 236, 190, 0.95),
    rgba(242, 193, 78, 0.6) 45%,
    rgba(24, 12, 2, 0.35));
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

/* ==========================================================================
   2 · THE RECIPE
   ========================================================================== */
.recipe-section { scroll-margin-top: var(--nav-h); }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.recipe-card {
  padding: 2.1rem 1.9rem;
  position: relative;
  overflow: hidden;
}
.recipe-card::after {
  /* faint accent wash rising from the base of each card */
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, var(--accent-dim));
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.4s;
}
.recipe-card:hover { transform: translateY(-5px); border-color: var(--accent-dim); box-shadow: 0 0 44px -14px var(--accent); }
.recipe-card:hover::after { opacity: 1; }

.recipe-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--accent);
}
.recipe-num::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  margin-top: 0.9rem;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.recipe-card h3 {
  margin-top: 1.3rem;
  font-size: 1.35rem;
}
.recipe-card p {
  margin-top: 0.8rem;
  font-size: 0.97rem;
  color: var(--star-3);
}

/* ==========================================================================
   3 · FEATURED CONSTELLATION — bento grid
   ========================================================================== */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(150px, auto);
  gap: 1.3rem;
}
.bento > :nth-child(1) { grid-column: span 4; grid-row: span 2; }
.bento > :nth-child(n + 2) { grid-column: span 2; }

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.7rem 1.6rem;
  color: var(--star-2);
  overflow: hidden;
  isolation: isolate;
}
.bento > :nth-child(1).bento-card { padding: 2.3rem 2.2rem; justify-content: flex-end; }

.bento-card:hover,
.bento-card:focus-visible {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 50px -14px var(--accent), var(--shadow-deep);
  color: var(--star-2);
}
.bento-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* card-local spotlight that follows the pointer (home.js sets --mx / --my) */
.card-spot {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 40%), var(--accent-dim), transparent 72%);
  opacity: 0;
  transition: opacity 0.45s;
  pointer-events: none;
}
.bento-card:hover .card-spot,
.bento-card:focus-visible .card-spot { opacity: 1; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start; /* chip rides beside the glyph — the arcana seal owns the top-right */
  gap: 0.8rem;
  margin-bottom: auto;
  padding-bottom: 1.4rem;
  padding-right: 84px; /* clearance for the absolutely-positioned .arcana-seal */
}

.glyph-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: var(--accent-hot);
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: inset 0 0 16px var(--accent-dim);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s;
}
.glyph-mark svg { width: 24px; height: 24px; }
.bento-card:hover .glyph-mark {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 0 22px -6px var(--accent), inset 0 0 16px var(--accent-dim);
}
.bento > :nth-child(1) .glyph-mark { width: 56px; height: 56px; border-radius: 16px; }
.bento > :nth-child(1) .glyph-mark svg { width: 30px; height: 30px; }

.status-chip {
  /* metrics match the shared .chip component; colors stay accent-driven */
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-hot);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  white-space: nowrap;
}
.status-chip--soon { opacity: 0.75; }

.card-name {
  font-size: 1.45rem;
  transition: color 0.3s;
}
.bento > :nth-child(1) .card-name { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.bento-card:hover .card-name { color: var(--accent-hot); }

.card-tagline {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--accent-hot);
  opacity: 0.85;
}
.card-hook {
  margin-top: 0.7rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--star-3);
}
.bento > :nth-child(1) .card-hook { max-width: 52ch; font-size: 1rem; }

.card-cta {
  margin-top: 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--star-3);
  transition: color 0.3s;
}
.card-arrow { display: inline-block; transition: transform 0.35s var(--ease-spring); }
.bento-card:hover .card-cta { color: var(--accent); }
.bento-card:hover .card-arrow { transform: translateX(5px); }

.constellation-empty { color: var(--star-3); }

.section-cta {
  margin-top: clamp(2.2rem, 4vw, 3.2rem);
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   4 · NUMBERS THAT GLOW
   ========================================================================== */
.stats-section {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
  padding: clamp(2.2rem, 4vw, 3.5rem) clamp(1.2rem, 3vw, 3rem);
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(242, 193, 78, 0.03), transparent 60%);
}
.stat { display: grid; gap: 0.55rem; justify-items: center; }
.stat-num {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2.7rem, 5.6vw, 4.6rem);
  line-height: 1;
  color: var(--star-1);
  letter-spacing: -0.02em;
  text-shadow: 0 0 34px rgba(242, 193, 78, 0.45), 0 0 90px rgba(242, 193, 78, 0.18);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--star-3);
}

/* ==========================================================================
   5 · TRUSTED BY — marquee
   ========================================================================== */
.trusted-section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
.trusted-label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--star-4);
  margin-bottom: 2rem;
}
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-list {
  display: flex;
  align-items: center;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--star-3);
  white-space: nowrap;
}
.marquee-list li { display: flex; align-items: center; }
.marquee-list li::after {
  content: '\2726'; /* ✦ */
  font-size: 0.55rem;
  color: var(--gold);
  opacity: 0.45;
  margin: 0 2.6rem;
}

@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================================
   6 · FINAL CTA
   ========================================================================== */
.final-cta { text-align: center; }
.final-cta .eyebrow::after {
  content: '';
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.final-cta h2 {
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  max-width: 20ch;
  margin: 1rem auto 0;
}
.final-cta-sub {
  margin: 1.3rem auto 0;
  max-width: 52ch;
  color: var(--star-3);
  font-size: 1.05rem;
}
.final-cta-btn { margin-top: 2.4rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: 1fr 0.9fr; }
}

@media (max-width: 920px) {
  .hero {
    padding-top: calc(var(--nav-h) + 3rem);
    padding-bottom: 6rem;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero-sub { margin-inline: auto; }
  .hero-ctas { justify-content: center; }
  .transmutation { width: min(76vw, 430px); }

  .recipe-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }

  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > :nth-child(1) { grid-column: span 2; grid-row: auto; }
  .bento > :nth-child(n + 2) { grid-column: span 1; }
  .bento > :nth-child(1).bento-card { padding: 1.9rem 1.8rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  /* every card back to a single track — a leftover span (set with
     :nth-child specificity above) would conjure a content-sized implicit
     column and crush the layout, so reset at matching specificity */
  .bento > :nth-child(1),
  .bento > :nth-child(n + 2) { grid-column: auto; grid-row: auto; }
  .scroll-cue { display: none; }
  .marquee-list li::after { margin: 0 1.6rem; }
  .moon-popup { width: 224px; padding: 0.75rem 0.8rem; }
  .moon-popup-art { width: 52px; height: 52px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
}

/* Short viewports: don't let the cue overlap the CTAs */
@media (max-height: 640px) {
  .scroll-cue { display: none; }
}

/* ==========================================================================
   Reduced motion — theme.css already collapses keyframe animations;
   make the static composition intentional rather than accidental.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-list[aria-hidden="true"] { display: none; }
  .orb, .orb-halo, .ring, .orbits, .orbiter-core, .moon-disc, .scroll-cue svg { animation: none; }

  /* orrery: no swell, popup + hint appear/disappear instantly */
  .moon:hover .moon-face,
  .moon:focus-visible .moon-face { transform: none; }
  .moon-popup,
  .moon-popup.is-visible { transition: none; transform: none; }
  .athanor-hint { transition: none; transform: none; }
}

/* ==========================================================================
   7 · KINETIC HEADLINE — type-foundry reveal on Fraunces' variable axes.
   home.js splits the h1 into .k-word > .k-letter spans (never under
   reduced motion — the unsplit markup is the fallback), letters forge in
   from soft/wonky/light and settle to the house cut. After settling, the
   headline is magnetic: the letter under the pointer swells in weight and
   optical size with smooth falloff (home.js drives --kw / --ko).
   ========================================================================== */
.hero-title.is-split { transition: none; opacity: 1; transform: none; }

.hero-title .k-word { display: inline-block; white-space: nowrap; }

.hero-title .k-letter {
  display: inline-block;
  font-variation-settings: 'wght' var(--kw, 560), 'opsz' var(--ko, 72), 'SOFT' 0, 'WONK' 0;
  transition: font-variation-settings 0.26s ease-out;
}

.hero-title.is-split .k-letter {
  animation: letter-forge 0.92s var(--ease-spring) both;
  animation-delay: calc(0.14s + var(--ki, 0) * 0.028s);
}
/* home.js flips .k-settled on animationend so the fill-mode stops
   overriding the hover-driven variation settings */
.hero-title .k-letter.k-settled { animation: none; }

@keyframes letter-forge {
  0% {
    opacity: 0;
    transform: translateY(0.38em);
    filter: blur(9px);
    font-variation-settings: 'wght' 260, 'opsz' 24, 'SOFT' 100, 'WONK' 1;
  }
  55% { opacity: 1; filter: blur(0); }
  76% { transform: translateY(-0.025em); }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    font-variation-settings: 'wght' 560, 'opsz' 72, 'SOFT' 0, 'WONK' 0;
  }
}

/* Aurora letters: each split letter carries a slice of the shared gradient
   (home.js sizes/offsets the background so the sweep stays continuous). */
.hero-title .k-aurora {
  background-image: var(--aurora);
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* the parent span hands its gradient to the letters once split */
.hero-title.is-split .aurora-text { background: none; animation: none; }

/* ==========================================================================
   8 · HERO CREDIT — quiet mono footnote under the CTAs
   ========================================================================== */
.hero-credit {
  margin-top: 1.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--star-3);
  max-width: 54ch;
}
.hero-credit a {
  color: var(--star-3);
  text-decoration: underline;
  text-decoration-color: rgba(242, 193, 78, 0.45);
  text-underline-offset: 3px;
}
.hero-credit a:hover { color: var(--gold-hot); text-decoration-color: var(--gold); }

@media (max-width: 920px) {
  .hero-credit { margin-inline: auto; }
}

/* ==========================================================================
   9 · SCROLL CHOREOGRAPHY — scroll-driven where supported; home.js provides
   an IntersectionObserver + rAF fallback when animation-timeline is missing.
   ========================================================================== */

/* -- Hero scroll-out parallax: copy drifts up gently, circle faster + fades -- */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-copy {
      animation: hero-copy-out linear both;
      animation-timeline: scroll(root block);
      animation-range: 0vh 80vh;
    }
    .transmutation-wrap {
      animation: hero-circle-out linear both;
      animation-timeline: scroll(root block);
      animation-range: 0vh 80vh;
    }
  }
}
@keyframes hero-copy-out {
  to { transform: translate3d(0, -8%, 0); opacity: 0.4; }
}
@keyframes hero-circle-out {
  to { transform: translate3d(0, -16%, 0) scale(0.96); opacity: 0; }
}

/* -- Recipe "pour": gold top-border fills left→right as the card crosses
      the viewport midline. Driven by view() timeline, or by --pour from
      the JS fallback. -- */
.recipe-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-hot) 55%, rgba(255, 221, 135, 0.35));
  box-shadow: 0 0 14px -2px rgba(242, 193, 78, 0.8);
  transform: scaleX(var(--pour, 0));
  transform-origin: left center;
  pointer-events: none;
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .recipe-card::before {
      animation: pour-fill linear both;
      animation-timeline: view(block);
      animation-range: cover 8% cover 52%;
    }
  }
}
@keyframes pour-fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ==========================================================================
   10 · ARCANA SEALS — circular wax-seal medallions on the bento cards,
   revealing each project's tarot emblem, ringed in gold, with a tiny
   roman-numeral badge. Tilts and gleams on card hover.
   ========================================================================== */
.arcana-seal {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  transform-origin: 62% 62%;
  transition: transform 0.5s var(--ease-spring);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  z-index: 1;
}
.seal-art {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid color-mix(in srgb, var(--gold) 78%, transparent);
  box-shadow:
    0 0 0 3px rgba(6, 4, 15, 0.6),
    0 0 0 4px rgba(242, 193, 78, 0.3),
    0 0 22px -6px var(--gold),
    inset 0 0 10px rgba(6, 4, 15, 0.55);
}
.seal-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%; /* the card's central emblem region */
}
/* gleam that sweeps across the seal on card hover */
.seal-art::after {
  content: '';
  position: absolute;
  inset: -30%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 244, 214, 0.4) 50%, transparent 60%);
  transform: translateX(-70%);
  transition: transform 0.9s var(--ease-spring);
  pointer-events: none;
}
.bento-card:hover .arcana-seal,
.bento-card:focus-visible .arcana-seal { transform: rotate(-7deg) scale(1.08); }
.bento-card:hover .seal-art::after,
.bento-card:focus-visible .seal-art::after { transform: translateX(70%); }

.seal-num {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 17px;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  color: var(--gold-hot);
  background: linear-gradient(180deg, var(--void-3), var(--void-1));
  border: 1px solid rgba(242, 193, 78, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.seal-num:empty { display: none; }

/* the hero bento tile gets a grander seal */
.bento > :nth-child(1) .arcana-seal { width: 76px; height: 76px; top: 1.6rem; right: 1.6rem; }

@media (max-width: 420px) {
  .arcana-seal,
  .bento > :nth-child(1) .arcana-seal { width: 56px; height: 56px; top: 1.1rem; right: 1.1rem; }
  .card-head { padding-right: 68px; }
}

/* ==========================================================================
   Reduced motion for the new layers — the headline just appears (home.js
   never splits it), parallax is off, pour-borders sit filled.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hero-copy, .transmutation-wrap { animation: none; transform: none; opacity: 1; }
  .recipe-card { --pour: 1; }
  .recipe-card::before { animation: none; }
  .seal-art::after { display: none; }
}
