/* Home: one full-screen 3D studio, no page scroll. */
body.home { height: 100vh; height: 100dvh; overflow: hidden; background: #d9d6d0; overscroll-behavior: none; }
body.home header.site { position: fixed; left: 0; right: 0; z-index: 5; background: transparent; }

#stage { position: fixed; inset: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; outline: none; }

/* name of the app in front */
.info {
  position: absolute; left: 50%; bottom: max(30px, 5vh); width: min(440px, calc(100vw - 32px));
  translate: -50% 0; text-align: center; opacity: 0; transition: opacity .5s ease;
}
.info-name {
  display: inline-block; font: inherit; font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
}
.info-q { font-family: var(--led); font-weight: 800; font-size: 40px; line-height: 1; color: var(--muted); }
.info-name:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.info-status { font-family: var(--led); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.info.swap .info-name, .info.swap .info-status { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.info.swap .info-status { animation-delay: .05s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.spin-hint {
  position: absolute; left: 0; right: 0; bottom: max(8px, 1.6vh); text-align: center; pointer-events: none;
  font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .6s ease 1s;
}

/* ---------- hologram above Trubot: a borderless virtual screen, only as tall as its text,
   floating halfway between the menu and Trubot. Same language as the boxes: mint light, LED dots. ---------- */
.holo {
  position: absolute; left: 50%; top: calc(var(--holo-top, 74px) + var(--holo-h, 220px) / 2); translate: -50% -50%;
  width: min(380px, calc(100vw - 32px)); max-height: var(--holo-h, 220px); display: flex; z-index: 3;
  background:
    repeating-linear-gradient(0deg, rgba(46,230,200,.07) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 50%, rgba(120,246,226,.22), rgba(120,246,226,.08) 70%, transparent);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  /* soft edges instead of a border: the light just fades out */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(0deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(0deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  transform-origin: 50% 100%;
  opacity: 0; transform: scaleY(.04) scaleX(.6); filter: brightness(1.6);
  transition: opacity .25s ease, transform .5s cubic-bezier(.2,.9,.2,1), filter .6s ease;
}
.holo[hidden] { display: none; }
.holo-open .holo { opacity: 1; transform: none; filter: none; transition-delay: .2s; animation: flicker 1.2s steps(1) .2s, breathe 5s ease-in-out 1.4s infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 8% { opacity: .5; } 12% { opacity: 1; } 30% { opacity: .8; } 33% { opacity: 1; } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .86; } 51% { opacity: .7; } 52% { opacity: .9; } }
.holo::after {   /* a faint scan line moving down */
  content: ""; position: absolute; left: 0; right: 0; height: 36px; top: -36px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(46,230,200,.16), transparent);
  animation: scan 5s linear infinite;
}
@keyframes scan { to { top: 100%; } }
.holo-body {
  position: relative; flex: 1; overflow-y: auto; padding: 22px 34px 24px; overscroll-behavior: contain; text-align: center;
  color: #0b5e53; text-shadow: 0 0 10px rgba(46,230,200,.45);
  scrollbar-width: none;   /* still scrolls on short screens, without a bar */
}
.holo-body::-webkit-scrollbar { display: none; }
.holo-status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--led); font-weight: 800; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.holo-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 6px var(--glow); animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.holo-name { font-family: var(--led); font-weight: 800; font-size: 30px; letter-spacing: .02em; line-height: 1.1; margin: 8px 0 4px; color: #0a8f7c; text-shadow: 0 0 6px rgba(92,244,220,.9), 0 0 18px rgba(46,230,200,.55); }
.holo-tag { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.holo-q { font-family: var(--led); font-weight: 800; font-size: 44px; line-height: 1; margin: 8px 0 8px; color: #0a8f7c; text-shadow: 0 0 8px rgba(92,244,220,.9); }
.holo-intro { color: #2f6b62; margin: 0 0 14px; font-size: 13px; line-height: 1.55; }
.holo-cta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.holo-cta a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px 6px 12px; border-radius: 999px; font-family: var(--led); font-weight: 800; font-size: 12px; letter-spacing: .04em;
  color: #075247; background: rgba(92,244,220,.28); text-shadow: none; transition: background .2s ease, box-shadow .2s ease; }
.holo-cta a:hover { text-decoration: none; background: rgba(92,244,220,.45); box-shadow: 0 0 14px rgba(46,230,200,.5); }
.holo-open .info, .holo-open .spin-hint { opacity: 0 !important; pointer-events: none; }

/* ---------- sound on/off ---------- */
.sound-btn {
  position: absolute; right: 22px; bottom: max(30px, 5vh); width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--muted);
  background: rgba(255,255,255,.4); box-shadow: 0 0 0 1px rgba(0,0,0,.07);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .6s ease .6s, color .2s ease, background .2s ease;
}
.sound-btn:hover { color: var(--ink); background: rgba(255,255,255,.7); }
.sound-btn .w1, .sound-btn .w2 { display: none; }
.sound-btn.on { color: var(--accent); }
.sound-btn.on .w1, .sound-btn.on .w2 { display: block; }
.sound-btn.on .x { display: none; }
.scene-ready .sound-btn { opacity: 1; }
.asleep .sound-btn { background: rgba(255,255,255,.08); color: rgba(255,255,255,.5); }

/* ---------- boot intro ---------- */
.booting .info, .booting .spin-hint, .booting .sound-btn, .booting header.site { opacity: 0 !important; transition: none; }
body.home header.site { transition: opacity .8s ease; }

/* ---------- asleep: lights down ---------- */
.asleep .info, .asleep .spin-hint { opacity: 0 !important; pointer-events: none; transition-delay: 0s; }
.asleep .brand { color: rgba(255,255,255,.55); }
.asleep header.site nav a, .asleep .langs button { color: rgba(255,255,255,.5); }
.asleep header.site nav a.on { color: rgba(255,255,255,.8); }
.asleep .langs { border-color: rgba(255,255,255,.18); }
.asleep .langs button.on { background: rgba(255,255,255,.8); color: #111; }

/* shown once the 3D scene is running */
.scene-ready .info, .scene-ready .spin-hint { opacity: 1; }
.spun .spin-hint { opacity: 0 !important; transition-delay: 0s; }

/* if WebGL can't start, a plain list instead */
.fallback { display: none; position: absolute; inset: 40% 24px auto; text-align: center; }
.no-webgl .fallback { display: block; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 700px) {
  .info { bottom: max(28px, calc(env(safe-area-inset-bottom) + 14px)); }
  .info-name { font-size: 20px; }
  .holo-body { padding: 20px 26px 22px; }
}
@media (prefers-reduced-motion: reduce) { .holo::after { display: none; } .holo-open .holo { animation: none; } }
