/* ============================================================
   指尖生花 · Let It Bloom
   A cinematic hand-tracking stage built around a particle flower.
   ============================================================ */

:root {
  --ink: #08060d;
  --ink-soft: #100b18;
  --cream: #f6eee4;
  --cream-dim: rgba(246, 238, 228, 0.64);
  --cream-faint: rgba(246, 238, 228, 0.38);
  --gold: #f6c990;
  --gold-bright: #ffe3b7;
  --rose: #ed8d91;
  --rose-deep: #c45470;
  --teal: #8edcca;
  --line: rgba(249, 228, 207, 0.14);
  --line-bright: rgba(249, 228, 207, 0.26);
  --panel: linear-gradient(158deg, rgba(28, 20, 33, 0.82), rgba(10, 8, 16, 0.62));
  --glass: blur(24px) saturate(1.2);
  --ease-out: cubic-bezier(0.2, 0.75, 0.2, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --font-ui: "Avenir Next", "SF Pro Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "STSong", "SimSun", serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

*[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--ink);
}

html {
  color-scheme: dark;
}

body {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: none;
  background:
    radial-gradient(circle at 66% 47%, #17101d 0%, #0a0710 44%, #06050a 100%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--gold-bright);
  outline-offset: 5px;
}

::selection {
  color: #1a1114;
  background: var(--gold);
}

.app {
  position: relative;
  width: 100%;
  min-height: 100svh;
  isolation: isolate;
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

/* ------------------------------------------------------------------
   Atmosphere
   ------------------------------------------------------------------ */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.atmosphere__wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(14px);
  opacity: 0.46;
  will-change: transform;
}

.atmosphere__wash--one {
  top: -24vh;
  right: -18vw;
  width: 72vw;
  height: 72vw;
  background: radial-gradient(circle, rgba(105, 49, 91, 0.16) 0%, rgba(50, 26, 61, 0.05) 42%, transparent 68%);
  animation: drift-one 24s ease-in-out infinite alternate;
}

.atmosphere__wash--two {
  bottom: -36vh;
  left: -22vw;
  width: 75vw;
  height: 75vw;
  background: radial-gradient(circle, rgba(127, 84, 54, 0.09) 0%, rgba(25, 48, 48, 0.04) 45%, transparent 70%);
  animation: drift-two 30s ease-in-out infinite alternate;
}

@keyframes drift-one {
  to { transform: translate3d(-4vw, 3vh, 0) scale(1.08); }
}

@keyframes drift-two {
  to { transform: translate3d(4vw, -2vh, 0) scale(1.05); }
}

.atmosphere__grain {
  position: absolute;
  inset: -40%;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.8'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  animation: grain-shift 0.7s steps(2) infinite;
}

@keyframes grain-shift {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-2%, 1%, 0); }
  50% { transform: translate3d(1%, -2%, 0); }
  75% { transform: translate3d(2%, 2%, 0); }
  100% { transform: translate3d(-1%, -1%, 0); }
}

.atmosphere__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 56% 48%, transparent 36%, rgba(4, 3, 8, 0.35) 76%, rgba(4, 3, 8, 0.7) 100%),
    linear-gradient(180deg, rgba(4, 3, 8, 0.3), transparent 20%, transparent 80%, rgba(4, 3, 8, 0.4));
}

.frame-lines {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  color: var(--cream-faint);
}

.frame-lines span {
  position: absolute;
  background: currentColor;
  opacity: 0.32;
}

.frame-lines__top,
.frame-lines__bottom {
  left: 34px;
  right: 34px;
  height: 1px;
  transform: scaleX(0.04);
  animation: line-in 1.8s var(--ease-out) 0.15s forwards;
  background: linear-gradient(90deg, transparent, currentColor 15%, currentColor 85%, transparent);
}

.frame-lines__top { top: 18px; }
.frame-lines__bottom { bottom: 18px; animation-delay: 0.3s; }

.frame-lines__left,
.frame-lines__right {
  top: 34px;
  bottom: 34px;
  width: 1px;
  transform: scaleY(0.04);
  animation: line-in-y 1.8s var(--ease-out) 0.22s forwards;
  background: linear-gradient(180deg, transparent, currentColor 15%, currentColor 85%, transparent);
}

