* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #060913; color: #e2e8f0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; }
a { color: inherit; }

.glass { border: 1px solid rgba(255,255,255,.1); border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.45);
  background: linear-gradient(160deg, rgba(30,41,59,.62), rgba(15,23,42,.55));
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }

/* title */
.hero { position: fixed; top: 22px; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 5; padding: 0 16px; }
.kicker { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(103,232,249,.85); }
.hero h1 { margin: 6px 0 4px; font-size: clamp(26px, 4.4vw, 52px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05;
  text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.oto { background: linear-gradient(90deg, #fbbf24, #f472b6, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(251,191,36,.35)); }
.sub { margin: 0; color: #94a3b8; font-size: 14px; }

/* planet labels (CSS2D) */
.plabel { text-align: center; transform: translateY(8px); white-space: nowrap; transition: opacity .3s; }
.plabel .n { font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: #94a3b8; }
.plabel .t { font-size: 14px; font-weight: 700; color: #f1f5f9; text-shadow: 0 2px 10px #000; }
.plabel.soon .t { color: #fbbf24; font-weight: 600; font-size: 13px; }

.rlabel { font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; text-shadow: 0 0 12px currentColor, 0 2px 6px #000; }

/* hover card */
.card { position: fixed; z-index: 10; width: 270px; padding: 14px 16px; pointer-events: none; transition: opacity .2s; }
.card .n { font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--c, #67e8f9); }
.card h3 { margin: 3px 0 8px; font-size: 18px; color: #fff; }
.card ul { margin: 0 0 10px; padding-left: 18px; font-size: 13px; color: #cbd5e1; line-height: 1.5; }
.card .go { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #0f172a;
  background: linear-gradient(90deg, var(--c, #22d3ee), var(--c2, #a78bfa)); }
.card.soon .go { background: rgba(251,191,36,.15); color: #fbbf24; border: 1px solid rgba(251,191,36,.35); }
.card p { margin: 0 0 10px; font-size: 13px; color: #cbd5e1; }

/* chapter chips */
.chapters { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; display: flex; gap: 6px; padding: 6px; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 24px); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; font: inherit; font-size: 13px;
  color: #e2e8f0; text-decoration: none; border: 1px solid transparent; background: transparent; cursor: pointer; transition: background .2s, border-color .2s; }
.chip b { color: #fff; white-space: nowrap; }
.chip:hover, .chip.hot { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
.chip.soon { color: #94a3b8; }
.chip.soon b { color: #cbd5e1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.lock { font-size: 12px; }

/* contact */
.contact { position: fixed; right: 18px; bottom: 18px; z-index: 6; padding: 12px 14px; font-size: 13px; min-width: 210px; }
.contact-title { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: #94a3b8; margin-bottom: 8px; }
.contact .row { white-space: nowrap; display: flex; align-items: center; gap: 8px; margin-top: 6px; color: #e2e8f0; }
.contact a { text-decoration: none; } .contact a:hover { color: #67e8f9; text-decoration: underline; }
.ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.1); font-size: 12px; }
.ico.fb { background: #1877f2; color: #fff; font-weight: 800; font-size: 13px; }

/* toast + fade */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); z-index: 12; opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #1c1917; background: #fbbf24; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#fade { position: fixed; inset: 0; z-index: 20; background: #060913; opacity: 0; pointer-events: none; }

body.picking #scene { cursor: pointer; }

@media (max-width: 860px) {
  .contact { left: 50%; right: auto; transform: translateX(-50%); bottom: auto; top: 128px; min-width: 0; padding: 8px 12px; display: flex; gap: 12px; align-items: center; }
  .contact-title { display: none; }
  .contact .row { margin: 0; }
  .card { display: none; }
  .chapters { display: grid; grid-template-columns: 1fr 1fr; width: calc(100vw - 24px); }
  .chip { padding: 8px 10px; font-size: 12px; }
}

/* materials menu (home) */
details.mat { position: relative; }
details.mat > summary { list-style: none; }
details.mat > summary::-webkit-details-marker { display: none; }
.mat-btn { color: #fde68a !important; }
.mat-btn b { color: #fde68a; }
details.mat[open] .mat-btn { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.35); }
.mat-menu { position: absolute; bottom: calc(100% + 12px); right: 0; width: 300px; padding: 12px; z-index: 30; background: rgba(15,23,42,.97) !important; }
.mat-h { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #94a3b8; margin: 4px 4px 6px; }
.mat-h:not(:first-child) { margin-top: 12px; }
.mat-menu a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; font-size: 13px; }
.mat-menu a:hover { background: rgba(255,255,255,.08); }
.mat-menu a b { color: #fff; } .mat-menu a span { color: #94a3b8; font-size: 11.5px; }
@media (max-width: 860px) { details.mat { grid-column: 1 / -1; } .mat-btn { width: 100%; justify-content: center; } .mat-menu { left: 50%; right: auto; transform: translateX(-50%); width: min(300px, calc(100vw - 32px)); } }
