:root {
  --ink: #0d1118;
  --paper: #efe7d6;
  --blue: #21324f;
  --blue-bright: #2f4d7a;
  --gold: #d1a34a;
  --card: #141a24;
  --radius: 8px;
  --ui-font: "Archivo Narrow", "Helvetica Neue", Arial, sans-serif;
  --display-font: "Anton", "Arial Narrow", sans-serif;
  --lyric-font: "Alegreya Sans", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--ui-font);
  color: var(--paper);
  background: var(--ink);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.2) contrast(1.05) brightness(0.85);
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 0;
  pointer-events: none;
}

.bg-layer.is-active {
  opacity: 1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(0deg, rgba(13, 17, 24, 0.85), rgba(13, 17, 24, 0.6));
  z-index: 1;
  pointer-events: none;
}

.footer-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px));
}

.footer-link {
  font-family: var(--ui-font);
  color: rgba(239, 231, 214, 0.86);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-link:focus-visible {
  color: var(--gold);
}

@media (hover: hover) and (pointer: fine) {
  .footer-link:hover {
    color: var(--gold);
  }
}

.stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  max-width: 1200px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 28px 28px 72px;
  width: min(1200px, 100%);
}

.mast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 16px 0;
  margin: auto;
  width: 100%;
}

.eyebrow {
  font-family: var(--ui-font);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gold);
  margin: 0 0 8px;
}