.frame-lines__left { left: 18px; }
.frame-lines__right { right: 18px; animation-delay: 0.36s; }

@keyframes line-in {
  to { transform: scaleX(1); }
}

@keyframes line-in-y {
  to { transform: scaleY(1); }
}

/* ------------------------------------------------------------------
   Shared chrome
   ------------------------------------------------------------------ */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(24px, 4.2vh, 44px) clamp(24px, 4.4vw, 68px);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.brand__mark {
  width: 29px;
  height: 29px;
  color: var(--gold-bright);
  filter: drop-shadow(0 0 10px rgba(255, 191, 133, 0.45));
  animation: mark-breathe 8s ease-in-out infinite;
}

.brand__mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes mark-breathe {
  0%, 100% { opacity: 0.82; transform: rotate(0deg); }
  50% { opacity: 1; transform: rotate(22deg); }
}

.brand__type {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand__type strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.18em;
  line-height: 1;
}

.brand__type em {
  color: var(--cream-faint);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.27em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: auto;
}

.chrome-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--cream-dim);
  background: rgba(18, 13, 24, 0.35);
  backdrop-filter: blur(14px);
  font-size: 10px;
  letter-spacing: 0.15em;
  transition: color 0.35s, border-color 0.35s, background 0.35s, transform 0.35s var(--ease-out);
}

.chrome-button svg {
  width: 13px;
  height: 13px;
  transition: transform 0.4s var(--ease-out);
}

.chrome-button:hover {
  color: var(--cream);
  border-color: var(--line-bright);
  background: rgba(39, 27, 42, 0.5);
}

.chrome-button:hover svg {
  transform: translateX(2px);
}

.chrome-button--icon {
  width: 34px;
  padding: 0;
  justify-content: center;
}

.chrome-button--icon svg {
  width: 16px;
  height: 16px;
}

.chrome-button--icon.is-off {
  color: var(--cream-faint);
}

body:not([data-mode="live"]) .chrome-button--icon {
  display: none;
}

.micro-label {
  margin: 0;
  color: var(--cream-faint);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1.4;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 54px;
  padding: 0 16px 0 24px;
  border-radius: 99px;
  overflow: hidden;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s, filter 0.45s;
}

