body.opening > header,
body.opening > main,
body.opening > footer {
  visibility: hidden;
}
details.lineage-preview-info {
  max-width: min(430px, calc(100% - 44px));
  padding: 9px 13px;
}
details.lineage-preview-info summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
details.lineage-preview-info summary::-webkit-details-marker {
  display: none;
}
details.lineage-preview-info summary strong {
  font-size: 14px;
}
.lineage-expand-hint {
  font-size: 11px;
  color: #c8b17c;
  white-space: nowrap;
}
.lineage-expand-hint:after {
  content: ' ▾';
}
details[open] .lineage-expand-hint:after {
  content: ' ▴';
}
details.lineage-preview-info[open] {
  padding-bottom: 12px;
}
details.lineage-preview-info summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
}
/* Weather is drawn on a canvas (weather.js) that replaces the placeholder layer. */
#stage .weather-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
#realm-ambience {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.journey:before {
  z-index: 1;
}
.journey-card {
  z-index: 2;
}
#intro-film {
  z-index: 3;
}
.journey .skip {
  z-index: 4;
}
.journey .ambience-toggle {
  position: absolute;
  right: 16px;
  top: 12px;
  z-index: 4;
  padding: 7px 12px;
  font-size: 12px;
  background: #101719bb;
}
.lineage-preview-info {
  position: absolute;
  top: 18px;
  left: 22px;
  z-index: 6;
  max-width: min(500px, calc(100% - 44px));
  padding: 13px 17px;
  background: #101719da;
  border: 1px solid #71664b99;
  border-radius: 4px;
  text-shadow: 0 1px 3px #000;
}
.lineage-preview-info[hidden] {
  display: none;
}
.lineage-preview-info strong {
  font-family: Cinzel, Georgia, serif;
  color: #dfc897;
  font-size: 17px;
}
.lineage-preview-info p {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}
.lineage-preview-info button {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid #a68d5b;
}
.lineage-preview-info button:hover {
  background: #a68d5b22;
}
@media (max-width: 650px) {
  .lineage-preview-info {
    top: 8px;
    left: 10px;
    max-width: calc(100% - 20px);
    padding: 8px 11px;
  }
  .lineage-preview-info strong {
    font-size: 14px;
  }
  .lineage-preview-info p {
    font-size: 12px;
    margin: 5px 0;
  }
}
.journey {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: auto;
  background: #0b1012 url('assets/intro/smoke.png') center/cover;
  color: #e7dfd0;
  display: grid;
  place-items: center;
  padding: 30px;
}
.journey[hidden] {
  display: none;
}
.journey:before {
  content: '';
  position: absolute;
  inset: 0;
  background: #05080b70;
  pointer-events: none;
}
.journey-card {
  position: relative;
  width: min(760px, 100%);
  text-align: center;
  padding: 30px 20px;
}
.journey .eyebrow {
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #c8b17c;
}
.journey h1 {
  font-weight: normal;
  font-size: clamp(38px, 6vw, 78px);
  font-family: Cinzel, Georgia, serif;
  letter-spacing: 0.08em;
  margin: 20px 0;
}
.journey h2 {
  font-size: clamp(27px, 4vw, 48px);
  margin-bottom: 25px;
}
.journey p {
  line-height: 1.85;
  font-size: 17px;
}
.journey .notice {
  font-size: 13px;
  color: #b8b6ae;
  max-width: 590px;
  margin: 25px auto;
}
.journey button,
.journey a {
  border: 1px solid #8b7954;
  margin: 8px;
  padding: 12px 24px;
}
.journey label {
  display: block;
  margin: 18px;
}
.journey video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #070b0d;
}
.journey .skip {
  position: absolute;
  z-index: 2;
  bottom: 25px;
  right: 25px;
  background: #0b1012cc;
}
.journey [hidden] {
  display: none !important;
}
#account-dialog,
#cloud-dialog {
  width: min(600px, 94vw);
  max-height: 90vh;
  overflow: auto;
}
#account-dialog label {
  display: block;
  margin: 16px 0;
}
#account-dialog input {
  display: block;
  width: 100%;
  padding: 10px;
  background: #162023;
  border: 1px solid #6d6046;
  color: var(--text);
  margin-top: 6px;
}
#account-error,
#cloud-status {
  line-height: 1.6;
  color: #dec994;
  white-space: pre-line;
}
.cloud-row {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #71664b;
  padding: 14px 0;
}
.cloud-row span {
  flex: 1;
}
.cloud-row small {
  display: block;
  color: var(--muted);
}
.cloud-row button {
  border: 1px solid #71664b;
}
.identity #account-button {
  font-size: 11px;
  padding: 4px 8px;
  margin-top: 5px;
  border: 1px solid #71664b;
}
.environment-drawer {
  position: absolute;
  z-index: 5;
  bottom: 65px;
  left: 15px;
  width: min(400px, 90%);
  padding: 18px;
  background: #101719f5;
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px #0008;
}
.environment-drawer[hidden] {
  display: none;
}
.environment-drawer select {
  border: 1px solid #71664b;
  width: 100%;
  padding: 8px;
  margin: 7px 0 12px;
}
.environment-drawer label {
  display: block;
  font-size: 13px;
}
.environment-drawer p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
#stage[data-landscape] {
  background-image: linear-gradient(#10171912, #10171925), var(--landscape);
  background-size: cover;
  background-position: center;
}
#stage[data-landscape] .scenery,
#stage[data-landscape] .floor {
  display: none;
}
#stage[data-time='evening']:after {
  content: '';
  position: absolute;
  inset: 0;
  background: #091a4550;
  pointer-events: none;
  z-index: 0;
}
#stage[data-time='sunset']:after {
  content: '';
  position: absolute;
  inset: 0;
  background: #c46b2b25;
  pointer-events: none;
  z-index: 0;
}
#reveal-dialog {
  width: min(1100px, 96vw);
  height: min(760px, 90vh);
  padding: 0;
  overflow: hidden;
  background: #122021;
}
#reveal-scene {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
}
#reveal-scene:after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(#0a111333, transparent, #0a1113e6);
  pointer-events: none;
}
#reveal-image {
  width: 85%;
  height: 85%;
  object-fit: contain;
  animation: bondEntrance 5s ease-in-out both;
  filter: drop-shadow(0 15px 14px #0005);
}
#reveal-dialog .reveal-copy {
  position: absolute;
  z-index: 2;
  bottom: 25px;
  left: 25px;
  right: 25px;
  text-align: center;
}
#reveal-dialog .close {
  position: absolute;
  z-index: 3;
  right: 15px;
  top: 15px;
  background: #0c141bcc;
}
#reveal-dialog h2 {
  font-size: 34px;
}
#reveal-dialog p {
  color: #d0c7b6;
}
#reveal-dialog button {
  border: 1px solid #a89160;
  background: #0c151dcc;
}
@keyframes bondEntrance {
  0% {
    opacity: 0;
    transform: translateX(-18%) translateY(10px) scale(0.88);
  }
  20% {
    opacity: 1;
    transform: translateX(-5%) translateY(-12px) rotate(-2deg) scale(0.96);
  }
  35% {
    transform: translateX(-2%) translateY(4px) rotate(1deg);
  }
  50% {
    transform: translateY(-9px) rotate(-1deg);
  }
  70% {
    transform: translateY(2px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #reveal-image {
    animation: none;
  }
  .journey video {
    display: none;
  }
}
@media (max-width: 900px) {
  header {
    padding: 10px;
    gap: 8px;
  }
  .brand {
    font-size: 18px;
    letter-spacing: 2px;
  }
  nav button {
    padding: 10px 6px;
    font-size: 12px;
  }
  .identity {
    min-width: 80px;
  }
  .preview-tools {
    flex-wrap: wrap;
  }
  .journey-card {
    padding: 12px;
  }
  .journey h1 {
    font-size: 36px;
  }
}
@media (max-width: 650px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  header {
    height: auto;
    flex-wrap: wrap;
  }
  nav {
    order: 3;
    flex-basis: 100%;
    overflow: auto;
    justify-content: flex-start;
  }
  main {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  #stage {
    height: 55vh;
    min-height: 420px;
  }
  aside {
    margin-bottom: 10px;
    max-height: none;
  }
  footer {
    position: sticky;
    bottom: 0;
    flex-wrap: wrap;
    height: auto;
    padding: 8px;
    gap: 3px;
  }
  .stats {
    display: none;
  }
  .preview-tools {
    font-size: 11px;
  }
  .preview-tools button {
    padding: 5px;
  }
  .preview-tools #zoom {
    width: 60px;
  }
}

