:root {
  --ink: #2a2118;
  --cream: #f4eadc;
  --gold: #e7c27a;
  --page-night: 1;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: #140e0a;
  color: var(--cream);
  font-family: Outfit, sans-serif;
}

img { max-width: none; }

a { color: inherit; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--cream);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
  z-index: 30;
}

.skip:focus { top: 0.6rem; }

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.85rem 1.4rem;
  color: color-mix(in srgb, var(--ink) calc((1 - var(--page-night)) * 100%), var(--cream));
  background: linear-gradient(to bottom, rgba(20, 14, 10, calc(var(--page-night) * 0.45)), transparent);
}

.site-header.scrolled {
  background: rgba(20, 14, 10, 0.72);
  color: var(--cream);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: Fraunces, serif;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 1rem;
  margin-left: auto;
}

.nav a {
  text-decoration: none;
  font-size: 0.92rem;
}

.nav a:hover,
.nav a:focus-visible,
.lang summary:hover,
.lang summary:focus-visible { color: var(--gold); }

.lang { position: relative; }

.lang summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.92rem;
}

.lang summary::-webkit-details-marker { display: none; }

.lang-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: 16.5rem;
  padding: 1rem 1rem 0.85rem;
  background: #1c1612;
  color: var(--cream);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.lang-kicker,
.lang-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.lang-panel p { margin: 0.25rem 0 0.7rem; }

.lang-choices {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lang-choices button,
#use-region {
  font: inherit;
  text-align: left;
  color: var(--cream);
  background: transparent;
  border: 1px solid rgba(244, 234, 220, 0.2);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.lang-choices button[aria-pressed="true"] {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
}

.planned {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.study {
  position: relative;
  height: 190vh;
  --night: 0;
}

.story {
  height: 560vh;
  --night: 1;
}

.pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sky {
  position: absolute;
  inset: -8% -12%;
}

.sky img,
.land img,
.ground img,
.layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sky .night,
.land .night,
.ground .night,
.layer .night {
  position: absolute;
  inset: 0;
  opacity: var(--night);
}

.sky .day,
.land .day,
.ground .day,
.layer .day {
  opacity: calc(1 - var(--night));
}

.land {
  position: absolute;
  left: -14%;
  width: 128%;
  bottom: 0;
  height: 82%;
  mask-image: linear-gradient(to top, #000 22%, rgba(0, 0, 0, 0.92) 48%, transparent);
}

.land img { object-position: center 46%; }

.ground {
  position: absolute;
  left: -16%;
  width: 132%;
  bottom: -6%;
  height: 28%;
  mask-image: linear-gradient(to top, #000 80%, transparent 100%);
}

.ground img { object-position: center 100%; }

.layer {
  position: absolute;
  width: auto;
  filter: drop-shadow(0 18px 18px rgba(20, 10, 4, 0.28));
}

.layer img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

.layer.wide { height: auto; }

.layer.wide img {
  width: 100%;
  height: auto;
}

.pair {
  position: absolute;
  pointer-events: none;
}

.pair img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 18px rgba(20, 10, 4, 0.28));
}

.cast {
  position: absolute;
  inset: 0;
  transform-origin: 50% 82%;
  pointer-events: none;
}

.cast[data-wave="trade"],
.cast[data-wave="harbor"],
.cast[data-wave="mega"],
.join,
.swap[data-stage="3"] { opacity: 0; }

.join { transform-origin: 50% 92%; }

.slide {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.slide[data-beat="closer"] .words {
  top: auto;
  bottom: 6%;
  transform: translate(-50%, 0);
}

.words {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: min(52rem, calc(100% - 2rem));
  pointer-events: none;
  color: color-mix(in srgb, var(--ink) calc((1 - var(--night)) * 100%), var(--cream));
  text-shadow: 0 10px 28px rgba(12, 8, 4, calc(var(--night) * 0.4));
}

.tag {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) calc((1 - var(--night)) * 100%), var(--gold));
}

h1, .words h2 {
  margin: 0;
  font-family: Fraunces, serif;
  font-weight: 520;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

h1 { font-size: clamp(4.2rem, 10vw, 8.4rem); }

.words h2 {
  font-size: clamp(2.1rem, 3.6vw, 3.3rem);
  line-height: 1.08;
}

.line {
  margin: 0.85rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
}

.land-board {
  width: min(68rem, calc(100% - 2.4rem));
  margin: 10vh auto 0;
  padding: 1.15rem 1.4rem 1.3rem;
  color: var(--ink);
  background: color-mix(in srgb, #f6efe4 92%, transparent);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(20, 10, 4, 0.16);
}

.land-board .tag { color: #6d5430; }

.land-board h2 {
  margin: 0;
  font-family: Fraunces, serif;
  font-weight: 520;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.land-row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(13rem, 0.72fr);
  gap: 1.5rem 2rem;
  align-items: center;
  margin-top: 1rem;
}

.map-standin {
  margin: 0;
  background: #1c1612;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(20, 10, 4, 0.28);
}

.map-standin svg { display: block; width: 100%; height: auto; }

.map-standin figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.9rem 0.7rem;
  color: var(--cream);
  font-size: 0.92rem;
}

.map-standin small { opacity: 0.7; }

.climates {
  margin: 0;
  padding: 0 0 0 1.15rem;
  text-align: left;
  font-size: 1.02rem;
  line-height: 1.55;
}

.climates li { break-inside: avoid; }

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.3rem;
  pointer-events: auto;
}

.cta {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.cta-quiet,
.cta-discord {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

.cta-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
}

.cta-join {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--cream);
  color: var(--ink);
  border: 0;
}

.cta:hover,
.cta:focus-visible { background: var(--gold); }

.cta-quiet:hover,
.cta-quiet:focus-visible,
.cta-discord:hover,
.cta-discord:focus-visible {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.rest, .shots, .close {
  position: relative;
  padding: 5.5rem 1.4rem;
  text-align: center;
}

.rest {
  background:
    linear-gradient(to bottom, rgba(12, 10, 18, 0.2), rgba(12, 10, 18, 0.55)),
    url("/assets/bg/sky-night.jpg") center 30% / cover no-repeat;
}

.rest ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 28rem;
}

.rest li {
  font-family: Fraunces, serif;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 520;
  line-height: 1.25;
  margin: 0.85rem 0;
}

.shots, .close { background: #1a1410; }

.shots h2, .close p {
  font-family: Fraunces, serif;
  font-weight: 520;
  letter-spacing: -0.03em;
}

.shots h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.shots p, .close .alpha-note {
  margin: 0.8rem auto 0;
  max-width: 28rem;
  font-family: Outfit, sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.miss {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.6rem;
  padding: 6rem 1.4rem 3rem;
  text-align: center;
}

.miss h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

@media (max-width: 960px) {
  .nav { display: none; }
}

@media (max-width: 720px) {
  h1 { font-size: 3.4rem; }
  .study { height: 170vh; }
  .story { height: 460vh; }
  .hide-narrow { display: none; }
  .land-row { grid-template-columns: 1fr; }
  .map-standin svg { max-height: 24vh; }
}
