:root {
  color-scheme: light;
  --teal: #178ca7;
  --teal-dark: #0d6175;
  --sky: #48bfef;
  --gold: #f4c95d;
  --cream: #fff8e5;
  --page: #fff1c7;
  --green: #6cc06d;
  --pink: #f48fb1;
  --ink: #3a2a1d;
  --white: #ffffff;
  --header-height: 72px;
  --dock-height: 88px;
  font-family:
    "Hiragino Maru Gothic ProN",
    "Hiragino Sans",
    "Yu Gothic",
    Meiryo,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--cream);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid var(--white);
  outline-offset: 4px;
  box-shadow: 0 0 0 7px var(--teal-dark);
}

.home-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: var(--sky);
}

.home-shell[data-launch-mode="coming-soon"] {
  --dock-height: 18px;
}

.scene-background,
.scene-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-background {
  z-index: -3;
  object-fit: cover;
  object-position: center;
}

.scene-shade {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(0deg, rgba(20, 94, 85, 0.18), transparent 24%);
  pointer-events: none;
}

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  min-height: var(--header-height);
  padding: 10px clamp(18px, 4vw, 52px);
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 900;
  text-decoration: none;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.92),
    0 0 14px rgba(255, 255, 255, 0.74);
  pointer-events: auto;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--teal-dark);
  background: var(--gold);
  border: 2px solid rgba(58, 42, 29, 0.58);
  border-radius: 50%;
  box-shadow: 0 3px 0 rgba(58, 42, 29, 0.2);
}

.home-main,
.closed-stage,
.open-browser {
  position: absolute;
  inset: 0;
}

.closed-stage {
  z-index: 5;
  transition:
    opacity 240ms ease,
    transform 300ms ease;
}

.home-title {
  position: absolute;
  z-index: 9;
  top: clamp(76px, 10vh, 100px);
  left: 50%;
  width: min(94vw, 720px);
  transform: translateX(-50%);
  text-align: center;
  text-wrap: balance;
}

.home-title h1 {
  margin: 0;
  color: var(--teal-dark);
  font-size: clamp(36px, 5.6vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 var(--white),
    0 0 20px rgba(255, 255, 255, 0.9);
}

.home-title p {
  margin: 8px 0 0;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 900;
  line-height: 1.5;
  text-shadow:
    0 2px 0 var(--white),
    0 0 14px rgba(255, 255, 255, 0.96);
}

.children,
.foreground-accent {
  position: absolute;
  z-index: 6;
  display: block;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.children-left {
  bottom: calc(var(--dock-height) - 4px);
  left: clamp(-28px, -1vw, 0px);
  width: clamp(220px, 24vw, 340px);
}

.child-right {
  right: clamp(0px, 2vw, 28px);
  bottom: calc(var(--dock-height) - 5px);
  width: clamp(155px, 18vw, 260px);
}

.foreground-accent {
  z-index: 7;
  right: -5vw;
  bottom: calc(var(--dock-height) - 10px);
  width: clamp(250px, 28vw, 430px);
  opacity: 0.86;
}

.bible-focus {
  position: absolute;
  z-index: 10;
  top: clamp(190px, 27vh, 260px);
  left: 50%;
  display: grid;
  width: clamp(300px, 39vw, 560px);
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  transform: translateX(-50%);
  transition: transform 180ms ease;
}

.bible-focus:hover {
  transform: translateX(-50%) translateY(-7px) rotate(-1deg);
}

.bible-focus:active {
  transform: translateX(-50%) translateY(-1px) scale(0.985);
}

.bible-focus img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 13px rgba(58, 42, 29, 0.28));
}

.open-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  margin-top: -2px;
  padding: 9px 20px;
  color: var(--white);
  background: var(--teal-dark);
  border: 3px solid var(--cream);
  border-radius: 8px;
  box-shadow: 0 5px 0 rgba(58, 42, 29, 0.28);
  font-size: clamp(16px, 1.7vw, 21px);
  font-weight: 900;
  line-height: 1;
}

.open-label-icon {
  width: 23px;
  height: 23px;
  background: currentColor;
  mask: url("../assets/site/navigation/stories.svg") center / contain no-repeat;
}

.open-browser {
  z-index: 20;
  display: grid;
  padding: calc(var(--header-height) + 10px) 22px calc(var(--dock-height) + 12px);
  place-items: center;
  overflow: auto;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition:
    opacity 220ms ease,
    transform 260ms ease;
}

.book-shell {
  position: relative;
  width: min(
    1120px,
    94vw,
    calc((100svh - var(--header-height) - var(--dock-height) - 28px) * 1.85)
  );
  aspect-ratio: 1706 / 922;
}

