/*
 * Mobile art direction for Jean's ongoing voyage.
 * This stylesheet is loaded only below 760px; the desktop composition is untouched.
 */

:root {
  --mobile-header: 56px;
  --mobile-gutter: 20px;
}

html {
  scroll-snap-type: y mandatory;
  background: #0b1511;
}

body {
  min-width: 320px;
  background: #0b1511;
  overscroll-behavior-y: none;
}

.site-header,
.site-header[data-active-scene="01"],
.site-header[data-active-scene="04"] {
  height: var(--mobile-header);
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 0 12px 0 16px;
  border: 0;
  background: linear-gradient(180deg, rgba(5, 12, 10, 0.7), rgba(5, 12, 10, 0));
  color: #f6f0e2;
  text-shadow: 0 1px 12px rgba(2, 8, 6, 0.34);
  backdrop-filter: none;
}

.site-mark {
  position: relative;
  z-index: 2;
}

.site-mark > span {
  font-size: 14px;
  letter-spacing: 0.22em;
}

.site-mark small,
.journey-nav__item small,
.journey-nav__line,
.sound-toggle {
  display: none;
}

.agent-nav-button {
  width: 38px;
  min-height: 38px;
  padding: 2px;
  border-color: rgba(246, 240, 226, 0.46);
  background: rgba(11, 21, 17, 0.26);
}

.agent-nav-button img {
  width: 32px;
  height: 32px;
}

.agent-nav-button > span {
  display: none;
}

.journey-nav {
  justify-self: end;
  gap: 1px;
}

.journey-nav__item {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  opacity: 0.58;
}

.journey-nav__item > span {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.journey-nav__item:hover,
.journey-nav__item.is-active {
  border-color: rgba(246, 240, 226, 0.46);
  background: rgba(11, 21, 17, 0.24);
  opacity: 1;
  transform: none;
}

.scene {
  height: 100svh;
  min-height: 680px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.scene-media {
  inset: 0;
}

.scene__image {
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  transform: scale(1.015);
}

.scene-media .scene__video {
  display: none;
}

.scene--opening .scene__image {
  object-position: 69% center;
}

.scene--01 .scene__image {
  object-position: 69% center;
}

.scene--02 .scene__image {
  object-position: 48% center;
}

.scene--03 .scene__image {
  object-position: 58% center;
}

.scene--04 .scene__image {
  object-position: 70% center;
}

.scene__veil--opening,
.scene__veil--01,
.scene__veil--02,
.scene__veil--03,
.scene__veil--04 {
  background:
    linear-gradient(180deg, rgba(4, 10, 8, 0.28) 0%, transparent 24%),
    linear-gradient(0deg, rgba(4, 10, 8, 0.91) 0%, rgba(4, 10, 8, 0.44) 34%, transparent 64%);
}

.scene--01::after,
.scene--04::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgba(39, 24, 14, 0.56), transparent 55%);
  content: "";
  pointer-events: none;
}

.scene-copy {
  top: auto;
  right: var(--mobile-gutter);
  bottom: 76px;
  left: var(--mobile-gutter);
  width: auto;
  color: #f6f0e2;
  text-align: left;
}

.scene-copy--01,
.scene-copy--02,
.scene-copy--04 {
  color: #f6f0e2;
}

.eyebrow {
  margin-bottom: 11px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.scene-copy h1,
.scene-copy h2,
.scene-copy--opening h1,
.scene-copy--01 h2 {
  max-width: 100%;
  font-size: clamp(46px, 13.2vw, 58px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 3px 28px rgba(0, 0, 0, 0.38);
}

.scene-copy--opening h1,
.scene-copy--01 h2,
.scene-copy--02 h1 {
  white-space: nowrap;
}

.scene-copy--03 h2 {
  max-width: 100%;
  font-size: clamp(39px, 10.8vw, 46px);
}

.scene-copy--04 h2 {
  max-width: 10ch;
  font-size: clamp(42px, 11.8vw, 52px);
}

.scene-copy__cn {
  margin-top: 10px;
  font-size: 17px;
  color: rgba(246, 240, 226, 0.88);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.32);
}

.scene-copy__lead {
  display: block;
  max-width: 28em;
  margin: 11px 0 19px;
  color: rgba(246, 240, 226, 0.78);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.65;
  text-wrap: pretty;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.32);
}

