:root {
  --ink: #f2f0ff;
  --muted: #a9a6c4;
  --panel: rgba(16, 16, 28, 0.86);
  --edge: rgba(255, 255, 255, 0.12);
  --accent: #ff9cc4;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0b14; color: var(--ink); overflow: hidden;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* The loading screen is the 3D view itself (see deskName in main.js): this layer only carries an error message */
#loader { position: fixed; inset: 0; z-index: 50; pointer-events: none; transition: opacity .5s; }
#loader.done { opacity: 0; }
/* the controls wait until the opening shot has pulled back into the room */
#hint, #tabs, #sound { transition: opacity .8s; }
body.loading #hint, body.loading #tabs, body.loading #sound { opacity: 0 !important; pointer-events: none; }
#loader-pct { position: absolute; left: 0; right: 0; bottom: 40px; margin: 0; text-align: center; color: var(--muted); font-size: 13px; }

#tooltip { position: fixed; z-index: 20; pointer-events: none; padding: 4px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--edge); font-size: 13px; transform: translate(14px, 14px); }
#hint { position: fixed; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 62px); transform: translateX(-50%); margin: 0; z-index: 10;
  width: max-content; max-width: calc(100vw - 32px); text-align: center; pointer-events: none;
  padding: 5px 14px; border-radius: 999px; background: rgba(10, 10, 20, .55); backdrop-filter: blur(6px);
  color: #cfcce4; font-size: 13px; letter-spacing: .04em; transition: opacity .4s; }
@media (hover: none) { #tooltip { display: none; } #tooltip.tap { display: block; } }

.chip { position: fixed; top: max(16px, env(safe-area-inset-top)); left: 16px; z-index: 30; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--edge); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.chip:hover { border-color: var(--accent); }

#fade { position: fixed; inset: 0; z-index: 26; background: #000; opacity: 0; pointer-events: none; }
#lens { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 25; pointer-events: none; opacity: 0; }

.panel { position: fixed; right: 16px; top: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); z-index: 30;
  padding: 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--edge); overflow-y: auto;
  backdrop-filter: blur(8px); }
.panel h2 { margin: 0 0 10px; font-size: 22px; }
.panel p { margin: 0 0 12px; color: #d8d6ea; }
.panel img, .panel video { width: 100%; border-radius: 10px; margin-bottom: 12px; display: block; }
.panel a { color: var(--accent); }
.panel .soon { padding: 40px 12px; border-radius: 10px; border: 1px dashed var(--edge); text-align: center;
  color: var(--muted); margin-bottom: 12px; }

#gallery, #cards, #phone { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; }
#reader { position: fixed; left: 12px; right: 12px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 104px); z-index: 25;
  max-height: 44vh; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px; border-radius: 16px;
  background: rgba(12, 14, 30, .9); border: 1px solid rgba(255, 111, 174, .5); color: #dfe1f2;
  font: 400 16px/1.5 system-ui, sans-serif; opacity: 0; transition: opacity .4s; }
#reader.on { opacity: 1; }
#reader .kicker { margin: 0 0 4px; color: #ff6fae; font: 600 12px/1.2 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
#reader h2 { margin: 0 0 8px; color: #fff; font: 800 22px/1.2 system-ui, sans-serif; }
#reader h2 .kicker { display: inline; margin: 0 4px 0 0; font-size: 13px; vertical-align: 2px; }
#reader p { margin: 0 0 10px; }
#reader p:last-child { margin-bottom: 0; }
#reader a { color: #ff9cc4; font-weight: 600; }
#reader[hidden], #gallery[hidden], #cards[hidden], #phone[hidden], .panel[hidden] { display: none; }
#gallery { align-content: center; background: linear-gradient(transparent, rgba(8, 8, 16, .55) 30%, rgba(8, 8, 16, .55) 70%, transparent); }
#gallery-track { width: 100vw; display: flex; gap: 28px; align-items: center; overflow-x: auto; padding: 24px 40px;
  scrollbar-width: none; cursor: grab; }
