/* ============================================================
   PROTAGONIST — anime-goods look
   Bright cream paper + candy accents (sakura pink / lemon yellow /
   sky blue), halftone dots, sticker cards with hard pop shadows.
   Hero: one character in the center, everything orbits her.
   Animation durations scale with --speed (set by SPEED in main.js).
   ============================================================ */

:root {
  --paper: #FFF9EF;        /* cream base */
  --paper-2: #FFFFFF;
  --ink: #33302E;          /* warm near-black */
  --pink: #FF5E8E;         /* sakura pop */
  --yellow: #FFC93C;       /* lemon marker */
  --sky: #4FC3F7;
  --orange: #FF6B35;
  --line: rgba(51, 48, 46, .12);
  --shadow: 6px 6px 0 rgba(51, 48, 46, .16);
  --speed: 1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(rgba(51, 48, 46, .055) 1.2px, transparent 1.4px) 0 0 / 18px 18px,
    var(--paper);
  color: var(--ink);
  font-family: -apple-system, "Helvetica Neue", "Inter", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* marker highlight for key words */
.hl {
  background: linear-gradient(transparent 55%, var(--yellow) 55%, var(--yellow) 92%, transparent 92%);
  padding: 0 4px;
}

/* ---------------- Top bar ---------------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255, 249, 239, .9);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: 3px; font-size: 13px; }
.brand-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--pink); border: 2px solid var(--ink);
}
.nav-cta {
  background: var(--pink); color: #fff;
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 8px 20px; font-size: 13px; font-weight: 800; letter-spacing: .5px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.nav-cta:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block; padding: 15px 38px;
  background: var(--pink); color: #fff;
  border: 2.5px solid var(--ink); border-radius: 999px;
  font-size: 16px; font-weight: 900; letter-spacing: .5px;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--ink); }
.btn-lg { padding: 18px 48px; font-size: 18px; }
.btn-ghost {
  display: inline-block; padding: 15px 30px;
  background: var(--paper-2); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: 999px;
  font-size: 16px; font-weight: 800;
  box-shadow: 5px 5px 0 rgba(51, 48, 46, .2);
  transition: transform .12s, box-shadow .12s;
}
.btn-ghost:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 rgba(51, 48, 46, .2); }

/* ============================================================
   SCREEN 1 — one character, its whole world
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  padding: 92px 20px 48px;
  overflow: hidden;
}
.hero-title {
  font-size: clamp(30px, 4.6vw, 58px);
  font-weight: 900; letter-spacing: -.5px; text-align: center;
  line-height: 1.15;
}

/* the solar system */
.orbit-stage {
  position: relative;
  width: min(1120px, 96vw);
  height: min(62vh, 620px); min-height: 380px;
  flex: none;
}
/* ---- limited-animation cel rig: hard cuts only, no easing ---- */
.cel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  height: 100%; aspect-ratio: 2 / 3;
  z-index: 5;
}
.cel-breathe {
  position: absolute; inset: 0;
  transform-origin: 50% 100%;
  animation: cel-breathe calc(6s * var(--speed)) ease-in-out infinite;
  will-change: transform;
}
/* smooth breathing: slight lift + chest expansion, GPU transforms only */
@keyframes cel-breathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(-3px) scaleY(1.006); }
}
.cel-base {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: bottom;
  filter: drop-shadow(0 16px 28px rgba(51, 48, 46, .28));
}
/* eye layers: source rect (400,130,640,260) of 1024x1536 */
.cel-eye {
  position: absolute;
  left: 39.06%; top: 8.46%; width: 23.44%; height: 8.46%;
  display: none;
}
.cel[data-eyes="half"] .cel-eye-half { display: block; }
.cel[data-eyes="closed"] .cel-eye-closed { display: block; }
/* hair-tip layer: source rect (100,480,300,700); stepped micro-sway set by JS */
.cel-hair {
  position: absolute;
  left: 9.77%; top: 31.25%; width: 19.53%; height: 14.32%;
  transform-origin: 100% 0;
  animation: hair-sway calc(7.3s * var(--speed)) ease-in-out infinite;
  will-change: transform;
}
@keyframes hair-sway {
  0%, 100% { transform: rotate(-1.8deg); }
  50%      { transform: rotate(1.8deg); }
}
/* 漫符: blade glint */
.cel-spark {
  position: absolute; left: 57%; top: 39.6%;
  width: 5%; aspect-ratio: 1;
  display: none;
  filter: drop-shadow(0 0 6px rgba(255, 220, 120, .95));
}
.cel[data-spark="a"] .cel-spark { display: block; transform: scale(.6) rotate(0deg); }
.cel[data-spark="b"] .cel-spark { display: block; transform: scale(1.15) rotate(20deg); }

