/* ==========================================================================
   Yrsvald — Landing ("The Descent into Yrsvald")
   Loaded only by index.html, after sections.css. One continuous pixel-art
   world: full-bleed band backdrops, hero parallax stack, MC hotbar, XP bar,
   advancement toast. No .panel boxes for world sections — the tip-card map
   labels and the join CTA are the only boxed content.
   ========================================================================== */

/* ---- Transparent header over the hero, solid once scrolled ------------------- */

.site-header {
  background: transparent;
}

.site-header.scrolled {
  background: oklch(0.16 0.02 265 / 0.92);
}

/* ---- Hero: 100svh, 4-layer parallax stack, particles ------------------------- */

.hero {
  min-height: 100svh;
}

.hero__parallax {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.hero__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  will-change: translate;
}

.hero__layer--sky       { z-index: 1; }
.hero__layer--mountains { z-index: 2; }
.hero__layer--headland  { z-index: 3; }
.hero__layer--pines     { z-index: 4; }

.hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

.hero__wordmark {
  width: min(640px, 88vw);
  height: auto;
  image-rendering: pixelated;
  margin-inline: auto;
}

.hero__cta-row {
  display: flex;
  justify-content: center;
  margin-block-start: var(--sp-1);
}

@media (prefers-reduced-motion: reduce) {
  .hero__layer {
    translate: none !important;
  }
}

/* ---- Band system: full-bleed world sections ----------------------------------- */

.band {
  position: relative;
  z-index: 0; /* new stacking context so negative-z backdrop/scrim children
                 stay local to this band while the band itself still paints
                 over earlier siblings in normal document order */
  display: flex;
  align-items: center;
  min-height: 70vh;
  margin-block-start: -24px;
  padding-block: calc(var(--sp-7) + 24px) var(--sp-7);
  overflow: hidden;
  clip-path: polygon(
    0% 16px, 6% 4px, 12% 20px, 18% 8px, 24% 24px, 30% 0%, 36% 14px, 42% 22px,
    48% 6px, 54% 18px, 60% 2px, 66% 16px, 72% 24px, 78% 10px, 84% 20px, 90% 4px,
    96% 14px, 100% 8px,
    100% 100%, 0% 100%
  );
}

.band__backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-position: center;
  background-size: cover;
  image-rendering: pixelated;
}

.band__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    oklch(0.16 0.02 265 / 0.35) 0%,
    oklch(0.16 0.02 265 / 0.55) 60%,
    oklch(0.16 0.02 265 / 0.75) 100%
  );
}

.band__inner {
  display: flex;
  width: 100%;
  min-width: 0; /* flex item of .band: allow shrinking below content width */
}

.band--left .band__inner {
  justify-content: flex-start;
}

.band--right .band__inner {
  justify-content: flex-end;
}

.band__label {
  max-width: 340px;
  width: 100%;
}

.band__label--hearthmoor { --accent: var(--region-hearthmoor); }
.band__label--skarrow    { --accent: var(--region-skarrow); }
.band__label--duskmere   { --accent: var(--region-duskmere); }
.band__label--caelador   { --accent: var(--region-caelador); }

.band__emblem {
  animation: band-bob 1.6s steps(2) infinite;
}

@keyframes band-bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -4px; }
}

@media (prefers-reduced-motion: reduce) {
  .band__emblem {
    animation: none;
  }
}

.band__link {
  display: inline-block;
  margin-block-start: var(--sp-2);
  color: var(--teal);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.band__link:hover {
  text-decoration: underline;
}

.band--hearthmoor .band__backdrop { background-image: url("../assets/img/band-hearthmoor.svg"); }
.band--skarrow    .band__backdrop { background-image: url("../assets/img/band-skarrow.svg"); }
.band--duskmere   .band__backdrop { background-image: url("../assets/img/band-duskmere.svg"); }
.band--caelador   .band__backdrop { background-image: url("../assets/img/band-caelador.svg"); }

.band__backdrop--bedrock {
  background-image: url("../assets/img/band-bedrock.svg");
}

/* ---- Paths band: dark interlude, no backdrop art, MC hotbar ------------------- */

.band--paths {
  min-height: auto;
  padding-block: var(--sp-6);
  background: linear-gradient(to bottom, oklch(0.13 0.02 265) 0%, oklch(0.09 0.02 265) 100%);
  justify-content: center;
}

.band__scrim--paths {
  background: none;
}

.band__paths-inner {
  width: 100%;
  text-align: center;
}

.band__title {
  color: var(--gold);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  text-shadow: 3px 3px 0 oklch(0 0 0 / 0.55);
  margin-block-end: var(--sp-4);
}

.hotbar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.hotbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}

