:root {
  --ink: #101214;
  --ink-soft: #3c4146;
  --slate: #6e7780;
  --gold: #a8842f;
  --gold-hi: #c9a44a;
  --white: #ffffff;
  /* the one glass every control wears; deepens on touch. The hairline edge
     is what makes glass read as an object against the night */
  --glass: rgba(22, 27, 40, .7);
  --glass-deep: rgba(32, 39, 56, .84);
  --glass-edge: inset 0 0 0 0 rgba(0, 0, 0, 0);  /* hairline retired */
  --glass-blur: 6px;
  /* the ink every control writes with */
  --chrome-ink: rgba(255, 255, 255, .94);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

button {
  font-family: inherit
}

html,
body {
  height: 100%
}

body {
  background: linear-gradient(180deg, #b9cddd 0%, #d6e2eb 55%, #e6edf2 100%);
  color: var(--ink);
  font-family: 'Cormorant', serif;
  font-size: 19px;
  line-height: 1.55;
  overflow: hidden;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0
}

#glf {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 6;
  pointer-events: none;
  transition: opacity 1.4s ease
}

.ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  /* the mobile map bleeds to the viewport edges; never let that become a
     horizontal scroll */
  overflow-x: hidden
}

.mono {
  font-family: 'Onest', sans-serif;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 10.5px;
  color: var(--slate)
}

.display {
  font-family: 'Cormorant', serif;
  font-weight: 500
}

/* ── the hud: the viewport is a card ──
   a hairline gold frame with the card's corner sparks; it draws itself once
   when the loader hands over, then holds still forever */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

.hudBrand {
  position: absolute;
  color: var(--gold);
  opacity: 0;
  transition: opacity .8s ease .15s;
}

/* the wordmark: a mask filled with currentColor, so it wears the chrome's
   metal — gold by day, white by night */
.hudBrand {
  top: 34px;
  left: 34px;
  width: 88px;
  height: 63px;
  background: currentColor;
  -webkit-mask: url("../svgs/logo-oracle.svg") center / contain no-repeat;
  mask: url("../svgs/logo-oracle.svg") center / contain no-repeat;
}

.hud.on .hudBrand {
  opacity: .9
}




.stage {
  width: 100%;
  max-width: 1000px;
  min-width: 0;
  text-align: center;
  will-change: transform, filter, opacity
}

/* enter = approaching from the distance: starts small, hazy, slightly toward
   the horizon, and grows to full size as the cloud rush decelerates.
   leave = flying past the camera: scales beyond the viewport and blurs out. */
.stage.enter {
  animation: morphIn 1.35s cubic-bezier(.16, .84, .3, 1) both
}

.stage.leave {
  animation: morphOut .5s cubic-bezier(.55, 0, .85, .35) both
}

@keyframes morphIn {
  0% {
    opacity: 0;
    transform: scale(.45) translateY(-26px);
    filter: blur(10px)
  }

  55% {
    opacity: 1
  }

  100% {
    opacity: 1;
    transform: none;
    filter: blur(0)
  }
}

@keyframes morphOut {
  0% {
    opacity: 1;
    transform: none;
    filter: blur(0)
  }

  55% {
    opacity: .18
  }

  100% {
    opacity: 0;
    transform: scale(1.35);
    filter: blur(14px)
  }
}

/* ════════ LOADER ════════
   covers everything until fonts and assets are ready; a lone star breathes */
#loader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: opacity .9s ease, visibility .9s;
}

#loader.done {
  opacity: 0;
  visibility: hidden
}

/* ── intro: the oracle riffles its deck ──
   all motion (deal-in, hand-rhythm flips, the wind-up exit) is driven from
   initIntroDeck in JS so the silhouette can swap exactly edge-on */
.introWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.introCardSVG {
  width: 62px;
  height: 116px;
  fill: var(--ink);
  overflow: visible;
  opacity: 0;
  will-change: transform, opacity;
}



html[data-theme="dark"] #loader {
  background: transparent;
}

/* ════════ TEMPLE ════════
   two silhouette halves anchored to the screen edges; entering the gate
   sweeps them past the camera on either side */
.temple {
  display: none !important;
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  /* center the two halves with a fixed gap between their inner edges;
     at narrow screens the outer tiers naturally bleed off-screen */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(80px, 22vw, 280px)
}

.templeHalf {
  position: relative;
  flex: none;
  /* height drives everything — width follows the SVG's intrinsic ratio */
  height: 72svh;
  width: calc(72svh * 929 / 1939);
  margin-bottom: -6vh;
  perspective: 700px;
  transform-origin: bottom center;
  transition: translate 1.25s cubic-bezier(.22, .7, .25, 1), scale 1.25s cubic-bezier(.22, .7, .25, 1),
    opacity 1s ease, filter 1.1s ease;
}

.templeHalf.r {
  transform: scaleX(-1)
}

/* fake depth: two copies of the silhouette; the back one is lighter, softer,
   and parallaxes slower — the rate difference reads as distance. A slight
   inward rotateY makes the towers stand like walls instead of cutouts. */
.tLayer {
  position: absolute;
  inset: 0;
  display: block;
  /* mask sized to full HEIGHT (auto width) and anchored to the inner edge, so
     when the box is narrower than the silhouette the tall central wall is kept
     full-height and only the outer tiers are clipped off the screen edge */
  -webkit-mask: url("../svgs/temple/temple_left.svg") right bottom / auto 100% no-repeat;
  mask: url("../svgs/temple/temple_left.svg") right bottom / auto 100% no-repeat;
  transform-origin: bottom center;
}

/* volume: the side wall is a stack of thin slices at 1.5px steps, so the
   extrusion is continuous and attached to the face — no separated edges.
   Each slice parallaxes a touch slower than the face, so the thickness
   shifts like a solid when the mouse moves. --dir mirrors the right half. */
.templeHalf {
  --dir: 1
}

.templeHalf.r {
  --dir: -1
}

.tLayer.front {
  background: linear-gradient(102deg, #c8d1da 0%, #d0d8e0 100%);
  translate: calc(var(--mx, 0)*var(--dir, 1)*16px) calc(var(--my, 0)*-5px);
  rotate: y calc(-9deg + var(--mx, 0)*5deg);
  filter: drop-shadow(-16px 7px 18px rgba(78, 98, 118, .14));
}

.tLayer.front::after {
  /* weathered stone: fine grain + mottled patches,
  both clipped by the silhouette mask */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .24 0 0 0 0 .27 0 0 0 0 .31 0 0 0 .42 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23s)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.028' numOctaves='4'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .33 0 0 0 0 .37 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='420' height='420' filter='url(%23w)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: .32;
}

