/* Main edition — clean type layer over the windows (overrides styles.css / immersive.css) */
#stage { font-family: Inter, "Helvetica Neue", Arial, sans-serif; color: #f4f3ef; }
#stage .topbar, #stage .status, #stage .coordinates, #stage .tracking, #stage .interaction-note, #stage .memory-link {
  text-shadow: 0 1px 14px rgba(0, 0, 0, .28);
}

/* top bar */
#stage .topbar {
  padding: 48px 5vw 0; border-bottom: 0; align-items: center;
  font: 400 12.5px/1.25 Inter, "Helvetica Neue", Arial, sans-serif; letter-spacing: .14em;
}
#stage .brand { font-weight: 400; }
#stage .mode { padding-top: 0; }
#stage .clock { display: flex; align-items: center; justify-content: flex-end; gap: 34px; }
#stage .countdown { color: #f4f3ef; font: 300 30px/1 Inter, "Helvetica Neue", Arial, sans-serif; letter-spacing: .04em; text-shadow: 0 1px 14px rgba(0, 0, 0, .28); }
#stage .dive-toggle, #stage .sound-toggle {
  margin: 0; padding: 0; border: 0; background: none; color: #f4f3ef;
  font: 400 12.5px/1 Inter, "Helvetica Neue", Arial, sans-serif; letter-spacing: .14em; opacity: .92;
}
#stage .sound-toggle.active, #stage .sound-toggle:hover, #stage .dive-toggle:hover { color: #f4f3ef; background: none; opacity: 1; text-shadow: none; }

/* title block */
#stage .status { left: 15.8vw; top: 39vh; width: auto; max-width: 80vw; transform: none; }
#stage .title-row { display: flex; align-items: baseline; gap: 2.1vw; flex-wrap: nowrap; }
#stage .glitch-title {
  margin: 0; padding: 0; background: none; color: #f4f3ef; text-shadow: 0 2px 24px rgba(0, 0, 0, .22);
  font: 400 clamp(44px, 6.15vw, 118px)/.92 Inter, "Helvetica Neue", Arial, sans-serif; font-style: normal;
  letter-spacing: -.025em; text-transform: uppercase; white-space: nowrap; filter: none; opacity: 1;
}
#stage .glitch-title::before, #stage .glitch-title::after { content: none; }
#stage .title-ja { font: 400 clamp(13px, 1.12vw, 20px)/1 "Noto Sans JP", sans-serif; letter-spacing: .2em; opacity: .92; }
#stage .world-description {
  margin: 2.6vw 0 0; max-width: 72vw;
  font: 400 clamp(14px, 1.03vw, 19px)/1.38 Inter, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0; text-transform: none; text-shadow: 0 1px 12px rgba(0, 0, 0, .45);
}

/* memory card: sits low in the middle, slightly tilted; hold to open */
#stage .memory-link {
  left: 46.2vw; right: auto; top: 62.5vh; width: clamp(77px, 7.4vw, 144px);
  transform: rotate(8deg); transform-origin: 50% 50%; isolation: auto; transition: transform .35s ease;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer;
}
#stage .memory-link::before { content: none; }
#stage .memory-link img {
  width: 100%; opacity: 1; mix-blend-mode: normal; filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .38));
  transition: transform .25s ease, filter .25s ease; pointer-events: none;
}
#stage .memory-link:hover, #stage .memory-link:focus-visible { transform: rotate(4deg) scale(1.04); filter: none; }
#stage .memory-link small {
  left: 0; top: calc(100% + 16px); width: max-content; transform: rotate(-8deg); transform-origin: 0 0;
  font: 400 13px/1.4 Inter, "Helvetica Neue", Arial, sans-serif; letter-spacing: .12em; text-align: left; opacity: .95;
}
#stage .hold-ring {
  position: absolute; left: 0; top: calc(100% + 66px); width: 100%; height: 2px;
  background: rgba(255, 255, 255, .22); transform: rotate(-8deg); transform-origin: 0 0; opacity: 0; transition: opacity .2s;
}
#stage .hold-ring::after { content: ""; display: block; width: 0; height: 100%; background: #f4f3ef; }
#stage .memory-link.holding .hold-ring { opacity: 1; }
#stage .memory-link.holding .hold-ring::after { width: 100%; transition: width 1.1s linear; }
#stage .memory-link.holding img { transform: scale(1.06); filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .45)) brightness(1.12); animation: card-shiver .09s steps(2) infinite; }
#stage .memory-link.opened img { animation: none; filter: drop-shadow(0 0 30px rgba(255, 255, 255, .7)) brightness(1.4); }
@keyframes card-shiver { 50% { translate: 1px -1px; } }