#gallery-track::-webkit-scrollbar { display: none; }
#gallery-track figure { flex: none; margin: 0; padding: 12px; background: #f4f1ea; border: 10px solid #121116;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
#gallery-track img { display: block; height: 52vh; width: auto; user-select: none; pointer-events: none; }
#gallery-track figcaption { color: #2a2830; font-size: 12px; margin-top: 8px; text-align: center; }
.overlay-note { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); margin: 0; color: var(--muted); font-size: 13px; }

#phone { background: rgba(8, 8, 16, .5); }
.phone-frame { width: min(320px, 80vw); aspect-ratio: 9 / 19.5; border-radius: 44px; padding: 12px; background: #1d1e24;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), inset 0 0 0 2px #3a3b44; }
#phone-screen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #0b0c14; position: relative; }
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 10px; padding: 70px 18px; }
.app-grid button { background: none; border: 0; color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; display: grid; justify-items: center; gap: 6px; }
.app-icon { width: 58px; height: 58px; border-radius: 15px; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: linear-gradient(140deg, #3b3d52, #1f202c); overflow: hidden; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.app-view header { display: flex; align-items: center; gap: 8px; padding: 46px 14px 10px; font-weight: 600; }
.app-view header button { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; }
.app-shots { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.app-shots img { flex: none; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.app-view p { margin: 0; padding: 10px 16px 22px; color: var(--muted); font-size: 12px; }
.app-empty { margin: auto; padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }

#cards { background: rgba(8, 8, 16, .45); }
#cards-fan { position: relative; width: min(900px, 96vw); height: 60vh; }
#cards-fan img { position: absolute; left: 50%; bottom: 0; height: 52vh; border-radius: 12px; cursor: pointer;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6); transform-origin: 50% 120%; transition: transform .35s, z-index 0s; }
#cards-fan img.lifted { z-index: 5; }

@media (max-width: 640px) {
  .panel { top: auto; height: 55vh; }
  #gallery-track img { height: 40vh; }
}

/* music toggle: a neon ring in the top right */
#sound { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 30; width: 46px; height: 46px;
  border-radius: 50%; padding: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(10, 10, 20, .6); border: 2px solid #ff6fae;
  box-shadow: 0 0 6px #ff6fae, 0 0 16px rgba(255, 111, 174, .55), inset 0 0 8px rgba(255, 111, 174, .35);
  transition: box-shadow .3s, border-color .3s, opacity .3s; }
#sound svg { width: 24px; height: 24px; fill: none; stroke: #ffd3e6; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 3px #ff6fae); }
#sound .speaker { fill: #ffd3e6; }
#sound .waves { display: none; }
#sound[aria-pressed="true"] .waves { display: inline; }
#sound[aria-pressed="true"] .cross { display: none; }
#sound[aria-pressed="false"] { border-color: rgba(255, 111, 174, .6); box-shadow: 0 0 4px rgba(255, 111, 174, .5), inset 0 0 6px rgba(255, 111, 174, .2); }
#sound:hover { box-shadow: 0 0 8px #ff6fae, 0 0 24px rgba(255, 111, 174, .75), inset 0 0 10px rgba(255, 111, 174, .45); }

/* shortcut tabs: neon pills along the bottom, in the same pink as the sound button */
#tabs { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; gap: 10px; }
#tabs button { padding: 9px 18px; border-radius: 999px; cursor: pointer; font: 600 14px/1 system-ui, sans-serif;
  letter-spacing: .06em; color: #ffd3e6; background: rgba(10, 10, 20, .6); border: 2px solid #ff6fae;
  box-shadow: 0 0 6px #ff6fae, 0 0 14px rgba(255, 111, 174, .45), inset 0 0 8px rgba(255, 111, 174, .3);
  text-shadow: 0 0 6px rgba(255, 111, 174, .9); transition: box-shadow .25s; }
#tabs button:hover, #tabs button:focus-visible { box-shadow: 0 0 8px #ff6fae, 0 0 24px rgba(255, 111, 174, .75), inset 0 0 10px rgba(255, 111, 174, .45); outline: none; }
@media (max-width: 480px) { #tabs { gap: 5px; width: max-content; max-width: calc(100vw - 32px); flex-wrap: wrap; justify-content: center; }
  #tabs button { padding: 8px 10px; font-size: 12px; letter-spacing: .03em; } }
