:root {
  color-scheme: only light;
  --ink: #10122b;
  --night: #07152c;
  --cream: #fff4dd;
  --coral: #ef8d69;
  --line: rgba(255, 244, 221, 0.48);
  font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--coral);
}

body {
  color: var(--cream);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button,
a { font: inherit; }

button { touch-action: manipulation; }

#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
}

#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

#app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.mast {
  position: absolute;
  z-index: 8;
  top: max(18px, env(safe-area-inset-top));
  left: clamp(18px, 3vw, 46px);
  right: clamp(18px, 3vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.mast p { margin: 0; }

.home {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
  border-bottom: 1px solid currentColor;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 650ms ease, visibility 650ms step-end;
}

.panel.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 650ms ease, visibility 0ms step-start;
}

.intro-copy {
  position: absolute;
  left: clamp(20px, 7vw, 108px);
  bottom: clamp(38px, 8vh, 104px);
  width: min(680px, calc(100vw - 40px));
}

.eyebrow {
  margin: 0 0 15px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 10px;
  font-weight: 700;
}

h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(62px, 10.7vw, 166px);
  font-weight: 560;
  line-height: 0.72;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

h1 span { display: block; }
h1 span:last-child { margin-left: 0.42em; font-weight: 760; }

.premise {
  width: min(470px, 85vw);
  margin: clamp(28px, 5vh, 52px) 0 24px;
  font-size: clamp(15px, 1.5vw, 20px);
  line-height: 1.45;
  letter-spacing: 0.01em;
}

button {
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  min-height: 52px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
  color: var(--night);
  background: var(--cream);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(4, 12, 28, 0.15);
}

button:hover { transform: translateY(-1px); }
button:focus-visible { outline: 3px solid white; outline-offset: 4px; }

.input-note {
  margin: 13px 0 0 5px;
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.75;
}

.chapter {
  position: absolute;
  top: max(72px, calc(env(safe-area-inset-top) + 62px));
  left: clamp(18px, 3vw, 46px);
}

.chapter p {
  margin: 0 0 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.chapter h2 {
  margin: 0;
  font-size: clamp(18px, 2.1vw, 30px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.balance-cue {
  position: absolute;
  top: 19%;
  left: 50%;
  height: 24%;
  width: 34px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: var(--cream);
  filter: drop-shadow(0 0 10px rgba(255,244,221,0.6));
}

.balance-cue span { font-size: 13px; }
.balance-cue .cue-reflection { opacity: 0.22; transform: scaleY(-1); }

.balance-cue i {
  width: 1px;
  flex: 1;
  margin: 4px 0;
  opacity: 0.24;
  background: linear-gradient(to bottom, currentColor, transparent 54%, currentColor);
  transform-origin: top;
}

.instruction {
  position: absolute;
  left: 50%;
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 20px));
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  max-width: calc(100vw - 96px);
  color: var(--cream);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 1px 18px rgba(7,21,44,0.8);
}

.passage-marks {
  position: absolute;
  right: clamp(18px, 3vw, 46px);
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 20px));
  display: flex;
  gap: 5px;
}

.passage-marks i {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,0.28);
}

.passage-marks i.done,
.passage-marks i.active { background: var(--cream); }
.passage-marks i.active { animation: pulse 1.7s ease-in-out infinite; }

.summit-copy,
.ending-copy {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(680px, calc(100vw - 44px));
  transform: translate(-50%, -50%);
  text-align: center;
}

.summit h2,
.ending h2 {
  margin: 0;
  font-size: clamp(48px, 8vw, 118px);
  line-height: 0.88;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.summit-copy > p:not(.eyebrow),
.ending-copy > p:not(.eyebrow) {
  width: min(440px, 90%);
  margin: 28px auto 0;
  font-size: 14px;
  line-height: 1.5;
}

.pour-arrow {
  width: 48px;
  height: 92px;
  margin: 32px auto 0;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  position: relative;
}

.pour-arrow span {
  position: absolute;
  width: 2px;
  height: 34px;
  left: 22px;
  bottom: 11px;
  background: var(--cream);
  animation: pour 1.4s ease-in-out infinite;
}

.pour-arrow span::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -4px;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--cream);
  border-top: 2px solid var(--cream);
  transform: rotate(45deg);
}

.ending-copy { color: var(--night); }
.ending .eyebrow { color: #9f4050; }
.ending h2 { font-size: clamp(42px, 7vw, 96px); }
.ending h2 strong { font-weight: inherit; }
.ending button { margin-top: 28px; background: var(--night); color: var(--cream); }

.edge-note {
  position: absolute;
  z-index: 7;
  left: clamp(18px, 3vw, 46px);
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
  max-width: 42vw;
  font-size: 9px;
  letter-spacing: 0.15em;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.edge-note.show { opacity: 0.75; }

.tilt-indicator {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: max(62px, calc(env(safe-area-inset-bottom) + 52px));
  width: min(220px, 44vw);
  height: 1px;
  background: rgba(255,255,255,0.22);
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 300ms ease;
}

.journey.is-visible ~ .tilt-indicator { opacity: 1; }
.tilt-indicator i {
  display: block;
  position: absolute;
  top: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 0 12px rgba(255,255,255,0.6);
  transform: translateX(-50%);
}

noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #07152c;
  color: #fff4dd;
  padding: 24px;
  text-align: center;
}

@keyframes pour {
  0%, 100% { transform: translateY(30px); opacity: 0; }
  35% { opacity: 1; }
  70% { transform: translateY(-22px); opacity: 1; }
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

@media (max-width: 680px) {
  .mast { font-size: 9px; }
  .intro-copy { bottom: max(34px, calc(env(safe-area-inset-bottom) + 22px)); }
  h1 { font-size: clamp(58px, 20vw, 98px); line-height: 0.76; }
  h1 span:last-child { margin-left: 0.18em; }
  .premise { margin-top: 26px; font-size: 14px; }
  .input-note { max-width: 280px; line-height: 1.4; }
  .chapter { top: max(66px, calc(env(safe-area-inset-top) + 56px)); }
  .balance-cue { top: 17%; height: 21%; }
  .passage-marks { top: max(74px, calc(env(safe-area-inset-top) + 64px)); bottom: auto; }
  .instruction { bottom: max(31px, calc(env(safe-area-inset-bottom) + 21px)); }
  .tilt-indicator { bottom: max(63px, calc(env(safe-area-inset-bottom) + 53px)); width: 130px; }
  .journey .edge-note { display: none; }
  .summit h2 { font-size: clamp(52px, 16vw, 82px); }
  .summit-copy > p:not(.eyebrow) { font-size: 13px; }
}

@media (max-height: 650px) {
  .intro-copy { bottom: 22px; }
  h1 { font-size: clamp(52px, 13vh, 92px); }
  .premise { margin-top: 20px; margin-bottom: 16px; }
  .input-note { display: none; }
  .chapter { top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition-duration: 1ms; }
  .passage-marks i.active,
  .pour-arrow span { animation: none; }
  button:hover { transform: none; }
}
