/* OppyWorks · Explore the Worlds — immersive WebGL diorama shell */
:root {
  color-scheme: dark;
  --bg: #101216;
  --panel: #1b1f25;
  --panel-soft: rgba(20, 23, 28, .86);
  --line: #343941;
  --text: #edf0f3;
  --muted: #aab1ba;
  --accent: #b3a2d4;
  --accent-hover: #c7b9e2;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --foot: 30px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 400 16px/1.55 Manrope, system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: 'Space Grotesk', Manrope, sans-serif; font-weight: 600; letter-spacing: -.02em; margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent-hover); outline-offset: 3px; }

.xp-skip { position: fixed; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--panel); border-radius: 4px; }
.xp-skip:focus { top: 12px; }

/* Stage */

/* Scrim under the world list and legal links, so they never sit on busy art; deeper while a world is open. */

/* Top bar */
.xp-bar {
  position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 3vw, 36px) 14px;
  background: linear-gradient(rgba(16, 18, 22, .78), rgba(16, 18, 22, 0)); pointer-events: none;
}
.xp-bar > * { pointer-events: auto; }
.xp-logo img { display: block; width: clamp(164px, 17vw, 232px); height: auto; }
.xp-bar-actions { display: flex; align-items: center; gap: 10px; }
.xp-icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-soft); color: var(--text); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.xp-icon:hover { border-color: var(--accent); }
.xp-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.xp-icon svg path:first-child { fill: currentColor; stroke: none; }
.xp-icon .xp-wave { display: none; }
.xp-icon[aria-pressed="true"] .xp-wave { display: inline; }
.xp-icon[aria-pressed="true"] .xp-x { display: none; }
.xp-icon[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-hover); }

/* Site menu: native <details>, so it works without JS */
.xp-menu { position: relative; }
.xp-menu summary { list-style: none; }
.xp-menu summary::-webkit-details-marker { display: none; }
.xp-icon svg path.xp-line { fill: none; stroke: currentColor; }
.xp-menu[open] summary { border-color: var(--accent); color: var(--accent-hover); }
.xp-menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; display: flex; flex-direction: column;
  background: rgba(19, 22, 27, .96); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.xp-menu-list a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 4px;
  font-size: 15px; text-decoration: none; color: var(--text);
}
.xp-menu-list a:hover { background: rgba(179, 162, 212, .12); }
.xp-menu-list a[lang="de"] { font-size: 13px; color: var(--muted); min-height: 38px; }
.xp-menu-sep { height: 1px; margin: 6px 8px; background: var(--line); }
/* OppyWorks Music's channels: the YouTube and TikTok glyphs in one colour, as their brand rules allow */
.xp-world h3 { font-size: 21px; margin: 26px 0 8px; }
.xp-w-tag { margin-left: 8px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; font: 500 12px/1.6 Manrope, sans-serif; letter-spacing: .04em; color: var(--muted); vertical-align: middle; }
.xp-w-also { color: var(--text); text-decoration: none; padding: 10px 0; border-bottom: 1px solid transparent; }
.xp-w-also:hover { border-bottom-color: var(--accent); }
.xp-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.xp-brand-ic { width: 18px; height: 18px; flex: none; fill: currentColor; }
.xp-menu-list .xp-brand-ic { margin-right: 12px; }

/* About & contact: shown when targeted (#about / #contact), JS or not */
.xp-about {
  display: none; position: fixed; z-index: 34; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 140px); overflow-y: auto; padding: 28px 30px 24px;
  background: rgba(19, 22, 27, .95); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.xp-about:target, .xp-about:has(:target) { display: block; animation: xp-about-in .5s var(--ease) both; }
@keyframes xp-about-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)); } }
.xp-about h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.05; outline: none; }
.xp-about p:not(.xp-eyebrow) { color: #d4d8de; margin: 16px 0 0; }
.xp-about a:not(.xp-btn) { color: var(--accent-hover); }
.xp-about-close { margin-top: 22px; min-height: 44px; }

/* In-world details (the facts from the retired project pages).
   With WebGL the portal opens them (.is-open); without JS or WebGL, #<world> shows them via :target. */
.xp-world {
  display: none; position: fixed; z-index: 35; left: 50%; top: calc(50% - var(--foot) / 2); transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 150px - var(--foot)); overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 30px 22px; background: #13161b; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.xp-world.is-open, html:not(.js) .xp-world:target { display: block; animation: xp-details-in .45s var(--ease) both; }
@keyframes xp-details-in { from { opacity: 0; } }
/* Beside an open portal (desktop), dock left so the portal panel stays readable on the right. */

.xp-world h2 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1; outline: none; }
.xp-world .xp-eyebrow { margin-bottom: 10px; }
.xp-w-status { display: inline-block; margin: 12px 0 0; padding: 4px 10px; border-radius: 999px; font-size: 12px; letter-spacing: .05em; border: 1px solid var(--line); color: var(--muted); }
.xp-w-lede { font-size: 17px; color: var(--text); margin: 16px 0 0; }
.xp-world p, .xp-world li, .xp-world dd { color: #d4d8de; }
.xp-world p { margin: 14px 0 0; }
.xp-world figure { margin: 18px 0 4px; }
.xp-world figure img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); }
.xp-world figure.is-portrait img { width: auto; max-width: 100%; max-height: 360px; margin: 0 auto; }
.xp-world figcaption { margin-top: 8px; font-size: 12px; color: var(--muted); }
.xp-world ul { margin: 14px 0 0; padding-left: 1.1em; }
.xp-world li { margin: 4px 0; }
.xp-world dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.xp-world dt { color: var(--muted); }
.xp-world dd { margin: 0; }
.xp-w-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 22px; }
.xp-w-close { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 14px; text-decoration: none; }
.xp-w-close:hover { color: var(--text); }
.xp-w-note { font-size: 12px; color: var(--muted) !important; display: flex; align-items: center; gap: 10px; }
.xp-w-note img { border-radius: 50%; flex: none; }