.tLayer.side {
  background: linear-gradient(102deg, #aeb9c5 0%, #b6c1cc 100%);
  translate: calc(var(--off, 0)*1px + var(--mx, 0)*var(--dir, 1)*var(--rate, 12)*1px) calc(var(--my, 0)*-4px);
  rotate: y calc(-9deg + var(--mx, 0)*5deg);
}

.temple.passing .templeHalf.l {
  translate: -58vw 14vh;
  scale: 2.3;
  opacity: 0;
  filter: blur(9px)
}

.temple.passing .templeHalf.r {
  translate: 58vw 14vh;
  scale: 2.3;
  opacity: 0;
  filter: blur(9px)
}

/* sunk in the mist — the gate is absent through the sky-only threshold and the
   map, then rises from here when you leave the outer world */
.temple.mist .templeHalf {
  translate: 0 24vh;
  scale: .82;
  opacity: 0;
  filter: blur(18px)
}

/* the crossing keeps its slower, accelerating sweep (overrides the rise timing) */
.temple.passing .templeHalf {
  transition: translate 2.1s cubic-bezier(.6, .04, .7, .25), scale 2.1s cubic-bezier(.6, .04, .7, .25),
    opacity .7s ease 1.35s, filter 1.6s ease .4s;
}


@media (prefers-reduced-motion:reduce) {
  .templeHalf {
    transition: opacity .3s ease
  }

  .temple.passing .templeHalf {
    opacity: 0;
    transition: opacity .3s ease
  }
}

/* ════════ THRESHOLD ════════ */
.stage.threshold {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center
}

.thresh-copy {
  animation: fadeUp 1.2s ease both .2s;
  position: relative
}

.thresh-copy::before {
  /* mist pocket so the title reads over the temple stone */
  content: "";
  position: absolute;
  inset: -36px -80px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(58% 62% at 50% 50%, rgba(225, 234, 242, .88), rgba(225, 234, 242, 0) 68%);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.brand-super {
  font-size: clamp(20px, 3.2vw, 42px);
  letter-spacing: .025em;
  line-height: 1.14;
  font-weight: 500;
  text-transform: uppercase;
  margin: 0;
  background: linear-gradient(178deg, #0b0c0d 30%, #494e53 52%, #0b0c0d 74%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand {
  font-size: clamp(56px, 11vw, 140px);
  letter-spacing: .025em;
  line-height: 1.14;
  /* tuck under "The Bali" proportionally to the word's own size (-32px at the
     140px desktop max) so the two lines never collide as the title shrinks */
  margin: -.23em 0 0;
  font-weight: 500;
  text-transform: uppercase;
  padding-bottom: .08em;
  background: linear-gradient(178deg, #0b0c0d 30%, #494e53 52%, #0b0c0d 74%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}


.sub {
  font-style: italic;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 30em;
  margin: 0 auto 0;
  line-height: 1.5;
  text-wrap: balance;
}


/* the two doors, stacked: a solid primary plate over a quiet secondary line */
.thresh-actions {
  margin-top: 56px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeUp 1.2s ease both .55s;
  transition: opacity .35s ease;
}

/* entering: everything dissolves together */
.thresh-actions.open,
.thresh-copy.open {
  opacity: 0;
  pointer-events: none;
}

.thresh-copy {
  transition: opacity .35s ease;
}


/* ── button-005: the 3D-flip primary gate button ── */
.button-005 {
  --button-005-color: var(--gold);
  --button-005-color-background: var(--glass-deep);
  --button-005-color: var(--chrome-ink);
  --button-005-color-focus: var(--gold);
  --button-005-text-border-radius: 14px;
  --button-005-icon-border-radius: 10px;
  --button-005-padding-top: 1.5em;
  --button-005-padding-bottom: 1.5em;
  --button-005-padding-x: 2em;
  --button-005-flex-flow: row;
  --button-005-mirror-focus: 1;
  --button-005-focus-inset: -0.125em;
  --button-005-text-click-scale: 0.955 0.925;
  --button-005-icon-click-scale: 0.925;
  --button-005-ease-hover: cubic-bezier(0.32, 0.72, 0, 1);
  --button-005-ease-click: cubic-bezier(0.4, 0, 0.2, 1);
  --button-005-ease-focus: cubic-bezier(0.32, 0.72, 0, 1);
  font-family: 'Onest', sans-serif;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: .19em;
  text-transform: uppercase;
  grid-column-gap: 0.0625em;
  grid-row-gap: 0.0625em;
  color: var(--button-005-color);
  flex-flow: var(--button-005-flex-flow);
  -webkit-user-select: none;
  user-select: none;
  background-color: transparent;
  outline-style: none;
  align-items: center;
  padding: 0;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  position: relative;
  -webkit-tap-highlight-color: transparent
}

.button-005::after {
  content: '';
  display: block;
  position: absolute;
  inset: var(--button-005-focus-inset);
  border-radius: var(--button-005-text-border-radius) var(--button-005-icon-border-radius) var(--button-005-icon-border-radius) var(--button-005-text-border-radius);
  transition: box-shadow 0.3s var(--button-005-ease-focus);
  pointer-events: none;
  z-index: 1;
  scale: var(--button-005-mirror-focus) 1
}

.button-005:focus-visible::after {
  box-shadow: 0 0 0 0.125em var(--button-005-color-focus)
}

.button-005__text-wrap {
  pointer-events: none;
  perspective: 10em;
  transform-style: preserve-3d;
  display: grid;
  transition: scale 0.15s var(--button-005-ease-click)
}

.button-005:active .button-005__text-wrap {
  scale: var(--button-005-text-click-scale)
}

.button-005__text {
  backface-visibility: hidden;
  padding-left: var(--button-005-padding-x);
  padding-right: var(--button-005-padding-x);
  padding-top: var(--button-005-padding-top);
  padding-bottom: var(--button-005-padding-bottom);
  background-color: var(--button-005-color-background);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: none;
  border-radius: var(--button-005-text-border-radius);
  transform-style: preserve-3d;
  grid-area: 1 / 1
}

.button-005__text.is--default {
  transform-origin: center top;
  opacity: 1;
  transition: translate 0.4s 0.05s var(--button-005-ease-hover), rotate 0.4s 0.05s var(--button-005-ease-hover), scale 0.4s 0.05s var(--button-005-ease-hover), opacity 0.1s 0.05s linear
}

.button-005__text.is--hover {
  transform-origin: center bottom;
  translate: 0 15% 0;
  rotate: 1 0 0 -85deg;
  scale: 0.55;
  opacity: 0;
  transition: translate 0.4s var(--button-005-ease-hover), rotate 0.4s var(--button-005-ease-hover), scale 0.4s var(--button-005-ease-hover), opacity 0.1s 0.075s linear
}

.button-005__icon-wrap {
  aspect-ratio: 1;
  pointer-events: none;
  perspective: 10em;
  width: calc(1em + var(--button-005-padding-top) + var(--button-005-padding-bottom));
  transform-style: preserve-3d;
  flex-shrink: 0;
  display: grid;
  transition: scale 0.15s var(--button-005-ease-click)
}

.button-005:active .button-005__icon-wrap {
  scale: var(--button-005-icon-click-scale)
}

.button-005__icon-inner {
  backface-visibility: hidden;
  border-radius: var(--button-005-icon-border-radius);
  background-color: var(--button-005-color-background);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: none;
  transform-style: preserve-3d;
  grid-area: 1 / 1;
  justify-content: center;
  align-items: center;
  display: flex
}

.button-005__icon-inner.is--default {
  transform-origin: center bottom;
  transition: translate 0.5s 0.05s var(--button-005-ease-hover), rotate 0.55s 0.05s var(--button-005-ease-hover), scale 0.55s 0.05s var(--button-005-ease-hover), opacity 0.1s 0.15s linear
}

.button-005__icon-inner.is--hover {
  transform-origin: center top;
  translate: 0 -15% 0;
  rotate: 1 0 0 85deg;
  scale: 0.55;
  opacity: 0;
  transition: translate 0.4s var(--button-005-ease-hover), rotate 0.4s var(--button-005-ease-hover), scale 0.4s var(--button-005-ease-hover), opacity 0.1s 0.075s linear
}

.button-005__icon {
  width: 1.8em;
  height: 1.8em
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .button-005:is(:hover, :focus-visible) .button-005__text.is--default {
    translate: 0 -15% 0;
    rotate: 1 0 0 85deg;
    scale: 0.55;
    opacity: 0;
    transition: translate 0.5s 0.05s var(--button-005-ease-hover), rotate 0.55s 0.05s var(--button-005-ease-hover), scale 0.55s 0.05s var(--button-005-ease-hover), opacity 0.1s 0.15s linear
  }

  .button-005:is(:hover, :focus-visible) .button-005__text.is--hover {
    translate: 0 0 0;
    rotate: 1 0 0 0deg;
    scale: 1;
    opacity: 1;
    transition: translate 0.5s 0.1s var(--button-005-ease-hover), rotate 0.55s 0.1s var(--button-005-ease-hover), scale 0.55s 0.1s var(--button-005-ease-hover), opacity 0.1s 0.075s linear
  }

  .button-005:is(:hover, :focus-visible) .button-005__icon-inner.is--default {
    translate: 0 15% 0;
    rotate: 1 0 0 -85deg;
    scale: 0.55;
    opacity: 0;
    transition: translate 0.5s 0.05s var(--button-005-ease-hover), rotate 0.55s 0.05s var(--button-005-ease-hover), scale 0.55s 0.05s var(--button-005-ease-hover), opacity 0.1s 0.15s linear
  }

  .button-005:is(:hover, :focus-visible) .button-005__icon-inner.is--hover {
    translate: 0 0 0;
    rotate: 1 0 0 0deg;
    scale: 1;
    opacity: 1;
    transition: translate 0.5s 0.1s var(--button-005-ease-hover), rotate 0.55s 0.1s var(--button-005-ease-hover), scale 0.55s 0.1s var(--button-005-ease-hover), opacity 0.1s 0.075s linear
  }
}

/* pills / corners */

.snd .iMoon {
  display: none
}

html[data-theme="dark"] .snd .iMoon {
  display: block
}

html[data-theme="dark"] .snd .iSun {
  display: none
}

/* the two corner controls ride one fixed bar; each is a labeled plate in the
   same language as the card's action seals */
.sndBar {
  position: fixed;
  top: 34px;
  right: 34px;
  z-index: 20;
  display: flex;
  gap: 10px
}

/* day mode is shelved for now: the theme plate sleeps, ready to return */
.snd.theme {
  display: none
}

.snd {
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  background: var(--glass);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  opacity: 0;
  pointer-events: none;
  transition: border-color .4s, background .4s, opacity .6s ease;
  box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5)
}

.snd.ui-visible {
  opacity: 1;
  pointer-events: auto;
}

.snd:hover {
  background: var(--glass-deep)
}

.snd svg {
  width: 17px;
  height: 17px;
  stroke: var(--chrome-ink);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round
}

.sndLbl {
  font-family: 'Onest', sans-serif;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--chrome-ink)
}

/* the sound plate carries a living wave: a swell travels through the bars
   while sound is on, and the line falls flat when it is muted */
.sndWave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 13px
}

.sndWave i {
  display: block;
  width: 1.5px;
  height: 100%;
  border-radius: 2px;
  background: var(--chrome-ink);
  transform: scaleY(.14);
  transform-origin: center;
  transition: transform .5s ease
}

/* the dance never stops — muting collapses its amplitude to zero, so the
   bars deflate smoothly to the flat line and inflate back mid-figure.
   --live is registered so it interpolates rather than snapping. */
@property --live {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

.sndWave {
  --live: 1;
  transition: --live .7s ease;
}

.snd.off .sndWave {
  --live: 0;
}

.sndWave i:nth-child(1) { animation: sndBob1 2.5s ease-in-out -.9s infinite }
.sndWave i:nth-child(2) { animation: sndBob2 3s ease-in-out -1.9s infinite }
.sndWave i:nth-child(3) { animation: sndBob3 2.2s ease-in-out -.4s infinite }
.sndWave i:nth-child(4) { animation: sndBob2 2.8s ease-in-out -1.2s infinite }
.sndWave i:nth-child(5) { animation: sndBob1 2.35s ease-in-out -1.7s infinite }

@keyframes sndBob1 {

  0%,
  100% {
    transform: scaleY(calc(.14 + .16 * var(--live)))
  }

  45% {
    transform: scaleY(calc(.14 + .66 * var(--live)))
  }

  70% {
    transform: scaleY(calc(.14 + .36 * var(--live)))
  }
}

@keyframes sndBob2 {

  0%,
  100% {
    transform: scaleY(calc(.14 + .41 * var(--live)))
  }

  30% {
    transform: scaleY(calc(.14 + .08 * var(--live)))
  }

  65% {
    transform: scaleY(calc(.14 + .71 * var(--live)))
  }
}

@keyframes sndBob3 {

  0%,
  100% {
    transform: scaleY(calc(.14 + .28 * var(--live)))
  }

  25% {
    transform: scaleY(calc(.14 + .71 * var(--live)))
  }

  60% {
    transform: scaleY(calc(.14 + .16 * var(--live)))
  }

  80% {
    transform: scaleY(calc(.14 + .56 * var(--live)))
  }
}

/* progress: journey constellation */
.progress {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  opacity: 0;
  transition: opacity .8s;
  text-align: center
}

.progress.show {
  opacity: 1
}

.progress svg {
  display: block;
  overflow: visible;
  margin: 0 auto
}

.progress-label {
  margin-top: 9px;
  font-size: 9px;
  color: var(--gold);
  letter-spacing: .2em;
  text-indent: .2em;
  white-space: nowrap
}

.pseg {
  stroke: rgba(16, 18, 20, .16);
  stroke-width: 1;
  stroke-dasharray: 1 4;
  stroke-linecap: round
}

.pseg-gold {
  stroke: var(--gold);
  stroke-width: 1.1;
  stroke-linecap: round;
  transition: stroke-dashoffset .85s cubic-bezier(.45, 0, .25, 1)
}

.pseg-gold.drawn {
  stroke-dashoffset: 0 !important
}

.pnode {
  fill: rgba(16, 18, 20, .22);
  transition: fill .5s;
  transform-box: fill-box;
  transform-origin: center
}

.pnode.done {
  fill: var(--gold)
}

.pnode.now {
  fill: var(--gold);
  animation: nodeBreathe 2.6s ease-in-out -1.3s infinite
}

.pnode.flare {
  animation: nodeFlare 1.3s ease-in-out
}

@keyframes nodeBreathe {

  0%,
  100% {
    opacity: .55;
    transform: scale(1)
  }

  50% {
    opacity: 1;
    transform: scale(1.25)
  }
}

@keyframes nodeFlare {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(201, 164, 74, 0))
  }

  40% {
    transform: scale(1.45);
    filter: drop-shadow(0 0 7px rgba(201, 164, 74, .8))
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(201, 164, 74, 0))
  }
}

