/* Astral Chronicles — layered key-art presentation
   This file intentionally owns the home hero as a self-contained component.
   It is loaded after the legacy theme so the layered scene no longer depends
   on the accumulated background-image overrides in astral.css. */

:root {
  --astral-v4-header-height: 68px;
  --astral-v4-hero-height: clamp(500px, 31vw, 650px);
}

.home-page {
  --hero-sky-x: 0px;
  --hero-sky-y: 0px;
  --hero-islands-x: 0px;
  --hero-islands-y: 0px;
  --hero-clouds-x: 0px;
  --hero-clouds-y: 0px;
  --hero-character-y: 0px;
  overflow-x: clip;
}

.home-page .page-shell {
  position: relative;
  isolation: isolate;
}

.home-page .site-header {
  min-height: var(--astral-v4-header-height);
  z-index: auto;
  isolation: auto;
  backdrop-filter: none;
}

.home-page .site-header > .brand,
.home-page .site-header > .burger,
.home-page .site-header > .main-nav,
.home-page .site-header > .header-actions {
  z-index: 30;
}

/* Layered hero ----------------------------------------------------------- */
.home-page .astral-hero {
  height: var(--astral-v4-hero-height);
  min-height: var(--astral-v4-hero-height);
  overflow: hidden;
  isolation: auto;
  background: #071c43;
  box-shadow:
    inset 0 -72px 86px rgba(1, 7, 24, 0.58),
    0 18px 44px rgba(0, 5, 22, 0.38);
}

.home-page .astral-hero__scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #0b2e68, #061a40 72%, #020b20);
}

.home-page .astral-hero__scene::before,
.home-page .astral-hero__scene::after {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  content: "";
}

.home-page .astral-hero__scene::before {
  background:
    radial-gradient(ellipse at 50% 28%, transparent 0 22%, rgba(2, 14, 43, 0.06) 48%, rgba(1, 8, 27, 0.42) 100%),
    linear-gradient(90deg, rgba(0, 8, 28, 0.24), transparent 19% 72%, rgba(0, 8, 28, 0.25));
}

.home-page .astral-hero__scene::after {
  background:
    linear-gradient(180deg, rgba(1, 8, 27, 0.05) 0 43%, rgba(1, 8, 26, 0.24) 68%, rgba(1, 7, 23, 0.92) 100%),
    radial-gradient(ellipse at 50% 94%, rgba(35, 109, 220, 0.17), transparent 48%);
}

.home-page .astral-hero__layer {
  position: absolute;
  inset: -3.5%;
  display: block;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
}

.home-page .astral-hero__layer img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  user-select: none;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.home-page .astral-hero__layer--sky {
  z-index: 0;
  transform: translate3d(var(--hero-sky-x), var(--hero-sky-y), 0) scale(1.018);
}

.home-page .astral-hero__layer--sky img {
  filter: brightness(0.62) saturate(1.13) contrast(1.08);
  animation: astral-v4-sky-breathe 24s ease-in-out infinite alternate;
}

.home-page .astral-hero__layer--islands {
  z-index: 2;
  transform: translate3d(var(--hero-islands-x), var(--hero-islands-y), 0) scale(1.028);
}

.home-page .astral-hero__layer--islands img {
  filter:
    brightness(0.76)
    saturate(1.04)
    contrast(1.045)
    drop-shadow(0 24px 28px rgba(0, 14, 49, 0.32));
  animation: astral-v4-island-drift 13.5s ease-in-out infinite alternate;
}

.home-page .astral-hero__layer--clouds {
  z-index: 3;
  inset: -6% -8%;
  mix-blend-mode: screen;
  transform: translate3d(var(--hero-clouds-x), var(--hero-clouds-y), 0);
}

.home-page .astral-hero__layer--clouds img {
  object-position: 50% 64%;
}

.home-page .astral-hero__layer--clouds-far {
  opacity: 0.34;
  filter: blur(2px);
}

.home-page .astral-hero__layer--clouds-far img {
  animation: astral-v4-clouds-far 31s ease-in-out infinite alternate;
}

.home-page .astral-hero__layer--clouds-near {
  z-index: 9;
  opacity: 0.62;
  filter: blur(0.2px);
  transform: translate3d(var(--hero-clouds-x), var(--hero-clouds-y), 0) scale(1.075);
}