/* No JS: the intro cannot be entered, so keep the world list usable under it. */

/* Intro */

.xp-eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }

.xp-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px;
  padding: 0 24px; border-radius: 4px; border: 1px solid var(--line); font: 600 16px/1 Manrope, sans-serif;
  text-decoration: none; cursor: pointer; overflow: hidden; transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.xp-btn:disabled { cursor: progress; }
.xp-btn-primary { background: var(--accent); border-color: var(--accent); color: #15121c; }
.xp-btn-primary:not(:disabled):hover { background: var(--accent-hover); transform: translateY(-1px); }
.xp-btn-quiet { background: var(--panel-soft); color: var(--text); }
.xp-btn-quiet:not(:disabled):hover { border-color: var(--accent); }
.xp-btn:disabled.xp-btn-quiet { opacity: .5; }

/* Hint + tooltip */

/* World rail */
.xp-rail {
  position: fixed; z-index: 15; left: 50%; bottom: calc(10px + var(--foot) + var(--safe-b)); transform: translateX(-50%);
  max-width: calc(100vw - 24px); transition: opacity .6s var(--ease), transform .6s var(--ease);
}

.xp-rail ul {
  list-style: none; margin: 0; padding: 6px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  background: var(--panel-soft); border: 1px solid var(--line); border-radius: 10px; scroll-snap-type: x proximity;
}
.xp-rail ul::-webkit-scrollbar { display: none; }
.xp-rail a {
  display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 6px 14px; border-radius: 6px;
  text-decoration: none; font: 600 14px/1.2 'Space Grotesk', sans-serif; white-space: nowrap; scroll-snap-align: center;
  border: 1px solid transparent; transition: background .2s, border-color .2s;
}
.xp-rail small { font: 500 11px/1.3 Manrope, sans-serif; color: var(--muted); letter-spacing: .03em; }
.xp-rail a:hover { background: rgba(179, 162, 212, .12); }
.xp-rail a[aria-current="true"] { border-color: var(--accent); background: rgba(179, 162, 212, .16); }
/* With a world open, the list steps back so the art and the panel lead; it returns on hover or focus. */

/* Portal panel */

.xp-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.xp-noscript { position: fixed; inset: calc(76px + env(safe-area-inset-top, 0px)) 16px auto; z-index: 21; font-size: 14px; padding: 16px; background: var(--panel); border-radius: 6px; }

/* Legal links: one tap away in every state, above the intro scrim and portal sheet */
.xp-foot {
  position: fixed; z-index: 32; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  padding: 0 16px var(--safe-b); pointer-events: none;
  background: linear-gradient(rgba(16, 18, 22, 0), rgba(16, 18, 22, .72));
}
.xp-foot nav { display: flex; gap: 4px; pointer-events: auto; }
.xp-foot a {
  display: inline-flex; align-items: center; min-height: var(--foot); padding: 0 10px; border-radius: 4px;
  color: var(--muted); font-size: 12px; letter-spacing: .02em; text-decoration: none;
}
.xp-foot a:hover { color: var(--text); text-decoration: underline; }
.xp-foot-social { margin-right: 6px; padding-right: 8px; border-right: 1px solid var(--line); }
.xp-foot-social .xp-brand-ic { width: 15px; height: 15px; }

/* No WebGL: still a usable, honest page */

/* Phone / portrait: bottom sheet */
@media (max-width: 760px) {
  .xp-world {
    left: 0; right: 0; top: auto; bottom: calc(var(--foot) + var(--safe-b)); transform: none; width: auto;
    max-height: calc(86vh - var(--foot)); padding: 20px 20px 18px; border-radius: 16px 16px 0 0;
  }

  .xp-world figure.is-portrait img { max-height: 280px; }

}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .15s !important; }
}

/* ?debug only: why the 3D view did not start */