.comet {
  fill: var(--gold-hi);
  opacity: 0;
  transition: opacity .6s ease;
  filter: drop-shadow(0 0 4px rgba(201, 164, 74, .9)) drop-shadow(0 0 9px rgba(201, 164, 74, .5))
}

/* ════════ READING ════════ */
.q-eyebrow {
  margin-bottom: 20px;
  color: var(--gold)
}

.q-title {
  font-family: 'Cormorant', serif;
  font-weight: 500;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.2;
  margin-bottom: 6px;
  padding-bottom: .07em;
  background: linear-gradient(178deg, #0b0c0d 25%, #43484d 52%, #0b0c0d 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent
}

.q-hint {
  font-style: italic;
  color: var(--slate);
  font-size: 18px;
  margin-bottom: 60px
}

/* ── deck slot entrance animation ── */
.deck.entering .deckSlot {
  animation: slotRise .6s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 75ms + 60ms)
}

@keyframes slotRise {
  from { opacity: 0; scale: .65; filter: blur(3px) }
  to   { opacity: 1; scale: 1;   filter: blur(0)   }
}

/* choices as mini oracle cards — small parchment cards, kin of the final card.
   Three transform layers that must not fight:
   .optShell  → CSS drift animation + hanging tilt + hover lift (rotate/translate/scale)
   .opt       → GSAP inertia target (momentum.js owns its transform) */
.opts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 2vw, 22px);
  max-width: 980px;
  min-width: 0;
  margin: clamp(22px, 3vw, 30px) auto 0
}

/* cards are objects to touch, not text to select */
.optShell,
.card,
.cardMapLink,
.sealBtn {
  user-select: none;
  -webkit-user-select: none
}

.optShell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: clamp(150px, 20vw, 210px);
  flex: none;
  transition: translate .6s cubic-bezier(.2, .8, .2, 1), scale .6s cubic-bezier(.2, .8, .2, 1),
    rotate .6s cubic-bezier(.2, .8, .2, 1), opacity .5s ease, filter .5s ease;
  animation: optDrift 8s ease-in-out infinite;
}

/* each card hangs at its own angle and drifts on its own rhythm */
.optShell:nth-child(1) {
  rotate: -2.4deg;
  animation-duration: 7.2s;
  animation-delay: -1.3s
}

.optShell:nth-child(2) {
  rotate: 1.6deg;
  animation-duration: 8.6s;
  animation-delay: -4.1s
}

.optShell:nth-child(3) {
  rotate: -1.2deg;
  animation-duration: 7.8s;
  animation-delay: -2.6s
}

.optShell:nth-child(4) {
  rotate: 2.6deg;
  animation-duration: 9.1s;
  animation-delay: -5.4s
}

@keyframes optDrift {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-9px)
  }
}

.optShell:hover,
.optShell:focus-visible {
  translate: 0 -6px;
  scale: 1.02;
  rotate: 0deg
}

.optShell:focus-visible {
  outline: none
}

/* choosing one card makes the rest recede */
.opts:has(.optShell:hover) .optShell:not(:hover) {
  opacity: .55;
  filter: saturate(.8)
}

.opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: clamp(150px, 20vw, 210px);
  height: clamp(224px, 30vw, 288px);
  position: relative;
  color: var(--ink);
  line-height: 1.5;
  /* explicit: buttons don't inherit line-height, body does */
  background: linear-gradient(180deg, #fffdf8, #f6f2e8);
  border: 1px solid rgba(168, 132, 47, .45);
  border-radius: 12px;
  padding: clamp(18px, 2.4vw, 22px) clamp(12px, 1.7vw, 18px) clamp(14px, 1.9vw, 18px);
  text-align: center;
  box-shadow: 0 16px 40px rgba(66, 88, 108, .22), 0 0 0 3px rgba(255, 255, 255, .35);
  transition: box-shadow .6s, border-color .5s;
}

.opt::before {
  /* inner tarot hairline */
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 7px;
  pointer-events: none;
  border: 1px solid rgba(168, 132, 47, .22);
  transition: border-color .5s;
}

.optNum {
  /* deck numeral at the top edge */
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--gold);
  letter-spacing: .15em;
  text-indent: .15em;
  opacity: .85;
}

.optStar {
  /* small ornament between illustration and name */
  width: 11px;
  height: 11px;
  fill: var(--gold);
  opacity: .7;
  flex: none;
  margin-bottom: clamp(8px, 1.4vw, 12px);
  transition: opacity .4s, transform .5s ease;
}

.optShell:hover .optStar {
  opacity: 1;
  transform: rotate(180deg)
}

.optShell:hover .opt,
.optShell:focus-visible .opt {
  border-color: var(--gold);
  box-shadow: 0 30px 64px rgba(66, 88, 108, .3), 0 0 0 3px rgba(255, 255, 255, .55)
}

.optShell:hover .opt::before,
.optShell:focus-visible .opt::before {
  border-color: rgba(168, 132, 47, .45)
}