.home-page .astral-hero__layer--clouds-near img {
  object-position: 50% 55%;
  filter: brightness(1.05) saturate(0.88) contrast(1.04);
  animation: astral-v4-clouds-near 22s ease-in-out infinite alternate;
}

.home-page .astral-hero__depth-light {
  position: absolute;
  top: -34%;
  left: 29%;
  z-index: 6;
  width: 47%;
  height: 144%;
  pointer-events: none;
  opacity: 0.3;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(204, 239, 255, 0.25), rgba(67, 153, 255, 0.12) 29%, transparent 67%);
  mix-blend-mode: screen;
  filter: blur(14px);
  animation: astral-v4-depth-light 9s ease-in-out infinite alternate;
}

.home-page .astral-hero::before {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(1, 10, 33, 0.18) 0%, rgba(2, 14, 42, 0.015) 31%, rgba(3, 15, 42, 0.04) 59%, rgba(1, 8, 27, 0.19) 100%),
    radial-gradient(ellipse at 50% 35%, transparent 0 32%, rgba(1, 9, 28, 0.18) 76%, rgba(1, 7, 23, 0.44));
}

.home-page .astral-hero::after {
  z-index: 7;
  height: 124px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(2, 11, 31, 0.32) 35%, rgba(2, 9, 25, 0.96) 100%),
    linear-gradient(90deg, transparent 4%, rgba(45, 139, 251, 0.13) 49%, transparent 96%);
}

.home-page .astral-hero__atmosphere {
  z-index: 8;
}

.home-page .astral-hero__mist {
  display: none;
}

.home-page .astral-hero__lightveil {
  opacity: 0.085;
}

.home-page .astral-hero__radiance {
  opacity: 0.2;
}

.home-page .astral-hero__content,
.home-page .astral-hero__motto,
.home-page .astral-hero__signature {
  z-index: 12;
}

.home-page .astral-hero__content {
  width: min(38vw, 548px);
  min-width: 430px;
  padding-top: clamp(5px, 0.55vw, 11px);
}

.home-page .astral-hero__logo-stage {
  width: min(100%, 548px);
}

.home-page .astral-hero__logo {
  filter:
    drop-shadow(0 14px 26px rgba(0, 11, 48, 0.88))
    drop-shadow(0 0 19px rgba(78, 167, 255, 0.48));
}

/* The character lives in the header stacking context so only her crown tips
   can cross the navigation divider while the body ends at the hero divider. */
.home-page .site-header__hero-character-frame {
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  height: calc(var(--astral-v4-header-height) + var(--astral-v4-hero-height));
  z-index: 4;
  overflow: hidden;
  transform: none;
}

.home-page .site-header__hero-character {
  top: clamp(-4px, calc(34px - 1.5vw), 14px);
  right: auto;
  left: 50%;
  width: max(1360px, min(100vw, 2400px));
  height: auto;
  opacity: 1;
  filter:
    drop-shadow(-23px 18px 31px rgba(0, 10, 43, 0.6))
    drop-shadow(-3px 0 10px rgba(69, 157, 255, 0.24))
    saturate(1.015)
    contrast(1.02);
  transform: translate3d(calc(-50% + var(--hero-character-x)), var(--hero-character-y), 0);
  transform-origin: 69% 20%;
}

/* Premium hero actions --------------------------------------------------- */
.home-page .astral-hero__actions {
  gap: 16px;
  margin-top: 17px;
}

.home-page .astral-cta {
  width: 218px;
  min-width: 218px;
  min-height: 56px;
  gap: 0;
  padding: 0 18px 0 0;
  overflow: hidden;
  border: 1px solid rgba(160, 211, 255, 0.86);
  border-radius: 2px;
  clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px);
  box-shadow:
    0 11px 21px rgba(0, 9, 39, 0.44),
    0 0 18px rgba(43, 132, 249, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 12, 48, 0.75);
}

.home-page .astral-cta::before {
  position: absolute;
  inset: 4px;
  display: block;
  z-index: 0;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(191, 226, 255, 0.18);
  clip-path: inherit;
}

