/* After home.css (load order matters): the floors from the run down to the hoard, the foot, arrival, then later touches. */

/* ---------- floor 1: the run ---------- */
.run { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 90px); align-items: center; max-width: 1180px; margin: 0 auto; min-height: 100vh; }
.beats { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.beats li { display: grid; grid-template-columns: 28px 110px 1fr; align-items: center; gap: 10px; }
.beats img { width: 21px; height: 21px; }
.beats b { font-size: 20px; color: var(--gold-hi); font-weight: 400; }
.beats span { color: var(--text); font-size: 16px; line-height: 1.4; }
.run-wren { position: absolute; right: clamp(0px, 4vw, 80px); bottom: 12%; width: 180px; height: auto; pointer-events: none; }
@media (max-width: 900px) { .run { grid-template-columns: 1fr; } .run-wren { display: none; } .beats li { grid-template-columns: 26px 1fr; } .beats span { grid-column: 2; } }

/* ---------- floor 3: merge ---------- */
.merge { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: clamp(24px, 4vw, 56px); align-items: center; max-width: 1320px; margin: 0 auto; min-height: 100vh; }
.forge { text-align: center; }
.tiles { display: flex; justify-content: center; gap: clamp(28px, 6vw, 70px); margin: 6px 0 22px; }
.tile { --line-c: var(--r0); --fill-c: var(--f0); width: clamp(112px, 15vw, 150px); aspect-ratio: 1; display: grid; place-items: center; position: relative; border-radius: 4px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--fill-c) 80%, #fff 6%), var(--fill-c) 70%);
  box-shadow: inset 0 0 0 3px var(--line-c), inset 0 0 0 5px rgba(0, 0, 0, .45), 0 0 26px color-mix(in srgb, var(--line-c) 45%, transparent), 0 10px 26px rgba(0, 0, 0, .55);
  transition: box-shadow .4s, background .4s; }