.button--primary {
  color: #211319;
  background: linear-gradient(108deg, #f7e2c6 0%, #f0c3a6 47%, #e6a3a5 100%);
  box-shadow:
    0 12px 40px rgba(213, 133, 126, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.button--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease-out);
}

.button--primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 18px 60px rgba(236, 167, 145, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.button--primary:hover::after {
  transform: translateX(120%);
}

.button__label {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.button__pulse {
  position: relative;
  z-index: 1;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8d4e4d;
  box-shadow: 0 0 0 4px rgba(91, 44, 48, 0.1);
}

.button__pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(91, 44, 48, 0.35);
  border-radius: 50%;
  animation: cta-pulse 2.4s ease-out infinite;
}

@keyframes cta-pulse {
  0% { transform: scale(0.5); opacity: 0.8; }
  70%, 100% { transform: scale(1.9); opacity: 0; }
}

.button__arrow {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--cream);
  background: #25161d;
}

.button__arrow svg {
  width: 17px;
  height: 17px;
  transition: transform 0.4s var(--ease-out);
}

.button--primary:hover .button__arrow svg {
  transform: translateX(2px);
}

.button--primary.is-loading {
  pointer-events: none;
  opacity: 0.82;
}

.button--primary.is-loading .button__pulse {
  animation: loading-dot 1s ease-in-out infinite alternate;
}

.button--primary.is-loading .button__arrow svg {
  animation: loading-spin 2s linear infinite;
}

@keyframes loading-dot {
  to { background: #f9e0cc; box-shadow: 0 0 14px rgba(255, 211, 170, 0.8); }
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.button--quiet {
  min-height: 46px;
  padding: 0 23px;
  border: 1px solid var(--line-bright);
  color: var(--cream);
  background: rgba(255, 235, 218, 0.04);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.button--quiet:hover {
  background: rgba(255, 235, 218, 0.09);
}

.text-button {
  position: relative;
  padding: 5px 0;
  color: var(--cream-dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  transition: color 0.35s;
}

.text-button span {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
  transition: transform 0.35s var(--ease-out);
}

.text-button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}

.text-button:hover {
  color: var(--cream);
}

.text-button:hover span {
  transform: translate(2px, -2px);
}

.text-button:hover::after {
  transform: scaleX(0.6);
}

.status-light {
  position: relative;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(255, 201, 144, 0.7);
}

.status-light::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(255, 204, 153, 0.38);
  border-radius: 50%;
  animation: status-breathe 2.8s ease-out infinite;
}

.status-light--quiet {
  background: var(--teal);
  box-shadow: 0 0 10px rgba(142, 220, 202, 0.5);
}

.status-light--quiet::after {
  border-color: rgba(142, 220, 202, 0.25);
}

.status-light.is-lost {
  background: var(--cream-faint);
  box-shadow: none;
}

.status-light.is-lost::after {
  border-color: rgba(246, 238, 228, 0.2);
  animation: none;
}

@keyframes status-breathe {
  0% { transform: scale(0.5); opacity: 0.9; }
  80%, 100% { transform: scale(1.9); opacity: 0; }
}

/* ------------------------------------------------------------------
   Intro
   ------------------------------------------------------------------ */

.intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 132px clamp(26px, 7vw, 108px) 44px;
  pointer-events: none;
  transition: opacity 0.9s var(--ease-soft), visibility 0.9s;
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 4, 10, 0.93) 0%, rgba(5, 4, 10, 0.76) 22%, rgba(5, 4, 10, 0.28) 46%, transparent 64%),
    linear-gradient(180deg, rgba(5, 4, 10, 0.34) 0%, transparent 24%, transparent 72%, rgba(5, 4, 10, 0.46) 100%);
  transition: opacity 0.9s;
  pointer-events: none;
}

.intro__content {
  position: relative;
  z-index: 2;
  width: min(595px, 51vw);
  pointer-events: auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 clamp(24px, 3.8vh, 42px);
  color: var(--cream-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
}

.eyebrow__line {
  width: 28px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}

.eyebrow__no {
  color: var(--cream-faint);
  letter-spacing: 0.12em;
}

.hero-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-weight: 400;
  line-height: 0.94;
}

.hero-title__cn {
  display: block;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(66px, 7.3vw, 108px);
  font-weight: 400;
  letter-spacing: 0.035em;
  text-shadow: 0 10px 50px rgba(255, 201, 157, 0.1);
}

.hero-title__cn em {
  font-style: normal;
  background: linear-gradient(118deg, #f8d9b5 0%, #eab08e 45%, #dd8997 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(233, 154, 142, 0.18));
}

.hero-title__en {
  margin-top: clamp(15px, 2.2vh, 24px);
  color: var(--cream-faint);
  font-family: var(--font-mono);
  font-size: clamp(8px, 0.72vw, 10px);
  font-weight: 400;
  letter-spacing: 0.56em;
}

.intro__copy {
  margin: clamp(27px, 4.2vh, 43px) 0 0;
  color: var(--cream-dim);
  font-size: clamp(13px, 1.02vw, 15px);
  font-weight: 300;
  line-height: 2.05;
  letter-spacing: 0.075em;
}

.intro__actions {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: clamp(30px, 4.4vh, 45px);
}

.intro__note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--cream-faint);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.intro__note svg {
  width: 12px;
  height: 12px;
  opacity: 0.65;
}