.home-page .astral-cta::after {
  position: absolute;
  top: -35%;
  bottom: -35%;
  left: -52%;
  z-index: 0;
  width: 37%;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: skewX(-20deg);
  transition: left 480ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.home-page .astral-cta:hover::after,
.home-page .astral-cta:focus-visible::after {
  left: 116%;
}

.home-page .astral-cta__icon,
.home-page .astral-cta__label {
  position: relative;
  z-index: 2;
}

.home-page .astral-cta__icon {
  align-self: stretch;
  width: 57px;
  height: auto;
  margin-right: 16px;
  border-right: 1px solid rgba(208, 235, 255, 0.24);
  background: radial-gradient(circle at 45% 50%, rgba(195, 232, 255, 0.14), transparent 62%);
}

.home-page .astral-cta__icon svg {
  width: 21px;
  height: 21px;
}

.home-page .astral-cta__label {
  flex: 1;
  font-size: 0.93rem;
  letter-spacing: 0.115em;
  text-shadow: 0 1px 5px rgba(0, 8, 31, 0.82);
}

.home-page .astral-cta--gold {
  color: #291801;
  border-color: rgba(255, 230, 169, 0.98);
  background:
    linear-gradient(180deg, rgba(255, 247, 217, 0.64), transparent 40%) top / 100% 52% no-repeat,
    linear-gradient(115deg, #f7d58a 0%, #d79a42 36%, #f5ca72 68%, #b87528 100%);
  box-shadow:
    0 11px 22px rgba(19, 11, 1, 0.42),
    0 0 20px rgba(236, 184, 83, 0.33),
    inset 0 1px 0 rgba(255, 251, 227, 0.88),
    inset 0 -2px 0 rgba(111, 59, 9, 0.52);
}

.home-page .astral-cta--gold .astral-cta__icon {
  border-right-color: rgba(89, 49, 8, 0.26);
  background: radial-gradient(circle at 45% 50%, rgba(255, 248, 218, 0.42), transparent 62%);
}

.home-page .astral-cta--blue {
  background:
    linear-gradient(180deg, rgba(142, 213, 255, 0.22), transparent 45%) top / 100% 54% no-repeat,
    linear-gradient(115deg, #1269cf 0%, #0750ac 38%, #0a65cf 69%, #02377f 100%);
  box-shadow:
    0 11px 22px rgba(0, 8, 35, 0.48),
    0 0 23px rgba(37, 132, 255, 0.39),
    inset 0 1px 0 rgba(217, 243, 255, 0.42),
    inset 0 -2px 0 rgba(0, 22, 76, 0.72);
}

.home-page .astral-cta:hover,
.home-page .astral-cta:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08) saturate(1.04);
}

/* Reference-like status console ----------------------------------------- */
.home-page .astral-content-stage > .realm-status {
  width: min(calc(100% - 7vw), 1500px);
  min-height: 72px;
  padding: 4px clamp(18px, 2.1vw, 38px);
  overflow: visible;
  border: 1px solid rgba(105, 181, 255, 0.62);
  border-top-color: rgba(192, 230, 255, 0.85);
  border-bottom-color: rgba(235, 189, 100, 0.86);
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 50% -30%, rgba(63, 155, 255, 0.25), transparent 49%),
    linear-gradient(105deg, rgba(3, 17, 46, 0.985), rgba(7, 32, 73, 0.975) 28%, rgba(3, 18, 49, 0.99) 52%, rgba(7, 31, 70, 0.975) 76%, rgba(2, 13, 37, 0.99));
  box-shadow:
    0 18px 40px rgba(0, 5, 24, 0.5),
    0 0 22px rgba(45, 143, 255, 0.18),
    inset 0 1px 0 rgba(239, 249, 255, 0.15),
    inset 0 -1px 0 rgba(247, 205, 124, 0.13),
    inset 0 0 34px rgba(42, 127, 239, 0.075);
  backdrop-filter: blur(12px) saturate(1.1);
}