.tile[data-r='1'] { --line-c: var(--r1); --fill-c: var(--f1); } .tile[data-r='2'] { --line-c: var(--r2); --fill-c: var(--f2); }
.tile[data-r='3'] { --line-c: var(--r3); --fill-c: var(--f3); } .tile[data-r='4'] { --line-c: var(--r4); --fill-c: var(--f4); }
.tile[data-r='5'] { --line-c: var(--r5); --fill-c: var(--f5); } .tile[data-r='6'] { --line-c: var(--r6); --fill-c: var(--f6); animation: gilded 2.4s ease-in-out infinite; }
@keyframes gilded { 50% { box-shadow: inset 0 0 0 3px #fff3c4, inset 0 0 0 5px rgba(0, 0, 0, .3), 0 0 48px rgba(255, 216, 115, .8), 0 10px 26px rgba(0, 0, 0, .55); } }
.tile.empty .piece { visibility: hidden; }
.piece { all: unset; cursor: grab; touch-action: none; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 4px; }
.piece:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: -6px; }
.piece.dragging { cursor: grabbing; z-index: 5; position: relative; }
.piece.picked { outline: 3px dashed var(--gold-hi); outline-offset: -8px; }
.item { width: 70%; height: auto; pointer-events: none; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
.tile.gild .item { filter: sepia(1) saturate(3.5) brightness(1.25) drop-shadow(0 0 10px #ffd873); }
.forge-say { font: 20px/1.3 'Gold Below Body', monospace; color: var(--hi); min-height: 2.6em; max-width: none; margin: 0 auto 10px; }
.forge-say .r { color: var(--rc, var(--gold-hi)); }
.forge-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }
.ladder { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ladder li { font: 10px/1 'Gold Below Body', monospace; padding: 6px 7px; border-radius: 2px; color: #6b5f50; box-shadow: inset 0 0 0 1px #3b3027; transition: color .3s, box-shadow .3s; }
.ladder li.got { color: var(--c); box-shadow: inset 0 0 0 1px var(--c), 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); }
.ladder li[data-r='0'] { --c: var(--r0); } .ladder li[data-r='1'] { --c: var(--r1); } .ladder li[data-r='2'] { --c: var(--r2); } .ladder li[data-r='3'] { --c: var(--r3); }
.ladder li[data-r='4'] { --c: var(--r4); } .ladder li[data-r='5'] { --c: var(--r5); } .ladder li[data-r='6'] { --c: var(--r6); }
.flash { position: absolute; inset: -30%; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, var(--line-c) 0, transparent 60%); opacity: 0; }
.tile.merged .flash { animation: flash .7s ease-out; }
@keyframes flash { 0% { opacity: .95; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.4); } }
@media (max-width: 1100px) { .merge { grid-template-columns: 1fr 1fr; } .merge .phone { grid-column: 1 / -1; } }
@media (max-width: 760px) { .merge { grid-template-columns: 1fr; } }

/* ---------- floor 6: read the enemy ---------- */
.read { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 70px); align-items: center; max-width: 1180px; margin: 0 auto; min-height: 100vh; }
.duel { display: grid; gap: 22px; }
.duel-foe { display: grid; justify-items: center; gap: 10px; text-align: center; }
.plate { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; background: #1c1210; border-radius: 3px;
  box-shadow: inset 0 0 0 2px #8a2a2a, 0 0 0 1px #000, 0 6px 18px rgba(0, 0, 0, .5); transition: box-shadow .2s; }
.plate-icon { width: 27px; height: 27px; }
.plate-n { font: 40px/1 'Gold Below Display', monospace; color: #ffd0c4; }
.duel[data-intent='heavy'] .plate { animation: warn .7s ease-in-out infinite; }
@keyframes warn { 50% { box-shadow: inset 0 0 0 2px #ff4a3a, 0 0 0 1px #000, 0 0 26px rgba(255, 74, 58, .6); } }
.foe { width: clamp(140px, 22vw, 210px); height: auto; }
.duel[data-intent='heavy'] .foe { animation: windup 1.1s ease-in-out infinite; }
@keyframes windup { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-6px) scale(1.04) rotate(-2deg); } 55% { transform: translateY(-6px) scale(1.04) rotate(2deg); } }
.foe.hit { animation: hit .35s ease-out; }
@keyframes hit { 20% { transform: translateX(8px); filter: brightness(2.2); } 60% { transform: translateX(-5px); } }
.bar-hp { width: min(240px, 70vw); height: 14px; background: #2a1414; box-shadow: inset 0 0 0 2px #000; border-radius: 2px; overflow: hidden; }
.bar-hp i { display: block; height: 100%; width: var(--w, 100%); background: linear-gradient(180deg, #ff8a9a, var(--hp) 45%, #a8243a); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.duel-intent { font: 20px/1.3 'Gold Below Body', monospace; color: var(--hi); margin: 0; max-width: none; }
.duel-you { display: grid; gap: 14px; justify-items: center; }
.you-row { display: flex; align-items: center; gap: 10px; }
.you-row img { width: 27px; height: 27px; }
.you-n { font: 40px/1 'Gold Below Display', monospace; color: var(--hp-text); min-width: 2.4ch; }
.you-row.hurt { animation: hit .35s ease-out; }
.duel-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.act { all: unset; cursor: pointer; display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border-radius: 4px; text-align: center; min-height: 64px; }
.act .display { font-size: 40px; line-height: 1; }
@media (max-width: 400px) { .act { padding-left: 4px; padding-right: 4px; } } /* room for the longer words of other languages */
.act small { font: 10px/1.2 'Gold Below Body', monospace; }
.act-attack { background: var(--gold); color: #1d1004; box-shadow: inset 0 2px 0 var(--gold-hi), inset 0 -4px 0 #b06a1c, 0 3px 0 #3a1f06; }
.act-guard { background: #233552; color: #e6efff; box-shadow: inset 0 2px 0 #3a5a8a, inset 0 -4px 0 #15233a, 0 3px 0 #000, inset 0 0 0 2px #4d6f9e; }
.act:hover { filter: brightness(1.1); }
.act:active { transform: translateY(2px); }
.act:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
.act[disabled] { opacity: .45; cursor: default; filter: none; }
.duel-say { font-size: 17px; color: var(--hi); text-align: center; min-height: 3.2em; margin: 0; max-width: 40ch; }
.duel-say b { color: var(--gold-hi); font-weight: 600; }
@media (max-width: 860px) { .read { grid-template-columns: 1fr; } }

/* ---------- floor 9: heroes ---------- */
.heroes { max-width: 1240px; margin: 0 auto; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'copy card' 'roster roster'; gap: 28px clamp(24px, 4vw, 56px); align-items: start; }
.heroes-copy { grid-area: copy; }
.hero-card { grid-area: card; }
.roster { grid-area: roster; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 1.5vw, 18px); }
.hero { all: unset; cursor: pointer; display: grid; justify-items: center; align-content: end; gap: 10px; padding: 18px 6px 14px; border-radius: 4px; min-height: 230px;
  background: linear-gradient(180deg, transparent, rgba(42, 33, 25, .75)); box-shadow: inset 0 0 0 2px rgba(110, 86, 56, .5); transition: box-shadow .25s, background .25s; }
.hero img { width: min(135px, 90%); height: auto; transition: transform .3s; }
.hero span { font-size: 20px; color: var(--dim); }
.hero[aria-selected='true'] { background: linear-gradient(180deg, rgba(247, 185, 62, .08), rgba(55, 44, 34, .9)); box-shadow: inset 0 0 0 2px var(--gold), 0 0 30px rgba(247, 185, 62, .2); }
.hero[aria-selected='true'] span { color: var(--gold-hi); }
.hero[aria-selected='true'] img { transform: scale(1.06); }
.hero:hover { box-shadow: inset 0 0 0 2px var(--line-hi); }
.hero:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
.hero-card header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.hero-name { font-size: 40px; margin: 0; color: var(--gold-hi); text-shadow: 0 2px 0 #3a1f06; }
.hero-title { font: 20px/1 'Gold Below Body', monospace; color: var(--dim); margin: 0; }
.tag { font: 10px/1 'Gold Below Body', monospace; color: #1d1004; background: var(--gold); padding: 5px 7px; border-radius: 2px; }
.hero-card dl { margin: 0; display: grid; gap: 8px; }
.hero-card dt { font: 600 20px/1.2 'Barlow Condensed', sans-serif; color: var(--hi); display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hero-card dt img { width: 21px; height: 21px; }
.hero-card dd { margin: 0 0 4px 29px; color: var(--text); }
@media (max-width: 900px) { .heroes { grid-template-columns: 1fr; grid-template-areas: 'copy' 'roster' 'card'; } .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hero { min-height: 170px; } }

/* ---------- floors 10, 20, 30: the keepers ---------- */
.keepers { padding: 0; }
.keeper { --glow: #ffb347; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 4vw, 60px);
  max-width: 1240px; margin: 0 auto; padding: clamp(80px, 12vh, 140px) var(--gutter); }
.keeper-brine { --glow: #48e0a0; } .keeper-avarax { --glow: #ff5a2a; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.keeper:nth-child(2) .boss { order: 2; }
.boss { width: min(560px, 88vw); height: auto; justify-self: center; filter: drop-shadow(0 0 40px color-mix(in srgb, var(--glow) 35%, transparent)); }
.keeper-copy h2 { font-size: 60px; }
@media (min-width: 900px) { .keeper-copy h2.display { font-size: 80px; } }
.quote { font: italic 22px/1.45 Barlow, serif; color: var(--hi); border-left: 3px solid var(--glow); padding-left: 16px; }
html:not(.gl) .keeper { background: radial-gradient(ellipse 50% 45% at 30% 50%, color-mix(in srgb, var(--glow) 14%, transparent), transparent 70%); }
html:not(.gl) .keeper-tally { background-image: radial-gradient(ellipse 50% 45% at 30% 50%, rgba(255, 179, 71, .14), transparent 70%), linear-gradient(rgba(10, 8, 6, .85), rgba(10, 8, 6, .85)), url(/img/bg-cellars.png); background-size: auto, auto, cover; background-position: center; }
html:not(.gl) .keeper-brine { background-image: radial-gradient(ellipse 50% 45% at 70% 50%, rgba(72, 224, 160, .14), transparent 70%), linear-gradient(rgba(10, 8, 6, .85), rgba(10, 8, 6, .85)), url(/img/bg-reliquary.png); background-size: auto, auto, cover; background-position: center; }
html:not(.gl) .keeper-avarax { background-image: radial-gradient(ellipse 50% 45% at 30% 50%, rgba(255, 90, 42, .16), transparent 70%), linear-gradient(rgba(10, 8, 6, .85), rgba(10, 8, 6, .85)), url(/img/bg-hoard.png); background-size: auto, auto, cover; background-position: center; }
@media (max-width: 1100px) { .keeper-avarax { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .keeper-avarax .phone { grid-column: 1 / -1; } }
@media (max-width: 860px) { .keeper, .keeper-avarax { grid-template-columns: 1fr; min-height: auto; } .keeper:nth-child(2) .boss { order: 0; } .boss { width: min(400px, 80vw); } .keeper-copy h2.display { font-size: 60px; } }

/* ---------- the crowd ---------- */
.crowd { text-align: center; overflow: hidden; display: grid; justify-items: center; gap: 30px; }
.crowd-track { width: 100vw; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.crowd-row { display: flex; gap: 46px; align-items: flex-end; width: max-content; animation: crowd 60s linear infinite; padding: 10px 0; }
.crowd-row img { height: 120px; width: auto; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .4)); }
@keyframes crowd { to { transform: translateX(-50%); } }

/* ---------- the bottom ---------- */
.hoard { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'copy phone' 'play play'; gap: 40px clamp(24px, 5vw, 70px); align-items: center; max-width: 1180px; margin: 0 auto; padding-bottom: 120px; }
.hoard-copy { grid-area: copy; } .hoard .phone { grid-area: phone; }
.play { grid-area: play; text-align: center; display: grid; justify-items: center; padding: clamp(30px, 5vw, 60px);
  box-shadow: inset 0 0 0 2px var(--gold-dark), inset 0 0 0 4px rgba(0, 0, 0, .4), inset 0 4px 0 4px rgba(255, 216, 115, .15), 0 0 80px rgba(247, 185, 62, .16), 0 24px 60px rgba(0, 0, 0, .6); }
.play p { margin-left: auto; margin-right: auto; }
.play-title { font-size: 40px; }
@media (min-width: 900px) { .play-title { font-size: 60px; } }
@media (max-width: 860px) { .hoard { grid-template-columns: 1fr; grid-template-areas: 'copy' 'phone' 'play'; } }

/* ---------- the foot ---------- */
.foot { display: grid; justify-items: center; gap: 14px; padding: 50px var(--gutter) calc(40px + env(safe-area-inset-bottom)); text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.foot img { width: 80px; height: auto; opacity: .85; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; }
.foot nav a { font: 20px/1.4 'Gold Below Body', monospace; color: var(--dim); text-decoration: none; padding: 8px 0; }
.foot nav a:hover { color: var(--gold-hi); }
.foot .langs { gap: 4px 16px; }
.foot .langs a { font: 15px/1.6 Barlow, system-ui, sans-serif; color: #9a8a73; padding: 4px 0; }
.foot .langs a:hover, .foot .langs a[aria-current] { color: var(--gold-hi); }
.foot p { font-size: 14px; color: #9a8a73; max-width: 70ch; }

/* ---------- arrival ---------- */
.rise { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.rise.in { opacity: 1; transform: none; }
.threshold-inner > * { animation: up 1s cubic-bezier(.2, .8, .2, 1) both; }
.threshold-inner > :nth-child(1) { animation-delay: .9s; } .threshold-inner > :nth-child(2) { animation-delay: .1s; } .threshold-inner > :nth-child(3) { animation-delay: 1.3s; }
.threshold-inner > :nth-child(4) { animation-delay: 1.5s; } .threshold-inner > :nth-child(5) { animation-delay: 1.7s; } .threshold-inner > :nth-child(6) { animation-delay: 1.9s; }
@keyframes up { from { opacity: 0; transform: translateY(18px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rise { opacity: 1; transform: none; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  section { padding-top: 70px; padding-bottom: 70px; }
}

/* a twin drops in beside the merged piece */
.piece.drop { animation: drop .5s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes drop { from { transform: translateY(-90px) scale(.7); opacity: 0; } }

/* the stages the voxels stand in: a bronze frame, open in the middle, dark only under their words */
.forge, .duel { border-radius: 4px; padding: clamp(20px, 3vw, 34px);
  background: linear-gradient(180deg, rgba(20, 15, 11, .08), rgba(20, 15, 11, .18) 40%, rgba(20, 15, 11, .78));
  box-shadow: inset 0 0 0 2px var(--line), inset 0 3px 0 2px rgba(143, 115, 80, .3), 0 18px 50px rgba(0, 0, 0, .35); }
html:not(.gl) .forge, html:not(.gl) .duel { background: linear-gradient(180deg, rgba(42, 33, 25, .9), rgba(28, 22, 16, .92)); }
.tile { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--fill-c) 45%, transparent), color-mix(in srgb, var(--fill-c) 30%, transparent) 70%); }
html:not(.gl) .tile { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--fill-c) 80%, #fff 6%), var(--fill-c) 70%); }
.forge-say, .duel-intent, .duel-say { text-shadow: 0 2px 6px #000, 0 0 2px #000; }
.hero { background: linear-gradient(180deg, transparent 55%, rgba(20, 15, 11, .7)); }
.hero[aria-selected='true'] { background: linear-gradient(180deg, rgba(247, 185, 62, .05) 55%, rgba(55, 44, 34, .85)); }
html:not(.gl) .hero { background: linear-gradient(180deg, transparent, rgba(42, 33, 25, .75)); }

/* the run: Wren stands between the words and the phone, then flattens into her sprite */
.run { grid-template-columns: minmax(0, 1fr) clamp(140px, 13vw, 200px) auto; }
.run-copy { grid-column: 1; grid-row: 1; }
.run .phone { grid-column: 3; grid-row: 1; }
.run-wren { position: static; grid-column: 2; grid-row: 1; align-self: end; width: 100%; margin-bottom: 40px; }
@media (max-width: 900px) { .run { grid-template-columns: 1fr; } .run .phone { grid-column: 1; grid-row: 2; } .run-wren { display: none; } }

/* the six at the vault door, three a side, standing on its floor */
.cast { position: absolute; inset: auto 0 0; height: 0; pointer-events: none; }
.cast img { position: absolute; bottom: 70px; width: clamp(90px, 8.4vw, 150px); height: auto; filter: brightness(.55) drop-shadow(0 0 12px rgba(255, 190, 90, .35)); }
.cast-l:nth-child(1) { left: 3vw; bottom: 96px; } .cast-l:nth-child(2) { left: 10.5vw; bottom: 82px; } .cast-l:nth-child(3) { left: 18vw; }
.cast-r:nth-child(4) { right: 18vw; } .cast-r:nth-child(5) { right: 10.5vw; bottom: 82px; } .cast-r:nth-child(6) { right: 3vw; bottom: 96px; }
.cast img { animation: up 1.2s cubic-bezier(.2, .8, .2, 1) 1.1s both; }
@media (max-width: 1100px) { .cast { display: none; } }

/* the stores' own badges, as Apple and Google draw them: same height, side by side, never altered */
.store { display: block; border-radius: 9px; transition: transform .15s ease, filter .15s ease; }
.store img { display: block; height: 58px; width: auto; }
.store:hover { transform: translateY(-2px); filter: drop-shadow(0 8px 18px rgba(247, 185, 62, .25)); }
.store:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 4px; }
.ctas { align-items: center; }
@media (max-width: 560px) { .store img { height: 50px; } .ctas { gap: 10px; } .play { padding: 26px 16px; } .play .store img { height: 44px; } }
.foot .marks { font-size: 12px; color: #7d6f5c; }
