/* ============================================
   3D SITE PROTOTYPES — shared styles
   Reuses the homepage tokens (style.css :root) so
   the prototypes read as the same brand.
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --pink: #C9867C;
  --pink-light: #D4A5B0;
  --pink-dark: #B088C4;
  --pink-gradient: linear-gradient(135deg, #C9867C, #D4A5B0);
  --pink-glow: rgba(201,134,124,.4);
  --slate: #7C9EC9;
  --slate-glass: rgba(124,158,201,.08);
  --slate-border: rgba(124,158,201,.25);
  --sage: #7CC99E;
  --sage-glass: rgba(124,201,158,.08);
  --sage-border: rgba(124,201,158,.25);
  --gold: #E8B86B;
  --bg: #0a0a0a;
  --bg-surface: #111111;
  --bg-card: #161616;
  --glass-bg: rgba(18,18,20,.62);
  --glass-border: rgba(255,255,255,.09);
  --glass-hover: rgba(255,255,255,.08);
  --text-primary: #ffffff;
  --text-secondary: #b4b0b6;
  --text-muted: #77737a;
  --serif: 'DM Serif Display', Georgia, 'Songti SC', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}
html { -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}
html[lang="zh-CN"] body { --serif: 'Songti SC', 'Noto Serif SC', 'STSong', Georgia, serif; }
a { color: var(--pink); text-decoration: none; }
a:hover { opacity: .85; }
::selection { background: rgba(201,134,124,.3); color: #fff; }
button { font: inherit; color: inherit; }

/* ---------- Stage (3D canvas + still poster) ---------- */
#stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
#stage.live canvas { opacity: 1; }
#stage .poster { position: absolute; inset: 0; transition: opacity 1.2s ease; }
#stage.live .poster { opacity: 0; pointer-events: none; }
#stage .poster svg { position: absolute; display: block; }

/* ---------- Header ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 64px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(10,10,10,.55);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; }
.brand svg { width: 26px; height: 26px; }
.brand small { font-weight: 500; color: var(--text-muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.top nav { display: flex; gap: 22px; }
.top nav a { color: var(--text-secondary); font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.top nav a:hover { color: #fff; }
.lang {
  display: inline-flex; border: 1px solid var(--glass-border); border-radius: 999px; padding: 3px;
  background: rgba(255,255,255,.04);
}
.lang button {
  border: 0; background: transparent; cursor: pointer; padding: 5px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
}
.lang button[aria-pressed="true"] { background: var(--pink); color: #1a0d0b; }

/* ---------- Content layer ---------- */
main { position: relative; z-index: 10; pointer-events: none; }
main a, main button, .panel, .proj { pointer-events: auto; }
section.sec { min-height: 100vh; display: flex; align-items: center; padding: 96px 6vw 110px; }
.panel {
  max-width: 520px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 30px 32px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.panel.bare { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding-left: 0; }
.kicker {
  font: 600 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .16em; text-transform: uppercase; color: var(--pink);
}
h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 5vw, 64px); line-height: 1.04; letter-spacing: -.01em;
  margin: 14px 0 14px;
}
h1 { text-wrap: balance; }
h1 .hl { color: var(--pink); font-style: italic; }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.1; margin: 10px 0 12px; }
.sub { color: var(--text-secondary); font-size: 17px; max-width: 480px; }
.sub b { color: #fff; font-weight: 600; }
p.body { color: var(--text-secondary); font-size: 16px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 22px; max-width: 480px; }
.stat {
  border: 1px solid var(--glass-border); border-radius: 14px; padding: 12px 14px;
  background: rgba(255,255,255,.035);
}
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(17px, 1.9vw, 28px); line-height: 1.1; color: #fff; white-space: nowrap; }
.stat span { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.35; margin-top: 4px; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--pink); color: var(--pink-light); background: transparent;
}
.btn.solid { background: var(--pink-gradient); color: #1a0d0b; border-color: transparent; }
.ph { color: var(--text-muted); font-size: 12px; margin-top: 12px; }

.photo {
  width: 72px; height: 72px; border-radius: 50%; flex: 0 0 auto;
  border: 1px dashed var(--pink); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 11px; margin-bottom: 14px;
}

/* ---------- Work ---------- */
.work-head { max-width: 560px; }
.projects { display: grid; gap: 12px; margin-top: 18px; }
.proj {
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 18px;
  padding: 16px 18px; transition: border-color .25s, transform .25s, background .25s;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.proj.on { border-color: var(--pink); background: rgba(40,24,22,.72); transform: translateY(-2px); }
.proj .tag { font: 600 11px/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); }
.proj h3 { font-size: 17px; margin: 6px 0 4px; font-weight: 700; }
.proj p { color: var(--text-secondary); font-size: 14px; line-height: 1.45; }
.proj .metric { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.proj .metric b { font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--pink-light); }
.proj .metric span { font-size: 12px; color: var(--text-muted); }
.proj .status { display: inline-block; margin-left: 6px; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--sage-border); color: var(--sage); background: var(--sage-glass); }
.proj .num { font: 600 11px ui-monospace, Menlo, monospace; color: var(--text-muted); float: right; }