.intro__error {
  max-width: 440px;
  margin: 15px 0 0;
  color: #f4b4a9;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

.intro__error:empty {
  display: none;
}

.gesture-legend {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: clamp(16px, 2.4vw, 36px);
  margin-top: clamp(30px, 5.5vh, 58px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.gesture-legend__item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.gesture-legend__index {
  align-self: flex-start;
  margin-top: 2px;
  color: var(--cream-faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.gesture-legend__icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 31px;
  color: rgba(247, 219, 190, 0.8);
}

.gesture-legend__icon svg {
  width: 100%;
  height: 100%;
}

.gesture-legend__icon--move {
  width: 25px;
  height: 29px;
  color: rgba(142, 220, 202, 0.65);
}

.gesture-legend__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  white-space: nowrap;
}

.gesture-legend__copy strong {
  color: var(--cream-dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.gesture-legend__copy small {
  color: var(--cream-faint);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.intro__aside {
  position: absolute;
  right: clamp(38px, 4.5vw, 78px);
  bottom: clamp(64px, 9vh, 104px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 17px;
  color: var(--cream-faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.2em;
  line-height: 1.8;
  text-align: right;
}

.intro__aside-rule {
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cream-faint));
}

.intro__aside-bottom {
  opacity: 0.7;
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  color: var(--cream-faint);
}

.scroll-cue span {
  position: relative;
  width: 1px;
  height: 28px;
  overflow: hidden;
  background: rgba(247, 224, 198, 0.16);
}

.scroll-cue span::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 1px;
  height: 60%;
  background: var(--gold);
  animation: scroll-line 2.8s ease-in-out infinite;
}

.scroll-cue small {
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.22em;
}

@keyframes scroll-line {
  0% { transform: translateY(0); opacity: 0; }
  25% { opacity: 1; }
  70%, 100% { transform: translateY(300%); opacity: 0; }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal-up 1s var(--ease-out) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes reveal-up {
  to { opacity: 1; transform: translateY(0); }
}

body[data-started="true"] .intro {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body[data-started="true"] .intro::before {
  opacity: 0;
}

/* ------------------------------------------------------------------
   In-experience HUD
   ------------------------------------------------------------------ */

.gesture-panel {
  position: fixed;
  bottom: clamp(26px, 4.6vh, 48px);
  left: clamp(22px, 3.4vw, 50px);
  z-index: 25;
  width: 306px;
  padding: 17px 19px 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 245, 231, 0.055);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.8s var(--ease-soft) 0.2s, transform 0.8s var(--ease-soft) 0.2s;
}

body[data-started="true"] .gesture-panel {
  opacity: 1;
  transform: translateY(0);
}

.gesture-panel__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(249, 228, 207, 0.09);
}

.gesture-panel__tracking {
  color: var(--cream-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gesture-panel__mode {
  margin-left: auto;
  padding: 4px 7px;
  border: 1px solid rgba(249, 228, 207, 0.13);
  border-radius: 99px;
  color: var(--cream-faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.gesture-panel__body {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 91px;
  padding: 14px 0 13px;
}

.rosette {
  --petal-open: 0.3;
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  color: var(--gold);
}

.rosette svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.rosette__petals {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(calc(0.66 + var(--petal-open) * 0.44)) rotate(calc(var(--petal-open) * 22deg));
  transition: transform 0.24s linear;
}

.rosette__petals ellipse {
  fill: rgba(239, 163, 137, 0.12);
  stroke: rgba(255, 205, 161, 0.68);
  stroke-width: 0.9;
  filter: drop-shadow(0 0 4px rgba(255, 189, 139, 0.4));
}

.rosette__center {
  fill: var(--gold-bright);
  opacity: 0.9;
  filter: drop-shadow(0 0 6px rgba(255, 213, 171, 0.8));
}

.gesture-panel__copy {
  min-width: 0;
}

.gesture-panel__copy h2 {
  margin: 2px 0 4px;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.gesture-panel__copy > p:last-child {
  margin: 0;
  color: var(--cream-faint);
  font-size: 10px;
  line-height: 1.65;
  letter-spacing: 0.035em;
}

.gesture-panel__copy .micro-label {
  color: rgba(246, 238, 228, 0.3);
  font-size: 6.5px;
  letter-spacing: 0.2em;
}

.bloom-meter {
  padding-top: 12px;
  border-top: 1px solid rgba(249, 228, 207, 0.09);
}

.bloom-meter__track {
  display: block;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 227, 199, 0.1);
}

.bloom-meter__fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e59e82, #ffe0ad 65%, #fff5df);
  box-shadow: 0 0 11px rgba(255, 200, 150, 0.65);
  transform: scaleX(0.3);
  transform-origin: left center;
  transition: transform 0.14s linear;
}

.bloom-meter__labels {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 7px;
  color: rgba(246, 238, 228, 0.32);
  font-family: var(--font-mono);
  font-size: 6.5px;
  font-weight: 400;
  letter-spacing: 0.13em;
}

.bloom-meter__labels strong {
  color: var(--gold);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.camera-hud {
  position: fixed;
  top: clamp(84px, 11vh, 108px);
  right: clamp(22px, 3.4vw, 50px);
  z-index: 25;
  width: clamp(218px, 20vw, 262px);
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 0.8s var(--ease-soft) 0.3s, transform 0.8s var(--ease-soft) 0.3s;
}

body[data-mode="live"][data-started="true"] .camera-hud {
  opacity: 1;
  transform: translateY(0);
}

.camera-hud.is-hidden {
  opacity: 0 !important;
  transform: translateY(-10px) !important;
  pointer-events: none;
}

.camera-hud__head,
.camera-hud__foot {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--cream-faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.camera-hud__head {
  padding: 0 2px 9px;
}

.camera-hud__live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
}

.camera-hud__live i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f2a28c;
  box-shadow: 0 0 9px rgba(255, 150, 130, 0.9);
  animation: live-blink 2s ease-in-out infinite;
}

@keyframes live-blink {
  50% { opacity: 0.35; }
}

.camera-hud__fps {
  margin-left: auto;
  color: rgba(246, 238, 228, 0.28);
}

.camera-window {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(249, 228, 207, 0.14);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 44%, rgba(91, 61, 73, 0.22), transparent 70%),
    #0d0912;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.3),
    inset 0 0 40px rgba(0, 0, 0, 0.35);
}

.camera-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 5, 12, 0.28), transparent 25%, transparent 75%, rgba(8, 5, 12, 0.35)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.035) 3px 4px);
  pointer-events: none;
}

.camera-window__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0.62;
  filter: saturate(0.55) contrast(1.08) brightness(0.8);
}

.camera-window__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.camera-window__corner {
  position: absolute;
  z-index: 3;
  width: 13px;
  height: 13px;
  border-color: rgba(255, 217, 174, 0.65);
  border-style: solid;
  pointer-events: none;
}

.camera-window__corner--tl { top: 7px; left: 7px; border-width: 1px 0 0 1px; }
.camera-window__corner--tr { top: 7px; right: 7px; border-width: 1px 1px 0 0; }
.camera-window__corner--bl { bottom: 7px; left: 7px; border-width: 0 0 1px 1px; }
.camera-window__corner--br { bottom: 7px; right: 7px; border-width: 0 1px 1px 0; }

.camera-window__scan {
  position: absolute;
  top: 0;
  right: 8px;
  left: 8px;
  z-index: 3;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 196, 143, 0.3), transparent);
  filter: blur(1px);
  animation: camera-scan 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes camera-scan {
  0%, 100% { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.7; }
  55% { opacity: 0.3; }
  85% { opacity: 0; }
  100% { transform: translateY(180px); }
}

.camera-hud__foot {
  justify-content: space-between;
  padding: 9px 2px 0;
  color: rgba(246, 238, 228, 0.27);
  font-size: 6.5px;
}

.live-hint {
  position: fixed;
  bottom: clamp(28px, 4.8vh, 50px);
  left: 50%;
  z-index: 24;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cream-faint);
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0;
  transform: translate(-50%, 9px);
  pointer-events: none;
  transition: opacity 0.7s var(--ease-soft) 0.45s, transform 0.7s var(--ease-soft) 0.45s;
}

