/* Cam's World
   Layout: full-bleed WebGL sky, a quiet HUD in the corners, storybook pages that slide up.
   One deliberate look (painted sky + washi paper), so no dark-mode switch. */
:root {
  --paper: #f5f0e1;
  --paper-2: #ebe3cc;
  --ink: #26332d;
  --ink-soft: #5b6a60;
  --kingfisher: #1d6c78;
  --sun: #eab64a;
  --moss: #557d47;
  --line: rgba(38, 51, 45, 0.16);
  --sky-top: #7fc3e6;
  --sky-bot: #e3f3ef;
  --display: 'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', Georgia, serif;
  --body: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Avenir Next', system-ui, sans-serif;
  --hand: 'Klee One', 'Segoe Print', 'Bradley Hand', cursive;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--sky-bot); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
kbd { font-family: var(--body); font-size: .78em; font-weight: 700; display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 .4em; border-radius: .45em; background: var(--paper); color: var(--ink); box-shadow: inset 0 -2px 0 var(--line); margin-right: .2em; }

#sky { position: fixed; inset: 0; background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 78%); transition: background 1.2s var(--ease); }
#stars { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s var(--ease);
  background-image: radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 42%, #fff 50%, transparent 51%), radial-gradient(1.6px 1.6px at 46% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 63% 30%, #fff 50%, transparent 51%), radial-gradient(1.3px 1.3px at 82% 16%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 91% 48%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 7% 60%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 36% 70%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 72% 64%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 55% 86%, #fff 50%, transparent 51%);
  background-size: 420px 420px; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#wipe { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 55%, #fffdf6 0%, #f3efe3 60%, #e6efe9 100%); transition: opacity .6s var(--ease); z-index: 30; }
#wipe.on { opacity: 1; }