/* bottom line */
#stage .coordinates, #stage .tracking, #stage .interaction-note {
  bottom: 40px; font: 400 11.5px/1 Inter, "Helvetica Neue", Arial, sans-serif; letter-spacing: .14em;
}
#stage .coordinates { left: 4vw; gap: 0; }
#stage .tracking { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); }
#stage .tracking #tracking-state { color: #dfff29; }
#stage .tracking #tracking-state:not(.live) { color: #f4f3ef; opacity: .7; }
#stage .interaction-note { right: 4vw; }
#stage .world-dots { display: none; }
#stage .tracking, #stage .interaction-note, #stage .dive-toggle { display: none; }
#stage .brand { font: 800 clamp(20px, 1.7vw, 28px)/1 Inter, "Helvetica Neue", Arial, sans-serif; letter-spacing: .22em; color: #fff; text-shadow: 0 0 14px rgba(255, 255, 255, .55), 0 2px 10px rgba(0, 0, 0, .35); }
#stage .tap-hint { display: none; }
#stage .deconstruction { z-index: 9; }
#stage .deconstruction-message h2 { font-family: Inter, "Helvetica Neue", Arial, sans-serif; font-weight: 400; letter-spacing: -.02em; }
#stage .deconstruction-message button { font-family: Inter, "Helvetica Neue", Arial, sans-serif; color: #f4f3ef; border-color: #f4f3ef; }
#stage .deconstruction-message button:hover { color: #050606; background: #f4f3ef; }
/* world arrows: clear round buttons that nudge toward the next world */
#stage .world-arrow {
  width: 58px; height: 58px; display: grid; place-items: center; padding: 0 0 4px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .9); background: rgba(10, 16, 22, .38); backdrop-filter: blur(4px);
  font: 300 38px/1 Inter, "Helvetica Neue", Arial, sans-serif; color: #fff; opacity: .95; box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
}
#stage .world-arrow--prev { left: 22px; animation: nudge-l 2.4s ease-in-out infinite; }
#stage .world-arrow--next { right: 22px; animation: nudge-r 2.4s ease-in-out infinite; }
@keyframes nudge-r { 0%, 70%, 100% { transform: translate(0, -50%); } 80% { transform: translate(6px, -50%); } 90% { transform: translate(0, -50%); } }
@keyframes nudge-l { 0%, 70%, 100% { transform: translate(0, -50%); } 80% { transform: translate(-6px, -50%); } 90% { transform: translate(0, -50%); } }
#stage .world-arrow:hover, #stage .world-arrow:focus-visible { color: #111; background: #fff; opacity: 1; }

