[data-page="home"] {
  --home-gutter: clamp(20px, 6vw, 105px);
  --portal-overlap: clamp(42px, 6vw, 86px);
  --night: #101e26;
  --night-light: #1c343c;
  --gold: #f3c77c;
  --line: #e4bb7966;
  --paper: #faefdb;
  --ink: #182c33;
  background: var(--night);
  color: var(--paper);
}

html:has([data-page="home"]) { scroll-padding-top: 18px; }

[data-page="home"] .section-wrap,
[data-page="home"] .masthead .modern-nav {
  width: calc(100% - 2 * var(--home-gutter));
  max-width: 1320px;
}

.home-scene {
  --scene-header: 76px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: var(--scene-header) 1fr;
  min-height: clamp(590px, 81svh, 890px);
  background: var(--night);
}

.scene-art, .home-scene::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.scene-art { object-fit: cover; object-position: 66% 39%; }

.home-scene::before {
  content: "";
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, #101e26a6 0%, #101e2666 30%, transparent 57%),
    linear-gradient(0deg, var(--night), #101e269e 14%, transparent 40%),
    linear-gradient(180deg, #101e26ad, transparent 24%);
}

[data-page="home"] .masthead {
  position: relative;
  height: var(--scene-header);
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

[data-page="home"] .masthead .modern-nav {
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.home-scene .home-brand {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #14242bd9;
}

.home-scene .home-brand img { display: block; border-radius: 50%; }
.home-scene .home-brand:hover { border-color: var(--gold); }
.home-scene .desktop-navigation { gap: 6px; }
.home-scene .desktop-navigation a {
  padding: 10px 15px;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--paper);
  text-shadow: 0 1px 5px #101e26;
}
.home-scene .desktop-navigation a:hover { background: #101e267f; }
.home-scene .modern-account {
  min-height: 43px;
  padding: 7px 14px;
  gap: 12px;
  color: var(--paper);
  background: #152831c7;
  border: 1px solid var(--line);
  border-radius: 3px 12px;
  box-shadow: none;
}
.home-scene .modern-account:hover { background: #25434b; }
.home-scene #mobile-nav {
  top: calc(var(--scene-header) - 2px);
  max-height: calc(100dvh - var(--scene-header) - 12px);
  overflow: auto;
  background: #162c35f7;
  border-color: var(--line);
}

.scene-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-self: stretch;
  margin-block: 0;
  padding-bottom: var(--portal-overlap);
}

.scene-brand {
  align-self: center;
  width: clamp(300px, 35vw, 550px);
  margin-bottom: 28px;
}

.hero-wordmark {
  position: relative;
  isolation: isolate;
  margin: 0;
  line-height: 1;
}
.hero-wordmark::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -14% 0;
  background: radial-gradient(ellipse, #0c1a23c9 10%, #0c1a2370 44%, transparent 70%);
  pointer-events: none;
}
.hero-wordmark img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(1.1) contrast(1.04)
          drop-shadow(0 3px 3px #07141bdd)
          drop-shadow(0 10px 16px #07141b80);
}


.home-play-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 25px;
  margin: clamp(16px, 2.4vw, 30px) 0 0;
}

.home-play-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 48px;
  font-size: clamp(13px, 1.25vw, 16px);
  font-weight: 600;
  line-height: 1.25;
}

.home-play-actions a span { font-size: 19px; }

.scene-register {
  position: relative;
  padding: 10px 18px;
  border: 1px solid #f5cec5;
  border-radius: 3px 15px 3px 15px;
  background: linear-gradient(112deg, #ad3638, #7e212d);
  color: #fff6f0;
  box-shadow: inset 0 0 0 3px #fff0e51f, 0 5px 18px #09181d80;
}
.scene-register:hover { background: #b53c42; }
.scene-register::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-right: 1px solid #f5cec5;
  border-bottom: 1px solid #f5cec5;
  pointer-events: none;
}

.scene-download {
  min-width: 0;
  padding: 9px 0;
  color: #fff6f0;
  text-shadow: 0 1px 5px #102027;
}
.scene-download:hover { text-decoration: underline; text-underline-offset: 5px; }
.scene-download span { color: #f5cec5; }

.home-text-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.home-text-link span { font-size: 19px; color: var(--gold); }
.home-text-link:hover { text-decoration: underline; text-underline-offset: 5px; }

.home-scene #scene-preview {
  position: absolute;
  inset: auto 0 calc(var(--portal-overlap) + 15px) auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e7c98c9c;
  border-radius: 50%;
  color: var(--paper);
  background: #112c35cf;
  font-size: 20px;
}
.home-scene #scene-preview:hover { border-color: var(--gold); background: #25434b; }

.scene-portals {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.35vw, 20px);
  margin-top: calc(-1 * var(--portal-overlap));
}
.scene-portal {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 5px;
  min-height: clamp(126px, 13vw, 184px);
  padding: 16px clamp(12px, 1.6vw, 23px);
  border: 1px solid #d9bb837f;
  border-radius: 5px 23px 5px 23px;
  background: #17333a;
  box-shadow: 0 10px 22px #08171c80;
  color: #fff3db;
}
.scene-portal img, .scene-portal::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.scene-portal img { z-index: -2; object-fit: cover; object-position: 50% 45%; transition: transform .3s ease; }
.portal-heroes img { object-position: 78% 39%; transform: scale(1.25); transform-origin: 82% 34%; }
.scene-portal::before {
  content: "";
  z-index: -1;
  background: linear-gradient(0deg, #101e26fa 4%, #101e26b3 30%, #101e2600 72%);
}
.scene-portal:hover { border-color: #ffe1a1; }
.scene-portal:not(.portal-heroes):hover img { transform: scale(1.045); }
.scene-portal strong { display: block; font: 400 clamp(22px, 2.7vw, 34px)/1.04 var(--display); }
.scene-portal small { display: block; margin-top: 5px; color: #ede0c5; font-size: 12px; line-height: 1.4; }
.portal-arrow { flex-shrink: 0; color: #efd298; font-size: 20px; line-height: 1.25; }

[data-page="home"] h2 {
  margin: 0 0 14px;
  font-size: clamp(35px, 5.6vw, 72px);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.world-section {
  display: grid;
  grid-template-columns: minmax(190px, .7fr) minmax(0, 1.65fr);
  align-items: center;
  gap: clamp(28px, 5vw, 86px);
  padding-block: clamp(48px, 7vw, 100px) 25px;
}
.world-section .section-heading { margin: 0; }
.world-section .section-heading p { margin: 15px 0; color: #c6d4d3; line-height: 1.7; }
.world-section .home-text-link { color: var(--paper); }
.world-section .world-layout { display: grid; grid-template-columns: 1fr; gap: 0; min-width: 0; }
.world-section .world-frame {
  height: clamp(285px, 35vw, 520px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px 34px 0 0;
  background: var(--night-light);
  overflow: hidden;
}
.world-section .world-frame::before { z-index: 1; inset: 7px; border-color: #ffddaa44; }
.world-section .world-frame::after { inset: 0; background: linear-gradient(0deg, #101e26e6, transparent 44%); }
.world-section .world-frame img { border-radius: 0; filter: none; }
.world-section .world-frame button { border-color: var(--line); color: #fff1d4; }
.world-section .location-caption { left: clamp(15px, 2vw, 30px); bottom: clamp(15px, 2vw, 30px); }
.world-section .location-caption h3 { color: var(--paper); }
.world-section .location-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--night-light);
}
.world-section .location-choice {
  display: block;
  height: 100%;
  padding: 14px 12px;
  border: 0;
  border-right: 1px solid var(--line);
}
.world-section .location-choice:last-child { border-right: 0; }
.world-section .location-choice::before {
  inset: auto 0 0;
  width: 100%;
  height: 3px;
  background: var(--gold);
}
.world-section .location-choice strong {
  min-height: 0;
  margin: 0;
  color: var(--paper);
  font: 600 clamp(11px, 1.25vw, 15px)/1.4 var(--body);
}
.world-section .location-choice > span > span { display: none; }
.world-section .location-choice.active, .world-section .location-choice:hover { background: #3d514d; }
.world-section .location-choice:focus-visible { outline-offset: -5px; }

.world-details { padding-bottom: clamp(45px, 7vw, 95px); }
.home-details { border-block: 1px solid var(--line); }
.home-details + .home-details { border-top: 0; }
.home-details summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 14px 4px;
  color: var(--paper);
  list-style: none;
  font-weight: 600;
  cursor: pointer;
}
.home-details summary::-webkit-details-marker { display: none; }
.home-details summary::after { content: "+" / ""; font-size: 21px; color: var(--gold); }
.home-details[open] summary::after { content: "−" / ""; }
.home-details summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.home-details summary:hover { color: var(--gold); }
.pw-race-grid, .pw-feats, .pw-steps, .pw-more {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.pw-race-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pw-race, .pw-feat, .pw-steps > li {
  padding: clamp(15px, 2.25vw, 29px);
  border: 1px solid #b8d0c43a;
  border-radius: 4px 19px;
  background: #1c343c;
}
.pw-race h3, .pw-feat h3, .pw-steps h3 {
  margin: 0 0 10px;
  font: 400 clamp(20px, 2vw, 27px)/1.1 var(--display);
}
.pw-race ul { list-style: none; padding: 0; }
.pw-race li { padding-block: 8px; }
.pw-race li > span { display: block; }
.pw-race li > span, .pw-feat p, .pw-steps p, .pw-more p {
  margin: 0;
  color: #c5d3d1;
  font-size: 14px;
  line-height: 1.65;
}
.pw-step-level { display: inline-block; margin-bottom: 8px; color: var(--gold); }
.pw-step-level small { margin-right: 5px; }
.pw-more { gap: 0 18px; }
.pw-more li { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid #b8d0c43a; }
.pw-more li > span { color: var(--gold); }

.home-journal {
  padding: clamp(42px, 7vw, 96px) 0;
  color: var(--ink);
  background: radial-gradient(ellipse at top left, #f9d8a3, transparent 60%), var(--paper);
  border-block: 1px solid #efc07c;
}
.home-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 14px;
  margin-bottom: 17px;
}
.home-journal .home-text-link span { color: #844528; }
.home-stories {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(160px, auto));
  gap: 14px;
}
.home-stories > article:first-child { grid-row: span 2; }
.home-story {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: end;
  height: 100%;
  min-height: 165px;
  padding: clamp(16px, 2.5vw, 28px) 54px clamp(16px, 2vw, 24px) clamp(16px, 2.5vw, 28px);
  overflow: hidden;
  border: 1px solid #855f36;
  border-radius: 5px 24px;
  color: #fff4df;
  background: var(--night);
}
.home-story img, .home-story::before { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.home-story img { object-fit: cover; }
.home-story::before { content: ""; z-index: -1; background: linear-gradient(0deg, #0b171dfa, #0b171d21); }
.home-story h3 { margin: 0; font: 400 clamp(23px, 3vw, 35px)/1.1 var(--display); }
.home-story p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: #f3e7d3; }
.home-story > span { position: absolute; bottom: 16px; right: 16px; color: var(--gold); font-size: 23px; }
.home-story:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.home-journal :is(a, button):focus-visible { outline-color: #713d20; }
.home-features { padding-block: clamp(48px, 7vw, 96px); }
.home-features h2 { margin-bottom: 22px; }
.project-note { color: #c5d3d1; font-size: 14px; }
.project-note a { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 900px) {
  .home-scene { --scene-header: 62px; }
  [data-page="home"] .masthead .modern-nav { display: flex; justify-content: space-between; gap: 12px; }
  .home-scene .home-brand { width: 42px; height: 42px; }
  .home-scene .home-brand img { width: 31px; height: 31px; }
  .home-scene .menu-toggle {
    width: 44px;
    height: 44px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #152831c7;
  }
  .home-scene .menu-toggle:hover,
  .home-scene .menu-toggle[aria-expanded="true"] { background: #25434b; }
  .world-section { grid-template-columns: 1fr; gap: 20px; }
  .world-section .section-heading p { max-width: 600px; }
  .pw-race-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (601px <= width <= 900px) {
  .scene-art { object-position: 53% 39%; }
  .scene-brand { margin-bottom: 48px; }
}

@media (max-width: 600px) {
  [data-page="home"] { --portal-overlap: 30px; }
  .home-scene { min-height: clamp(490px, 76svh, 650px); }
  .scene-art { object-position: 81% top; }
  .home-scene::before {
    background: linear-gradient(0deg, var(--night) 4%, #101e26ef 17%, #101e266b 37%, transparent 66%),
                linear-gradient(180deg, #101e26ad, transparent 26%);
  }
  .scene-brand {
    align-self: end;
    justify-self: center;
    width: min(100%, 375px);
    margin: 0 0 61px;
  }
  .home-play-actions { gap: 8px 15px; }
  .home-play-actions a { gap: 6px; min-height: 44px; }
  .scene-register { padding-inline: 11px; }
  .home-scene #scene-preview { inset: 11px 0 auto auto; width: 38px; height: 38px; }
  .scene-portal {
    min-height: 99px;
    padding: 9px 7px;
    border-radius: 4px 13px 4px 13px;
  }
  .scene-portal strong { font-size: clamp(14px, 4vw, 21px); }
  .scene-portal small { display: none; }
  .portal-arrow { font-size: 14px; }
  .world-section .world-frame { height: clamp(220px, 66vw, 330px); }
  .world-section .location-choice { padding: 11px 6px; min-height: 48px; }
  .world-section .location-choice strong { font-size: 11px; }
  .pw-race-grid, .pw-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pw-feats, .pw-more, .home-stories { grid-template-columns: 1fr; }
  .home-stories { grid-template-rows: none; }
  .home-stories > article:first-child { grid-row: auto; }
  .home-story { min-height: clamp(170px, 53vw, 300px); }
}