.home-page .astral-content-stage > .realm-status::before,
.home-page .astral-content-stage > .realm-status::after {
  width: 14px;
  height: 30px;
  background:
    radial-gradient(circle at 50% 50%, #fff8d6 0 7%, transparent 9%),
    linear-gradient(135deg, #ffe29b, #a96520 43%, #f4c96f 66%, #6d3b0d);
  filter:
    drop-shadow(0 0 5px rgba(246, 199, 106, 0.68))
    drop-shadow(0 0 10px rgba(63, 155, 255, 0.34));
}

.home-page .astral-content-stage > .realm-status::before { left: -8px; }
.home-page .astral-content-stage > .realm-status::after { right: -8px; }

.home-page .realm-status article {
  min-height: 62px;
  gap: clamp(12px, 1.15vw, 19px);
  padding: 6px clamp(15px, 1.7vw, 28px);
  background: radial-gradient(ellipse at 50% -42%, rgba(94, 180, 255, 0.075), transparent 68%);
  transition: background 220ms ease, filter 220ms ease;
}

.home-page .realm-status article:hover {
  background: radial-gradient(ellipse at 50% -28%, rgba(105, 192, 255, 0.14), transparent 72%);
  filter: brightness(1.04);
}

.home-page .realm-status article:not(:last-child)::after {
  top: 13px;
  bottom: 13px;
  opacity: 0.76;
  background: linear-gradient(180deg, transparent, rgba(130, 201, 255, 0.52) 35%, rgba(225, 187, 112, 0.29) 72%, transparent);
  box-shadow: 0 0 8px rgba(65, 155, 255, 0.17);
}

.home-page .realm-status__icon {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle, rgba(76, 170, 255, 0.22), transparent 66%);
  box-shadow: none;
}

.home-page .realm-status__icon::before {
  inset: 4px;
  height: auto;
  border: 1px solid rgba(122, 201, 255, 0.28);
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 13px rgba(63, 157, 255, 0.12), 0 0 10px rgba(62, 157, 255, 0.13);
  transform: none;
}

.home-page .realm-status__icon::after {
  top: 50%;
  bottom: auto;
  left: 50%;
  width: 52px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(133, 210, 255, 0.38), transparent);
  transform: translate(-50%, -50%);
}

.home-page .realm-status__icon svg {
  width: 23px;
  height: 23px;
  filter:
    drop-shadow(0 0 3px rgba(227, 248, 255, 0.95))
    drop-shadow(0 0 9px rgba(70, 168, 255, 0.9));
}

.home-page .realm-status small {
  color: #c4d7ee;
  font-size: clamp(0.68rem, 0.64rem + 0.08vw, 0.75rem);
  letter-spacing: 0.16em;
}

.home-page .realm-status strong {
  margin-top: 4px;
  color: #f4f9ff;
  font-size: clamp(0.95rem, 0.9rem + 0.14vw, 1.08rem);
  letter-spacing: 0.12em;
}

.home-page .realm-status__state.is-offline {
  color: #ff8fa5;
  text-shadow: 0 0 12px rgba(255, 94, 130, 0.55);
}

/* Header login belongs to the same component family as the hero CTAs. */
.home-page .header-cta {
  min-width: 94px;
  min-height: 42px;
  padding: 0 19px;
  border: 1px solid rgba(235, 194, 111, 0.72);
  border-radius: 2px;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  background:
    linear-gradient(180deg, rgba(255, 239, 194, 0.07), transparent 48%),
    linear-gradient(115deg, rgba(9, 27, 58, 0.98), rgba(4, 16, 40, 0.99));
  box-shadow:
    0 9px 20px rgba(0, 4, 18, 0.34),
    inset 0 1px 0 rgba(255, 241, 204, 0.11),
    0 0 15px rgba(221, 174, 85, 0.11);
}

/* Motion ---------------------------------------------------------------- */
@keyframes astral-v4-sky-breathe {
  from { transform: translate3d(-0.25%, -0.15%, 0) scale(1.006); }
  to { transform: translate3d(0.28%, 0.18%, 0) scale(1.02); }
}

@keyframes astral-v4-island-drift {
  from { transform: translate3d(-0.16%, 1px, 0) scale(1.004); }
  to { transform: translate3d(0.18%, -4px, 0) scale(1.012); }
}

@keyframes astral-v4-clouds-far {
  from { transform: translate3d(-1.8%, 0.4%, 0) scale(1.03); opacity: 0.68; }
  to { transform: translate3d(1.6%, -0.7%, 0) scale(1.055); opacity: 0.94; }
}

@keyframes astral-v4-clouds-near {
  from { transform: translate3d(1.4%, 0.5%, 0) scale(1.05); opacity: 0.72; }
  to { transform: translate3d(-1.9%, -0.8%, 0) scale(1.085); opacity: 1; }
}

@keyframes astral-v4-depth-light {
  from { opacity: 0.18; transform: translate3d(-2%, 1%, 0) scale(0.96); }
  to { opacity: 0.34; transform: translate3d(3%, -1.5%, 0) scale(1.06); }
}