/* orbiting output cards: white sticker frames, tilted */
.orb {
  position: absolute; z-index: 3;
  background: var(--paper-2);
  border: 2px solid var(--ink); border-radius: 12px;
  padding: 6px 6px 4px;
  box-shadow: var(--shadow);
  animation: bob calc(4.6s * var(--speed)) ease-in-out infinite;
}
.orb img { display: block; border-radius: 7px; }
.orb figcaption {
  text-align: center; font-size: 11px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase; padding: 5px 0 3px;
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}

.o-comic   { left: 3%;  top: 2%;  rotate: -6deg; }
.o-comic img   { width: 150px; }
.o-plush   { left: 0;   bottom: 6%; rotate: 5deg; animation-delay: calc(-1.1s * var(--speed)); }
.o-plush img   { width: 170px; }
.o-stickers{ left: 22%; bottom: -2%; rotate: -3deg; animation-delay: calc(-2.3s * var(--speed)); z-index: 6; }
.o-stickers img{ width: 140px; }
.o-anim    { right: 2%; top: 0;   rotate: 5deg; animation-delay: calc(-.6s * var(--speed)); }
.o-anim img    { width: 230px; }
.o-figure  { right: 0;  bottom: 8%; rotate: -4deg; animation-delay: calc(-3.2s * var(--speed)); }
.o-figure img  { width: 140px; }
.o-tin     { right: 21%; bottom: -3%; rotate: 3deg; animation-delay: calc(-1.8s * var(--speed)); z-index: 6; }
.o-tin img     { width: 150px; }