/* ---------- 小红书 ---------- */
.posts { display: grid; gap: 10px; margin: 16px 0; }
.post { display: flex; gap: 12px; align-items: center; border: 1px solid var(--glass-border); border-radius: 14px; padding: 10px; background: rgba(255,255,255,.03); }
.post i { width: 52px; height: 52px; border-radius: 10px; flex: 0 0 auto; background: linear-gradient(135deg, rgba(201,134,124,.35), rgba(124,158,201,.25)); }
.post b { display: block; font-size: 14px; }
.post span { font-size: 12px; color: var(--text-muted); }
.followers { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 14px; }
.followers b { font-family: var(--serif); font-weight: 400; font-size: 36px; }

/* ---------- Contact ---------- */
.sec.contact .panel { margin: 0 auto; text-align: center; }
.sec.contact .ctas { justify-content: center; }
footer.foot { position: relative; z-index: 10; text-align: center; color: var(--text-muted); font-size: 12px; padding: 0 20px 110px; }

/* ---------- Switcher bar ---------- */
.switch {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 4px; padding: 5px;
  border-radius: 999px; border: 1px solid var(--glass-border);
  background: rgba(14,14,16,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  max-width: calc(100vw - 20px);
}
.switch a {
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
}
.switch a b { font: 700 11px ui-monospace, Menlo, monospace; color: var(--text-muted); }
.switch a[aria-current="page"] { background: rgba(201,134,124,.18); color: #fff; }
.switch a[aria-current="page"] b { color: var(--pink); }
.switch .mode { font: 600 10px ui-monospace, Menlo, monospace; letter-spacing: .1em; color: var(--text-muted); padding: 0 8px 0 4px; text-transform: uppercase; white-space: nowrap; }
#go3d {
  position: fixed; right: 16px; bottom: 74px; z-index: 60;
  border: 1px solid var(--pink); background: rgba(14,14,16,.85); color: var(--pink-light);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer;
}
#go3d[hidden] { display: none; }

/* ---------- Seal stamp (Curio Cabinet) ---------- */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border: 3px solid #c0392b; color: #c0392b; border-radius: 6px;
  font-family: 'Songti SC', 'STSong', serif; font-weight: 700; font-size: 20px; line-height: 1;
  writing-mode: vertical-rl; transform: rotate(-8deg) scale(1.6); opacity: 0;
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,1.6,.4,1);
  vertical-align: middle; margin-left: 10px; background: rgba(192,57,43,.06);
}
.seal.on { opacity: .92; transform: rotate(-8deg) scale(1); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .top { padding: 0 14px; height: 56px; }
  .top nav { display: none; }
  .brand small { display: none; }
  section.sec { padding: 76px 14px 96px; align-items: flex-end; }
  .panel { padding: 22px 20px; border-radius: 20px; max-width: none; width: 100%; }
  .panel.bare { padding: 22px 20px; background: var(--glass-bg); border-color: var(--glass-border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  h1 { font-size: clamp(32px, 9vw, 44px); }
  .sub { font-size: 15px; }
  .stats { gap: 8px; }
  .stat { padding: 10px; }
  .stat b { font-size: clamp(16px, 5vw, 22px); }
  .switch a { padding: 7px 9px; font-size: 12px; }
  .switch a .long { display: none; }
  .switch .mode { display: none; }
  #go3d { top: 64px; bottom: auto; right: 12px; padding: 7px 13px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Sparkie (HTML spots) ---------- */
[data-sparkie] { display: inline-block; vertical-align: middle; }
[data-sparkie] svg { width: 100%; height: auto; }
.blink { animation: blink 6.5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* ---------- Layout per concept ---------- */
.work-wrap { width: 100%; }
/* A · Dawn Line: globe left in Work, cards right */
.c-a .work-wrap { max-width: 660px; margin-left: auto; }
.c-a .projects { grid-template-columns: 1fr 1fr; }
.c-a .work-head { max-width: none; }
/* B · Curio Cabinet: one object per beat, copy alternates left/right (Oryzo) */
.c-b .projects { gap: 48vh; padding: 30vh 0 34vh; }
.c-b .proj { max-width: 380px; }
.c-b .proj:nth-child(even) { margin-left: auto; }
.c-b section.work { display: block; }
.c-b .work-head { margin-top: 10vh; }
.c-b .hero .panel, .c-b .about .panel { max-width: 460px; }
.c-b .xhs .panel { margin-left: auto; }
/* C · Pocket Planet: glass panels bottom-left, planet owns the centre */
.c-c section.sec { align-items: flex-end; }
.c-c .panel { max-width: 460px; }
.c-c .work-wrap { display: grid; gap: 14px; max-width: 640px; }
.c-c .projects { grid-template-columns: 1fr 1fr; }
.c-c .proj { padding: 12px 14px; }
.c-c .proj p { font-size: 13px; }
.c-c .xhs .panel { margin-left: auto; }

@media (max-width: 860px) {
  .c-a .projects, .c-c .projects { grid-template-columns: 1fr; }
  .c-b .projects { gap: 38vh; padding: 20vh 0 26vh; }
  .c-b .proj { max-width: none; }
  .c-c .proj p { font-size: 14px; }
}

/* ---------- Still posters (fallback) ---------- */
#stage .poster { background: radial-gradient(ellipse at 70% 40%, #17121a 0%, #0a0a0a 65%); }
.c-c #stage .poster { background: radial-gradient(ellipse at 62% 45%, #0f2a72 0%, #0a1d50 45%, #071334 100%); }
.poster-a { right: 2vw; top: 50%; transform: translateY(-50%); width: min(54vw, 680px); height: auto; }
.poster-b { right: 3vw; top: 50%; transform: translateY(-50%); width: min(50vw, 640px); height: auto; }
/* C is the planet baked from the live scene; pocket-planet.js places it with the camera's framing.
   It is baked opaque (alpha doubled the file), so a radial mask feathers the square into the stage. */
.poster-c { position: absolute; right: 4vw; top: 50%; transform: translateY(-50%); width: min(70vh, 52vw); height: auto; aspect-ratio: 1;
  -webkit-mask-image: radial-gradient(closest-side, #000 94%, transparent); mask-image: radial-gradient(closest-side, #000 94%, transparent); }
@media (max-width: 759px) { .poster-c { right: auto; left: 50%; top: 56px; transform: translateX(-50%); width: 82vw; } }
@media (max-width: 860px) {
  .poster-a { right: auto; left: 50%; top: 58px; transform: translateX(-50%); width: 112vw; }
  .poster-b { right: auto; left: 50%; top: 64px; transform: translateX(-50%); width: 100vw; }
}

/* B and C: the hero copy sits over a busy scene, so give it the glass panel */
.c-b .hero .panel.bare, .c-c .hero .panel.bare {
  background: var(--glass-bg); border-color: var(--glass-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-left: 32px;
}
html[lang="zh-CN"] h1 .hl { font-style: normal; }

/* ---------- Pocket Planet: Sparkie's speech bubble (under the panels) and drag-to-spin ---------- */
.sp-bubble {
  position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none;
  width: max-content; max-width: min(260px, 70vw); padding: 8px 13px; margin-top: -10px;
  border-radius: 14px; background: rgba(255,250,244,.95); color: #2a1a1f;
  font: 600 13px/1.35 var(--sans); box-shadow: 0 8px 24px rgba(0,0,0,.28);
  opacity: 0; scale: .7; transform-origin: 50% 100%; transition: opacity .2s ease, scale .35s cubic-bezier(.2,1.6,.4,1);
}
.sp-bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: rgba(255,250,244,.95); border-bottom: 0; }
.sp-bubble.on { opacity: 1; scale: 1; }
.pp-drag, .pp-drag * { user-select: none; -webkit-user-select: none; }
.foot .hint { color: var(--pink-light); }