/* Responsive art direction ---------------------------------------------- */
@media (max-width: 1100px) {
  :root {
    --astral-v4-hero-height: clamp(470px, 49vw, 540px);
  }

  .home-page .astral-hero__content {
    width: min(48vw, 510px);
    min-width: 390px;
  }

  .home-page .astral-hero__motto {
    left: clamp(22px, 3vw, 42px);
  }

  .home-page .site-header__hero-character {
    width: max(1260px, 112vw);
  }
}

@media (max-width: 980px) {
  :root {
    --astral-v4-header-height: 64px;
    --astral-v4-hero-height: 540px;
  }

  .home-page .astral-hero__layer--sky img {
    object-position: 49% 50%;
  }

  .home-page .astral-hero__layer--islands img {
    object-position: 46% 50%;
  }

  .home-page .astral-hero__content {
    width: min(72vw, 500px);
    min-width: 0;
  }

  .home-page .site-header__hero-character-frame {
    display: block;
    opacity: 0.62;
    -webkit-mask-image: linear-gradient(90deg, transparent 0 22%, #000 47% 100%);
    mask-image: linear-gradient(90deg, transparent 0 22%, #000 47% 100%);
  }

  .home-page .site-header__hero-character {
    display: block;
    top: 0;
    left: 50%;
    width: auto;
    height: 100%;
    max-width: none;
    transform: translate3d(calc(-55% + var(--hero-character-x)), var(--hero-character-y), 0);
  }

  .home-page .astral-content-stage > .realm-status {
    width: min(calc(100% - 34px), 860px);
    padding: 7px 12px;
  }

  .home-page .realm-status article {
    min-height: 58px;
  }
}

@media (max-width: 680px) {
  :root {
    --astral-v4-header-height: 58px;
    --astral-v4-hero-height: 560px;
  }

  .home-page .astral-hero__scene {
    background: #071d46;
  }

  .home-page .astral-hero__layer {
    inset: -2%;
  }

  .home-page .astral-hero__layer--sky img,
  .home-page .astral-hero__layer--islands img {
    object-position: 38% 50%;
    animation: none;
  }

  .home-page .astral-hero__layer--clouds-far {
    display: none;
  }

  .home-page .astral-hero__layer--clouds-near {
    opacity: 0.38;
  }

  .home-page .astral-hero__depth-light {
    left: 8%;
    width: 84%;
    opacity: 0.16;
  }

  .home-page .site-header__hero-character-frame {
    display: block;
    height: calc(var(--astral-v4-header-height) + var(--astral-v4-hero-height));
    opacity: 0.38;
    -webkit-mask-image: linear-gradient(90deg, transparent 0 11%, rgba(0, 0, 0, 0.45) 42%, #000 66% 100%);
    mask-image: linear-gradient(90deg, transparent 0 11%, rgba(0, 0, 0, 0.45) 42%, #000 66% 100%);
  }

  .home-page .site-header__hero-character {
    display: block;
    top: 0;
    width: auto;
    height: 100%;
    max-width: none;
    transform: translate3d(-57%, var(--hero-character-y), 0);
    filter: saturate(0.94) contrast(1.03) drop-shadow(-15px 14px 24px rgba(0, 8, 35, 0.52));
  }

  .home-page .astral-hero__content {
    width: min(calc(100% - 28px), 470px);
    padding-top: 31px;
  }

  .home-page .astral-hero__actions {
    width: min(100%, 330px);
    margin: 15px auto 0;
  }

  .home-page .astral-cta {
    width: 100%;
    min-width: 0;
    min-height: 52px;
  }

  .home-page .astral-content-stage > .realm-status {
    width: calc(100% - 22px);
    border-radius: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* The project deliberately keeps a very slow ambient drift. It avoids
     abrupt motion while preserving the layered key-art requested here. */
  .home-page .astral-hero__layer--sky img {
    animation: astral-v4-sky-breathe 48s ease-in-out infinite alternate !important;
  }

  .home-page .astral-hero__layer--islands img {
    animation: astral-v4-island-drift 34s ease-in-out infinite alternate !important;
  }

  .home-page .astral-hero__layer--clouds-far img {
    animation: astral-v4-clouds-far 58s ease-in-out infinite alternate !important;
  }

  .home-page .astral-hero__layer--clouds-near img {
    animation: astral-v4-clouds-near 44s ease-in-out infinite alternate !important;
  }

  .home-page .astral-hero__depth-light {
    animation: astral-v4-depth-light 22s ease-in-out infinite alternate !important;
  }
}