/* the flying clone freezes the hover state so nothing visually snaps */
.opt.flash::after {
  /* one-shot: gold light blooms outward from the card edge */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  animation: chosenEcho .9s ease-out forwards;
}

@keyframes chosenEcho {
  0% {
    box-shadow: 0 0 0 0 rgba(201, 164, 74, 0)
  }

  22% {
    box-shadow: 0 0 24px 3px rgba(201, 164, 74, .65)
  }

  100% {
    box-shadow: 0 0 60px 22px rgba(201, 164, 74, 0)
  }
}

.opt.frozen {
  border-color: var(--gold);
  box-shadow: 0 30px 64px rgba(66, 88, 108, .3), 0 0 0 3px rgba(255, 255, 255, .55)
}

.opt.frozen::before {
  border-color: rgba(168, 132, 47, .45)
}

.opt.frozen .drawnIcon {
  background: var(--gold-hi)
}

.opt.frozen .gl {
  stroke: var(--gold-hi)
}

.opt.frozen .gf {
  fill: var(--gold-hi)
}

.opt.frozen .optStar {
  opacity: 1;
  transform: rotate(180deg)
}

html[data-theme="dark"] .opt.frozen {
  border-color: var(--gold);
  box-shadow: 0 30px 64px rgba(0, 0, 0, .55), 0 0 0 2px rgba(201, 164, 74, .45)
}

.opt .glyph {
  height: clamp(58px, 8vw, 74px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(13px, 1.9vw, 18px)
}

/* the icon grows to fill the space between the numeral and the star,
   centering itself there */
.opt .glyph:has(.drawnIcon) {
  flex: 1;
  height: auto;
  min-height: 0;
  width: 100%;
  margin-bottom: 0
}

.opt .glyph svg {
  height: clamp(54px, 7.2vw, 68px);
  width: clamp(54px, 7.2vw, 68px);
  overflow: visible
}

.drawnIcon {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold);
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  transition: background .4s;
}

.fi-marigold {
  -webkit-mask-image: url("../svgs/icon_marigold-final.svg");
  mask-image: url("../svgs/icon_marigold-final.svg")
}

.fi-hibiscus {
  -webkit-mask-image: url("../svgs/icon_hibiscus-final.svg");
  mask-image: url("../svgs/icon_hibiscus-final.svg")
}

.fi-lotus {
  -webkit-mask-image: url("../svgs/icon_lotus-final.svg");
  mask-image: url("../svgs/icon_lotus-final.svg")
}

.fi-frangipani {
  -webkit-mask-image: url("../svgs/icon_frangipani-final.svg");
  mask-image: url("../svgs/icon_frangipani-final.svg")
}

.fi-mist {
  -webkit-mask-image: url("../svgs/icon_mist-final.svg");
  mask-image: url("../svgs/icon_mist-final.svg")
}

.fi-salt {
  -webkit-mask-image: url("../svgs/icon_salt-final.svg");
  mask-image: url("../svgs/icon_salt-final.svg")
}

.fi-stone {
  -webkit-mask-image: url("../svgs/icon_stone-final.svg");
  mask-image: url("../svgs/icon_stone-final.svg")
}

.fi-smoke {
  -webkit-mask-image: url("../svgs/icon_smoke-final.svg");
  mask-image: url("../svgs/icon_smoke-final.svg")
}

.fi-near {
  -webkit-mask-image: url("../svgs/icon_hearth_final.svg");
  mask-image: url("../svgs/icon_hearth_final.svg")
}

.fi-wander {
  -webkit-mask-image: url("../svgs/icon_wanderer_final.svg");
  mask-image: url("../svgs/icon_wanderer_final.svg")
}

.fi-across {
  -webkit-mask-image: url("../svgs/icon_pilgrim_final.svg");
  mask-image: url("../svgs/icon_pilgrim_final.svg")
}

.fi-fullmoon {
  -webkit-mask-image: url("../svgs/icon_fullmoon-final.svg");
  mask-image: url("../svgs/icon_fullmoon-final.svg")
}

.fi-halfmoon {
  -webkit-mask-image: url("../svgs/icon_halfmoon-final.svg");
  mask-image: url("../svgs/icon_halfmoon-final.svg")
}

.fi-newmoon {
  -webkit-mask-image: url("../svgs/icon_newmoon-final.svg");
  mask-image: url("../svgs/icon_newmoon-final.svg")
}

.fi-stillwater {
  -webkit-mask-image: url("../svgs/icon_stillwater-final.svg");
  mask-image: url("../svgs/icon_stillwater-final.svg")
}

.fi-risingfire {
  -webkit-mask-image: url("../svgs/icon_risingfire_final.svg");
  mask-image: url("../svgs/icon_risingfire_final.svg")
}

.fi-storm {
  -webkit-mask-image: url("../svgs/icon_storm_final.svg");
  mask-image: url("../svgs/icon_storm_final.svg")
}

.optShell:hover .drawnIcon {
  background: var(--gold-hi)
}

/* warm inks only on the parchment: the card is one warm object */
.opt h3 {
  font-family: 'Marcellus', serif;
  font-size: clamp(16px, 1.9vw, 18px);
  font-weight: 400;
  letter-spacing: .03em;
  color: #14120e;
  line-height: 1.3
}

.opt p {
  font-style: italic;
  font-size: clamp(14px, 1.6vw, 15.5px);
  color: #7d7466;
  line-height: 1.45
}

.gl {
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .4s, filter .4s
}

.gf {
  fill: var(--gold);
  stroke: none;
  transition: fill .4s
}

.optShell:hover .gl {
  stroke: var(--gold-hi);
  filter: drop-shadow(0 1px 4px rgba(168, 132, 47, .45))
}

.optShell:hover .gf {
  fill: var(--gold-hi)
}


/* map: the island as a living dot field; touch where you stand */
.mapwrap {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  transition: scale 1.1s cubic-bezier(.5, .05, .6, .4), opacity .9s ease .15s, filter 1s ease
}

.mapwrap.dive {
  scale: 2.6;
  opacity: 0;
  filter: blur(6px);
  pointer-events: none
}

#dotMap {
  display: block;
  width: 100%;
  aspect-ratio: 1153/731;
  height: auto
}

.mapwrap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible
}

.hitLayer .hitZone path {
  fill: rgba(0, 0, 0, 0);
  stroke: none;
  cursor: pointer
}

.hitZone {
  outline: none
}

.pinStar {
  fill: var(--gold-hi);
  filter: drop-shadow(0 0 6px rgba(201, 164, 74, .8));
  animation: pinPop .5s cubic-bezier(.2, .8, .3, 1.4) both;
  transform-box: fill-box;
  transform-origin: center
}

@keyframes pinPop {
  0% {
    transform: scale(0)
  }

  100% {
    transform: scale(1)
  }
}

.pinRipple {
  stroke: none;
  animation: pinRipple 1.3s cubic-bezier(.15, .65, .3, 1) forwards
}

@keyframes pinRipple {
  0%   { r: 6   }
  100% { r: 118 }
}

/* cursor tooltip with the zone name */
/* map compass box reuses the flip-hint chip style; shows N/SW/etc. as text */
.mapCompass {
  font-family: 'Onest', sans-serif;
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--chrome-ink);
  font-weight: 400
}

/* palm */
.palmwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px
}

/* the portal: no hard disc — a soft glow fading into depth, bounded only by
   the orbiting script. A faint progress arc lights as the offering is given. */
.palm {
  position: relative;
  width: min(300px, 72vw, 62svh);
  aspect-ratio: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1)
}

.palm.holding {
  transform: scale(1.04)
}

.palm svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible
}

/* a faint groove is always present; the gold fills it as the offering is given */
.pRingBase {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  opacity: .16
}

.pRingGo {
  fill: none;
  stroke: url(#goldgrad);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 792;
  stroke-dashoffset: 792;
  filter: drop-shadow(0 0 5px rgba(201, 164, 74, .7));
  opacity: .9
}

.palm.holding .pRingGo {
  transition: stroke-dashoffset 2.7s linear;
  stroke-dashoffset: 0
}

.palm:not(.holding) .pRingGo {
  transition: stroke-dashoffset 1s linear;
  stroke-dashoffset: 792
}

/* a bright mote rides the leading edge of the closing ring and seals at the top */
.pSpark {
  fill: none;
  stroke: #fff3cf;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 0 792;
  stroke-dashoffset: 792;
  filter: drop-shadow(0 0 6px rgba(255, 226, 150, .95)) drop-shadow(0 0 13px rgba(201, 164, 74, .8));
  opacity: 0
}

.palm.holding .pSpark {
  transition: stroke-dashoffset 2.7s linear, opacity .4s ease;
  stroke-dashoffset: 0;
  opacity: 1
}

/* on release the mote rides the leading edge back to the top in lockstep with the
   ring (same 1s linear), fading only as it arrives — it stays attached, never snaps */
.palm:not(.holding) .pSpark {
  transition: stroke-dashoffset 1s linear, opacity .9s ease .1s;
  stroke-dashoffset: 792;
  opacity: 0
}

/* the portal interior — glow and vortex are clipped to the ring so nothing
   spills past the edge, even as the vortex darkens on hold */
.portalField {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}

.portalCore {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(201, 164, 74, .32), rgba(201, 164, 74, .09) 42%, transparent 72%);
  animation: breathe 3.4s ease-in-out infinite;
  transition: filter 1s ease;
}