/* iOS motion permission: a real button right after loading */
#stage .motion-ask {
  position: absolute; z-index: 8; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; gap: 8px; justify-items: center;
  padding: 18px 26px; border: 1.5px solid #fff; border-radius: 999px; background: rgba(10, 16, 22, .55); backdrop-filter: blur(6px);
  color: #fff; font: 700 14px/1 Inter, sans-serif; letter-spacing: .2em; white-space: nowrap; cursor: pointer; transition: opacity .5s;
  animation: ask-pulse 1.8s ease-in-out infinite;
}
#stage .motion-ask small { font: 400 11px/1.4 "Noto Sans JP", sans-serif; letter-spacing: .12em; opacity: .85; }
#stage .motion-ask em { font: 400 10px/1.4 Inter, sans-serif; letter-spacing: .04em; font-style: normal; color: #ffd36b; max-width: 72vw; }
#stage .motion-ask em:empty { display: none; }
#stage .motion-ask.gone { opacity: 0; pointer-events: none; }
#stage .motion-ask[hidden] { display: none; }
@keyframes ask-pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, .12); } }
@media (prefers-reduced-motion: reduce) { #stage .world-arrow, #stage .motion-ask { animation: none; } }
#stage .eyebrow { display: none; }
#stage.diving .tracking { opacity: 0; transition: opacity .9s; }

/* loading screen uses the cards */
#stage .loading { font-family: Inter, "Helvetica Neue", Arial, sans-serif; }
#stage .loading-memories figure { width: clamp(56px, 6.4vw, 104px); }
#stage .loading-memories figure::before { content: none; }
#stage .loading-memories img { mix-blend-mode: normal; filter: drop-shadow(0 10px 12px rgba(25, 35, 39, .22)); }
#stage .loading-memories figure:nth-child(odd) img { transform: rotate(-5deg); }
#stage .loading-memories figure:nth-child(even) img { transform: rotate(6deg); }

@media (max-width: 760px) {
  #stage .topbar { padding: 20px 18px 0; font-size: 10px; }
  #stage .mode { display: none; }
  #stage .clock { gap: 14px; }
  #stage .countdown { font-size: 22px; white-space: nowrap; }
  #stage .dive-toggle, #stage .sound-toggle { font-size: 10px; white-space: nowrap; }
  #stage .brand { font-size: 18px; }
  #stage .world-arrow { width: 44px; height: 44px; font-size: 30px; }
  #stage .world-arrow--prev { left: 10px; } #stage .world-arrow--next { right: 10px; }
  /* phones: every world's title + text ends on the same line (where Summer's text ends) */
  #stage .status { left: 6vw; top: auto; bottom: 52vh; max-width: 88vw; }
  #stage .title-row { flex-wrap: wrap; row-gap: 10px; }
  #stage .glitch-title { font-size: 12.5vw; white-space: normal; line-height: .95; }
  #stage .title-ja { font-size: 12px; }
  #stage .world-description { font-size: 12.5px; margin-top: 16px; max-width: 86vw; }
  #stage .memory-link { left: 50%; top: 66vh; width: 20vw; transform: translateX(-50%) rotate(8deg); }
  #stage .tap-hint { display: block; position: absolute; z-index: 4; left: 50%; bottom: 7vh; transform: translateX(-50%); font: 400 10.5px/1 Inter, sans-serif; letter-spacing: .2em; opacity: .8; transition: opacity .6s; pointer-events: none; }
  #stage .tap-hint.gone { opacity: 0; }
  #stage .memory-link:hover { transform: translateX(-50%) rotate(4deg) scale(1.04); }
  #stage .memory-link small { font-size: 10.5px; top: calc(100% + 12px); }
  /* phones: the progress bar sits above the card (a thumb covers whatever is below it) */
  #stage .hold-ring { top: -20px; }
  #stage .coordinates, #stage .tracking { bottom: 20px; font-size: 9.5px; }
  #stage .coordinates { left: 18px; }
  #stage .interaction-note { display: none; }
}

/* leaving for a memory page: white flash (the memory page fades in from white) */
body::after { content: ""; position: fixed; inset: 0; z-index: 20; background: #fff; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
body.is-leaving::after { opacity: 1; }
#stage .memory-link.denied img { animation: card-deny .5s steps(6) 1; }
@keyframes card-deny { 20% { translate: -6px 0; } 40% { translate: 5px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }
