/* Spunworks: standard studio layout; the cosmic/psychedelic feel lives in the backdrop. */
@font-face { font-family: "Spun Dip"; src: url("../fonts/spun-dip.woff2") format("woff2"); font-display: swap; } /* house font, OFL: fonts/OFL-SpunDip.txt */
:root {
  color-scheme: dark;
  --night: #120e26; --night-2: #1b1638; --night-3: #241d4a; --line: #ffffff17;
  --text: #ece6ff; --muted: #bdb4dc; --mint: #9ff5d6; --mint-ink: #0f2a22; --gold: #ffe29a;
  --pink: #ff5fa8; --violet: #7b5cff; --teal: #2fd3c3; --orange: #ff8a3d;
  --display: "Spun Dip", "Segoe UI Variable Display", system-ui, sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
  --radius: 18px; --wrap: 1200px; --pad: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--night); color: var(--text); font: 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
main { overflow-x: clip; }
a { color: var(--mint); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: #c9fbe8; }
::selection { background: #ff5fa866; color: #fff; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: #3b3170 var(--night); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--mint); color: var(--mint-ink); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- backdrop: the setting, never the subject ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 80% at 80% -10%, #2a1f5c 0%, transparent 55%), radial-gradient(90% 70% at -10% 110%, #2b1440 0%, transparent 55%), var(--night); }
.backdrop .blob { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(80px); opacity: .22; mix-blend-mode: screen; will-change: transform; }
.blob.b1 { background: var(--violet); left: -12vmax; top: -10vmax; animation: drift1 70s ease-in-out infinite alternate; }
.blob.b2 { background: var(--pink); right: -16vmax; top: 18vh; opacity: .14; animation: drift2 85s ease-in-out infinite alternate; }
.blob.b3 { background: var(--teal); left: 20vw; bottom: -24vmax; opacity: .12; animation: drift3 95s ease-in-out infinite alternate; }
.blob.b4 { background: var(--orange); right: 10vw; bottom: -30vmax; opacity: .08; animation: drift1 110s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(18vw, 14vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-20vw, 22vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-14vw, -18vh) scale(1.2); } }
.backdrop canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.backdrop .glow { position: absolute; left: 0; top: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%;
  background: radial-gradient(circle, #ff5fa81c 0%, #7b5cff14 35%, transparent 70%); transform: translate(var(--gx, -999px), var(--gy, -999px)); transition: opacity .6s; }
@media (prefers-reduced-motion: reduce) { .backdrop .blob { animation: none; } .backdrop .glow { display: none; } }
@media (hover: none) { .backdrop .glow { display: none; } }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: #120e26d9; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; min-height: 72px; padding-top: 10px; padding-bottom: 10px; }
.logo { font: 26px/1 var(--display); color: #f6f2ff; text-decoration: none; letter-spacing: .005em; }
.logo:hover { color: #fff; }
.logo, .logo picture, .logo img { display: block; }
.logo img { width: 166px; height: 32px; }
.logo .u { display: inline-block; animation: spin 14s linear infinite; transform-origin: 50% 58%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .logo .u { animation: none; } }
.site-nav { display: flex; gap: 4px 26px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 16px; padding: 6px 0; position: relative; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--pink), var(--violet), var(--teal)); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px; font-weight: 650; font-size: 16px; text-decoration: none; border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, border-color .25s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--mint); color: var(--mint-ink); box-shadow: 0 6px 16px -8px #000c; }
.btn-primary:hover, .btn-primary:focus-visible { color: var(--mint-ink); background: #b8f8e1; transform: translateY(-2px); box-shadow: 0 12px 24px -10px #000e; }
.btn-ghost { color: var(--text); border-color: #ece6ff40; background: #ffffff06; }
.btn-ghost:hover { color: var(--text); border-color: #ece6ff90; background: #ffffff10; transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; font-weight: 400; }
.display { font-family: var(--display); line-height: 1.05; letter-spacing: -.005em; text-wrap: balance; }
h1.display { font-size: clamp(2.6rem, 5.4vw, 4.4rem); }
.hero h1.display { font-size: clamp(2rem, 3vw, 2.85rem); line-height: 1.12; }
h1 .soon { color: var(--gold); }
h2.display { font-size: clamp(2.1rem, 4.4vw, 3.2rem); margin-bottom: 14px; }
h3.display { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.lead { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--muted); max-width: 58ch; margin: 18px 0 30px; }
p { max-width: 68ch; }
.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section + .section::before { content: ""; position: absolute; top: 0; left: 50%; width: min(70%, 720px); height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #ff5fa855, #7b5cff77, #2fd3c355, transparent); }
.section-intro { color: var(--muted); margin: 0 0 clamp(36px, 5vw, 56px); }
.tag { display: inline-block; font: 600 13px/1 var(--body); letter-spacing: .01em; color: var(--gold); background: #ffe29a1a; border: 1px solid #ffe29a40; padding: 6px 11px; border-radius: 999px; vertical-align: middle; }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(64px, 9vw, 112px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-art { position: relative; margin: 0; }
.hero-art .main { display: block; }
.hero .wrap > *, .game > *, .ol-teaser > *, .about > * { min-width: 0; }
.hero-art .main { border-radius: var(--radius); overflow: hidden; box-shadow: 0 40px 80px -30px #000c, 0 0 0 1px var(--line); }
.hero-art .main img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.hero-art .inset { position: absolute; width: 42%; left: -8%; bottom: -14%; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 50px -18px #000d, 0 0 0 1px var(--line); }
.hero-art .inset img { aspect-ratio: 16 / 9; object-fit: cover; }
.hero-art figcaption { position: absolute; right: 14px; bottom: 12px; font-size: 13px; color: #fff; background: #0d0a1fb3; padding: 5px 10px; border-radius: 999px; }
@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { margin-bottom: 40px; }
  .hero-art .inset { width: 46%; left: auto; right: 0; bottom: -18%; }
}

/* ---------- games ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.game + .game { margin-top: clamp(72px, 10vw, 120px); }
.game.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.game.flip .gallery { order: 2; }
.gallery .stage { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px -28px #000c, 0 0 0 1px var(--line); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.gallery .stage img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; transition: transform 1.4s var(--ease), opacity .3s; }
.gallery .stage:hover { transform: translateY(-6px); box-shadow: 0 44px 70px -30px #000d, 0 0 0 1px #9ff5d655, 0 0 60px -20px #ff5fa855; }
.gallery .stage:hover img { transform: scale(1.04); }
.thumbs { display: flex; gap: 10px; margin-top: 12px; padding: 0; list-style: none; }
.thumbs button { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; overflow: hidden; width: 104px; box-shadow: 0 0 0 1px var(--line); opacity: .65; transition: opacity .25s, box-shadow .25s, transform .25s var(--ease); }
.thumbs button img { aspect-ratio: 16 / 9; object-fit: cover; }
.thumbs button:hover { opacity: 1; transform: translateY(-2px); }
.thumbs button[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--mint); }
.game h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.game p { color: var(--muted); margin: 0 0 18px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 26px; }
.facts li { font-size: 14px; color: var(--text); background: #ffffff0a; border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
@media (max-width: 880px) {
  .game, .game.flip { grid-template-columns: 1fr; }
  .game.flip .gallery { order: 0; }
  .thumbs button { width: 30%; }
}

/* ---------- OneLobby teaser ---------- */
.ol-teaser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.ol-points { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 14px; }
.ol-points li { padding-left: 26px; position: relative; color: var(--muted); }
.ol-points li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px #9ff5d688; }
.ol-points strong { color: var(--text); font-weight: 650; }
@media (max-width: 880px) { .ol-teaser { grid-template-columns: 1fr; } }

/* ---------- code ---------- */
pre { margin: 0 0 22px; background: #0c0a1c; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; overflow-x: auto; font: 14px/1.6 var(--mono); color: #e4dcff; position: relative; tab-size: 4; }
code { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: #ffffff10; border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
pre code { font-size: inherit; background: none; border: 0; padding: 0; }
.ol-teaser pre, .tabs pre, .ol-hero pre, #quickstart pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.codebox { position: relative; }
.copy { position: absolute; top: 10px; right: 10px; font: 600 12px var(--body); color: var(--muted); background: #1b1638; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; opacity: 0; transition: opacity .2s, color .2s; }
.codebox:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { color: var(--text); }
@media (hover: none) { .copy { opacity: 1; } }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.about p { color: var(--muted); font-size: 1.1rem; }
.about p:first-of-type { color: var(--text); }
.music h3 { font: 650 15px var(--body); color: var(--muted); margin: 6px 0 14px; }
.music ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 880px) { .about { grid-template-columns: 1fr; } }
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); margin-top: clamp(40px, 6vw, 64px); }
.player h3 { font: 650 15px var(--body); color: var(--muted); margin: 0 0 12px; }
.player iframe { width: 100%; height: 352px; border: 0; border-radius: 14px; background: #0c0a1c; box-shadow: 0 24px 50px -24px #000c, 0 0 0 1px var(--line); display: block; }
.playlist-card { height: 352px; border-radius: 14px; padding: 32px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  background: radial-gradient(120% 90% at 85% 10%, #ff5fa833, transparent 60%), radial-gradient(100% 80% at 0% 100%, #2fd3c32e, transparent 60%), #1b1638; box-shadow: 0 24px 50px -24px #000c, 0 0 0 1px var(--line); }
.playlist-card .pl-title { font: 400 2rem/1.1 var(--display); color: var(--text); margin: 0; }
.playlist-card p { margin: 0 0 14px; }
.playlist-card .btn { align-self: flex-start; }
.player p { color: var(--muted); font-size: 15px; margin: 12px 0 0; }
@media (max-width: 880px) { .players { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--muted); font-size: 15px; background: #0e0b20aa; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- OneLobby page ---------- */
.ol-hero { padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 80px); }
.ol-hero .version { color: var(--muted); font-size: 15px; margin-top: 18px; }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin: 0; }
.pillars div { border-top: 1px solid var(--line); padding-top: 18px; }
.pillars dt { font-weight: 650; margin-bottom: 6px; }
.pillars dd { margin: 0; color: var(--muted); }
@media (max-width: 880px) { .pillars { grid-template-columns: 1fr; } }
.status { margin-top: clamp(36px, 5vw, 56px); border: 1px solid #ffe29a40; background: #ffe29a0d; border-radius: var(--radius); padding: 22px 24px; }
.status h3 { font: 650 17px var(--body); color: var(--gold); margin-bottom: 8px; }
.status p { color: var(--muted); margin: 0 0 8px; }
.status p:last-child { margin: 0; }
.tabs [role="tablist"] { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tabs [role="tab"] { font: 600 15px var(--body); color: var(--muted); background: #ffffff08; border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; cursor: pointer; transition: color .2s, background-color .2s, border-color .2s; }
.tabs [role="tab"]:hover { color: var(--text); border-color: #ece6ff55; }
.tabs [role="tab"][aria-selected="true"] { color: var(--mint-ink); background: var(--mint); border-color: var(--mint); }
.tabs [role="tabpanel"] { max-width: 900px; }
.tabs [role="tabpanel"] h3 { font: 650 18px var(--body); margin: 22px 0 10px; }
.tabs [role="tabpanel"] h3:first-child { margin-top: 0; }
.tabs [role="tabpanel"] p { color: var(--muted); }
.docs-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px 40px; }
.docs-index h3 { font: 650 15px var(--body); color: var(--gold); margin-bottom: 10px; }
.docs-index ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.docs-index a { color: var(--text); text-decoration: none; display: inline-block; padding: 3px 0; }
.docs-index a:hover { color: var(--mint); }
.docs-index .ext::after { content: " (GitHub)"; color: var(--muted); font-size: 13px; }

/* ---------- docs pages ---------- */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); padding-top: 40px; padding-bottom: 96px; }
.docs-side { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; font-size: 15px; }
.docs-side summary { display: none; }
.docs-side ul { list-style: none; padding: 0; margin: 0; }
.docs-side > ul > li { margin-bottom: 18px; }
.docs-group { display: block; color: var(--gold); font-weight: 650; font-size: 14px; margin-bottom: 6px; }
.docs-side a { display: block; color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 8px; }
.docs-side a:hover { color: var(--text); background: #ffffff08; }
.docs-side a[aria-current="page"] { color: var(--text); background: #9ff5d614; box-shadow: inset 0 0 0 1px #9ff5d640; }
.prose { min-width: 0; }
.prose h1 { font: 400 clamp(2rem, 4vw, 2.8rem)/1.1 var(--display); margin: 0 0 24px; text-wrap: balance; }
.prose h2 { font: 700 1.5rem/1.3 var(--body); margin: 48px 0 14px; }
.prose h3 { font: 650 1.2rem/1.35 var(--body); margin: 32px 0 10px; }
.prose h4 { font: 650 1.05rem var(--body); margin: 24px 0 8px; }
.prose p, .prose li { color: #d9d1f2; }
.prose ul, .prose ol { padding-left: 1.3em; max-width: 72ch; }
.prose li { margin: 4px 0; }
.prose table { border-collapse: collapse; margin: 0 0 24px; display: block; overflow-x: auto; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: #ffffff08; }
.prose blockquote { margin: 0 0 22px; padding: 4px 18px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff06; }
.prose .source { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
@media (max-width: 880px) {
  .docs { grid-template-columns: 1fr; padding-top: 20px; }
  .docs-side { position: static; max-height: none; border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
  .docs-side summary { display: block; cursor: pointer; padding: 10px 0; font-weight: 650; }
  .docs-side:not([open]) > ul { display: none; }
}

/* ---------- 404 ---------- */
.lost { min-height: calc(100vh - 200px); display: grid; place-items: center; text-align: center; padding: 64px 0; }
.lost p { margin: 16px auto 30px; color: var(--muted); }
.lost .actions { justify-content: center; }

/* ---------- video banner (home, sign-off above the footer) ---------- */
.felt-word { width: min(50%, 720px); margin: clamp(24px, 4vw, 56px) auto 0; padding: 12px 0; }
.felt-row { position: relative; width: 100%; aspect-ratio: 2560 / 494; perspective: 900px; animation: fl-float 6s ease-in-out infinite; }
.felt-row .fl { position: absolute; top: 0; height: 100%; cursor: default; filter: drop-shadow(4px 8px 8px #0008); }
.felt-row .fl img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.felt-row .fl picture { display: block; width: 100%; height: 100%; transform-style: preserve-3d; }
.felt-row .fl.spin picture { animation: fl-spin .9s cubic-bezier(.45,.05,.25,1) both; }
@keyframes fl-spin { to { transform: rotateY(360deg); } }
@keyframes fl-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (max-width: 640px) { .felt-word { width: 92%; } }
@media (prefers-reduced-motion: reduce) { .felt-row { animation: none; } }