/* brightening on hold is a smooth filter sweep — no gradient swap, no jump */
.palm.holding .portalCore {
  filter: brightness(1.55) saturate(1.06);
}

/* vortex: rings of darkness spiral inward toward the centre, pulling faster
   while you hold — the portal feels like it is drinking what you give */
.portalWave {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, transparent 36%, var(--wave, rgba(120, 92, 36, .42)) 52%, transparent 68%);
  opacity: 0;
  animation: vortexIn 4.2s linear infinite;
}

.portalWave.w2 {
  animation-delay: -2.1s
}

@keyframes vortexIn {
  0% {
    transform: rotate(0deg) scale(1.2);
    opacity: 0
  }

  20% {
    opacity: .7
  }

  100% {
    transform: rotate(150deg) scale(.04);
    opacity: 0
  }
}

/* the vortex keeps a steady cadence (the shader deepens it on hold); no duration
   swap here, so nothing snaps the moment you press */

/* spirit hands: inside the portal, clipped by its rim. At rest only the
   fingertips break the edge; while you hold, the arms reach in to receive.
   The drawing points up-left, so a +45deg correction aims it at the center. */
.spiritHands {
  position: absolute;
  inset: 5%;
  pointer-events: none;
  border-radius: 50%;
  overflow: hidden;
}

/* --idle scales the idle bob's amplitude; easing it to 0 on hold flattens the
   motion WITHOUT removing the animation, so nothing snaps when you press, and it
   eases back to 1 on release (the motion returns from where it left off) */
@property --idle {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

.spiritHand {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 84px;
  margin: -42px -48px;
  background: #8799aa;
  -webkit-mask: url("../svgs/hand-final.svg") center / contain no-repeat;
  mask: url("../svgs/hand-final.svg") center / contain no-repeat;
  transform: rotate(var(--a, 0deg)) translateY(var(--reach, 168px)) rotate(45deg);
  opacity: .24;
  --idle: 1;
  /* release timing — kept at 1s so the hands settle back in sync with the ring,
     the spark and the spell wheel (all 1s) */
  transition: transform 1s ease, opacity 1s ease, --idle 1s ease;
  animation: spiritIdle var(--dur, 4.4s) ease-in-out var(--d, 0s) infinite;
}

@keyframes spiritIdle {

  0%,
  100% {
    scale: 1;
    rotate: calc(var(--wob, 0deg) * -1 * var(--idle));
    translate: 0 0;
  }

  50% {
    scale: calc(1 + .07 * var(--idle));
    rotate: calc(var(--wob, 0deg) * var(--idle));
    translate: 0 calc(var(--drift, 4px) * var(--idle));
  }
}

/* reach in to receive, but stay shy of the centre so the cut arm-end stays hidden.
   The idle animation keeps running; --idle:0 just flattens it — no snap. */
.palm.holding .spiritHand {
  transition: transform 2.7s cubic-bezier(.4, .12, .3, 1), opacity 1.2s ease, --idle .9s ease;
  transform: rotate(var(--a, 0deg)) translateY(100px) rotate(45deg);
  opacity: .5;
  --idle: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* the spell: balinese script wheels around the portal, quickening as it feeds */
.spellWheel {
  transform-origin: 50% 50%;
  transform-box: view-box;
  animation: spin 80s linear infinite reverse;
  rotate: 0deg;
  transition: rotate 1s linear;
}

/* the quickening is an extra sweep layered on the steady spin — it accelerates in
   from the current angle and unwinds on release, so the speed never snaps */
.palm.holding .spellWheel {
  rotate: -260deg;
  transition: rotate 2.7s cubic-bezier(.25, 0, .6, 1);
}

.spellText {
  font-family: 'Noto Sans Balinese', sans-serif;
  font-size: 11px;
  fill: var(--gold);
  opacity: .5;
  letter-spacing: 3px;
}

.palm.holding .spellText {
  opacity: .85;
  transition: opacity 1.2s
}

/* hover: the portal stirs before it is touched — core brightens, the wheel
   turns a breath faster, the script and hint wake (hover devices only) */
@media (hover: hover) and (pointer: fine) {
  .palm:not(.holding):hover .portalCore {
    filter: brightness(1.3);
  }

  .palm:not(.holding):hover .portalHint {
    opacity: 1;
  }
}

/* the closing flare: a ring of light blooms outward the instant the offering seals */
.portalFlare {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  border: 2px solid rgba(255, 231, 160, .9);
  box-shadow: 0 0 26px rgba(201, 164, 74, .7), inset 0 0 26px rgba(201, 164, 74, .45);
}

.palm.sealed .portalFlare {
  animation: portalSeal 1.9s ease-out forwards;
}

/* blooms fast to full, holds with the bell, then fades out slowly into the reveal */
@keyframes portalSeal {
  0% { opacity: 0; transform: scale(.7) }
  14% { opacity: 1; transform: scale(1) }
  42% { opacity: .9; transform: scale(1.12) }
  100% { opacity: 0; transform: scale(1.5) }
}

/* the centre cue, so the gesture is obvious; it dims away the moment you hold */
.portalHint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Onest', sans-serif;
  font-size: 12px;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: var(--gold);
  pointer-events: none;
  white-space: nowrap;
  animation: hintPulse 2.6s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: .38 }
  50% { opacity: .8 }
}

.palm.holding .portalHint {
  animation: none;
  opacity: 0;
  transition: opacity .4s ease;
}


/* ════════ REVELATION ════════ */
.vtextwrap {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center
}

.vtext {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 20px;
  letter-spacing: .04em;
  animation: breathe 2.6s ease-in-out infinite
}

/* the offering recap — the lines stack, but each one is spoken in turn: it
   fades up into its place below the previous and stays lit until the whole
   read-back clears together */
.vtextwrap.stacked {
  height: auto;
  flex-direction: column;
  gap: 12px
}

.vtextwrap.stacked .vtext {
  animation: lineIn 1s ease both
}

.vtextwrap.stacked .vtext:nth-child(2) { animation-delay: 1.1s }
.vtextwrap.stacked .vtext:nth-child(3) { animation-delay: 2.2s }