.hotbar__slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--bg-inset);
  border: var(--edge-width) solid var(--edge);
  box-shadow:
    inset -2px -2px 0 var(--bevel-light),
    inset 2px 2px 0 var(--bevel-dark);
  text-decoration: none;
  transition: box-shadow var(--dur-fast) linear;
}

.hotbar__slot:hover,
.hotbar__slot:focus-visible {
  box-shadow:
    inset 0 0 0 2px oklch(1 0 0 / 0.9),
    inset -2px -2px 0 var(--bevel-light),
    inset 2px 2px 0 var(--bevel-dark);
}

.hotbar__icon {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  pointer-events: none;
}

.hotbar__caption {
  display: block;
  color: var(--ink-dim);
  font-size: 0.8rem;
  text-align: center;
  max-width: 160px;
}

.js .hotbar__caption {
  display: none;
}

.hotbar__tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  translate: -50% 0;
  width: 220px;
  text-align: left;
  z-index: 20;
}

.js .hotbar__slot:hover .hotbar__tooltip,
.js .hotbar__slot:focus-visible .hotbar__tooltip {
  display: block;
}

.hotbar__tooltip-name {
  display: block;
  color: var(--gold);
  font-weight: 700;
  margin-block-end: 0.4em;
}

.hotbar__tooltip-ability {
  display: block;
  color: var(--teal);
  font-size: 0.85rem;
}

.hotbar__tooltip-flavor {
  display: block;
  color: var(--ink-dim);
  font-size: 0.8rem;
  margin-block-start: 0.5em;
}

/* ---- Join band ------------------------------------------------------------------ */

.band--join {
  justify-content: center;
}

/* ---- Responsive: center map labels below the 920px breakpoint ------------------ */

@media (max-width: 919px) {
  .band--left .band__inner,
  .band--right .band__inner {
    justify-content: center;
  }
}

/* ---- XP scroll-progress bar (JS-injected; absent without JS) ------------------- */

.xp-bar {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  height: 6px;
}

.xp-bar__track {
  flex: 1;
  height: 100%;
  background: var(--bg-inset);
  border-block-start: 1px solid var(--edge);
}

.xp-bar__fill {
  height: 100%;
  width: 0%;
  background: var(--grass);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.35);
}

.xp-bar__chip {
  position: absolute;
  inset-inline-start: var(--sp-2);
  inset-block-end: calc(100% + 4px);
  padding: 0.2em 0.6em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--bg-deep);
  background: var(--grass);
  border: var(--edge-width) solid var(--edge);
}

/* ---- Advancement toast (JS-injected; skipped under reduced motion) ------------- */

.toast {
  position: fixed;
  top: var(--sp-3);
  right: var(--sp-3);
  z-index: 300;
  max-width: 320px;
  translate: 0 -16px;
  opacity: 0;
  pointer-events: none;
  transition: translate var(--dur-reveal) var(--ease-out), opacity var(--dur-reveal) var(--ease-out);
}

.toast.is-in {
  translate: 0 0;
  opacity: 1;
  pointer-events: auto;
}

.toast.is-out {
  translate: 0 -16px;
  opacity: 0;
  pointer-events: none;
}

.toast__dismiss {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  background: oklch(0.22 0.02 265 / 0.97);
  border: 2px solid var(--rune-tint);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark);
}

.toast__icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  flex: none;
}

.toast__body {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.toast__eyebrow {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toast__title {
  color: var(--ink);
  font-weight: 700;
}