body[data-started="true"] .live-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.live-hint__key {
  color: var(--cream-dim);
}

.live-hint__text {
  color: rgba(246, 238, 228, 0.32);
}

.live-hint__divider {
  width: 1px;
  height: 11px;
  margin: 0 5px;
  background: var(--line);
}

.corner-caption {
  position: fixed;
  right: clamp(24px, 4.4vw, 68px);
  bottom: 30px;
  z-index: 24;
  display: flex;
  gap: 20px;
  color: rgba(246, 238, 228, 0.27);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.16em;
  opacity: 0;
  transition: opacity 0.7s 0.65s;
}

body[data-started="true"] .corner-caption {
  opacity: 1;
}

.pointer-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 22;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 228, 187, 0.18) 0%, rgba(239, 154, 146, 0.08) 32%, transparent 68%);
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 0.35s;
  mix-blend-mode: screen;
}

.pointer-glow.is-visible {
  opacity: 1;
}

/* ------------------------------------------------------------------
   Boot / loader
   ------------------------------------------------------------------ */

.boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(5, 4, 10, 0.52);
  backdrop-filter: blur(18px) saturate(0.8);
  -webkit-backdrop-filter: blur(18px);
}

.boot__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 260px;
  text-align: center;
}

.boot__flower {
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 26px;
  animation: boot-rotate 9s linear infinite;
}