/* Title */
.title { position: fixed; inset: 0; z-index: 20; display: grid; align-items: end; padding: clamp(20px, 5vw, 64px); padding-bottom: max(clamp(28px, 7vh, 80px), env(safe-area-inset-bottom)); background: linear-gradient(90deg, rgba(245,240,225,.86) 0%, rgba(245,240,225,.55) 38%, rgba(245,240,225,0) 62%); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.title.gone { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.title__inner { max-width: 34rem; display: grid; gap: 1.1rem; }
.kicker { margin: 0; font-family: var(--hand); font-size: 1.15rem; color: var(--kingfisher); }
.title h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 9vw, 6.6rem); line-height: .92; letter-spacing: -.02em; text-wrap: balance; color: var(--ink); }
.title__lede { margin: 0; font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.65; color: var(--ink-soft); max-width: 30rem; }
.title__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .4rem; }
.title__hint { margin: 0; font-family: var(--hand); color: var(--ink-soft); font-size: .95rem; }
.loader { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.loader span { display: block; height: 100%; width: 0; background: var(--kingfisher); transition: width .4s var(--ease), opacity .6s; }

.btn { appearance: none; border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: .85rem 1.4rem; font-weight: 700; font-size: 1rem; cursor: pointer; transition: transform .25s var(--ease), background .25s, color .25s, box-shadow .25s; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: .5rem; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 0 -2px var(--line); }
.btn:focus-visible, .tool:focus-visible, .prompt:focus-visible, .tab:focus-visible, .journal__go:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:disabled { opacity: .55; cursor: progress; }
.btn--ghost { border-color: transparent; text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
.btn--small { padding: .55rem 1rem; font-size: .9rem; }

/* HUD */
.hud { position: fixed; z-index: 10; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud__brand { display: flex; align-items: center; gap: .7rem; background: rgba(245,240,225,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: .5rem .9rem .5rem .5rem; border-radius: 999px; min-width: 0; }
.hud__seal { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: #b8452f; color: #fbeee0; font-family: var(--display); font-weight: 800; font-size: .9rem; letter-spacing: .02em; transform: rotate(-6deg); flex: none; }
.hud__name { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1rem; line-height: 1.1; }
.hud__count { margin: .1rem 0 0; font-size: .78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.hud__tools { display: flex; gap: .45rem; }
.tool { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: rgba(245,240,225,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; cursor: pointer; transition: transform .25s var(--ease), background .25s; }
.tool:hover { transform: translateY(-2px); background: var(--paper); }
.tool svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#btn-planet[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
#btn-planet[aria-pressed="true"] svg { stroke: var(--paper); }
body.planet-view .prompt, body.planet-view .banner, body.planet-view .hop, body.planet-view .stick { opacity: 0; pointer-events: none; }

.banner { position: fixed; z-index: 9; left: 50%; top: 18%; transform: translate(-50%, 10px); text-align: center; pointer-events: none; opacity: 0; transition: opacity .8s var(--ease), transform .8s var(--ease); width: min(90vw, 40rem); }
.banner.on { opacity: 1; transform: translate(-50%, 0); }
.banner__years { margin: 0; font-family: var(--hand); font-size: 1.1rem; color: #fffaf0; text-shadow: 0 1px 12px rgba(20,40,40,.45); }
.banner__name { margin: .1rem 0 0; font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1; color: #fffaf0; text-shadow: 0 2px 22px rgba(20,40,40,.4); text-wrap: balance; }

.prompt { position: fixed; z-index: 10; left: 50%; bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px)); transform: translateX(-50%); display: inline-flex; align-items: center; gap: .55rem; border: 0; border-radius: 999px; padding: .7rem 1.2rem .7rem .7rem; background: var(--paper); box-shadow: 0 10px 30px -10px rgba(20,40,40,.45); font-weight: 700; cursor: pointer; animation: rise .5s var(--ease); max-width: calc(100vw - 32px); }
.prompt kbd { background: var(--ink); color: var(--paper); box-shadow: none; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

.toast { position: fixed; z-index: 11; left: 50%; top: max(84px, calc(env(safe-area-inset-top) + 72px)); transform: translate(-50%, -6px); background: var(--ink); color: var(--paper); padding: .6rem 1.1rem; border-radius: 999px; font-family: var(--hand); font-size: 1rem; opacity: 0; transition: opacity .4s, transform .4s var(--ease); pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.controls { position: fixed; z-index: 9; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); margin: 0; font-family: var(--hand); font-size: .95rem; color: var(--ink); background: rgba(245,240,225,.78); padding: .45rem .85rem; border-radius: 999px; transition: opacity 1.2s; }
.controls.fade { opacity: 0; }

.stick { position: fixed; z-index: 8; width: 110px; height: 110px; border-radius: 50%; border: 2px solid rgba(255,255,255,.75); background: rgba(255,255,255,.18); transform: translate(-50%, -50%); pointer-events: none; }
.stick__knob { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255,250,240,.92); }

/* Pages */
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.sheet__scrim { position: absolute; inset: 0; background: rgba(28, 44, 42, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.page { position: relative; width: min(100%, 50rem); max-height: 100%; overflow: auto; background: var(--paper); border-radius: 18px; padding: clamp(22px, 4vw, 44px); box-shadow: 0 30px 80px -30px rgba(10, 30, 30, .6); animation: pageIn .55s var(--ease); overscroll-behavior: contain;
  background-image: radial-gradient(rgba(120,100,60,.05) 1px, transparent 1px); background-size: 6px 6px; }
@keyframes pageIn { from { opacity: 0; transform: translateY(24px) rotate(-.6deg); } }
.page__close { position: absolute; top: 12px; right: 12px; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: var(--paper-2); font-size: 1.5rem; line-height: 1; cursor: pointer; z-index: 2; }
.page__wash { position: absolute; inset: 0 0 auto 0; height: 9rem; border-radius: 18px 18px 0 0; opacity: .55; pointer-events: none; }
.page__head { position: relative; display: grid; gap: .45rem; padding-right: 2.5rem; }
.page__years { margin: 0; font-family: var(--hand); font-size: 1.05rem; color: var(--kingfisher); }
.page__name { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.02; text-wrap: balance; }
.page__where { margin: 0; font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.page__intro { margin: .35rem 0 0; line-height: 1.7; max-width: 62ch; color: var(--ink); }
.page__tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.4rem 0 1rem; }
.page__tabs:empty { display: none; }
.tab { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: .4rem .85rem; font-size: .88rem; cursor: pointer; transition: background .2s, border-color .2s; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.page__project { border-top: 1px dashed var(--line); padding-top: 1.1rem; margin-top: 1rem; }
.page__tabs:not(:empty) + .page__project { margin-top: 0; }
.project__title { margin: 0 0 .9rem; font-family: var(--display); font-weight: 800; font-size: 1.45rem; line-height: 1.2; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .9rem 1.4rem; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.facts dd { margin: .2rem 0 0; font-size: 1rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.project__link { display: inline-block; margin-top: 1.1rem; color: var(--kingfisher); font-weight: 700; text-underline-offset: .25em; }
.page__foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1.6rem; flex-wrap: wrap; }
.page__foot--journal { justify-content: flex-end; }
.page__folio { font-family: var(--hand); color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.journal { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: .2rem; counter-reset: land; }
.journal li { display: grid; grid-template-columns: 4.6rem 1fr auto; gap: .9rem; align-items: center; padding: .8rem 0; border-top: 1px dashed var(--line); }
.journal__years { font-family: var(--hand); color: var(--kingfisher); font-size: .95rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.journal__name { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.journal__sub { margin: .15rem 0 0; font-size: .86rem; color: var(--ink-soft); line-height: 1.4; }
.journal__go { border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: .4rem .8rem; font-size: .85rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.journal__go:hover { background: var(--ink); color: var(--paper); }
.journal li.seen .journal__name::after { content: ' ✓'; color: var(--moss); font-family: var(--body); font-size: .9rem; }
.journal li.future .journal__name { color: var(--ink-soft); font-style: italic; }

.keys { display: grid; gap: .8rem; margin: 1.2rem 0; }
.keys div { display: grid; grid-template-columns: 9rem 1fr; gap: .8rem; align-items: baseline; }
.keys dt { font-weight: 700; }
.keys dd { margin: 0; line-height: 1.8; color: var(--ink-soft); }

.noscript { position: fixed; inset: auto 16px 16px; background: var(--paper); padding: 1rem; border-radius: 12px; }

@media (max-width: 640px) {
  .title { background: linear-gradient(0deg, rgba(245,240,225,.92) 0%, rgba(245,240,225,.7) 45%, rgba(245,240,225,0) 75%); }
  .hud__count { font-size: .72rem; }
  .hud__name { font-size: .92rem; }
  .tool { width: 2.5rem; height: 2.5rem; }
  .hud__tools { gap: .3rem; }
  .journal li { grid-template-columns: 1fr auto; }
  .journal__years { grid-column: 1 / -1; }
  .keys div { grid-template-columns: 1fr; gap: .2rem; }
  .banner { top: 14%; }
}
@media (max-width: 420px) {
  .hud__brand { padding-right: .6rem; }
  .hud__name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.title__role { margin: -.3rem 0 0; font-family: var(--display); font-weight: 600; font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--ink); max-width: 30rem; line-height: 1.35; }
.btn:disabled { opacity: .35; cursor: default; transform: none !important; box-shadow: none !important; }
.hud__next { margin: .15rem 0 0; font-family: var(--hand); font-size: .85rem; color: var(--kingfisher); min-height: 1em; }
.hud__next:empty { display: none; }
.hud__hello { align-self: center; text-decoration: none; font-weight: 700; font-size: .88rem; color: var(--paper); background: var(--ink); padding: .65rem 1rem; border-radius: 999px; margin-right: .2rem; transition: transform .25s var(--ease); }
.hud__hello:hover { transform: translateY(-2px); }
.hud__hello:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.prompt, .toast { left: 0; right: 0; margin-inline: auto; width: max-content; max-width: calc(100vw - 32px); transform: none; }
.prompt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast { transform: translateY(-6px); }
.toast.on { transform: translateY(0); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.banner__inner { display: inline-block; }
.banner { text-shadow: none; }
.banner__years, .banner__name { color: var(--ink); text-shadow: 0 0 18px rgba(245,240,225,.95), 0 0 6px rgba(245,240,225,.9); }
.night .banner__years, .night .banner__name { color: #fffaf0; text-shadow: 0 0 18px rgba(8,16,40,.85), 0 0 6px rgba(8,16,40,.8); }
.hop { position: fixed; z-index: 9; right: max(20px, env(safe-area-inset-right)); bottom: max(96px, calc(env(safe-area-inset-bottom) + 86px)); width: 4.2rem; height: 4.2rem; border-radius: 50%; border: 0; background: rgba(245,240,225,.9); font-weight: 700; color: var(--ink); box-shadow: 0 8px 20px -8px rgba(20,40,40,.5); }
.hop:active { transform: scale(.94); }
.coach { position: fixed; inset: 0; z-index: 12; display: grid; grid-template-columns: 1fr 1fr; pointer-events: none; transition: opacity .8s; }
.coach.fade { opacity: 0; }
.coach__half { display: grid; place-items: center; border-right: 1.5px dashed rgba(255,255,255,.7); background: rgba(20,40,40,.16); }
.coach__half:last-child { border-right: 0; }
.coach__half span { background: var(--paper); padding: .6rem 1rem; border-radius: 999px; font-family: var(--hand); font-size: 1.05rem; text-align: center; max-width: 80%; }
.parts { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.parts a, .parts span { display: inline-block; padding: .35rem .75rem; border-radius: 999px; background: var(--paper-2); color: var(--ink); text-decoration: none; font-size: .88rem; font-weight: 500; }
.parts a:hover { background: var(--ink); color: var(--paper); }
.journal__extras { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 1.2rem; }
.extra { background: var(--paper-2); border-radius: 14px; padding: .9rem 1rem; }
.extra h3 { margin: 0 0 .5rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.stamps { display: flex; flex-wrap: wrap; gap: .35rem; }
.stamp { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; border: 2px dashed rgba(38,51,45,.22); }
.stamp svg { width: 1.9rem; height: 1.9rem; fill: rgba(38,51,45,.18); stroke: rgba(38,51,45,.18); stroke-width: .6; }
.stamp.got { border: 2px solid #b8452f; transform: rotate(-8deg); background: rgba(184,69,47,.07); box-shadow: inset 0 0 0 2px rgba(245,240,225,1), inset 0 0 0 3.5px rgba(184,69,47,.55); }
.stamp.got svg { fill: #b8452f; stroke: #b8452f; }
.stamp.new { animation: thump .6s var(--ease) both; }
@keyframes thump { from { transform: scale(1.5) rotate(-2deg); opacity: 0; } to { transform: scale(1) rotate(-8deg); opacity: 1; } }
.cranes { display: flex; gap: .35rem; }
.cranes svg { width: 2.1rem; height: 1.7rem; fill: none; stroke: rgba(38,51,45,.55); stroke-width: 1.2; stroke-dasharray: 2.2 1.6; stroke-linejoin: round; }
.cranes svg.got { fill: var(--cc); stroke: rgba(38,51,45,.7); stroke-dasharray: none; }
.cranes .c { opacity: .25; } .cranes .c.got { opacity: 1; }
.extra p { margin: .45rem 0 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.45; }
@media (pointer: coarse) {
  .hud__brand, .tool { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(245,240,225,.94); }
  .sheet__scrim { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(28,44,42,.5); }
}
@media (max-width: 640px) {
  .hud__hello { display: none; }
  .hud__next { font-size: .78rem; }
}

.page__folio { margin: 1.4rem 0 0; text-align: center; }
.page__foot { margin-top: .6rem; }
.page__work { font-weight: 700; color: var(--kingfisher); text-underline-offset: .25em; }
.highlights { margin: 0 0 1.1rem; }
.highlights h4 { margin: 0 0 .4rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.highlights ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.highlights li { position: relative; padding-left: 1.1rem; line-height: 1.55; }
.highlights li::before { content: ''; position: absolute; left: 0; top: .72em; width: .6rem; height: 2px; background: var(--kingfisher); border-radius: 2px; }
.tool--hello { display: none; text-decoration: none; }
@media (max-width: 640px) { .tool--hello { display: grid; } .hud__next { max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

.hud__brand { flex: 0 1 auto; min-width: 0; }
.hud__brand > div { min-width: 0; }
.hud__count, .hud__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 440px) { .hud__count { display: none; } .hud__next { max-width: 44vw; } .hud__tools { gap: .25rem; } .tool { width: 2.35rem; height: 2.35rem; } }

.has-prompt .hop { bottom: max(132px, calc(env(safe-area-inset-bottom) + 122px)); }
.has-prompt .fire { bottom: calc(max(132px, calc(env(safe-area-inset-bottom) + 122px)) + 84px) !important; }   /* keep Jet stacked above Hop when the prompt pill lifts Hop */

.page__art { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin: 0 0 1.2rem; background: var(--paper-2); box-shadow: 0 10px 30px -18px rgba(10,30,30,.6); }
.page__art + .page__head { padding-right: 0; }

/* round-2 polish: banner sits on a soft washi wash; phones get a wrapping "next land" line and a toast that
   lives at the bottom, so it never stacks on the land banner */
.banner__inner { padding: .5rem 1.4rem .7rem; border-radius: 1.4rem; background: radial-gradient(ellipse at center, rgba(245,240,225,.62) 0%, rgba(245,240,225,.38) 55%, rgba(245,240,225,0) 75%); }
.night .banner__inner { background: radial-gradient(ellipse at center, rgba(8,16,40,.45) 0%, rgba(8,16,40,.25) 55%, rgba(8,16,40,0) 75%); }
@media (max-width: 640px) {
  .hud__next { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; max-width: 50vw; }
  .toast { top: auto; bottom: max(96px, calc(env(safe-area-inset-bottom) + 86px)); font-size: .92rem; max-width: calc(100vw - 120px); }
}
@media (max-width: 640px) {
  .title { background: linear-gradient(0deg, rgba(245,240,225,.94) 0%, rgba(245,240,225,.86) 46%, rgba(245,240,225,0) 66%); }
}
@media (pointer: coarse) { .prompt kbd { display: none; } .prompt { padding-left: 1.2rem; } .prompt::before { content: "☝"; margin-right: .1rem; } }

/* secret destruction mode */
.tool--boom span { font-size: 1.2rem; line-height: 1; }
#btn-boom[aria-pressed="true"] { background: #e8543f; box-shadow: 0 0 0 3px rgba(232, 84, 63, .3); }
.fire { display: none; }
body.boom .fire { display: grid; place-items: center; background: #e8543f; color: #fff7ea; bottom: calc(max(96px, calc(env(safe-area-inset-bottom) + 86px)) + 84px); }
body.boom #scene { cursor: crosshair; }
#btn-jet.locked { filter: grayscale(1); opacity: .55; }
#btn-jet.locked::after { content: "?"; position: absolute; right: -2px; top: -4px; font: 700 .7rem/1 var(--ui, sans-serif); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 2px 5px; }
#btn-boom, #btn-jet { position: relative; }
@media (max-width: 600px) { .prompt { white-space: normal; text-align: left; line-height: 1.25; max-width: calc(100vw - 150px); } }
.hud__mini { display: none; margin: .1rem 0 0; font-size: .72rem; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 440px) { .hud__mini { display: block; } }
.bubble { position: fixed; left: 0; top: 0; z-index: 8; pointer-events: none; max-width: min(320px, 70vw); padding: .5rem .85rem; border-radius: 14px; background: var(--paper); color: var(--ink); font-family: var(--hand); font-size: .95rem; line-height: 1.3; box-shadow: 0 8px 22px -10px rgba(20,40,40,.55); opacity: 0; transition: opacity .25s; margin-top: -12px; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: var(--paper); }
.bubble.on { opacity: 1; }
@media (max-width: 440px) { .hud__next { display: none; } }
/* LinkedIn card on the last page */
.li-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: .35rem .9rem; align-items: center; margin-top: 1rem; padding: .9rem 1rem; border-radius: 16px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 10px 28px -16px rgba(10,40,60,.55), 0 0 0 1px rgba(10,102,194,.12); transition: transform .2s var(--ease), box-shadow .2s; }
.li-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(10,40,60,.6), 0 0 0 2px rgba(10,102,194,.35); }
.li-card__photo { grid-row: span 2; position: relative; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #e85d4f, #c9473d); display: grid; place-items: center; box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(10,102,194,.3); }
.li-card__photo span { font: 800 1.3rem/1 "Shippori Mincho B1", Georgia, serif; color: #fff7ea; }
.li-card__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.li-card__text { display: grid; gap: .1rem; }
.li-card__text strong { font-size: 1.05rem; }
.li-card__text span { font-size: .82rem; color: var(--ink-soft); line-height: 1.3; }
.li-card__cta { display: inline-flex; align-items: center; gap: .45rem; justify-self: start; padding: .45rem .9rem; border-radius: 999px; background: #0a66c2; color: #fff; font-weight: 700; font-size: .88rem; }
.li-card__cta svg { width: 1rem; height: 1rem; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 440px) { .hud__tools { gap: .18rem; } .tool { width: 2.1rem; height: 2.1rem; } .tool svg { width: 1.1rem; height: 1.1rem; } .hud__brand { gap: .4rem; } .hud__seal { width: 2.1rem; height: 2.1rem; } }

/* rocket race */
.race-btn { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: max(84px, calc(env(safe-area-inset-bottom) + 74px)); border: 0; border-radius: 999px; padding: .6rem 1.1rem; background: #e8543f; color: #fff7ea; font-weight: 800; box-shadow: 0 10px 26px -10px rgba(120,30,10,.6); cursor: pointer; display: inline-flex; gap: .45rem; align-items: center; }
.race-btn kbd { background: rgba(255,255,255,.22); color: #fff; border: 0; }
@media (pointer: coarse) { .race-btn kbd { display: none; } }
.race-hud { position: fixed; z-index: 9; top: max(78px, calc(env(safe-area-inset-top) + 68px)); left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); padding: .6rem .9rem .55rem; border-radius: 16px; background: rgba(245,240,225,.92); box-shadow: 0 10px 26px -14px rgba(20,40,40,.55); text-align: center; }
.race-hud__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.race-hud__time { font: 800 1.9rem/1 "Shippori Mincho B1", Georgia, serif; font-variant-numeric: tabular-nums; color: var(--ink); }
.race-hud__speed { font-weight: 800; color: #e8543f; font-variant-numeric: tabular-nums; }
.race-hud__track { height: 6px; margin: .45rem 0 .3rem; border-radius: 99px; background: rgba(38,51,45,.12); overflow: hidden; }
.race-hud__track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #f2c94c, #e8543f); }
.race-hud__msg { margin: 0; font-size: .8rem; color: var(--ink-soft); }
.race-count { position: fixed; z-index: 11; left: 50%; top: 38%; transform: translate(-50%, -50%); font: 800 clamp(4rem, 14vw, 8rem)/1 "Shippori Mincho B1", Georgia, serif; color: #fff7ea; text-shadow: 0 6px 0 #e8543f, 0 14px 30px rgba(60,20,10,.45); pointer-events: none; }
body.racing .prompt, body.racing .hud__next { display: none; }
body.racing .fire { display: grid; place-items: center; background: #e8543f; color: #fff7ea; bottom: calc(max(96px, calc(env(safe-area-inset-bottom) + 86px)) + 84px); }
body.racing #scene { cursor: crosshair; }
.board__result { display: flex; align-items: baseline; gap: .9rem; margin: .2rem 0 1rem; }
.board__time { font: 800 2.6rem/1 "Shippori Mincho B1", Georgia, serif; font-variant-numeric: tabular-nums; }
.board__shots { color: var(--ink-soft); }
.board__form label { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: .35rem; }
.board__form div { display: flex; gap: .5rem; }
.board__form input { flex: 1; min-width: 0; padding: .55rem .8rem; border-radius: 999px; border: 1px solid rgba(38,51,45,.35); font: inherit; background: #fff; color: var(--ink); caret-color: var(--ink); -webkit-text-fill-color: var(--ink); }
.board__form input::placeholder { color: rgba(38,51,45,.45); -webkit-text-fill-color: rgba(38,51,45,.45); }
.board__list { list-style: none; margin: 1.1rem 0 .4rem; padding: 0; display: grid; gap: .25rem; counter-reset: none; }
.board__list li { display: grid; grid-template-columns: 2rem 1fr auto; gap: .5rem; align-items: center; padding: .45rem .7rem; border-radius: 10px; background: rgba(38,51,45,.05); font-variant-numeric: tabular-nums; }
.board__list li.me { background: rgba(242,201,76,.35); font-weight: 800; }
.board__list li.empty { display: block; text-align: center; color: var(--ink-soft); }
.board__list .rank { font-weight: 800; color: #e8543f; }
.board__note { font-size: .78rem; color: var(--ink-soft); margin: .2rem 0 0; }
body.jet:not(.racing):not(.boom) .fire { display: grid; place-items: center; background: #3f8fd9; color: #fff; bottom: calc(max(96px, calc(env(safe-area-inset-bottom) + 86px)) + 84px); }

/* game controls never select text or pop the iOS callout on long-press */
#scene, .hud, .hop, .fire, .prompt, .race-hud, .race-btn, .race-count, .toast, .stick, .bubble, .controls, .banner { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.hop, .fire, .race-btn, .tool, .prompt { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body.racing, body.boom { -webkit-user-select: none; user-select: none; }
.race-hud__speed.kick { animation: kick .25s ease-out; }
@keyframes kick { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.race-hud__speed { display: inline-block; }
body.race-hop .fire { display: none !important; }

/* Loading: golden-hour paper over everything until the planet has been built and rendered */
.loading { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; text-align: center;
  background: radial-gradient(ellipse 62% 52% at 50% 56%, rgba(250,244,228,.55), rgba(250,244,228,0) 70%), linear-gradient(180deg, #7fb7dc 0%, rgba(127,183,220,0) 46%), url('../art/sky/golden.webp') 50% 100% / cover no-repeat, #e8d6be;
  transition: opacity .9s var(--ease), visibility 0s linear .9s; }
.loading::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .42 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.loading.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loading.done .loading__inner { transform: scale(1.06); }
.loading__inner { position: relative; z-index: 1; display: grid; justify-items: center; gap: .55rem; width: min(100%, 26rem); transition: transform .9s var(--ease); }
.loading .kicker { animation: fade 1s var(--ease) both; }
.loading__art { width: min(78vw, 360px, 50vh); height: auto; overflow: visible; margin: -.2rem 0 -.3rem; }
.loading__spin { transform-origin: 150px 168px; transform-box: view-box; animation: lsSpin 48s linear infinite; }
.loading__bob { animation: lsBob .42s ease-in-out infinite alternate; }
.loading__leg { transform-box: fill-box; transform-origin: 50% 0; animation: lsStep .42s ease-in-out infinite alternate; }
.loading__leg--b { animation-direction: alternate-reverse; }
.loading__cloud--a { animation: lsDrift 9s ease-in-out infinite alternate; }
.loading__cloud--b { animation: lsDrift 11s ease-in-out -4s infinite alternate-reverse; }
.ls-flag { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0); transition: transform .55s cubic-bezier(.3, 1.6, .5, 1); }
.ls-flag.up { transform: scale(1); }
.ls-flag .ls-pennant { transform-box: fill-box; transform-origin: 0 50%; animation: lsFlap 1.6s ease-in-out infinite alternate; }
.loading__name { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.loading__caption { margin: .1rem 0 0; min-height: 1.5em; font-family: var(--hand); font-size: 1.1rem; color: var(--ink-soft); }
.loading__caption.swap { animation: rise .5s var(--ease); }
.loading__bar { width: min(62vw, 220px); height: 12px; overflow: visible; }
.loading__tip { margin: .5rem 0 0; min-height: 2.8em; max-width: 22rem; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.loading__tip.swap { animation: fade .8s var(--ease); }
.loading__tip b { font-weight: 700; color: var(--ink); }
@keyframes lsSpin { to { transform: rotate(-360deg); } }
@keyframes lsBob { to { transform: translateY(-1.2px); } }
@keyframes lsStep { from { transform: rotate(22deg); } to { transform: rotate(-22deg); } }
@keyframes lsDrift { to { transform: translateX(16px); } }
@keyframes lsFlap { to { transform: scaleX(.72) skewY(-6deg); } }
@media (prefers-reduced-motion: reduce) {
  .loading__spin, .loading__bob, .loading__leg, .loading__cloud--a, .loading__cloud--b, .ls-flag .ls-pennant { animation: none !important; }
}