.hero-sub { font-size: clamp(14px, 1.6vw, 18px); font-weight: 600; opacity: .75; text-align: center; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 12vh 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.giant { font-size: clamp(48px, 8.5vw, 116px); font-weight: 900; letter-spacing: -2px; line-height: 1.05; }
.sec-title { font-size: clamp(26px, 3.6vw, 44px); font-weight: 900; }
.quiet { font-size: 15px; opacity: .62; max-width: 560px; font-weight: 500; }


/* The studio: one-canvas pipeline UI (ComfyUI-style mock) */
.pipe { border-top: 2px solid var(--ink); }
.studio-ui {
  width: min(1100px, 96vw);
  border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden; background: #23252E;
  margin: 14px 0 4px;
}
.ui-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: #2C2E39; border-bottom: 1px solid #3A3D4A;
}
.ui-dots { display: flex; gap: 6px; }
.ui-dots i { width: 11px; height: 11px; border-radius: 50%; background: #4A4D5C; }
.ui-dots i:first-child { background: var(--pink); }
.ui-dots i:nth-child(2) { background: var(--yellow); }
.ui-dots i:nth-child(3) { background: #7BD88F; }
.ui-title { font-size: 12px; letter-spacing: 1px; color: #A8ABBA; font-weight: 700; flex: 1; text-align: left; }
.ui-run {
  font-size: 11px; font-weight: 900; letter-spacing: 1px; color: #23252E;
  background: #7BD88F; border-radius: 6px; padding: 4px 12px;
}
.ui-canvas { overflow-x: auto; }
.ui-inner {
  position: relative; width: 1040px; height: 435px;
  background:
    radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.2px) 0 0 / 22px 22px,
    #23252E;
}
.ui-wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.ui-wires path { fill: none; stroke: #6E7284; stroke-width: 2.5; stroke-dasharray: none; }
.ui-wires path:nth-child(odd) { stroke: #C88DA8; }

.node {
  position: absolute;
  background: #2E313C; border: 1.5px solid #454959; border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.node-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 900; letter-spacing: 1.5px;
  padding: 6px 10px; color: #23252E;
}
.nh-pink { background: var(--pink); color: #fff; }
.nh-yellow { background: var(--yellow); }
.nh-sky { background: var(--sky); }
.node-head .ok {
  width: 8px; height: 8px; border-radius: 50%;
  background: #7BD88F; border: 1.5px solid rgba(0,0,0,.35);
}
.node-head .who {
  font-style: normal; font-size: 8.5px; font-weight: 900; letter-spacing: 1px;
  background: rgba(0,0,0,.28); color: #fff;
  border-radius: 4px; padding: 1.5px 6px; margin-left: 6px; margin-right: auto;
}
.node-body.anno { position: relative; height: 170px; background: #F4EFE6; }
.node-body.anno > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pin {
  position: absolute; display: flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: .4px;
  color: #fff; background: rgba(35, 37, 46, .82);
  border-radius: 999px; padding: 2px 7px 2px 4px;
  white-space: nowrap;
}
.pin i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pink); flex: none;
  animation: pin-pulse calc(1.8s * var(--speed)) ease-in-out infinite;
}
@keyframes pin-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 94, 142, .7); }
  55%      { box-shadow: 0 0 0 5px rgba(255, 94, 142, 0); }
}

.node-body.node-text {
  padding: 10px 12px; font-size: 11.5px; line-height: 1.55;
  color: #C9CCDA; text-align: left; white-space: pre-line;
}
.node-body.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; }
.node-thumb { height: 118px; background: #23252E; }
.node-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.thumb-light { background: #F4EFE6; }
.thumb-light img { object-fit: contain; padding: 4px 0; }
.node-foot {
  font-size: 10px; letter-spacing: .5px; color: #8B8FA3; font-weight: 700;
  padding: 6px 10px; border-top: 1px solid #3A3D4A; text-align: left;
}

/* The library (showroom) */
.library { border-top: 2px solid var(--ink); background: rgba(79, 195, 247, .07); }
.lib-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 26px; margin: 20px 0 6px;
  max-width: 1080px; width: 100%;
}
.lib-card { text-align: center; }
.lib-fig {
  aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  box-shadow: var(--shadow);
  display: flex; align-items: flex-end; justify-content: center;
  margin-bottom: 14px;
  transition: transform .18s, box-shadow .18s;
}
.lib-card:hover .lib-fig { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 9px 9px 0 rgba(51, 48, 46, .16); }
.lib-fig img { width: 88%; height: 94%; object-fit: contain; object-position: bottom; }
.lib-name { font-size: 15px; font-weight: 900; letter-spacing: 3px; }
.lib-vibe { font-size: 12px; opacity: .55; letter-spacing: 1px; font-weight: 600; }
.lib-yours .lib-fig { border-style: dashed; background: rgba(255, 94, 142, .07); align-items: center; }
.lib-q { font-size: 64px; font-weight: 900; color: var(--pink); }
.lib-yours:hover .lib-fig { background: rgba(255, 94, 142, .14); }

/* A real run — output mosaic */
.run { border-top: 2px solid var(--ink); }
.brief-card {
  max-width: 560px; width: 100%;
  background: var(--paper-2);
  border: 2px solid var(--ink); border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 26px 24px;
  position: relative;
  rotate: -1deg;
  margin-top: 8px;
}
.brief-card::before {
  content: ""; position: absolute; left: 50%; top: -9px; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--pink); border: 2px solid var(--ink);
}
.brief-label {
  font-size: 11px; font-weight: 800; letter-spacing: 3px;
  color: var(--pink); margin-bottom: 8px;
}
.brief-card p { font-size: 16.5px; line-height: 1.65; text-align: left; font-weight: 500; }
.brief-card em { font-style: italic; font-weight: 800; }


