:root {
  color-scheme: dark;
  /* BAMO working palette */
  --midnight: var(--bamo-midnight);
  --gold: var(--bamo-gold);
  --royal-purple: var(--bamo-royal-purple);
  --morto-red: var(--bamo-morto-red);

  /* Elysium source colors for network and portal details */
  --deep-ink: var(--elysium-deep-ink);
  --deep-teal: var(--elysium-deep-teal);
  --ocean-blue: var(--elysium-ocean-blue);
  --cyan: var(--elysium-cyan);
  --bright-cyan: var(--elysium-bright-cyan);
  --white: var(--elysium-white);

  --night: var(--midnight);
  --cream: color-mix(in srgb, var(--white) 82%, var(--gold));
  --muted: color-mix(in srgb, var(--white) 80%, var(--royal-purple));
  --surface: color-mix(in srgb, var(--midnight) 88%, var(--royal-purple));
  --surface-raised: color-mix(in srgb, var(--midnight) 79%, var(--royal-purple));
  --line: color-mix(in srgb, var(--midnight) 74%, var(--muted));
  --violet-glow: color-mix(in srgb, var(--royal-purple) 56%, var(--midnight));
  --warm-glow: color-mix(in srgb, var(--morto-red) 64%, var(--gold));
  --gold-light: color-mix(in srgb, var(--gold) 65%, var(--white));
  --gold-edge: color-mix(in srgb, var(--warm-glow) 66%, var(--midnight));
  --portal-light: color-mix(in srgb, var(--white) 60%, var(--bright-cyan));
  --shadow: color-mix(in srgb, var(--midnight) 78%, transparent);
  --heading: ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  font-family: system-ui, sans-serif;
  background: var(--night);
  color: var(--cream);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 5px; }