.boot__flower i {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 12px;
  height: 24px;
  margin-left: -6px;
  border: 1px solid rgba(255, 219, 178, 0.65);
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, rgba(255, 226, 186, 0.22), rgba(220, 129, 127, 0.04));
  transform-origin: 50% 25px;
  box-shadow: 0 0 16px rgba(255, 183, 134, 0.08);
  animation: boot-petal 2.8s ease-in-out infinite alternate;
}

.boot__flower i:nth-child(1) { transform: rotate(0deg) translateY(0); }
.boot__flower i:nth-child(2) { transform: rotate(60deg); animation-delay: -0.3s; }
.boot__flower i:nth-child(3) { transform: rotate(120deg); animation-delay: -0.6s; }
.boot__flower i:nth-child(4) { transform: rotate(180deg); animation-delay: -0.9s; }
.boot__flower i:nth-child(5) { transform: rotate(240deg); animation-delay: -1.2s; }
.boot__flower i:nth-child(6) { transform: rotate(300deg); animation-delay: -1.5s; }

@keyframes boot-rotate {
  to { transform: rotate(360deg); }
}

@keyframes boot-petal {
  to { opacity: 0.35; height: 17px; }
}

.boot__kicker {
  margin: 0 0 10px;
  color: var(--cream-faint);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.24em;
}

.boot__text {
  margin: 0;
  color: var(--cream-dim);
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.15em;
}

.boot__hint {
  max-width: 340px;
  margin: 14px 0 0;
  color: rgba(246, 238, 228, 0.38);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.045em;
}

.boot__cancel {
  min-height: 34px;
  margin-top: 18px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--cream-dim);
  background: rgba(255, 235, 218, 0.04);
  font-size: 9px;
  letter-spacing: 0.12em;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.boot__cancel:hover {
  color: var(--cream);
  border-color: var(--line-bright);
  background: rgba(255, 235, 218, 0.08);
}

.boot__line {
  display: block;
  width: 146px;
  height: 1px;
  margin-top: 27px;
  overflow: hidden;
  background: rgba(255, 229, 199, 0.12);
}

.boot__line i {
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: boot-line 1.6s ease-in-out infinite;
}

@keyframes boot-line {
  from { transform: translateX(-110%); }
  to { transform: translateX(330%); }
}

/* ------------------------------------------------------------------
   Guide dialog
   ------------------------------------------------------------------ */

.guide-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100svh - 40px);
  padding: 28px 30px 30px;
  overflow: auto;
  border: 1px solid rgba(250, 228, 205, 0.17);
  border-radius: 22px;
  color: var(--cream);
  background:
    radial-gradient(circle at 90% -10%, rgba(124, 73, 89, 0.24), transparent 52%),
    linear-gradient(158deg, rgba(27, 19, 32, 0.98), rgba(9, 7, 14, 0.98));
  box-shadow:
    0 50px 120px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 245, 233, 0.07);
  touch-action: pan-y;
}

.guide-dialog::backdrop {
  background: rgba(4, 3, 8, 0.65);
  backdrop-filter: blur(12px);
}

.guide-dialog[open] {
  animation: dialog-in 0.5s var(--ease-out);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.guide-dialog__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.close-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cream-dim);
  transition: color 0.3s, border-color 0.3s, transform 0.4s var(--ease-out);
}

.close-button svg {
  width: 16px;
  height: 16px;
}