h1 {
  font-family: var(--display-font);
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  font-weight: 400;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.mast-home-link,
.mast-home-link:visited,
.mast-home-link:hover,
.mast-home-link:active,
.mast-home-link:focus-visible {
  color: inherit;
  text-decoration: none;
}

.tagline {
  max-width: 260px;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(239, 231, 214, 0.8);
}

.pages {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  scroll-snap-type: y mandatory;
  border-radius: var(--radius);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pages::-webkit-scrollbar {
  display: none;
}

.scroll-hint {
  position: fixed;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  border: 1px solid rgba(209, 163, 74, 0.44);
  border-radius: var(--radius);
  background: rgba(239, 231, 214, 0.055);
  box-shadow:
    inset 0 0 38px rgba(239, 231, 214, 0.07),
    0 0 24px rgba(209, 163, 74, 0.08);
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.scroll-hint.is-visible {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.scroll-hint-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid rgba(209, 163, 74, 0.52);
  border-radius: 999px;
  color: rgba(239, 231, 214, 0.94);
  background: rgba(13, 17, 24, 0.84);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
}

.scroll-hint-message::after {
  content: "\2195";
  color: var(--gold);
  font-size: 1rem;
  line-height: 1;
}

.page {
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
}

.panel {
  width: 100%;
  min-width: 0;
  max-width: 1100px;
  padding: var(--panel-pad, 10px);
}

.panel h2 {
  font-family: var(--display-font);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 400;
  margin: 0 0 16px;
  color: var(--gold);
}

.panel p {
  font-family: var(--ui-font);
  font-size: 1.15rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
  margin: 0 0 16px;
}

.panel .quote-attribution {
  margin-top: 22px;
  color: rgba(239, 231, 214, 0.72);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-align: right;
}

.scene-video {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.scene-poster,
.scene-video video {
  width: min(100%, calc(var(--video-max-height, 60vh) * 1.25));
  max-width: 100%;
  display: block;
  height: auto;
  max-height: var(--video-max-height, 60vh);
}

.scene-poster {
  object-fit: cover;
}

.scene-loading {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: min(100%, calc(var(--video-max-height, 60vh) * 1.25));
  max-width: 100%;
  max-height: var(--video-max-height, 60vh);
  aspect-ratio: 5 / 4;
  container-type: inline-size;
  color: rgba(239, 231, 214, 0.86);
  background: rgba(13, 17, 24, 0.38);
  transform: translateX(-50%);
  opacity: 1;
  transition: background-color 0.22s ease, opacity 0.24s ease;
}

.scene-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  border: solid rgba(0, 0, 0, 0.88);
  border-width: 1.33cqw 2cqw;
  pointer-events: none;
}

.scene-loading-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  transition: opacity 0.12s ease;
}

.scene-loading-bar {
  position: relative;
  display: block;
  width: 86px;
  height: 2px;
  overflow: hidden;
  background: rgba(239, 231, 214, 0.24);
  transition: opacity 0.12s ease;
}

.scene-loading-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  background: var(--gold);
  animation: scene-loading 1s ease-in-out infinite;
}

.scene-video.is-revealing .scene-loading,
.scene-video.is-ready .scene-loading {
  background-color: #000;
}

.scene-video.is-revealing .scene-loading-label,
.scene-video.is-revealing .scene-loading-bar,
.scene-video.is-ready .scene-loading-label,
.scene-video.is-ready .scene-loading-bar {
  opacity: 0;
}

.scene-video.is-ready .scene-loading {
  opacity: 0;
  pointer-events: none;
}

.scene-video.is-settled .scene-poster {
  visibility: hidden;
}

.scene-video.is-settled .scene-loading {
  display: none;
}

.scene-video.is-error .scene-loading-bar {
  display: none;
}

.scene-video video {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.scene-video video.is-ready {
  opacity: 1;
}

@keyframes scene-loading {
  0% {
    transform: translateX(-125%);
  }
  50% {
    transform: translateX(140%);
  }
  100% {
    transform: translateX(140%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-loading-bar::after {
    animation: none;
    width: 100%;
  }

  .scroll-hint {
    transition-duration: 0.01ms;
  }
}

.scene-lyric {
  font-family: var(--lyric-font);
  width: min(34ch, 100%);
  margin: 22px auto 0;
  padding: 14px 0 0;
  font-size: clamp(1.2rem, 0.95rem + 0.9vw, 1.7rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: 0.015em;
  text-align: center;
  color: rgba(239, 231, 214, 0.96);
  opacity: 0.8;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  min-height: var(--lyric-min-height, 0px);
  max-width: 100%;
  overflow-wrap: break-word;
}


.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.index-item {
  font-family: var(--ui-font);
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.index-item img {
  width: 100%;
  border-radius: 0;
  display: block;
  margin-bottom: 8px;
  border: 2px solid rgba(239, 231, 214, 0.38);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.4);
}

@media (orientation: portrait) {
  .panel {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (min-width: 1024px) and (orientation: landscape) {
  .stage {
    grid-template-columns: clamp(360px, 27vw, 430px) minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: clamp(24px, 3vw, 52px);
    width: min(1600px, 100%);
    max-width: 1600px;
  }

  .mast {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin: 0;
  }

  .pages {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
  }

  .index-grid {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 10px;
  }

  .index-item {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .index-item img {
    margin-bottom: 5px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
  }
}

@media (max-width: 720px) {
  .stage {
    padding: 20px 20px 76px;
  }

  .footer-nav {
    padding-left: 14px;
    padding-right: 14px;
  }

  .footer-link {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
  }

  #title .panel,
  #closing .panel {
    padding-bottom: clamp(90px, 18vh, 180px);
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .stage {
    grid-template-columns: minmax(170px, 22vw) minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 12px;
    align-items: stretch;
    padding: 14px 14px 56px;
  }

  .mast {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    align-self: start;
    width: 100%;
    padding: 4px 0 0;
  }

  .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    margin-bottom: 6px;
  }

  h1 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 0.95;
  }

  .pages {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
  }

  .panel {
    padding: 8px;
  }

  .page[id^="scene-"] .panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(140px, 28%);
    align-items: center;
    column-gap: 12px;
  }

  .page[id^="scene-"] .scene-video {
    margin: 0;
  }

  .page[id^="scene-"] .scene-poster,
  .page[id^="scene-"] .scene-loading,
  .page[id^="scene-"] .scene-video video {
    width: min(100%, calc((100vh - 86px) * 1.25));
    width: min(100%, calc((100dvh - 86px) * 1.25));
    max-height: calc(100vh - 86px);
    max-height: calc(100dvh - 86px);
  }

  .page[id^="scene-"] .scene-lyric {
    width: 100%;
    margin: 0;
    padding: 0 0 0 8px;
    min-height: 0;
    text-align: left;
    line-height: 1.15;
  }

  #title .panel,
  #closing .panel {
    padding-bottom: clamp(72px, 20vh, 140px);
  }

  .footer-nav {
    padding-top: 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .footer-link {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
  }
}

#title {
  margin: auto;
}

/* @media (max-width: 900px) {
  .mast {
    flex-direction: column;
    align-items: flex-start;
  }

  .tagline {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .stage {
    padding: 18px;
    height: 100vh;
  }

} */