.open-book {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 24px 18px rgba(58, 42, 29, 0.28));
  pointer-events: none;
  user-select: none;
}

.book-content {
  position: absolute;
  inset: 10.5% 13% 15.5%;
}

.book-view {
  display: none;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.home-shell[data-view="games"] [data-book-view="games"],
.home-shell[data-view="comingsoon"] [data-book-view="comingsoon"],
.home-shell[data-view="stories"] [data-book-view="stories"],
.home-shell[data-view="jesus"] [data-book-view="jesus"],
.home-shell[data-view="grownups"] [data-book-view="grownups"] {
  display: grid;
}

.game-spread {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5.5vw, 76px);
}

.book-spread-layout {
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5.5vw, 76px);
  align-items: stretch;
}

.book-spread-page {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-direction: column;
  justify-content: center;
}

.book-spread-page--left {
  padding: 2% 0 2% 5%;
}

.book-spread-page--right {
  padding: 2% 5% 2% 0;
}

.book-spread-page--art {
  align-items: center;
}

.book-spread-page--copy {
  align-items: flex-start;
}

.book-spread-page > * {
  max-width: 100%;
}

.book-spread-page :where(h1, h2, p) {
  overflow-wrap: anywhere;
}

.book-page {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(4px, 1vw, 14px);
}

.page-kicker {
  margin: 0 0 2px;
  color: var(--teal-dark);
  font-size: clamp(11px, 1.1vw, 15px);
  font-weight: 900;
}

.book-page h2,
.spread-copy h2,
.coming-soon-text-page h2,
.spread-message h2,
.grownups-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(19px, 2.2vw, 32px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.game-thumbnail {
  display: block;
  width: 100%;
  margin: clamp(7px, 1vw, 13px) 0;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 3px solid rgba(58, 42, 29, 0.48);
  border-radius: 6px;
  box-shadow: 0 5px 0 rgba(58, 42, 29, 0.16);
}

.page-copy {
  margin: 8px 0 0;
  font-size: clamp(12px, 1.25vw, 17px);
  font-weight: 700;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 10px;
  padding: 7px 18px;
  color: var(--white);
  background: var(--teal-dark);
  border-radius: 7px;
  box-shadow: 0 4px 0 rgba(58, 42, 29, 0.24);
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: 900;
  text-decoration: none;
}

.primary-action span {
  font-size: 1.4em;
  line-height: 0.7;
}

.future-page {
  align-items: center;
  text-align: center;
}

.future-art {
  display: block;
  width: min(55%, 220px);
  height: auto;
  margin: 4px auto 0;
}

.story-spread,
.coming-soon-spread,
.jesus-spread,
.grownups-spread {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 0 5%;
}

.spread-copy {
  display: grid;
  width: min(760px, 90%);
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.3fr);
  gap: clamp(22px, 5vw, 64px);
  align-items: center;
}

.coming-soon-copy {
  display: grid;
}

.coming-soon-text-page {
  min-width: 0;
}

.coming-soon-text-page h2 {
  overflow-wrap: normal;
  word-break: keep-all;
}

.heading-phrase {
  display: inline-block;
}

.keep-phrase {
  display: inline-block;
}

.coming-soon-signoff {
  margin: 14px 0 0;
  color: var(--teal-dark);
  font-size: clamp(14px, 1.4vw, 19px);
  font-weight: 900;
  line-height: 1.7;
}

