/* Shared page chrome for the lab intros (versions 4-6). */
@font-face {
  font-family: 'Sorts Mill Goudy';
  src: url('../assets/fonts/sorts-mill-goudy-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #f4efe8;
  font-family: 'Sorts Mill Goudy', 'Palatino Linotype', Palatino, Georgia, serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
svg { display: block; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.intro-ready #scene { opacity: 1; }

/* plain fallback when WebGL is unavailable */
.fallback {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  margin: 0;
  font-weight: 400;
  font-size: clamp(34px, 9vw, 110px);
  letter-spacing: 0.01em;
}
.no-intro .fallback { display: grid; }
.no-intro #scene, .no-intro .corner { display: none; }

.versions {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100vw - 28px);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.versions:hover, .versions:focus-within { opacity: 1; }
.versions a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(244, 239, 232, 0.92);
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s, background 0.2s;
}
.versions a:hover, .versions a:focus-visible { border-color: rgba(242, 194, 126, 0.7); color: #fff; outline: none; }
.versions a[aria-current="page"] { border-color: rgba(242, 194, 126, 0.75); background: rgba(242, 194, 126, 0.18); color: #fff; }

.corner {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 12, 16, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 15px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s, border-color 0.2s;
}
.chip:hover, .chip:focus-visible { opacity: 1; border-color: rgba(242, 194, 126, 0.7); outline: none; }
.chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#skip { display: none; }
.intro-running #skip { display: inline-flex; }
.intro-running #replay { display: none; }

.hint {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: rgba(244, 239, 232, 0.45);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
  white-space: nowrap;
}
.show-hint .hint { opacity: 1; }
@media (max-width: 560px) { .hint { bottom: 70px; } }