.scene-copy .primary-action {
  min-height: 48px;
  margin-top: 0;
  gap: 24px;
  padding: 0 18px;
  border: 1px solid rgba(246, 240, 226, 0.5);
  background: rgba(8, 17, 13, 0.5);
  color: #f6f0e2;
  font-size: 11px;
  letter-spacing: 0.08em;
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.scene-copy .primary-action:active {
  transform: scale(0.98);
}

.scene-copy--opening .primary-action {
  border-color: #f1c861;
  background: #f1c861;
  color: #17314a;
  backdrop-filter: none;
}

.scene-index {
  display: none;
}

.next-scene {
  right: 18px;
  bottom: 16px;
  left: auto;
  width: 42px;
  min-height: 42px;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(246, 240, 226, 0.5);
  border-radius: 50%;
  background: rgba(7, 15, 12, 0.28);
  color: #f6f0e2 !important;
  font-size: 0;
  backdrop-filter: blur(10px);
}

.next-scene span {
  font-size: 15px;
}

.prototype-note {
  display: none;
}

.opening-route,
.fork-route,
.object-hotspot,
.friend-hotspots {
  display: none;
}

/* Chapter 01: mobile bottom sheets */
.life-path-menu {
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  height: min(68svh, 610px);
  justify-content: flex-start;
  gap: 0;
  padding: 32px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: rgba(239, 229, 204, 0.97);
  box-shadow: 0 -24px 70px rgba(19, 15, 10, 0.28);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.life-path-menu::before {
  display: block;
  width: 38px;
  height: 4px;
  flex: 0 0 auto;
  margin: -17px auto 17px;
  border-radius: 99px;
  background: rgba(23, 33, 28, 0.2);
  content: "";
}

.life-path {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  min-height: 78px;
  grid-template-columns: 84px 1fr;
  align-content: center;
  padding: 12px 6px;
  border: 0;
  border-bottom: 1px solid rgba(23, 33, 28, 0.16);
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  backdrop-filter: none;
}

.life-path span {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 8px;
}

.life-path strong {
  font-size: 24px;
}

.life-path small {
  margin-top: 2px;
}

.life-path:hover,
.life-path:focus-visible,
.life-path.is-active {
  padding-left: 12px;
  background: transparent;
  color: var(--rust);
  transform: none;
}

.life-path-menu__back {
  position: static;
  min-height: 48px;
  margin-top: auto;
  color: var(--ink);
  text-align: left;
}

.life-panel {
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: min(82svh, 720px);
  padding: 30px 20px calc(36px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -26px 74px rgba(19, 15, 10, 0.32);
  transform: translateY(104%);
}

.life-panel::before {
  display: block;
  width: 38px;
  height: 4px;
  margin: -15px auto 18px;
  border-radius: 99px;
  background: rgba(23, 33, 28, 0.2);
  content: "";
}

.life-panel__header h3 {
  font-size: 27px;
}

.life-panel__close {
  width: 40px;
  height: 40px;
}

.life-panel__tabs {
  top: -1px;
  margin: 18px 0 24px;
}

.life-view h4 {
  font-size: 40px;
}

.life-facts {
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Chapter 02: dialogue becomes a clear mobile conversation sheet. */
.dialogue-tab {
  top: 27%;
  left: 8%;
  min-height: 44px;
  padding: 0 12px 0 10px;
}

.dialogue-tab.is-at-jean {
  top: 31%;
  left: 38%;
}

.dialogue-tab.is-at-friend-b {
  top: 29%;
  left: 65%;
}

.dialogue-panel {
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  padding: 30px 22px calc(28px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 26px 26px 0 0;
  background: rgba(239, 229, 204, 0.98);
  color: var(--ink);
  box-shadow: 0 -24px 70px rgba(3, 10, 7, 0.34);
  backdrop-filter: blur(18px);
}

.dialogue-panel::before {
  display: block;
  width: 38px;
  height: 4px;
  margin: -15px auto 18px;
  border-radius: 99px;
  background: rgba(23, 33, 28, 0.2);
  content: "";
}

.dialogue-panel__line {
  min-height: 0;
  padding-right: 8px;
  font-size: 19px;
  line-height: 1.6;
}

.dialogue-panel__hint {
  color: rgba(23, 33, 28, 0.55);
}

.travel-book-trigger {
  right: 18px;
  bottom: 18px;
  left: 18px;
  width: auto;
  min-width: 0;
  border-radius: 2px;
}

.scene--02.dialogue-complete .dialogue-panel {
  bottom: 120px;
}

/* Book, bar and atlas are full-screen mobile canvases. */
.book-shell > .close-button {
  top: 12px;
  right: 12px;
}

.book-cover {
  width: calc(100vw - 28px);
  max-height: calc(100svh - 28px);
}

.open-book {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.book-page {
  padding: 30px 20px;
}

.bar-portal {
  grid-template-rows: 50px minmax(0, 1fr);
}

.bar-portal__header {
  padding: 0 14px;
}

.bar-portal__header > span {
  font-size: 11px;
}

.agent-dialog {
  inset: 0;
  width: 100vw;
  height: 100dvh;
  margin: 0;
}

.agent-shell {
  grid-template-rows: calc(62px + env(safe-area-inset-top)) minmax(0, 1fr);
  border: 0;
  border-radius: 0;
}

.agent-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: env(safe-area-inset-top) 10px 0 14px;
}

.agent-header__avatar {
  width: 38px;
  height: 38px;
}

.agent-header__identity h2 {
  font-size: 14px;
}

.agent-header__identity p {
  font-size: 9px;
}

.agent-header__boundary {
  display: none;
}

.agent-close {
  width: 42px;
  height: 42px;
}

.agent-main {
  display: block;
  min-height: 0;
}

.agent-profile {
  display: none;
}

.agent-chat {
  width: 100%;
  height: 100%;
}

.agent-thread {
  padding: 16px 15px 24px;
}

.agent-message {
  gap: 8px;
  margin-bottom: 16px;
}

.agent-message > img {
  width: 34px;
  height: 34px;
}

.agent-message__content {
  max-width: 84%;
}

.agent-bubble {
  padding: 12px 13px;
}

.agent-bubble p {
  font-size: 13px;
  line-height: 1.68;
}

.agent-mobile-questions {
  display: grid;
  gap: 7px;
  margin: 6px 0 22px 42px;
}

.agent-mobile-questions.is-used {
  display: none;
}

.agent-mobile-questions > p {
  margin: 0 0 2px;
  color: rgba(23, 33, 28, 0.46);
  font-size: 10px;
}

.agent-mobile-questions button {
  justify-self: start;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 33, 28, 0.15);
  border-radius: 6px;
  background: rgba(251, 250, 246, 0.68);
  color: var(--ink);
  font-size: 11px;
  text-align: left;
}

.agent-sources {
  gap: 6px;
}

.agent-source {
  min-height: 52px;
}

.agent-composer {
  padding: 11px 12px calc(9px + env(safe-area-inset-bottom));
}

.agent-composer input {
  min-height: 44px;
  font-size: 16px;
}

.agent-composer button {
  min-width: 62px;
  min-height: 44px;
  padding: 0 13px;
}

.place-balloon {
  width: 76px;
  height: 88px;
}

.place-balloon--africa {
  top: 15%;
  left: 7%;
}

.place-balloon--guangzhou {
  top: 20%;
  left: 33%;
}

.place-balloon--beijing {
  top: 27%;
  left: 57%;
}

.place-balloon--dali {
  top: 35%;
  left: 75%;
}

.map-shortcut {
  right: auto;
  bottom: 22px;
  left: var(--mobile-gutter);
  color: #f6f0e2;
}

.map-layer {
  top: var(--mobile-header);
  padding: 22px 16px 0;
  border-radius: 24px 24px 0 0;
}

.atlas {
  height: calc(100% - 76px);
}

.atlas__map {
  min-height: 270px;
}

@media (max-width: 370px) {
  .site-mark {
    display: none;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .journey-nav {
    justify-self: stretch;
    justify-content: space-between;
  }

  .scene-copy h1,
  .scene-copy h2,
  .scene-copy--opening h1,
  .scene-copy--01 h2 {
    font-size: 43px;
  }
}