/* base -> their heroine */
.adapt-row {
  display: flex; align-items: stretch; justify-content: center;
  gap: clamp(14px, 3vw, 34px); flex-wrap: wrap;
  margin: 10px 0 6px;
}
.adapt-card { text-align: center; width: min(300px, 42vw); }
.adapt-fig {
  aspect-ratio: 3 / 4; border-radius: 16px;
  border: 2px solid var(--ink); background: var(--paper-2);
  box-shadow: var(--shadow);
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden; margin-bottom: 12px;
}
.adapt-new .adapt-fig { background: linear-gradient(180deg, #EAF4FF, #FFFFFF); border-color: var(--pink); }
.adapt-fig img { width: 88%; height: 94%; object-fit: contain; object-position: bottom; }
.adapt-card figcaption strong { display: block; font-size: 14px; font-weight: 900; letter-spacing: 3px; }
.adapt-card figcaption span { font-size: 12px; opacity: .6; font-weight: 600; }
.adapt-arrow {
  align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 26px; color: var(--pink); font-weight: 900;
}
.adapt-arrow span { font-size: 10px; letter-spacing: 2px; color: var(--ink); font-weight: 800; }

.later-arrow {
  font-size: 13px; font-weight: 900; letter-spacing: 4px;
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0;
}
.later-arrow span { font-size: 20px; color: var(--pink); }

.launch-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 22px; align-items: start;
  max-width: 1000px; width: 100%; margin: 4px 0 8px;
}
.run-item {
  break-inside: avoid; margin: 0 0 22px;
  border-radius: 14px; overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  box-shadow: var(--shadow);
  position: relative;
}
.run-item img { display: block; width: 100%; height: auto; }
.run-item figcaption {
  padding: 11px 14px; font-size: 13px; font-weight: 700; letter-spacing: .3px;
  text-align: left; border-top: 2px solid var(--ink);
  background: var(--paper-2);
}
.run-char { background: linear-gradient(180deg, #E9F0FF, #FAFBFF); }
.run-char img { padding: 16px 24px 0; }

/* Speed */
.speed { border-top: 2px solid var(--ink); background: rgba(255, 201, 60, .12); }
.strike {
  font-size: clamp(18px, 2.6vw, 28px); font-weight: 800; letter-spacing: 1px;
  color: rgba(51, 48, 46, .38); text-decoration: line-through;
}
.speed .giant { color: var(--pink); text-shadow: 4px 4px 0 rgba(51, 48, 46, .14); }

/* CTA + footer */
.cta { border-top: 2px solid var(--ink); }
.footer {
  text-align: center; padding: 26px 0 32px; font-size: 12px;
  letter-spacing: 2px; font-weight: 700; opacity: .45;
  border-top: 2px solid var(--ink);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .orbit-stage { height: 54vh; min-height: 340px; }
  .o-comic img { width: 96px; } .o-anim img { width: 140px; }
  .o-figure img { width: 92px; } .o-plush img { width: 104px; }
  .o-tin img { width: 96px; } .o-stickers img { width: 92px; }
  .o-stickers { left: 12%; } .o-tin { right: 12%; }
  .launch-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .lib-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .section { padding: 9vh 20px; }
}
@media (max-width: 700px) {
  .adapt-card { width: min(320px, 84vw); }
  .adapt-arrow { transform: rotate(90deg); margin: -6px 0; }
  .adapt-arrow span { transform: rotate(-90deg); }
  .topbar { padding: 10px 14px; }
  .brand { letter-spacing: 2px; font-size: 11px; }
  .nav-cta { padding: 6px 14px; font-size: 12px; white-space: nowrap; box-shadow: 2px 2px 0 var(--ink); }
  .hero { padding-top: 80px; }
  .orbit-stage { height: 46vh; min-height: 300px; }
  .launch-grid { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  .cel-breathe, .cel-hair { animation: none; }
}

/* ============================================================
   Interaction layer: custom cursor + orbit card style-fans
   ============================================================ */
@media (pointer: fine) {
  body, a, button { cursor: none; }
}
/* two layers: outer = position (JS-owned, NO transitions); inner = effects */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 9999;
  pointer-events: none;
  will-change: transform;
  opacity: 0;
}
.cursor.on { opacity: 1; }
.cursor-core {
  display: block; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  transition: scale .18s ease;
}
.cursor-core svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 0 rgba(51,48,46,.5)); }
.cursor.hot .cursor-core { scale: 1.55; }
.cursor.hot .cursor-core svg { animation: cursor-spin 1.2s linear infinite; }
@keyframes cursor-spin { to { transform: rotate(180deg); } }
.trail {
  position: fixed; z-index: 9998; pointer-events: none;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  animation: trail-fade .55s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes trail-fade {
  from { opacity: .9; transform: scale(1) rotate(0deg); }
  to   { opacity: 0; transform: scale(.2) rotate(90deg) translateY(6px); }
}

/* hovered card: stop breathing, come to front */
.orb { pointer-events: auto; }
.orb:hover { animation-play-state: paused; z-index: 40; }
.orb:hover > img { filter: brightness(1.03); }

/* focus mode: hovered card enlarges, page dims, six variants fan out.
   JS owns enter/leave intent timers (grace period); CSS owns choreography. */
.dim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(43, 36, 54, .52);
  opacity: 0; pointer-events: none;
  transition: opacity .38s ease;
}
body.focus-mode .dim { opacity: 1; }

.orb { scale: 1; transition: scale .45s cubic-bezier(.3, 1.4, .4, 1); }
.orb.focus {
  z-index: 90;
  scale: 1.28;
  animation-play-state: paused;
}

.subring { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.orb.focus .subring { scale: calc(1 / 1.28); }  /* subs keep true size under card zoom */

.sub {
  position: absolute; left: 0; top: 0;
  width: 198px;
  margin: -109px 0 0 -99px;
  background: var(--paper-2);
  border: 2px solid var(--ink); border-radius: 14px;
  padding: 7px 7px 3px;
  box-shadow: 5px 6px 0 rgba(51, 48, 46, .22);
  opacity: 0;
  pointer-events: none;
  translate: 0 0; scale: .3; rotate: var(--tilt);
  transition:
    translate .22s ease-in,
    scale .22s ease-in,
    opacity .16s ease,
    rotate .2s ease;
}
.orb.focus .sub {
  opacity: 1;
  pointer-events: auto;
  translate: var(--tx) var(--ty);
  scale: 1;
  transition:
    translate .6s cubic-bezier(.22, 1.35, .36, 1),
    scale .6s cubic-bezier(.22, 1.35, .36, 1),
    opacity .3s ease,
    rotate .2s ease;
}
/* stagger only while opening, so sub-hover stays snappy afterwards */
.orb.focus.opening .sub {
  transition-delay: var(--d), var(--d), var(--d), 0s;
}
.orb.focus .sub:hover {
  scale: 1.12; rotate: 0deg; z-index: 20;
  box-shadow: 8px 10px 0 rgba(51, 48, 46, .28);
}
.sub img {
  display: block; width: 184px; height: 184px;
  object-fit: cover; object-position: center; border-radius: 9px;
}
.sub b {
  display: block; text-align: center;
  font-size: 10.5px; font-weight: 900; letter-spacing: 2.5px; padding: 5px 0 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cursor, .trail { display: none; }
  body, a, button { cursor: auto; }
  .sub { transition: none; }
}