p { margin: 0; line-height: 1.6; }
h1, h2, h3 { margin: 0; font-family: var(--heading); line-height: 1.02; }
ul, dl { margin: 0; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 5; padding: 10px; background: var(--night); transform: translateY(-160%); }
.skip:focus { transform: none; }
.site-header { position: relative; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-row, .brand, nav { display: flex; align-items: center; }
.nav-row { justify-content: space-between; gap: 20px; min-height: 72px; }
.brand { gap: 10px; font-family: var(--heading); font-weight: 950; letter-spacing: .09em; }
.brand img { border-radius: 50%; }
nav { gap: clamp(12px, 2.1vw, 28px); flex-wrap: wrap; font-size: .88rem; font-weight: 680; color: var(--muted); }
nav a:hover, .brand:hover { color: var(--gold); }
.menu-toggle { padding: 8px 15px; border: 1px solid var(--line); border-radius: 100px; color: var(--gold); background: var(--surface-raised); font: inherit; cursor: pointer; }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(ellipse at 68% 48%, var(--violet-glow), transparent 54%),
    radial-gradient(ellipse at 10% 82%, var(--surface-raised), transparent 52%), var(--surface);
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 22%; z-index: -1;
  background: linear-gradient(transparent, var(--night));
}
.starlight, .starlight::after { position: absolute; inset: -14px; pointer-events: none; z-index: -1; }
.starlight {
  background: radial-gradient(circle at 19px 23px, var(--gold-light) 0 1px, transparent 1.8px) 0 0 / 143px 109px,
    radial-gradient(circle at 41px 11px, var(--muted) 0 1px, transparent 1.6px) 0 0 / 99px 125px;
  animation: stars 9s ease-in-out infinite alternate;
}
.starlight::after {
  content: ""; inset: 0;
  background: radial-gradient(circle at 31px 25px, var(--bright-cyan) 0 1px, transparent 1.6px) 0 0 / 181px 133px;
}
@keyframes stars { from { opacity: .24; transform: translateY(0); } to { opacity: .58; transform: translateY(-12px); } }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; align-items: center; padding-block: clamp(55px, 8vw, 102px); }
.hero-copy { min-width: 0; }
h1 { font-size: clamp(5rem, 11vw, 10rem); font-weight: 1000; letter-spacing: -.07em; color: var(--gold-light); text-shadow: 0 .045em var(--gold-edge), 0 .075em var(--night); }
.tagline { margin-top: 25px; font-family: var(--heading); font-size: clamp(1.7rem, 3.5vw, 3.15rem); line-height: 1.13; font-weight: 850; letter-spacing: -.035em; }
.tagline span { color: var(--gold); }
.network { display: flex; align-items: center; gap: 8px; margin-top: 19px; color: var(--portal-light); font-size: .85rem; font-weight: 680; }
.network img { object-fit: contain; }
.button { display: inline-flex; align-items: center; gap: 14px; margin-top: 23px; padding: 12px 19px; background: var(--gold); color: var(--night); border-radius: 100px; font-weight: 800; box-shadow: 0 4px var(--gold-edge); }
.button:hover { background: var(--gold-light); }
.emblem {
  position: relative; width: min(100%, 450px); justify-self: center;
  border-radius: 50%; box-shadow: 0 0 90px color-mix(in srgb, var(--royal-purple) 48%, transparent), 0 14px 30px var(--shadow);
}
.emblem::before { content: ""; position: absolute; inset: -15px; border: 1px solid color-mix(in srgb, var(--muted) 28%, transparent); border-radius: 50%; }
.emblem img { width: 100%; height: auto; border-radius: 50%; }
.worlds, .characters { padding-block: clamp(48px, 7vw, 86px) 0; }
.section-title { margin-bottom: 26px; text-align: center; font-size: clamp(2.15rem, 5.4vw, 4.45rem); letter-spacing: -.055em; }
.gate-scene { margin: 0; position: relative; isolation: isolate; border-radius: 28px; background: var(--violet-glow); box-shadow: 0 12px 40px var(--shadow); }
.gate-scene img { width: 100%; height: auto; border-radius: inherit; }
.gate-scene figcaption {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--deep-ink); color: var(--portal-light); border: 1px solid color-mix(in srgb, var(--cyan) 50%, transparent);
  padding: 6px 12px; border-radius: 50px; text-transform: uppercase; letter-spacing: .13em; font-size: .68rem; font-weight: 850;
}
.realm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.cool { --accent: var(--muted); --tint: var(--violet-glow); --glow: var(--royal-purple); }
.warm { --accent: var(--gold-light); --tint: color-mix(in srgb, var(--midnight) 75%, var(--morto-red)); --glow: var(--warm-glow); }
.realm { overflow: hidden; border-radius: 22px; background: var(--tint); border: 1px solid var(--line); }
.realm img { width: 100%; height: auto; aspect-ratio: 3.5; object-fit: cover; }
.realm-copy { padding: 18px 20px 21px; }
.realm h3 { color: var(--accent); font-size: clamp(1.45rem, 3vw, 2.15rem); }
.realm p { margin-top: 8px; color: var(--muted); }
.character {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 6vw, 80px);
  min-height: 320px; margin-top: 20px; border-radius: 32px; padding: 24px clamp(22px, 7vw, 94px);
  background: radial-gradient(ellipse at 28% 48%, var(--tint), var(--surface) 72%);
  border: 1px solid var(--line);
}
.character.cool { background: radial-gradient(ellipse at 73% 48%, var(--tint), var(--surface) 72%); }
.character.cool .portrait { grid-column: 2; grid-row: 1; }
.character.cool .character-copy { grid-column: 1; grid-row: 1; }
.portrait { position: relative; display: grid; place-items: center; isolation: isolate; min-height: 244px; }
.portrait::before {
  content: ""; position: absolute; z-index: -1; width: min(90%, 252px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), var(--tint) 68%); border: 1px solid color-mix(in srgb, var(--accent) 48%, transparent);
  box-shadow: 0 0 46px color-mix(in srgb, var(--glow) 41%, transparent);
}
.portrait img { width: auto; height: clamp(209px, 23vw, 274px); object-fit: contain; filter: drop-shadow(0 10px 9px var(--shadow)); }
.character h3 { color: var(--accent); font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 950; letter-spacing: -.055em; }
.epithet { font-family: var(--heading); font-size: clamp(1.2rem, 2.5vw, 1.73rem); font-weight: 760; }
.character-copy p:last-child { color: var(--muted); max-width: 32ch; margin-top: 12px; }
.story {
  margin-top: clamp(52px, 9vw, 110px); text-align: center; padding-block: clamp(46px, 7vw, 82px);
  border-block: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, var(--violet-glow), transparent 65%), radial-gradient(ellipse at 50% 130%, var(--surface-raised), transparent 65%), var(--surface);
}
.story-emblem { width: 144px; height: auto; object-fit: contain; margin: 0 auto 22px; }
.story h2 { font-size: clamp(1.75rem, 4vw, 3rem); margin-bottom: 14px; }
.story p { color: var(--muted); }
.story .story-end { margin-top: 14px; color: var(--gold); font-family: var(--heading); font-weight: 900; font-size: clamp(1.4rem, 4vw, 2.7rem); line-height: 1.2; }
.launch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; padding-block: clamp(44px, 7vw, 82px); }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); padding: 21px 24px; }
.panel h2 { font-size: clamp(1.4rem, 3vw, 1.95rem); letter-spacing: -.031em; }
.panel p { margin-top: 9px; color: var(--muted); }
.panel .status { color: var(--gold); font-size: .85rem; font-weight: 800; }
.token { grid-row: span 2; }
.token dl { margin-top: 11px; }
.token dl > div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.token dl > div:last-child { border-bottom: 0; }
.token dt { color: var(--muted); }
.token dd { margin: 0; text-align: right; font-weight: 710; }
.token small { color: var(--gold); font-weight: 600; }
.funding, .footer-top ul { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.funding { margin-top: 13px; }
.funding li { border: 1px solid var(--line); border-radius: 30px; padding: 4px 10px; font-size: .78rem; }
footer { border-top: 1px solid var(--line); background: var(--night); }
.footer-content { padding-block: 25px 31px; }
.footer-top { display: flex; align-items: center; gap: 15px; justify-content: space-between; flex-wrap: wrap; }
.footer-top ul { gap: 16px; color: var(--muted); font-size: .85rem; }
footer p { color: var(--muted); margin-top: 12px; font-size: .83rem; }
.reveal { animation: rise .48s ease-out both; }
@keyframes rise { from { opacity: .72; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .nav-row { min-height: 62px; flex-wrap: wrap; padding-block: 10px; }
  nav { width: 100%; padding-bottom: 8px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 34px; padding-block: 40px 48px; }
  .network { justify-content: center; }
  h1 { font-size: clamp(4.8rem, 17vw, 7rem); }
  .emblem { width: min(85%, 350px); }
}
@media (max-width: 560px) {
  .realm-grid, .launch { grid-template-columns: 1fr; }
  .character, .character.cool { grid-template-columns: minmax(0, 1fr); text-align: center; gap: 11px; padding: 14px 17px 23px; background: radial-gradient(ellipse at 50% 34%, var(--tint), var(--surface) 75%); }
  .character.cool .portrait, .character.cool .character-copy { grid-column: auto; grid-row: auto; }
  .character-copy p:last-child { margin-inline: auto; }
  .portrait { min-height: 232px; }
  .portrait::before { width: 205px; }
  .panel { padding-inline: 17px; }
  .gate-scene { border-radius: 16px; }
  .gate-scene figcaption { bottom: 6px; font-size: .59rem; padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .starlight, .gate-scene img, .reveal { animation: none; }
  .starlight { opacity: .35; }
}


/* v3 production artwork and four-card information layout */
.gate-scene { background: transparent; box-shadow: none; border-radius: 0; }
.gate-scene img { width: min(100%, 920px); margin: auto; object-fit: contain; height: auto; }
.gate-scene figcaption { position: static; transform: none; width: fit-content; margin: 10px auto 26px; font-size: .875rem; }

.realm img { aspect-ratio: 1672 / 467; height: auto; object-fit: contain; }
.portrait img { height: 310px; width: auto; max-width: 100%; object-fit: contain; }
.launch { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; }
.token { grid-row: auto; }
.panel { padding: 22px 18px; }
.panel h2 { font-size: 1.5rem; line-height: 1.15; }
.token dl > div { display: block; padding-block: 9px; }
.token dd { text-align: left; overflow-wrap: anywhere; }
.token dt, .token small, .status { font-size: .875rem; }
.community-channels { list-style: none; padding: 0; margin-top: 18px; }
.community-channels li { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; padding-block: 9px; border-bottom: 1px solid var(--line); }
.community-channels li span:last-child { color: var(--muted); font-size: .875rem; }
.community-channels a { display: flex; flex: 1; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; color: inherit; text-decoration: none; border-radius: 4px; }
.community-channels a:hover { text-decoration: underline; text-underline-offset: 4px; }
.community-channels a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.panel .status { margin-top: 16px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .panel, .realm { transition: transform .22s ease, border-color .22s ease; }
  .panel:hover, .realm:hover { transform: translateY(-4px); border-color: var(--gold); }
}
@media (max-width: 1050px) { .launch { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .launch { grid-template-columns: minmax(0, 1fr); }
  .portrait img { height: 280px; }
  .gate-scene figcaption { font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) { .gate-scene img { animation: none; } }

/* Both poses occupy the same fixed canvas, including while images load. */
.portrait { height: 310px; min-height: 310px; }
.portrait img {
  grid-area: 1 / 1; width: 100%; height: 100%; min-height: 0;
  position: absolute; inset: 0; object-fit: contain;
  transition: opacity 180ms ease, visibility 180ms;
}
.pose-alternate { opacity: 0; visibility: hidden; }
.portrait.is-alternate .pose-primary { opacity: 0; visibility: hidden; }
.portrait.is-alternate .pose-alternate { opacity: 1; visibility: visible; }
.pose-toggle {
  margin-top: 18px; padding: 9px 13px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--gold); font: inherit; font-size: .875rem; cursor: pointer;
}
.pose-toggle:hover { border-color: var(--gold); }
.pose-toggle[aria-pressed="true"] { background: var(--surface-raised); }
@media (max-width: 560px) { .portrait { height: 280px; min-height: 280px; } }
@media (prefers-reduced-motion: reduce) { .portrait img { transition: none; } }

/* v3.1 Two Worlds and progressive story */
.world-introduction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 4.8fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}
.world-introduction .gate-scene img { width: 100%; max-width: 782px; }
.world-lore { min-width: 0; position: relative; }
.cat-lore { align-self: start; margin-top: 58px; }
.dog-lore { align-self: end; margin-bottom: 65px; }
.world-lore::before {
  content: ""; display: block; width: 42px; height: 1px;
  background: var(--gold); margin-bottom: 16px; opacity: .6;
}
.world-symbol { display: block; color: var(--gold); font-size: 1.65rem; margin-bottom: 9px; }
.laurel-symbol { letter-spacing: -.12em; }
.paw-symbol { filter: grayscale(1) sepia(1) saturate(5); }
.world-lore h3 { font-size: 1.05rem; letter-spacing: .06em; color: var(--gold); }
.cat-lore h3 { color: var(--muted); }
.world-lore p { margin-top: 10px; font-size: .925rem; color: var(--muted); }
.world-lore .realm-epithet { margin-top: 4px; color: var(--cream); font-style: italic; }
.world-lore .world-status { color: var(--gold); font-size: .8rem; font-weight: 800; letter-spacing: .035em; }
.gate-scene figcaption { text-align: center; letter-spacing: .05em; }
.gate-scene figcaption span { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; margin-top: 3px; }
.gate-story { margin: 14px auto 30px; max-width: 640px; text-align: center; }
.gate-story h3 { font-size: 1rem; line-height: 1.3; color: var(--portal-light); }
.gate-story p { margin-top: 9px; color: var(--muted); }
.realm h3 span { display: block; margin-top: 6px; font-size: .95rem; font-weight: 550; }
.story .story-tagline { color: var(--cream); font-family: var(--heading); font-size: clamp(1.5rem, 3.5vw, 2.65rem); line-height: 1.15; font-weight: 800; }
.story-beats { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 68px; margin: 45px auto 0; max-width: 880px; text-align: left; }
.story-beat { position: relative; padding: 18px 0 12px 20px; border-left: 1px solid var(--muted); }
.story-beat p + p { margin-top: 15px; }
.story-beat p { max-width: 46ch; }
.story-beat.dog-beat { border-color: var(--gold); }
.story-beat.cat-beat { border-color: var(--muted); }
.story-beat:last-child { grid-column: 1 / -1; max-width: 600px; margin: 0 auto; }
.story .story-emphasis { color: var(--gold); font-family: var(--heading); font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.12; font-weight: 900; }
.cat-beat .story-emphasis { color: var(--muted); }
.story-finale { max-width: 650px; margin: 36px auto 0; }
.story-finale .story-emphasis { margin-top: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .world-symbol { animation: symbol-glow 5s ease-in-out infinite alternate; }
  @keyframes symbol-glow { from { text-shadow: 0 0 0 transparent; } to { text-shadow: 0 0 14px color-mix(in srgb, var(--gold) 42%, transparent); } }
}
@media (max-width: 1050px) and (min-width: 761px) {
  .world-introduction { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
  .cat-lore { margin-top: 0; }
  .dog-lore { margin-bottom: 0; }
}
@media (max-width: 760px) {
  .world-introduction { grid-template-columns: 1fr 1fr; gap: 20px 18px; }
  .world-introduction .gate-scene { grid-column: 1 / -1; grid-row: 1; }
  .world-introduction .gate-scene img { max-width: 580px; }
  .cat-lore, .dog-lore { margin: 0; align-self: start; }
  .world-lore p { font-size: .875rem; }
  .world-lore h3 { font-size: .92rem; }
  .world-lore .world-status { font-size: .8rem; overflow-wrap: anywhere; }
  .gate-story { margin-top: 26px; }
  .story-beats { grid-template-columns: 1fr; gap: 30px; margin-top: 30px; }
  .story-beat:last-child { grid-column: auto; margin: 0; max-width: none; }
}

/* Compact mobile world labels. Desktop composition retains its original rules. */
.mobile-world-symbol, .mobile-status { display: none; }
@media (max-width: 600px) {
  .world-introduction { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .world-introduction .gate-scene { grid-column: 1; }
  .world-lore {
    display: grid; grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px 10px; align-items: center; padding-block: 12px;
    border-bottom: 1px solid var(--line);
  }
  .world-lore::before, .world-symbol, .world-lore > p, .desktop-status { display: none; }
  .world-lore .world-status { display: block; grid-column: 2; margin: 0; font-size: .875rem; }
  .mobile-status { display: inline; }
  .mobile-world-symbol {
    display: block; width: 28px; height: 28px; grid-row: 1 / 3; color: var(--gold);
  }
  .world-lore h3 { font-size: 1rem; line-height: 1.25; }
  .realm-grid { grid-template-columns: minmax(0, 1fr); }
  .story-beats { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .story-beat { padding: 10px 0 10px 16px; }
  .story-beat p { font-size: 1rem; line-height: 1.7; }
  .story-beat .story-emphasis { font-size: 1.6rem; line-height: 1.2; }
}

/* Mobile-only world accordions. */
.world-mobile-heading { display: none; }
.world-accordion-body, .world-accordion-inner { display: contents; }
@media (max-width: 600px) {
  .world-lore { display: block; padding: 0; }
  .world-lore > h3:not(.world-mobile-heading), .world-lore > .world-status { display: none; }
  .world-mobile-heading { display: block; }
  .world-toggle {
    display: grid; grid-template-columns: 28px minmax(0, 1fr) 12px; gap: 10px;
    align-items: center; width: 100%; padding: 15px 0;
    background: transparent; border: 0; color: var(--cream); text-align: left; font: inherit; cursor: pointer;
  }
  .world-toggle .mobile-world-symbol { grid-row: auto; }
  .world-toggle-name { display: block; font-size: 1rem; font-weight: 800; letter-spacing: .06em; }
  .cat-lore .world-toggle-name { color: var(--muted); }
  .dog-lore .world-toggle-name { color: var(--gold); }
  .world-toggle-status { display: block; margin-top: 4px; color: var(--gold); font-size: .875rem; font-weight: 700; line-height: 1.4; }
  .world-chevron { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 250ms ease; }
  .world-toggle[aria-expanded="true"] .world-chevron { transform: rotate(225deg); }
  .world-accordion-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 250ms ease, opacity 250ms ease; opacity: 0; }
  .world-accordion-inner { display: block; overflow: hidden; min-height: 0; }
  .world-lore.is-open .world-accordion-body { grid-template-rows: 1fr; opacity: 1; }
  .world-accordion-inner p { margin: 0 0 12px 38px; font-size: 1rem; line-height: 1.65; }
  .world-accordion-inner p:last-child { margin-bottom: 18px; }
}
@media (min-width: 601px) and (max-width: 760px) {
  .world-introduction { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
  .world-introduction .gate-scene { grid-column: 2; grid-row: 1; }
  .cat-lore { grid-column: 1; grid-row: 1; }
  .dog-lore { grid-column: 3; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .world-accordion-body, .world-chevron { transition: none; }
}


/* The overlay repeats existing pixels, restricted to the energy inside the ring. */
.portal-visual { position: relative; width: 100%; margin-inline: auto; }
.portal-energy, .portal-energy::after {
  position: absolute; inset: 0; pointer-events: none;
  background: url("assets/images/optimized/central-gate-approved.webp") center / 100% 100% no-repeat;
}
.portal-energy {
  mask-image: radial-gradient(ellipse 18% 5.2% at 50% 51%, #000 30%, transparent 100%),
    radial-gradient(ellipse 2.1% 8% at 50% 50%, #000 45%, transparent 100%);
  filter: brightness(1.9) saturate(1.3);
  opacity: .06;
}
.portal-energy::after {
  content: ""; filter: brightness(1.4);
  mask-image: radial-gradient(ellipse 3% 2% at 44% 51%, #000, transparent),
    radial-gradient(ellipse 2% 2% at 56% 51%, #000, transparent);
}
.realm-visual { position: relative; overflow: hidden; isolation: isolate; }
.realm-visual img { display: block; }
.world-spark { position: absolute; pointer-events: none; opacity: 0; }
.cat-sky .world-spark {
  width: 8px; height: 8px; color: var(--cream);
  background: currentColor;
  clip-path: polygon(50% 0, 60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%);
}
.cat-sky .spark-a { left: 27%; top: 12%; }
.cat-sky .spark-b { left: 72%; top: 18%; }
.cat-sky .spark-c { left: 86%; top: 48%; }
.city-lights .world-spark { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 4px var(--gold); }
.city-lights .spark-a { left: 82%; top: 62%; }
.city-lights .spark-b { left: 94%; top: 57%; }
.city-lights .spark-c { left: 35%; top: 66%; }
.realm-visual::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
}
.cat-sky::after { background: radial-gradient(ellipse 4% 13% at 51% 15%, color-mix(in srgb, var(--cream) 52%, transparent), transparent); }
.city-lights::after { background: radial-gradient(ellipse 4% 9% at 74% 36%, color-mix(in srgb, var(--gold) 62%, transparent), transparent); }
@media (prefers-reduced-motion: no-preference) {
  .portal-energy { animation: portal-energy-pulse 3.6s ease-in-out infinite; }
  .portal-energy::after { animation: portal-inner-flash 3.6s ease-in-out infinite; }
  @keyframes portal-energy-pulse { 0%,100% { opacity: .05; } 50% { opacity: .95; } }
  @keyframes portal-inner-flash { 0%,30%,70%,100% { opacity: 0; } 44%,60% { opacity: .9; } }
  .world-spark { animation: sky-twinkle 5s ease-in-out infinite; }
  .spark-b { animation-delay: -1.7s; }
  .spark-c { animation-delay: -3.2s; }
  .city-lights .world-spark { animation-name: workshop-spark; animation-duration: 7s; }
  @keyframes sky-twinkle { 0%,35%,100% { opacity: 0; } 53% { opacity: .85; } 68% { opacity: .1; } }
  @keyframes workshop-spark { 0%,70%,100% { opacity: 0; transform: translateY(0); } 77% { opacity: .8; } 90% { opacity: 0; transform: translateY(-6px); } }
  .realm-visual::after { animation: window-glint 6s ease-in-out infinite; }
  @keyframes window-glint { 0%,100% { opacity: .05; } 48% { opacity: .65; } }
  .portal-energy, .portal-energy::after, .world-spark, .realm-visual::after,
  .starlight, .starlight::after, .world-symbol { animation-play-state: paused; }
  .is-in-view .portal-energy, .is-in-view .portal-energy::after,
  .is-in-view .world-spark, .is-in-view .realm-visual::after,
  .is-in-view .starlight, .is-in-view .starlight::after,
  .world-lore.is-in-view .world-symbol { animation-play-state: running; }
  .page-hidden .portal-energy, .page-hidden .portal-energy::after,
  .page-hidden .world-spark, .page-hidden .realm-visual::after,
  .page-hidden .starlight, .page-hidden .starlight::after, .page-hidden .world-symbol { animation-play-state: paused; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .realm { transition: border-color 250ms ease, box-shadow 250ms ease; }
  .realm:hover { transform: none; box-shadow: 0 0 12px color-mix(in srgb, var(--gold) 14%, transparent); }
  .realm-visual img { transition: transform 350ms ease; }
  .realm:hover .realm-visual img { transform: scale(1.015); }
}
@media (max-width: 600px) {
  .portal-energy { filter: brightness(1.65) saturate(1.2); }
  .cat-sky .world-spark { width: 6px; height: 6px; }
  .spark-c { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-energy, .world-spark, .realm-visual::after { animation: none; opacity: 0; }
  .world-symbol { animation: none; }
}

/* Full-screen World Explorer. */
.world-entry { position: relative; display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--cream); font: inherit; cursor: pointer; text-align: left; }
.world-entry-label { position: absolute; bottom: 8px; right: 9px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 20px; background: var(--midnight); font-size: .8rem; }
.world-explorer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; color: var(--cream); background: var(--midnight); }
.world-explorer::backdrop { background: var(--midnight); }
.explorer-shell { display: flex; flex-direction: column; height: 100%; padding-top: env(safe-area-inset-top); }
.explorer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.explorer-heading { text-align: center; min-width: 0; }
.explorer-heading h2 { font-size: clamp(1.3rem, 3vw, 2.2rem); }
.explorer-subtitle { font-size: .95rem; margin-top: 3px; }
.explorer-status { font-size: .8rem; color: var(--gold); margin-top: 4px; font-weight: 750; }
.explorer-toolbar button, .explorer-zoom button { min-height: 44px; border: 1px solid var(--line); border-radius: 24px; padding: 9px 15px; background: var(--surface); color: var(--cream); font: inherit; cursor: pointer; }
.explorer-toolbar .explorer-switch { color: var(--midnight); background: var(--gold); border-color: var(--gold); font-weight: 750; }
.explorer-toolbar button:disabled { opacity: .55; cursor: progress; }
.explorer-stage { flex: 1; position: relative; min-height: 120px; overflow: hidden; isolation: isolate; touch-action: none; cursor: grab; background: var(--midnight); }
.explorer-stage:active { cursor: grabbing; }
.world-layer { position: absolute; inset: 0; overflow: hidden; }
.explorer-panorama { position: absolute; top: 50%; left: 50%; max-width: none; height: auto; user-select: none; pointer-events: none; }
.incoming-layer { visibility: hidden; }
.explorer-portal { position: absolute; top: 50%; left: 50%; width: 72px; height: 72px; margin: -36px; border-radius: 50%; border: 2px solid var(--bright-cyan); box-shadow: inset 0 0 12px var(--ocean-blue), 0 0 12px var(--cyan); opacity: 0; pointer-events: none; }
.explorer-controls { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 12px 22px max(12px, env(safe-area-inset-bottom)); }
.explorer-controls p { font-size: .875rem; color: var(--muted); }
.explorer-zoom { display: flex; align-items: center; gap: 8px; }
.explorer-zoom output { min-width: 48px; text-align: center; font-size: .875rem; }
.explorer-zoom button { min-width: 44px; }
.explorer-message { text-align: center; color: var(--gold); font-size: .875rem; }
.explorer-message:not(:empty) { padding: 8px 16px; }
@media (max-width: 600px) {
  .explorer-toolbar { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .explorer-heading { order: -1; width: 100%; }
  .explorer-toolbar button { padding: 8px 12px; font-size: .875rem; }
  .explorer-controls { flex-direction: column; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); gap: 7px; }
  .explorer-controls p { font-size: .8rem; }
}

/* A shared coordinate plane keeps illumination attached during zoom and pan. */
.card-panorama-plane { position: relative; overflow: hidden; }
.panorama-plane { position: absolute; top: 50%; left: 50%; aspect-ratio: 1672 / 467; }
.panorama-plane .explorer-panorama { display: block; position: static; width: 100%; height: 100%; max-width: none; }
.scene-atmosphere { position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: .48; }
.panorama-plane .scene-atmosphere { opacity: 1; }
.scene-effect {
  position: absolute; transform: translate(-50%, -50%); opacity: 0;
  pointer-events: none; border-radius: 50%;
  background: radial-gradient(ellipse, var(--scene-light) 0%, transparent 72%);
}
.scene-atmosphere[data-scene="catlysium"] { --scene-light: var(--portal-light); }
.scene-effect.crystal { --scene-light: var(--bright-cyan); mix-blend-mode: screen; }
.scene-effect.window, .scene-effect.gold-detail { --scene-light: var(--gold-light); mix-blend-mode: screen; }
.scene-effect.workshop, .scene-effect.rocket-light { --scene-light: var(--gold); mix-blend-mode: screen; }
.scene-effect.sky-light { background: var(--cream); box-shadow: 0 0 6px var(--cream); }
.scene-effect.forge-spark, .scene-effect.signal { background: var(--gold); box-shadow: 0 0 5px var(--gold); }
.scene-effect.waterfall {
  border-radius: 0; overflow: hidden;
  background: transparent;
  mask-image: radial-gradient(ellipse, #000 30%, transparent 72%);
}
.scene-effect.waterfall::after {
  content: ""; position: absolute; inset: -60% 0;
  background: linear-gradient(transparent 36%, color-mix(in srgb, var(--muted) 70%, transparent) 50%, transparent 64%);
}
.realm-visual::after { display: none; }
.world-explorer.is-entering { background: transparent; }
.world-explorer.is-entering::backdrop { background: transparent; }
.world-explorer.is-entering .explorer-stage { background: transparent; }
.world-explorer.is-entering .current-layer { visibility: hidden; }
.world-explorer.is-entering .explorer-toolbar, .world-explorer.is-entering .explorer-controls { opacity: 0; }
.world-explorer.is-entering .explorer-back { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .scene-effect {
    animation: scene-light-pulse var(--effect-duration) ease-in-out var(--effect-delay) infinite;
    animation-play-state: paused;
  }
  @keyframes scene-light-pulse { 0%,100% { opacity: .12; } 50% { opacity: .85; } }
  .scene-effect.sky-light, .scene-effect.signal { animation-name: scene-light-twinkle; }
  @keyframes scene-light-twinkle { 0%,25%,100% { opacity: .04; } 52% { opacity: .85; } 70% { opacity: .12; } }
  .scene-effect.forge-spark { animation-name: scene-forge-spark; }
  @keyframes scene-forge-spark {
    0%,55%,100% { opacity: 0; transform: translate(-50%, -50%); }
    65% { opacity: .95; }
    84% { opacity: 0; transform: translate(-50%, -220%); }
  }
  .scene-effect.waterfall { animation-name: scene-light-pulse; }
  .scene-effect.waterfall::after { animation: scene-waterfall-glint var(--effect-duration) linear var(--effect-delay) infinite; animation-play-state: paused; }
  @keyframes scene-waterfall-glint { from { transform: translateY(-24%); } to { transform: translateY(24%); } }
  .realm.is-in-view .scene-effect, .realm.is-in-view .scene-effect.waterfall::after,
  .world-explorer[open]:not(.is-entering) .explorer-stage:not([aria-busy]) .current-layer .scene-effect,
  .world-explorer[open]:not(.is-entering) .explorer-stage:not([aria-busy]) .current-layer .scene-effect.waterfall::after { animation-play-state: running; }
  .page-hidden .scene-effect, .page-hidden .scene-effect.waterfall::after { animation-play-state: paused !important; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card-panorama-plane { transition: transform 350ms ease; }
  .realm:hover .card-panorama-plane { transform: scale(1.015); }
  .realm:hover .realm-visual img { transform: none; }
}
@media (max-width: 600px) { .card-panorama-plane .scene-atmosphere { opacity: .36; } }
@media (prefers-reduced-motion: reduce) {
  .scene-effect, .scene-effect.waterfall::after { animation: none; opacity: 0; }
}

/* v3.6 source-aligned illumination. Original pixels remain unmodified. */
.scene-atmosphere { --scene-light: var(--gold-light); contain: layout paint; }
.scene-effect { background: transparent; border-radius: 0; }
.scene-effect::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--scene-image);
  background-size: var(--source-size);
  background-position: var(--source-position);
  background-repeat: no-repeat;
  mask-image: radial-gradient(ellipse, #000 38%, transparent 74%);
  filter: brightness(1.8) saturate(1.25);
}
.scene-effect.crystal::before { filter: brightness(2.1) saturate(1.45); }
.scene-effect.window::before, .scene-effect.gold-detail::before,
.scene-effect.workshop::before, .scene-effect.rocket-light::before {
  filter: brightness(2) saturate(1.2);
}
.scene-effect::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--scene-light) 55%, transparent), transparent 72%);
}
.scene-effect.waterfall { --scene-light: color-mix(in srgb, var(--royal-purple) 32%, var(--white)); }
.scene-effect.waterfall::before { filter: brightness(1.55) saturate(1.1); }
.scene-effect.waterfall::after {
  inset: -60% 0;
  background: linear-gradient(transparent 42%, color-mix(in srgb, var(--scene-light) 70%, transparent) 50%, transparent 58%);
}
.scene-effect.sky-light, .scene-effect.forge-spark, .scene-effect.signal {
  border-radius: 50%; background: var(--scene-light);
}
.scene-effect.sky-light { --scene-light: var(--portal-light); }
.scene-effect.forge-spark, .scene-effect.signal { --scene-light: var(--gold); }
.scene-effect.sky-light::before, .scene-effect.sky-light::after,
.scene-effect.forge-spark::before, .scene-effect.forge-spark::after,
.scene-effect.signal::before, .scene-effect.signal::after { display: none; }
.scene-effect.crystal, .scene-effect.window, .scene-effect.gold-detail,
.scene-effect.workshop, .scene-effect.rocket-light { mix-blend-mode: screen; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes scene-light-pulse { 0%,100% { opacity: .06; } 48% { opacity: .96; } }
  @keyframes scene-forge-spark {
    0%,28%,100% { opacity: 0; transform: translate(-50%, -50%); }
    38% { opacity: .95; }
    66% { opacity: 0; transform: translate(-50%, -420%); }
  }
  .world-explorer[open] .current-layer .scene-effect { will-change: opacity; }
}
body.explorer-open main *, body.explorer-open main *::before, body.explorer-open main *::after,
body.explorer-open .site-header *, body.explorer-open .site-header *::before,
body.explorer-open .site-header *::after { animation-play-state: paused !important; }
.explorer-mode { color: var(--gold); font-weight: 750; margin-right: 10px; }
.explorer-overview {
  min-height: 44px; border: 1px solid var(--line); border-radius: 24px; padding: 9px 15px;
  background: var(--surface); color: var(--cream); font: inherit; cursor: pointer;
}
.explorer-view-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.explorer-zoom button:disabled { opacity: .4; cursor: default; }
.explorer-controls { flex-wrap: wrap; }
.explorer-controls p { flex: 1 1 220px; }
@media (max-width: 600px) {
  .panorama-plane .scene-atmosphere { opacity: .86; }
  .explorer-controls p { flex: none; text-align: center; font-size: .8rem; }
  .explorer-view-controls { gap: 7px; }
  .explorer-view-controls button { font-size: .8rem; padding-inline: 10px; }
  .explorer-mode { margin: 0; font-size: .875rem; }
}

/* Approved Portal Navigation. */
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 0; background: var(--midnight); }
.site-header::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 28%, var(--cyan) 75%, transparent);
  opacity: .6;
}
.site-header.is-scrolled { background: color-mix(in srgb, var(--midnight) 93%, transparent); backdrop-filter: blur(7px); }
.nav-row { min-height: 74px; }
nav { gap: clamp(12px, 1.45vw, 23px); }
nav > a { position: relative; padding-block: 10px; }
nav > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 200ms ease;
}
nav > a:hover::after, nav > a:focus-visible::after, nav > a[aria-current="location"]::after { transform: scaleX(1); }
nav > a[aria-current="location"] { color: var(--gold); }
.portal-navigation { position: relative; }
.portal-toggle {
  display: flex; align-items: center; gap: 8px; padding: 10px 0 10px 8px;
  color: var(--portal-light); border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .75rem; letter-spacing: .045em; font-weight: 750; white-space: nowrap;
}
.header-portal-ring { display: block; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--bright-cyan); box-shadow: inset 0 0 5px color-mix(in srgb, var(--cyan) 40%, transparent); }
.portal-destinations {
  position: absolute; right: 0; top: calc(100% + 12px); width: 228px; padding: 15px;
  border: 1px solid var(--line); border-radius: 17px; background: var(--surface);
  box-shadow: 0 14px 32px var(--shadow); color: var(--cream);
}
.portal-destinations p { color: var(--muted); font-size: .875rem; margin-bottom: 10px; }
.portal-destination { display: block; width: 100%; text-align: left; font: inherit; padding: 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--cream); background: var(--midnight); cursor: pointer; }
.portal-destination + .portal-destination { margin-top: 8px; }
.portal-destination:hover { border-color: var(--cyan); }
.hero-grid { padding-block: 44px 64px; }
[id] { scroll-margin-top: 92px; }
.project-philosophy { margin: 50px auto 0; max-width: 890px; padding-block: 36px; border-block: 1px solid var(--line); }
.project-philosophy h3 { color: var(--gold); font-size: .95rem; letter-spacing: .1em; }
.project-philosophy .philosophy-lead { margin: 20px auto 25px; color: var(--cream); font-family: var(--heading); font-size: clamp(1.65rem, 4vw, 3.1rem); font-weight: 850; line-height: 1.15; letter-spacing: -.035em; }
.philosophy-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 34px; text-align: left; }
.philosophy-copy p:first-child { grid-column: 1 / -1; color: var(--gold-light); font-size: 1.1rem; }
.project-philosophy .philosophy-conclusion { margin-top: 25px; font: 850 clamp(1.5rem, 3.4vw, 2.6rem) var(--heading); color: var(--gold); }
.project-philosophy .philosophy-motto { margin-top: 12px; color: var(--cream); font-style: italic; }
.emblem::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 50%; opacity: 0;
  background: conic-gradient(transparent 0deg 300deg, var(--gold-light) 329deg, transparent 352deg);
  mask-image: radial-gradient(closest-side, transparent calc(100% - 10px), #000 calc(100% - 8px), #000 calc(100% - 2px), transparent 100%);
}
@media (prefers-reduced-motion: no-preference) {
  .header-portal-ring { animation: header-portal-pulse 7s ease-in-out infinite; animation-play-state: paused; }
  .site-header.is-in-view .header-portal-ring { animation-play-state: running; }
  @keyframes header-portal-pulse { 0%,100% { opacity: .65; } 50% { opacity: 1; } }
  .emblem::after { animation: emblem-rim-glint 22s linear infinite; animation-play-state: paused; }
  .hero.is-in-view .emblem::after { animation-play-state: running; }
  @keyframes emblem-rim-glint { 0%,87% { opacity: 0; transform: rotate(0deg); } 89% { opacity: .65; } 98% { opacity: .65; } 100% { opacity: 0; transform: rotate(360deg); } }
}
.page-hidden .header-portal-ring, .page-hidden .emblem::after { animation-play-state: paused !important; }
@media (max-width: 900px) and (min-width: 761px) { nav { gap: 11px; font-size: .8rem; } .portal-toggle { font-size: .7rem; } .nav-row { gap: 13px; } }
@media (max-width: 760px) {
  .nav-row { min-height: 64px; }
  nav { gap: 8px 18px; }
  .portal-navigation { width: 100%; }
  .portal-toggle { padding-left: 0; }
  .portal-destinations { position: static; width: min(100%, 300px); margin-top: 7px; }
  .hero-grid { padding-block: 28px 40px; }
}
@media (max-width: 600px) {
  .philosophy-copy { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .project-philosophy { margin-top: 34px; padding-block: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  nav > a::after { transition: none; }
  .emblem::after, .header-portal-ring { animation: none; }
}

/* Keep symbol illumination compositor-friendly instead of animating glyph shadow. */
.world-symbol { text-shadow: 0 0 9px color-mix(in srgb, var(--gold) 32%, transparent); }
@keyframes symbol-glow { from { opacity: .72; } to { opacity: 1; } }

/* Composite all source-aligned light against the panorama, preserving dark contours. */
.scene-atmosphere { mix-blend-mode: screen; }

/* Keep cancellation and loading feedback available during the entry preload. */
.world-explorer.is-entering .explorer-toolbar { opacity: 1; border-color: transparent; }
.world-explorer.is-entering .explorer-heading, .world-explorer.is-entering .explorer-switch { visibility: hidden; }
.explorer-message { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 2; border-radius: 12px; background: var(--midnight); max-width: calc(100% - 30px); }
@media (max-width: 600px) { .explorer-message { bottom: 150px; } }

.skip { z-index: 30; }