@keyframes lineIn {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

@keyframes breathe {

  0%,
  100% {
    opacity: .35
  }

  50% {
    opacity: 1
  }
}

/* — 3D card — */
.cardScene {
  perspective: 560px;
  display: inline-block;
  margin: 0 auto
}

.card {
  /* width is also capped by height (72svh ÷ the face's 1145/1713 ratio) so the
     whole card — frame, art and buttons — always fits a short/landscape screen.
     --cw is the card's real width; the face derives its font base from it, so
     ALL inner text/spacing (set in em) scales with the card and the content
     always fits the fixed aspect-ratio instead of stretching it */
  --cw: min(400px, 88vw, calc(72svh * 1145 / 1713));
  position: relative;
  width: var(--cw);
  text-align: center;
  cursor: pointer;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  /* no will-change: Safari can flatten 3D contexts when it creates
     a separate compositing layer for a preserve-3d element */
}

.cardScene {
  position: relative
}

/* flip — GSAP drives the rotationY; these rules are fallbacks for reduced-motion */
.cardFlip {
  position: relative;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d
}

.card.flipped .cardFlip {
  -webkit-transform: rotateY(180deg);
  transform: rotateY(180deg)
}

/* arrival: the card spins in fast and decelerates into place, face up */
.card.arrive .cardFlip {
  animation: cardSpinIn .95s cubic-bezier(.22, .9, .3, 1) both
}

/* no filter here: a filter flattens the preserve-3d layers for its whole
   duration, and the depth would snap in visibly the instant it ended */
/* rotateY + opacity only — NO scale: scaling .cardFlip would scale the
   layers' translateZ depth, making the text pop to its perspective at the end.
   With constant scale, the text holds its 3D depth from the first frame. */
@keyframes cardSpinIn {
  0% {
    transform: rotateY(720deg);
    opacity: 0
  }

  35% {
    opacity: 1
  }

  100% {
    transform: rotateY(0deg);
    opacity: 1
  }
}

/* touch devices: iOS Safari mangles the 720° entrance spin (the card lands
   tilted and un-flipped until first touch), so the card simply rises in — the
   flip stays reserved for the tap-to-flip interaction, which works fine */
@media (hover: none), (pointer: coarse) {
  .card.arrive .cardFlip {
    animation: cardRiseIn .8s ease-out both
  }
}

@keyframes cardRiseIn {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

  to {
    opacity: 1;
    transform: none
  }
}


/* the face carries NO border-radius: Chrome's rounded-corner clip flattens
   preserve-3d children, so the rounded parchment lives on .faceBg below */
.face {
  /* base em = 14.5px at the 400px reference card; every inner size is em so
     the whole face scales as one piece with the card width */
  font-size: calc(var(--cw) * 0.03625);
  padding: 2.2em 2.34em 2em;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* no preserve-3d here: children use 2D translate for parallax and don't need
     a 3D context; keeping it would let text bleed through on Safari */
}

.faceBg {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 1px solid rgba(168, 132, 47, .3);
  background: linear-gradient(180deg, #fffdf8, #f6f2e8);
  box-shadow: 0 40px 90px rgba(66, 88, 108, .32), 0 0 0 5px rgba(255, 255, 255, .5);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* every popped layer hides its own back, since the face no longer flattens */
.lyr,
.cardBorder,
.cardBackArt {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden
}

.face.front {
  position: relative;
  -webkit-transform: translateZ(1px);
  transform: translateZ(1px);
  /* match the inner frame svg's ratio so the ornament is never distorted;
     grows past it only if content needs more room */
  aspect-ratio: 1145/1713;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.face.back {
  position: absolute;
  inset: 0;
  -webkit-transform: rotateY(180deg) translateZ(1px);
  transform: rotateY(180deg) translateZ(1px);
  display: flex;
  align-items: center;
  justify-content: center
}

/* the sheen lives on .faceBg (a flat leaf), NOT on .face: a blend mode on a
   child of .face would force it to flatten and kill the 3D layer depth */
.faceBg::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  background: linear-gradient(112deg,
      transparent 36%,
      rgba(255, 168, 178, .09) 43%,
      rgba(255, 224, 148, .09) 46.5%,
      rgba(168, 238, 196, .09) 50%,
      rgba(158, 196, 255, .11) 53.5%,
      rgba(216, 170, 255, .09) 57%,
      transparent 64%);
  background-size: 230% 230%;
  background-position: var(--gx, 50%) var(--gy, 50%);
  opacity: 0;
  transition: opacity .4s;
  mix-blend-mode: multiply
}

.card.live .faceBg::after {
  opacity: 1
}

/* ornamental frame — the svg is used as a mask so it inherits the project gold */
.cardBorder {
  position: absolute;
  inset: calc(var(--cw) * -.0175);
  pointer-events: none;
  background: var(--gold);
  opacity: .45;
  transform: translateZ(2px);
  /* attached to the card surface */
  -webkit-mask: url("../svgs/card/border-card-inside.svg") center / 100% 100% no-repeat;
  mask: url("../svgs/card/border-card-inside.svg") center / 100% 100% no-repeat;
}

/* back design — full-bleed to the edges and flat, like the front frame */
.cardBackArt {
  position: absolute;
  inset: calc(var(--cw) * -.0175);
  pointer-events: none;
  background: var(--gold);
  opacity: .45;
  transform: translateZ(2px);
  -webkit-mask: url("../svgs/card/border-card-back.svg") center / 100% 100% no-repeat;
  mask: url("../svgs/card/border-card-back.svg") center / 100% 100% no-repeat;
}

/* the constellation: the whole sky of choices faint, the five walked ones lit
   and joined in walking order, the path's numerals sealed beneath */
.constWrap {
  position: absolute;
  inset: 0;
  z-index: 1;                 /* above the parchment leaf, like the front text */
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* the path's numerals arc under the crescent's arch at the head of the card */
.constSealArc {
  position: absolute;
  top: 6.5%;
  left: 50%;
  transform: translateX(-50%);
  width: 58%;
  overflow: visible;
}

.cSealTxt {
  font-family: 'Onest', sans-serif;
  font-weight: 500;
  font-size: 3.6px;
  letter-spacing: .5px;
  fill: var(--gold);
  opacity: .85;
}

/* the two sky leaves stack in one frame; the tilt drives them apart in depth */
.constStack {
  position: relative;
  width: 14.5em;              /* 210px at the 400px reference card */
}

.constellation {
  display: block;
  width: 100%;
}

.constPath {
  position: absolute;
  inset: 0;
}

.constellation .cDim {
  fill: var(--gold);
  opacity: .32;
  animation: starTwinkle 3.4s ease-in-out infinite
}

@keyframes starTwinkle {

  0%,
  100% {
    opacity: .2
  }

  50% {
    opacity: .5
  }
}

@keyframes haloBreathe {

  0%,
  100% {
    opacity: .1
  }

  50% {
    opacity: .26
  }
}


.constellation .cLit {
  fill: var(--gold)
}

.constellation .cHalo {
  fill: var(--gold);
  opacity: .15;
  animation: haloBreathe 4.2s ease-in-out infinite
}

.constellation .cLine {
  fill: none;
  stroke: var(--gold);
  stroke-width: .45;
  opacity: .5
}


/* each depth gets an inverse scale of (perspective - z) / perspective, so a
   layer is exactly its natural size when viewed head-on. The 3D then shows
   purely as parallax on tilt, and the entrance flattening (stage fade/blur)
   ends without any visible size jump. perspective = 560px. */
/* depth/parallax is faked in JS (2D translate offsets on tilt) instead of
   translateZ — so the 3D spin never flattens the layers and the text never
   pops at the end. The .z classes are just depth tags read by bindCardTilt. */
.lyr {
  will-change: translate
}

/* card text is all em off the face's card-derived base, so it scales with the
   card and can never overflow the fixed ratio (px values noted at 400px ref) */
.reading-no {
  margin-bottom: .7em;
  color: var(--gold);
  font-size: .62em          /* 9px */
}

.dest-name {
  font-family: 'Cormorant', serif;
  font-weight: 500;
  font-size: 2em;           /* 29px */
  line-height: 1.12;
  margin-bottom: .17em;
  color: #14120e
}

.dest-region {
  color: var(--gold);
  margin-bottom: 0;
  font-size: .66em          /* 9.5px */
}

/* the plate: each terrain's engraved scene (svgs/plates are copies cropped to
   the ink so no viewBox whitespace shrinks them), inked via the same mask
   trick as the ritual glyphs so it takes a themed ink on the parchment. It is
   the one flex child allowed to shrink, so a dense card (long name + long
   texts) compresses the art instead of ever stretching the face past its ratio */
.sceneArt {
  height: 13em;             /* 188px */
  min-height: 4em;
  flex: 0 1 auto;
  margin: .7em 0 0;
  background: var(--gold);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* the plates are addressed by class so the urls resolve against this
   stylesheet — a relative url() smuggled through a custom property resolves
   here too and would 404 under css/ */
.sceneArt.art-coast {
  -webkit-mask-image: url("../svgs/plates/coast.svg");
  mask-image: url("../svgs/plates/coast.svg")
}

.sceneArt.art-town {
  -webkit-mask-image: url("../svgs/plates/town.svg");
  mask-image: url("../svgs/plates/town.svg")
}

.sceneArt.art-jungle {
  -webkit-mask-image: url("../svgs/plates/jungle.svg");
  mask-image: url("../svgs/plates/jungle.svg")
}

.sceneArt.art-sacred {
  -webkit-mask-image: url("../svgs/plates/sacred.svg");
  mask-image: url("../svgs/plates/sacred.svg")
}

.sceneArt.art-highland {
  -webkit-mask-image: url("../svgs/plates/highland.svg");
  mask-image: url("../svgs/plates/highland.svg")
}

.sceneArt.art-pool {
  -webkit-mask-image: url("../svgs/plates/pool.svg");
  mask-image: url("../svgs/plates/pool.svg")
}

.sceneArt.art-rice {
  -webkit-mask-image: url("../svgs/plates/rice.svg");
  mask-image: url("../svgs/plates/rice.svg")
}

.attrs {
  display: flex;
  margin: 1.05em 0 0;
  border-top: 1px solid rgba(168, 132, 47, .3);
  border-bottom: 1px solid rgba(168, 132, 47, .3);
  /* lift above the absolutely-positioned .faceBg parchment, the same way the
     .lyr text does via its transform — otherwise the divider lines and the
     Terrain/Spirit/Renown titles paint behind the parchment and vanish */
  position: relative;
  z-index: 1
}

.attr {
  flex: 1;
  padding: .69em .28em
}

.attr+.attr {
  border-left: 1px solid rgba(168, 132, 47, .3)
}

.attr .mono {
  display: block;
  font-size: .55em;         /* 8px */
  margin-bottom: .5em;
  color: var(--gold)
}

.attr b {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: .86em;         /* 12.5px */
  letter-spacing: .02em;
  color: #14120e;
  display: block
}

.finds {
  font-size: 1em;           /* 14.5px */
  color: #14120e;
  line-height: 1.55;
  margin: .9em auto 0;
  max-width: 22.8em
}

/* collector's number — mirrors the gold mono header line at the foot */
.deck-no {
  font-size: .55em;         /* 8px */
  margin-top: 1.5em;
  color: var(--gold);
  opacity: .8
}

/* cursor-following flip hint */
.flipHintIcon,
.flipHintLabel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  pointer-events: none;
  height: 36px;
  background: var(--glass);
  border: none;
  border-radius: 10px;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  scale: .5;
  transform-origin: left top;
  transition: opacity .25s ease, scale .35s cubic-bezier(.25, .6, .3, 1);
  box-shadow: 0 8px 22px rgba(10, 14, 22, .3);
}

.flipHintIcon {
  width: 36px;
  perspective: 120px
}

.flipHintIcon svg {
  height: 18px;
  width: auto;
  color: var(--chrome-ink)
}

.flipHintLabel {
  padding: 0 14px;
  white-space: nowrap;
  font-family: 'Onest', sans-serif;
  font-size: 9px;
  letter-spacing: .14em;
  text-indent: .14em;
  text-transform: uppercase;
  color: var(--chrome-ink)
}

.flipHintIcon.on,
.flipHintLabel.on {
  opacity: 1;
  scale: 1
}

/* the offering track: five slots strung along a thread at the foot of the
   screen, one per card token. Empty placeholders fill as each card is chosen —
   the progression and the gathered offering in one. A gold thread draws as far
   as you've laid, and the current step is named above it. */
.deck {
  position: fixed;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
  transition: opacity .6s ease, filter .6s ease;
}

.deck.hidden {
  opacity: 0;
  filter: blur(6px)
}

.deck.hidden .deckSlot {
  pointer-events: none
}


/* fanned hand: each card rotates + lifts into a gentle arch, overlapping its
   neighbours and pivoting around a point below the row */
.deckSlot {
  position: relative;
  width: 54px;
  height: 80px;
  flex: none;
  border-radius: 7px;
  z-index: 1;
  margin: 0 -7px;
  transform-origin: 50% 124%;
  translate: 0 var(--arcY, 0);
  rotate: var(--rot, 0deg);
  transition: translate .4s cubic-bezier(.2, .8, .2, 1), rotate .4s cubic-bezier(.2, .8, .2, 1),
    scale .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease;
}

/* empty: a frosted-glass placeholder holding a faint star, waiting to be filled */
.deckSlot.empty {
  border: 1px dashed rgba(168, 132, 47, .5);
  background: rgba(255, 255, 255, .3);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  pointer-events: none;
}

.slotStar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: auto;
  translate: -50% -50%;
  fill: rgba(168, 132, 47, .45);
  transition: fill .3s, opacity .3s;
}

.deckSlot.filled .slotStar {
  display: none
}

/* the slot we're about to fill breathes softly */
.deckSlot.now {
  animation: slotWait 2.4s ease-in-out infinite
}

.deckSlot.now .slotStar {
  fill: var(--gold);
  opacity: .95
}

@keyframes slotWait {

  0%,
  100% {
    border-color: rgba(168, 132, 47, .5);
    box-shadow: 0 0 0 0 rgba(201, 164, 74, 0)
  }

  50% {
    border-color: var(--gold);
    box-shadow: 0 0 16px 0 rgba(201, 164, 74, .55)
  }
}

/* filled: the chosen card scaled to fill the slot, edged in warm gold */
.deckSlot.filled {
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(66, 88, 108, .32), 0 0 0 1px rgba(201, 164, 74, .5),
    inset 0 0 0 1px rgba(255, 255, 255, .35);
}

@keyframes slotFill {
  from {
    scale: .55;
    opacity: .3
  }

  to {
    scale: 1;
    opacity: 1
  }
}

/* the hand opens + magnifies in JS (bindDeckDock); short transitions during
   tracking let the row follow the cursor fluidly, settling back on leave */
.deck.docking .deckSlot {
  transition: translate .14s ease, rotate .14s ease, scale .14s ease, box-shadow .14s ease;
}

.deckSlot.filled:hover {
  box-shadow: 0 18px 34px rgba(66, 88, 108, .4), 0 0 0 1px rgba(201, 164, 74, .7);
}

/* the flying clone keeps the slot's full look (radius, crop, border) the whole way,
   so nothing pops on the trip to the portal or back */

/* tapping a laid card lifts it full-size to the centre of the screen */
.cardZoomBackdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 12, 16, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.cardZoom {
  position: fixed;
  z-index: 71;
  cursor: pointer;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .5));
}

html[data-theme="dark"] .deckSlot.empty {
  border-color: rgba(201, 164, 74, .4);
  background: rgba(20, 24, 34, .34)
}

html[data-theme="dark"] .deckSlot.filled {
  box-shadow: 0 10px 24px rgba(0, 0, 0, .5), 0 0 0 1px rgba(201, 164, 74, .3)
}

html[data-theme="dark"] .trackArc .arcBase {
  stroke: rgba(201, 164, 74, .3)
}

/* the card's menu: one glass dock holding the three actions as segments;
   it rises from the bottom edge as the card arrives and sinks away with it */
.hudActions {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 90px);
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 5px;
  border-radius: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  box-shadow: var(--glass-edge), 0 12px 34px rgba(10, 14, 22, .25);
  opacity: 0;
  pointer-events: none;
  transition: transform .7s cubic-bezier(.22, .9, .3, 1), opacity .5s ease
}