@media (max-width: 650px) {
  .preview-tools {
    height: auto;
    min-height: 85px;
    padding: 8px 4px;
    background: #101719;
  }
  footer {
    background: #101719;
  }
  #stage {
    min-height: 460px;
  }
  .preview-label {
    bottom: 105px;
  }
}
@keyframes bondEntrance {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
#reveal-image {
  animation: bondEntrance 0.7s ease-out both;
}
#skip-intro {
  z-index: 5;
}
#intro-film {
  pointer-events: none;
}

/* Proof-of-concept note: a longer letter, so a wider card that scrolls within the window. */
.journey-card.poc-note {
  max-width: min(760px, 92vw);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  text-align: left;
  box-sizing: border-box;
}
.journey-card.poc-note h2,
.journey-card.poc-note .eyebrow {
  text-align: center;
}
.journey-card.poc-note p {
  line-height: 1.65;
  margin: 0 0 0.9em;
}
.journey-card.poc-note #poc-continue {
  display: block;
  margin: 18px auto 0;
}

/* Path choice: two illustrated cards after the proof-of-concept note. */
.journey-card.path-choice {
  width: min(1180px, 96vw);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-sizing: border-box;
}
.path-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  text-align: left;
}
.path-card {
  display: flex;
  flex-direction: column;
  background: #0d1214d9;
  border: 1px solid #8b7954;
  box-shadow:
    0 0 0 4px #0b1012,
    0 0 0 5px #8b795455,
    0 18px 40px #000b;
  overflow: hidden;
}
.path-art {
  height: clamp(170px, 30dvh, 300px);
  overflow: hidden;
  border-bottom: 1px solid #8b7954;
}
.path-art img {
  width: 100%;
  height: 100%;
  display: block;
}
.path-art-story img {
  object-fit: cover;
  object-position: 50% 6%;
}
.path-art-faravar {
  background:
    linear-gradient(#0b101255, #0b1012aa),
    url('assets/environments/stable.webp') center 60% / cover;
}
.path-art-faravar img {
  object-fit: contain;
  padding: 12px 18px 0;
  box-sizing: border-box;
  filter: drop-shadow(0 10px 14px #000c);
}
.path-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 22px 20px;
}
.path-copy h3 {
  margin: 0 0 8px;
  font:
    600 clamp(20px, 2vw, 26px) Cinzel,
    Alegreya,
    Georgia,
    serif;
  color: #e9d9b0;
  letter-spacing: 0.04em;
}
.journey .path-copy p {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 10px;
}
.journey .path-copy .path-character {
  font-style: italic;
  color: #d8c48f;
}
.path-copy button {
  margin: auto 0 0;
  align-self: flex-start;
}
@media (max-width: 760px) {
  .path-cards {
    grid-template-columns: 1fr;
  }
  .path-art {
    height: 180px;
  }
}