.close-button:hover {
  color: var(--cream);
  border-color: var(--line-bright);
  transform: rotate(90deg);
}

.guide-dialog h2 {
  margin: 26px 0 28px;
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.guide-steps li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 13px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(249, 228, 207, 0.075);
}

.guide-steps li > span {
  padding-top: 2px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.guide-steps strong {
  display: block;
  margin-bottom: 5px;
  color: var(--cream);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
}

.guide-steps p {
  margin: 0;
  color: var(--cream-faint);
  font-size: 11px;
  line-height: 1.75;
  letter-spacing: 0.03em;
}

.guide-dialog__note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin: 22px 0 24px;
  padding: 13px 15px;
  border: 1px solid rgba(142, 220, 202, 0.12);
  border-radius: 10px;
  background: rgba(142, 220, 202, 0.035);
}

.guide-dialog__note .status-light {
  margin-top: 4px;
}

.guide-dialog__note p {
  margin: 0;
  color: rgba(213, 236, 227, 0.52);
  font-size: 10px;
  line-height: 1.7;
}

/* ------------------------------------------------------------------
   Fatal
   ------------------------------------------------------------------ */

.fatal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
  background: #08060d;
}

.fatal p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
}

.fatal span {
  color: var(--cream-dim);
  font-size: 12px;
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */

@media (max-width: 980px) {
  .intro__content {
    width: min(540px, 57vw);
  }

  .intro__aside {
    display: none;
  }

  .gesture-legend {
    gap: 18px;
  }

  .gesture-legend__item--last {
    display: none;
  }

  .gesture-legend {
    grid-template-columns: repeat(2, auto);
  }
}

@media (max-width: 760px) {
  .frame-lines__top,
  .frame-lines__bottom {
    left: 16px;
    right: 16px;
  }

  .frame-lines__left,
  .frame-lines__right {
    top: 22px;
    bottom: 22px;
  }

  .frame-lines__left { left: 10px; }
  .frame-lines__right { right: 10px; }

  .topbar {
    padding: 20px 18px;
  }

  .brand__mark {
    width: 25px;
    height: 25px;
  }

  .brand__type strong {
    font-size: 14px;
  }

  .brand__type em {
    font-size: 6px;
  }

  .chrome-button {
    min-height: 32px;
    padding: 0 12px;
    font-size: 9px;
  }

  .chrome-button span {
    display: inline;
  }

  #guideButton svg {
    display: none;
  }

  .chrome-button--icon {
    width: 32px;
    padding: 0;
  }

  .chrome-button--icon svg {
    display: block;
    width: 16px;
    height: 16px;
  }

  .intro {
    align-items: flex-end;
    padding: 104px 22px 30px;
  }

  .intro::before {
    background:
      linear-gradient(180deg, rgba(5, 4, 10, 0.3) 0%, transparent 25%, rgba(5, 4, 10, 0.5) 55%, rgba(5, 4, 10, 0.95) 91%),
      radial-gradient(ellipse at 50% 30%, transparent 0%, rgba(5, 4, 10, 0.1) 60%, rgba(5, 4, 10, 0.4) 100%);
  }

  .intro__content {
    width: 100%;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 8px;
  }

  .hero-title__cn {
    font-size: clamp(54px, 16.5vw, 82px);
  }

  .hero-title__en {
    font-size: 7px;
    letter-spacing: 0.45em;
    margin-top: 13px;
  }

  .intro__copy {
    margin-top: 22px;
    font-size: 12px;
    line-height: 1.85;
  }

  .intro__actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    margin-top: 24px;
  }

  .button--primary {
    min-height: 50px;
    width: 100%;
    justify-content: flex-start;
    padding-left: 22px;
  }

  .button__arrow {
    margin-left: auto;
    width: 32px;
    height: 32px;
  }

  .intro__note {
    margin-top: 14px;
    font-size: 8.5px;
  }

  .gesture-legend {
    gap: 20px;
    margin-top: 25px;
    padding-top: 16px;
  }

  .gesture-legend__item--last {
    display: flex;
  }

  .gesture-legend {
    grid-template-columns: repeat(3, auto);
  }

  .gesture-legend__icon {
    width: 23px;
    height: 27px;
  }

  .gesture-legend__index {
    display: none;
  }

  .gesture-legend__copy strong {
    font-size: 9px;
  }

  .gesture-legend__copy small {
    font-size: 7px;
  }

  .scroll-cue {
    display: none;
  }

  .gesture-panel {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
    padding: 13px 15px 12px;
  }

  .gesture-panel__head {
    padding-bottom: 10px;
  }

  .gesture-panel__body {
    gap: 10px;
    min-height: 64px;
    padding: 10px 0;
  }

  .rosette {
    width: 49px;
    height: 49px;
  }

  .gesture-panel__copy h2 {
    margin: 0 0 2px;
    font-size: 20px;
  }

  .gesture-panel__copy > p:last-child {
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gesture-panel__copy .micro-label {
    font-size: 6px;
  }

  .bloom-meter {
    padding-top: 9px;
  }

  .camera-hud {
    top: 76px;
    right: 14px;
    width: 148px;
  }

  .camera-hud__head {
    font-size: 6px;
    gap: 6px;
    padding-bottom: 6px;
  }

  .camera-hud__foot {
    display: none;
  }

  .camera-window {
    border-radius: 10px;
  }

  .live-hint {
    display: none;
  }

  .corner-caption {
    display: none;
  }

  .gesture-panel__mode {
    font-size: 6px;
  }

  .guide-dialog {
    padding: 22px 20px 24px;
    border-radius: 18px;
  }

  .guide-dialog h2 {
    margin: 20px 0 20px;
    font-size: 30px;
  }

  .guide-steps li {
    padding: 13px 0;
  }

  .guide-dialog__note {
    margin: 17px 0 19px;
  }
}