.hudActions.on {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto
}

.sealBtn {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px 0 13px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .3s
}

/* hairline seams between the segments */
.sealBtn + .sealBtn {
  position: relative;
  margin-left: 3px
}

.sealBtn + .sealBtn::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 26%;
  height: 48%;
  width: 1px;
  background: rgba(255, 255, 255, .16)
}

/* the dock's icons are the hand-drawn set from svgs/final card, printed in
   the chrome's white via the same mask trick as the logo */
.sealIco {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  background: var(--chrome-ink);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.ico-map {
  -webkit-mask-image: url("../svgs/final card/icon_map.svg");
  mask-image: url("../svgs/final card/icon_map.svg")
}

.ico-redraw {
  -webkit-mask-image: url("../svgs/final card/icon_redraw.svg");
  mask-image: url("../svgs/final card/icon_redraw.svg")
}

.ico-restart {
  -webkit-mask-image: url("../svgs/final card/icon_restart.svg");
  mask-image: url("../svgs/final card/icon_restart.svg")
}

.sealLbl {
  font-family: 'Onest', sans-serif;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--chrome-ink);
  transition: opacity .35s
}

.sealBtn:hover,
.sealBtn:focus-visible {
  background: rgba(255, 255, 255, .1);
  outline: none
}

.sealBtn:hover .sealLbl,
.sealBtn:focus-visible .sealLbl {
  opacity: 1
}

@media (max-width:640px) {

  /* safe center: centres short screens (threshold) but pins tall ones to the
     top so nothing is clipped by body overflow:hidden */
  .ui {
    justify-content: safe center;
    padding: 88px 16px 80px
  }

  /* pin the stage to the viewport in absolute units — flex % width was being
     floored by content and overflowing the phone */
  .stage {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px)
  }

  .progress {
    top: 60px
  }

  .q-title {
    font-size: clamp(25px, 6.6vw, 33px);
    line-height: 1.18
  }

  .q-hint {
    font-size: 15px;
    margin-bottom: 38px
  }

  /* card size + 2-up column count are handled fluidly below (clamp + the
     ≤820px rule), so no hard phone overrides are needed here */
  .attrs {
    flex-wrap: wrap
  }

  /* the threshold re-stacks on phones: the title block centers itself in the
     space above the gate button, and the button + signature hold the bottom */
  .stage.threshold {
    justify-content: flex-end
  }

  .thresh-copy {
    width: 100%;
    margin: auto 0
  }

  .thresh-actions {
    margin-top: 0;
    margin-bottom: 0;
    gap: 14px;
    width: 100%
  }

  /* the gate button spans the stage (viewport minus its 16px side padding):
     the text plate stretches and centers, the square icon keeps its size */
  .thresh-actions .button-005 {
    width: 100%
  }

  .thresh-actions .button-005__text-wrap {
    flex: 1
  }

  .thresh-actions .button-005__text {
    text-align: center
  }

  /* the threshold's button sits near the true bottom edge; other stages keep
     the roomier padding */
  .ui:has(.stage.threshold) {
    padding-bottom: 30px
  }

  .button-003 {
    font-size: 11.5px
  }

  .brand-super {
    font-size: clamp(18px, 6vw, 36px)
  }

  .brand {
    font-size: clamp(44px, 18vw, 96px)
  }

  .sub {
    font-size: 16px;
    max-width: 84vw
  }

  .card {
    --cw: min(340px, 88vw, calc(72svh * 1145 / 1713))
  }

  .hudBrand {
    top: 12px;
    left: 14px
  }

  .sndBar {
    top: 14px;
    right: 14px
  }

  .hudActions {
    bottom: 22px;
    gap: 8px
  }

  /* phones keep the dock tight: "find in map" shortens to "map" */
  .lblWide {
    display: none
  }

  .sealBtn {
    padding: 0 12px 0 10px;
    gap: 7px
  }

  /* the island uses the whole phone width — it bleeds past the stage padding
     to the viewport edges (the .ui clips x-overflow so nothing scrolls) */
  .mapwrap {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw)
  }

  /* the offering fan shrinks and flattens so it never crowds a small screen */
  .deckSlot {
    width: 42px;
    height: 60px;
    margin: 0 -5px;
    border-radius: 5px;
    /* scale down arc lift and rotation for a flatter fan */
    translate: 0 calc(var(--arcY, 0px) * 0.5);
    rotate: calc(var(--rot, 0deg) * 0.65)
  }


  .hudActions {
    gap: 10px
  }
}