.spread-art {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.spread-message {
  width: min(760px, 88%);
  text-align: center;
}

.message-cross {
  position: relative;
  display: block;
  width: 52px;
  height: 70px;
  margin: 0 auto 14px;
}

.message-cross::before,
.message-cross::after {
  position: absolute;
  content: "";
  background: var(--gold);
  border: 2px solid rgba(58, 42, 29, 0.5);
  border-radius: 4px;
  box-shadow: 0 3px 0 rgba(58, 42, 29, 0.15);
}

.message-cross::before {
  top: 0;
  left: 19px;
  width: 14px;
  height: 68px;
}

.message-cross::after {
  top: 19px;
  left: 0;
  width: 50px;
  height: 14px;
}

.grownups-spread {
  align-content: center;
  gap: 12px;
}

.grownups-note {
  padding: 7px 13px;
  color: var(--teal-dark);
  background: rgba(23, 140, 167, 0.1);
  border: 1px solid rgba(23, 140, 167, 0.32);
  border-radius: 6px;
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 900;
  text-align: center;
}

.grownups-copy {
  width: min(760px, 88%);
}

.grownups-copy p:not(.page-kicker) {
  margin: 9px 0 0;
  font-size: clamp(12px, 1.15vw, 16px);
  font-weight: 600;
  line-height: 1.65;
}

.close-browser {
  position: fixed;
  z-index: 50;
  top: 14px;
  right: clamp(16px, 3vw, 42px);
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  color: var(--white);
  background: var(--teal-dark);
  border: 3px solid var(--cream);
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(58, 42, 29, 0.24);
  cursor: pointer;
}

.close-browser span {
  font-size: 34px;
  font-weight: 500;
  line-height: 0.8;
  transform: translateY(-1px);
}

.home-shell[data-state="open"] .closed-stage {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
}

.home-shell[data-state="open"] .open-browser {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.navigation-dock {
  position: absolute;
  z-index: 60;
  right: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  width: min(720px, calc(100% - 28px));
  min-height: 70px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: rgba(255, 248, 229, 0.94);
  border: 2px solid rgba(58, 42, 29, 0.34);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(58, 42, 29, 0.24);
  transform: translateX(50%);
  backdrop-filter: blur(14px);
}

.home-shell[data-launch-mode="coming-soon"] .navigation-dock {
  display: none;
}

.nav-choice {
  display: flex;
  min-width: 0;
  min-height: 56px;
  padding: 5px 7px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: clamp(11px, 1.2vw, 15px);
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-choice:hover {
  background: rgba(23, 140, 167, 0.11);
}

.nav-choice.is-active {
  color: var(--white);
  background: var(--teal-dark);
  box-shadow: 0 3px 0 rgba(58, 42, 29, 0.2);
}

.nav-icon {
  display: block;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.icon-play {
  mask-image: url("../assets/site/navigation/play.svg");
}

.icon-stories {
  mask-image: url("../assets/site/navigation/stories.svg");
}

.icon-jesus {
  mask-image: url("../assets/site/navigation/jesus.svg");
}

.icon-grownups {
  mask-image: url("../assets/site/navigation/parents-teachers.svg");
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.no-script {
  padding: 18px;
  color: var(--white);
  background: var(--teal-dark);
  font-weight: 800;
  text-align: center;
}

@media (max-width: 720px) {
  :root {
    --header-height: 62px;
    --dock-height: 82px;
  }

  .site-header {
    min-height: var(--header-height);
    padding: 8px 14px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .home-title {
    top: 72px;
  }

  .home-title p {
    margin-top: 5px;
  }

  .bible-focus {
    top: clamp(190px, 25vh, 225px);
    width: min(78vw, 380px);
  }

  .open-label {
    min-height: 42px;
    padding: 7px 14px;
  }

  .children-left {
    bottom: calc(var(--dock-height) - 4px);
    left: -36px;
    width: min(47vw, 220px);
  }

  .child-right {
    right: -19px;
    bottom: calc(var(--dock-height) - 2px);
    width: min(36vw, 168px);
  }

  .foreground-accent {
    right: -18vw;
    bottom: calc(var(--dock-height) - 9px);
    width: min(62vw, 300px);
    opacity: 0.7;
  }

  .navigation-dock {
    bottom: max(7px, env(safe-area-inset-bottom));
    width: calc(100% - 14px);
    min-height: 68px;
    gap: 2px;
    padding: 4px;
  }

  .nav-choice {
    min-height: 58px;
    padding: 4px 2px;
    font-size: clamp(9px, 2.75vw, 12px);
    white-space: normal;
  }

  .nav-icon {
    width: 23px;
    height: 23px;
    flex-basis: 23px;
  }

  .open-browser {
    display: block;
    padding: calc(var(--header-height) + 12px) 10px calc(var(--dock-height) + 13px);
  }

  .book-shell {
    width: 100%;
    min-height: calc(100svh - var(--header-height) - var(--dock-height) - 25px);
    aspect-ratio: auto;
    padding-top: calc(54.05% + 8px);
  }

  .open-book {
    inset: 0 0 auto;
    width: 100%;
    height: auto;
  }

  .book-content {
    position: relative;
    inset: auto;
    min-height: 420px;
    margin: 0 auto;
    padding: 24px 18px 28px;
    background: rgba(255, 248, 229, 0.97);
    border: 2px solid rgba(58, 42, 29, 0.35);
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(58, 42, 29, 0.23);
  }

  .game-spread {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .book-page {
    padding: 0;
  }

  .book-page + .book-page {
    padding-top: 24px;
    border-top: 1px solid rgba(58, 42, 29, 0.22);
  }

  .book-page h2,
  .spread-copy h2,
  .coming-soon-text-page h2,
  .spread-message h2,
  .grownups-copy h2 {
    font-size: clamp(24px, 7vw, 32px);
  }

  .page-kicker {
    font-size: 13px;
  }

  .page-copy,
  .grownups-copy p:not(.page-kicker) {
    font-size: 15px;
  }

  .game-thumbnail {
    max-width: 520px;
  }

  .future-art {
    width: min(54vw, 210px);
  }

  .story-spread,
  .coming-soon-spread,
  .jesus-spread,
  .grownups-spread {
    padding: 0;
  }

  .spread-copy {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .coming-soon-copy {
    width: 100%;
    height: auto;
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .book-spread-page {
    align-items: center;
  }

  .book-spread-page--left,
  .book-spread-page--right {
    padding: 0;
  }

  .coming-soon-signoff {
    font-size: 16px;
  }

  .spread-art {
    width: min(48vw, 190px);
    margin: 0 auto;
  }

  .spread-message,
  .grownups-copy {
    width: 100%;
  }

  .close-browser {
    top: 9px;
    right: 10px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 380px), (max-width: 720px) and (max-height: 640px) {
  .open-browser {
    padding: calc(var(--header-height) + 8px) 8px 12px;
  }

  .book-shell {
    min-height: 0;
    padding-top: calc(54.05% + 4px);
  }

  .book-content {
    min-height: 0;
    padding: 18px 14px 20px;
  }

  .coming-soon-copy {
    gap: 8px;
  }

  .coming-soon-art-page {
    display: none;
  }

  .coming-soon-text-page h2 {
    font-size: clamp(22px, 7vw, 25px);
    line-height: 1.3;
  }

  .coming-soon-text-page .page-kicker {
    font-size: 12px;
  }

  .coming-soon-text-page .page-copy {
    font-size: 14px;
    line-height: 1.6;
  }

  .coming-soon-signoff {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.6;
  }
}

@media (max-width: 720px) {
  .home-shell[data-launch-mode="coming-soon"] .open-browser {
    display: grid;
    padding: calc(var(--header-height) + 8px) 8px 12px;
    place-items: center;
    overflow-x: hidden;
  }

  .home-shell[data-launch-mode="coming-soon"] .book-shell {
    width: min(calc(100% - 8px), 660px);
    height: auto;
    min-height: 0;
    margin: 0 auto;
    padding-top: 0;
    aspect-ratio: 1706 / 922;
  }

  .home-shell[data-launch-mode="coming-soon"] .open-book {
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    transform: none;
  }

  .home-shell[data-launch-mode="coming-soon"] .book-content {
    position: absolute;
    inset: 10.5% 13% 15.5%;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    transform: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .home-shell[data-launch-mode="coming-soon"] .coming-soon-copy {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 5.5vw, 40px);
    align-items: stretch;
  }

  .home-shell[data-launch-mode="coming-soon"] .coming-soon-art-page {
    display: flex;
  }

  .home-shell[data-launch-mode="coming-soon"] .book-spread-page--right {
    height: 100%;
    padding: 0 clamp(4px, 1.6vw, 10px) 0 0;
    justify-content: center;
  }

  .home-shell[data-launch-mode="coming-soon"] .coming-soon-art-page .spread-art {
    width: min(82%, 140px);
    margin: 0 auto;
  }

  .home-shell[data-launch-mode="coming-soon"] .coming-soon-text-page .page-kicker {
    font-size: clamp(8px, 2.4vw, 13px);
    line-height: 1.3;
  }

  .home-shell[data-launch-mode="coming-soon"] .kicker-phrase {
    display: block;
  }

  .home-shell[data-launch-mode="coming-soon"] .coming-soon-text-page h2 {
    font-size: clamp(14px, 4vw, 24px);
    line-height: 1.25;
  }

  .home-shell[data-launch-mode="coming-soon"] .heading-phrase {
    display: block;
  }

  .home-shell[data-launch-mode="coming-soon"] .coming-soon-text-page .page-copy,
  .home-shell[data-launch-mode="coming-soon"] .mobile-optional {
    display: none;
  }

  .home-shell[data-launch-mode="coming-soon"] .coming-soon-signoff {
    margin-top: 5px;
    font-size: clamp(11px, 2.8vw, 16px);
    line-height: 1.45;
  }

  .home-shell[data-launch-mode="coming-soon"] .signoff-phrase {
    display: block;
  }
}

@media (max-height: 700px) and (min-width: 721px) {
  .home-title {
    top: 66px;
  }

  .home-title h1 {
    font-size: 44px;
  }

  .home-title p {
    margin-top: 3px;
    font-size: 16px;
  }

  .bible-focus {
    top: 135px;
    width: min(38vw, 430px);
  }

  .children-left {
    width: min(21vw, 270px);
  }

  .child-right {
    width: min(16vw, 205px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