@media (max-height: 680px) and (min-width: 761px) {
  .intro {
    padding-top: 108px;
    padding-bottom: 26px;
  }

  .eyebrow {
    margin-bottom: 18px;
  }

  .intro__copy {
    margin-top: 22px;
  }

  .intro__actions {
    margin-top: 23px;
  }

  .gesture-legend {
    margin-top: 24px;
  }

  .gesture-panel {
    bottom: 18px;
  }

  .camera-hud {
    top: 76px;
    width: 210px;
  }
}

/* Short landscape screens (phones on their side, small laptops). */
@media (max-height: 580px) and (min-width: 761px) {
  .topbar {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .intro {
    padding: 82px 6vw 20px;
  }

  .intro__content {
    width: min(540px, 58vw);
  }

  .eyebrow {
    margin-bottom: 11px;
    font-size: 8px;
  }

  .hero-title__cn {
    font-size: clamp(48px, 6vw, 66px);
  }

  .hero-title__en {
    margin-top: 9px;
    font-size: 7px;
  }

  .intro__copy {
    margin-top: 15px;
    font-size: 11.5px;
    line-height: 1.72;
  }

  .intro__actions {
    gap: 20px;
    margin-top: 17px;
  }

  .button--primary {
    min-height: 45px;
    padding-left: 18px;
  }

  .button__arrow {
    width: 28px;
    height: 28px;
  }

  .intro__note {
    margin-top: 11px;
    font-size: 8px;
  }

  .gesture-legend,
  .intro__aside,
  .scroll-cue {
    display: none;
  }

  .gesture-panel {
    bottom: 14px;
  }

  .camera-hud {
    top: 72px;
    width: 190px;
  }

  .live-hint,
  .corner-caption {
    display: none;
  }
}

/* Tight portrait screens: trim the onboarding without losing the CTA. */
@media (max-width: 760px) and (max-height: 700px) {
  .intro {
    padding-bottom: 22px;
  }

  .eyebrow {
    margin-bottom: 12px;
  }

  .hero-title__cn {
    font-size: clamp(48px, 15vw, 70px);
  }

  .intro__copy {
    margin-top: 16px;
    line-height: 1.72;
  }

  .intro__actions {
    gap: 12px;
    margin-top: 19px;
  }

  .intro__note {
    display: none;
  }

  .gesture-legend {
    margin-top: 18px;
    padding-top: 12px;
  }

  .button--primary {
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .atmosphere__grain {
    display: none;
  }
}