@media (prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important
  }

  .stage.enter,
  .stage.leave {
    animation: none
  }

  .stage.leave {
    opacity: 0
  }

  .card {
    animation: none
  }
}

/* ════════ TABLET & NARROW ════════
   below this width four cards no longer sit comfortably in a row, so the deck
   collapses to a clean 2×2. Capping .opts at exactly two cards + one gap means
   the third can never squeeze on — no stray 3+1 row at any in-between width.
   Card SIZE is untouched here (it's the fluid clamp), so crossing this
   threshold only re-flows the grid; nothing snaps bigger or smaller. */
@media (max-width:820px) {
  .opts {
    max-width: calc(2 * clamp(150px, 20vw, 210px) + clamp(12px, 2vw, 22px))
  }
}

/* ════════ SHORT / LANDSCAPE ════════
   landscape phones and stubby windows: trim the vertical rhythm so a whole
   screen still fits without the .ui having to scroll. Widths stay fluid; only
   heights/margins tighten here. The result card and palm are already height-
   capped (svh) in their base rules, so they shrink to fit on their own. */
@media (max-height:560px) {
  .ui {
    padding-top: 60px;
    padding-bottom: 52px
  }

  .thresh-copy {
    margin-top: 0
  }

  .sub {
    margin-top: 8px
  }

  .thresh-actions {
    margin-top: 18px;
    margin-bottom: 14px;
    gap: 12px
  }

  .button-003 {
    font-size: 11px
  }

  .q-eyebrow {
    margin-bottom: 10px
  }

  .q-hint {
    margin-bottom: 28px
  }

  .opts {
    margin-top: 12px
  }

  .opt {
    height: min(clamp(224px, 30vw, 288px), 58svh)
  }

  .vtextwrap {
    height: 22px
  }

  .hudActions {
    bottom: 16px
  }
}


/* ════════ NIGHT ════════ */
html[data-theme="dark"] body {
  background: linear-gradient(180deg, #12151f 0%, #1b2030 55%, #232a3a 100%);
}

html[data-theme="dark"] {
  --ink: #e9e4d8;
  --ink-soft: #c9c3b4;
  --slate: #97a1ad;
  --gold-hi: #e0bb5e;
}

html[data-theme="dark"] .brand,
html[data-theme="dark"] .brand-super,
html[data-theme="dark"] .q-title {
  background: linear-gradient(178deg, #f0ead9 25%, #b3ab97 52%, #f0ead9 78%);
  -webkit-background-clip: text;
  background-clip: text;
}


/* at night the wordmark goes white with the rest of the chrome */
html[data-theme="dark"] .hudBrand {
  color: rgba(255, 255, 255, .88)
}

/* the maker's mark: a square plate beside the sound toggle holding one white
   heart; greeting it unfolds the name and sets the heart beating */
.sigBtn {
  padding: 0 11px;
  gap: 0;              /* a perfect 38px square until the name unfolds */
  text-decoration: none;
}

/* beats the .snd svg stroke rule: this one heart is solid */
.sigBtn .sigHeart {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: var(--chrome-ink);
  stroke: none;
  transform-origin: center;
}

.sigLbl {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  margin-right: 0;
  transition: max-width .5s cubic-bezier(.22, .9, .3, 1), opacity .4s ease, margin-right .5s cubic-bezier(.22, .9, .3, 1);
}

.sigBtn:hover .sigLbl,
.sigBtn:focus-visible .sigLbl {
  max-width: 130px;
  opacity: 1;
  margin-right: 8px;
}

.sigBtn:hover .sigHeart,
.sigBtn:focus-visible .sigHeart {
  animation: heartBeat 1s ease-in-out infinite
}

.sigBtn:focus-visible {
  outline: none
}

@keyframes heartBeat {

  0%,
  100% {
    transform: scale(1)
  }

  14% {
    transform: scale(1.28)
  }

  28% {
    transform: scale(1)
  }

  42% {
    transform: scale(1.18)
  }
}



html[data-theme="dark"] .button-003 {
  --button-003-color-background: rgba(20, 24, 34, .4)
}

html[data-theme="dark"] .button-003:is(:hover, :focus-visible) .button-003__text-bg,
html[data-theme="dark"] .button-003:is(:hover, :focus-visible) .button-003__icon-bg {
  background-color: rgba(28, 34, 48, .6)
}

html[data-theme="dark"] .pseg {
  stroke: rgba(233, 228, 216, .2)
}

html[data-theme="dark"] .pnode {
  fill: rgba(233, 228, 216, .28)
}

html[data-theme="dark"] .thresh-copy::before {
  background: radial-gradient(58% 62% at 50% 50%, rgba(20, 26, 40, .85), rgba(20, 26, 40, 0) 74%);
}

html[data-theme="dark"] .tLayer.front {
  background: linear-gradient(102deg, #272f3c 0%, #2c3542 100%);
  filter: drop-shadow(-22px 10px 22px rgba(0, 0, 0, .5));
}

html[data-theme="dark"] .tLayer.side {
  background: linear-gradient(102deg, #1a212c 0%, #1f2833 100%);
}

html[data-theme="dark"] .vtext {
  color: var(--ink-soft)
}

/* night cards: dark lacquer instead of parchment */
html[data-theme="dark"] .opt {
  background: linear-gradient(180deg, #252b3c 0%, #1b202d 100%);
  border-color: rgba(201, 164, 74, .4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5), 0 0 0 2px rgba(201, 164, 74, .1);
}

html[data-theme="dark"] .opt::before {
  border-color: rgba(201, 164, 74, .22)
}

html[data-theme="dark"] .opt h3 {
  color: #ece6d6
}

html[data-theme="dark"] .opt p {
  color: #b2aa98
}

html[data-theme="dark"] .deckSlot .opt {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .55), 0 0 0 1px rgba(201, 164, 74, .12)
}

html[data-theme="dark"] .faceBg {
  background: linear-gradient(180deg, #272d3f 0%, #1c2130 100%);
  border-color: rgba(201, 164, 74, .4);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .55), 0 0 0 2px rgba(201, 164, 74, .1);
}

html[data-theme="dark"] .dest-name,
html[data-theme="dark"] .attr b,
html[data-theme="dark"] .finds {
  color: #ece6d6
}

/* the engraving prints in the brighter night gold on the lacquer */
html[data-theme="dark"] .sceneArt {
  background: var(--gold-hi)
}

/* the walked stars burn in the night gold */
html[data-theme="dark"] .constellation .cLit {
  fill: var(--gold-hi)
}

html[data-theme="dark"] .cSealTxt {
  fill: var(--gold-hi)
}

html[data-theme="dark"] .faceBg::after {
  /* emitted spectrum: the same iridescence, but glowing off the lacquer */
  mix-blend-mode: screen;
  background: linear-gradient(112deg,
      transparent 36%,
      rgba(255, 120, 140, .08) 43%,
      rgba(255, 210, 110, .08) 46.5%,
      rgba(120, 235, 170, .08) 50%,
      rgba(120, 170, 255, .1) 53.5%,
      rgba(200, 130, 255, .08) 57%,
      transparent 64%);
  background-size: 230% 230%;
  background-position: var(--gx, 50%) var(--gy, 50%);
}

html[data-theme="dark"] .spiritHand {
  background: #a7b6c9
}

/* night map */



/* night hover: the ring around a chosen card is gold, not white */
html[data-theme="dark"] .optShell:hover .opt,
html[data-theme="dark"] .optShell:focus-visible .opt {
  box-shadow: 0 30px 64px rgba(0, 0, 0, .55), 0 0 0 2px rgba(201, 164, 74, .45);
}

/* night portal: a dark mouth instead of a golden glow */
html[data-theme="dark"] .portalCore {
  background: radial-gradient(circle at 50% 50%, rgba(4, 6, 12, .9), rgba(6, 8, 15, .4) 46%, transparent 74%);
}

html[data-theme="dark"] .portalWave {
  --wave: rgba(2, 4, 10, .72)
}

html[data-theme="dark"] .palm.holding .portalCore {
  filter: brightness(.72) contrast(1.08);
}