/* ==========================================================================
   指尖生花 · Gesture Bloom
   Editorial interface over a procedural Three.js flower
   ========================================================================== */

:root {
  --bg: #050307;
  --bg-deep: #020104;
  --ink: #f6eee7;
  --ink-soft: rgba(246, 238, 231, 0.68);
  --ink-muted: rgba(246, 238, 231, 0.44);
  --ink-faint: rgba(246, 238, 231, 0.2);
  --line: rgba(255, 234, 223, 0.14);
  --line-strong: rgba(255, 234, 223, 0.26);
  --rose: #ff6e9f;
  --rose-soft: #ffb0c2;
  --peach: #ffd0b0;
  --cream: #f6e9dd;
  --teal: #8fe5d5;
  --serif: "Bodoni 72", "Didot", "Bodoni MT", "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --pad: clamp(24px, 3.2vw, 54px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
}

body {
  min-height: 100svh;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button,
input,
video {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  background: none;
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--peach);
  outline-offset: 5px;
}

::selection {
  color: var(--bg);
  background: var(--peach);
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(31, 9, 27, 0.32), transparent 60%),
    var(--bg);
}

/* --------------------------------------------------------------------------
   Ambient light / texture
   -------------------------------------------------------------------------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient__aurora {
  position: absolute;
  width: 72vw;
  height: 72vw;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.ambient__aurora--rose {
  top: -26vw;
  right: -12vw;
  background:
    radial-gradient(circle at 42% 45%, rgba(255, 83, 142, 0.25), transparent 47%),
    radial-gradient(circle at 62% 60%, rgba(146, 31, 95, 0.2), transparent 58%);
  animation: aurora-drift 24s var(--ease-soft) infinite alternate;
}

.ambient__aurora--teal {
  bottom: -38vw;
  left: -22vw;
  width: 66vw;
  height: 66vw;
  background:
    radial-gradient(circle at 48% 48%, rgba(55, 147, 139, 0.12), transparent 48%),
    radial-gradient(circle at 60% 45%, rgba(25, 56, 80, 0.22), transparent 61%);
  animation: aurora-drift-two 30s var(--ease-soft) infinite alternate;
}

.ambient__halo {
  position: absolute;
  top: 50%;
  left: 64%;
  width: min(72vw, 980px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 219, 201, 0.055);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ambient__halo::before,
.ambient__halo::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  border: 1px solid rgba(255, 219, 201, 0.035);
}

.ambient__halo::before {
  inset: 8.5%;
}

.ambient__halo::after {
  inset: 21%;
}

.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.17;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.72'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.ambient__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 34%, rgba(2, 1, 4, 0.28) 72%, rgba(2, 1, 4, 0.76) 100%),
    linear-gradient(90deg, rgba(2, 1, 4, 0.58) 0%, transparent 34%, transparent 72%, rgba(2, 1, 4, 0.24) 100%);
}

.ambient__rules {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(255, 235, 225, 0.035) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(255, 235, 225, 0.026) 50%, transparent calc(50% + 0.5px));
}

@keyframes aurora-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-4vw, 5vh, 0) scale(1.08); }
}

@keyframes aurora-drift-two {
  from { transform: translate3d(0, 0, 0) scale(1.04); }
  to { transform: translate3d(5vw, -4vh, 0) scale(0.96); }
}

/* --------------------------------------------------------------------------
   WebGL canvas
   -------------------------------------------------------------------------- */

.scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.webgl-fallback {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  width: min(460px, calc(100vw - 48px));
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(8, 5, 10, 0.88);
  backdrop-filter: blur(24px);
  transform: translate(-50%, -50%);
}

.webgl-fallback h1 {
  margin: 18px 0 12px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
}

.webgl-fallback p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
}

/* --------------------------------------------------------------------------
   Shared typography
   -------------------------------------------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.28em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow > span {
  color: var(--peach);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.05em;
}

.eyebrow::after {
  content: "";
  width: 38px;
  height: 1px;
  margin-left: 2px;
  background: var(--line-strong);
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
  padding: 0 var(--pad);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.brand__mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--peach);
}

.brand__mark svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 12px rgba(255, 140, 160, 0.38));
}

.brand__name {
  color: rgba(246, 238, 231, 0.82);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
}

.brand__name span {
  color: var(--ink-muted);
  letter-spacing: 0.14em;
}

.topbar__meta {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(246, 238, 231, 0.32);
  font-size: 8px;
  letter-spacing: 0.23em;
  transform: translateX(-50%);
}

.topbar__rule {
  width: 30px;
  height: 1px;
  background: var(--line);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 104px;
  height: 31px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 7, 13, 0.42);
  backdrop-filter: blur(14px);
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.5s var(--ease-soft), border-color 0.5s var(--ease-soft), background 0.5s var(--ease-soft);
  pointer-events: auto;
}

.status-pill__dot {
  position: relative;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(246, 238, 231, 0.4);
  transition: background 0.4s ease;
}

.status-pill[data-tone="working"] {
  color: var(--peach);
  border-color: rgba(255, 208, 176, 0.24);
}

.status-pill[data-tone="working"] .status-pill__dot {
  background: var(--peach);
  box-shadow: 0 0 10px rgba(255, 182, 150, 0.8);
  animation: status-blink 1.3s ease-in-out infinite;
}

.status-pill[data-tone="live"] {
  color: rgba(239, 255, 243, 0.88);
  border-color: rgba(143, 229, 213, 0.25);
  background: rgba(10, 24, 23, 0.32);
}

.status-pill[data-tone="live"] .status-pill__dot {
  background: var(--teal);
  box-shadow: 0 0 12px rgba(143, 229, 213, 0.75);
}

.status-pill[data-tone="live"] .status-pill__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(143, 229, 213, 0.4);
  border-radius: inherit;
  animation: dot-ping 2.5s ease-out infinite;
}

.status-pill[data-tone="error"] {
  color: #ffb5b0;
  border-color: rgba(255, 120, 120, 0.26);
}

.status-pill[data-tone="error"] .status-pill__dot {
  background: #ff8984;
}

@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes dot-ping {
  0% { transform: scale(0.7); opacity: 0.8; }
  80%, 100% { transform: scale(1.55); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Intro
   -------------------------------------------------------------------------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  transition: opacity 1.1s var(--ease-out), visibility 1.1s;
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 2, 5, 0.9) 0%, rgba(3, 2, 5, 0.78) 24%, rgba(3, 2, 5, 0.38) 48%, transparent 68%),
    linear-gradient(0deg, rgba(3, 2, 5, 0.46), transparent 22%);
  pointer-events: none;
}

.intro__inner {
  position: absolute;
  top: 50%;
  left: var(--pad);
  width: min(440px, 43vw);
  transform: translateY(-50%);
  pointer-events: auto;
}

.intro__eyebrow {
  opacity: 0;
  animation: intro-rise 1.1s 0.15s var(--ease-out) forwards;
}

.hero-title {
  margin: 24px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(72px, 9.4vw, 154px);
  letter-spacing: -0.055em;
  line-height: 0.78;
}

.hero-title__line {
  display: block;
  opacity: 0;
  transform: translateY(34px);
  animation: intro-rise 1.3s var(--ease-out) forwards;
}

.hero-title__line--one {
  padding-left: 0.04em;
  color: var(--cream);
  animation-delay: 0.24s;
}

.hero-title__line--two {
  padding-left: 0.65em;
  color: rgba(248, 231, 219, 0.9);
  animation-delay: 0.36s;
}

.hero-title em {
  position: relative;
  color: var(--rose-soft);
  font-style: normal;
  text-shadow: 0 0 54px rgba(255, 93, 145, 0.42);
}

.hero-title em::after {
  content: "";
  position: absolute;
  top: 14%;
  right: -0.11em;
  width: 0.055em;
  height: 0.64em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--peach), rgba(255, 126, 160, 0));
  opacity: 0.7;
}

.intro__copy-wrap {
  display: flex;
  gap: 22px;
  margin: 38px 0 0;
  opacity: 0;
  animation: intro-rise 1.2s 0.5s var(--ease-out) forwards;
}

.intro__copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.075em;
  line-height: 2.05;
}

.intro__hairline {
  display: block;
  width: 1px;
  height: 58px;
  margin-top: 3px;
  background: linear-gradient(180deg, var(--line-strong), transparent);
}

.intro__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 38px;
  opacity: 0;
  animation: intro-rise 1.2s 0.62s var(--ease-out) forwards;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 53px;
  cursor: pointer;
  transition: transform 0.5s var(--ease-out), border-color 0.4s ease, color 0.4s ease, background 0.4s ease;
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled,
.enable-camera:disabled,
.bottombar__camera:disabled {
  cursor: wait;
  opacity: 0.45;
  pointer-events: none;
}

.btn--primary {
  gap: 18px;
  min-width: 196px;
  padding: 0 8px 0 25px;
  overflow: hidden;
  border: 1px solid rgba(255, 245, 238, 0.8);
  border-radius: 999px;
  background: var(--cream);
  color: #11080d;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  box-shadow: 0 12px 40px rgba(255, 180, 173, 0.12);
}

.btn--primary:hover {
  background: #fff7ef;
  transform: translateY(-2px);
  box-shadow: 0 18px 48px rgba(255, 135, 156, 0.22);
}

.btn__wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.9) 48%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 1.1s var(--ease-out);
}

.btn--primary:hover .btn__wash {
  transform: translateX(130%);
}

.btn__label {
  position: relative;
  z-index: 1;
}

.btn__arrow {
  position: relative;
  z-index: 1;
  display: grid;
  width: 38px;
  height: 38px;
  margin-left: 2px;
  border-radius: 50%;
  background: #180d12;
  color: var(--cream);
  place-items: center;
  transition: transform 0.6s var(--ease-out), background 0.4s ease;
}

.btn__arrow svg {
  width: 18px;
  height: 18px;
}

.btn--primary:hover .btn__arrow {
  background: #2a111b;
  transform: rotate(-35deg);
}

.btn--primary.is-loading {
  pointer-events: none;
  color: rgba(17, 8, 13, 0.62);
}

.btn--primary.is-loading .btn__arrow svg {
  animation: button-spin 1.1s linear infinite;
}

.btn--ghost {
  height: 44px;
  padding: 0 2px;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.btn--ghost:hover {
  color: var(--ink);
  border-color: var(--peach);
}

.privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 30px 0 0;
  color: rgba(246, 238, 231, 0.3);
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0;
  animation: intro-rise 1.2s 0.75s var(--ease-out) forwards;
}

.privacy svg {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}

.intro__error {
  max-width: 380px;
  min-height: 17px;
  margin: 14px 0 0;
  color: #ffaaa3;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.7;
}

.intro__aside {
  position: absolute;
  top: 50%;
  right: var(--pad);
  display: flex;
  width: 160px;
  align-items: flex-end;
  gap: 16px;
  color: var(--ink-muted);
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  opacity: 0;
  animation: intro-fade 1.6s 0.9s var(--ease-out) forwards;
}

.intro__aside-index {
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.18em;
}

.intro__aside-word {
  color: rgba(246, 238, 231, 0.5);
  font-size: 8px;
  letter-spacing: 0.44em;
}

.intro__aside-line {
  width: 1px;
  height: 78px;
  background: linear-gradient(180deg, transparent, var(--line-strong));
}

.intro__aside-note {
  color: rgba(246, 238, 231, 0.23);
  font-family: var(--serif);
  font-size: 10px;
  font-style: italic;
  letter-spacing: 0.09em;
  line-height: 1.7;
}

.intro__corner {
  position: absolute;
  bottom: 48px;
  right: var(--pad);
  display: flex;
  align-items: flex-end;
  gap: 13px;
  color: rgba(246, 238, 231, 0.22);
  font-size: 7px;
  letter-spacing: 0.22em;
  line-height: 1.8;
  text-align: right;
  opacity: 0;
  animation: intro-fade 1.6s 1.05s var(--ease-out) forwards;
}

.intro__corner-line {
  width: 44px;
  height: 1px;
  margin-bottom: 8px;
  background: var(--line);
}

.app[data-state="tracking"] .intro,
.app[data-state="pointer"] .intro {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.app[data-state="tracking"] .intro__inner,
.app[data-state="pointer"] .intro__inner {
  transform: translateY(-50%) translateX(-24px);
}

.intro__inner {
  transition: transform 0.9s var(--ease-out);
}

@keyframes intro-rise {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes intro-fade {
  to { opacity: 1; }
}

@keyframes button-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Tracking interface
   -------------------------------------------------------------------------- */

.tracking-ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s var(--ease-out), visibility 0.9s;
}

.app[data-state="tracking"] .tracking-ui,
.app[data-state="pointer"] .tracking-ui {
  visibility: visible;
  opacity: 1;
}

.camera-card {
  position: absolute;
  bottom: 52px;
  left: var(--pad);
  width: 254px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: rgba(10, 6, 12, 0.48);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.app[data-state="pointer"] .camera-card {
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px);
}

.camera-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 40%, rgba(91, 42, 60, 0.32), transparent 70%),
    #08050a;
}

.camera-frame video,
.camera-frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-frame video {
  filter: saturate(0.72) contrast(1.04) brightness(0.72);
  opacity: 0.88;
}

.camera-frame canvas {
  z-index: 2;
}

.camera-frame__tint {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(0deg, rgba(7, 3, 9, 0.5), transparent 44%),
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(5, 2, 8, 0.2) 100%);
  mix-blend-mode: multiply;
}

.camera-frame__scan {
  position: absolute;
  top: -20%;
  right: 0;
  left: 0;
  z-index: 4;
  height: 38%;
  background: linear-gradient(180deg, transparent, rgba(255, 204, 183, 0.045), transparent);
  opacity: 0;
  animation: camera-scan 5s 1.2s ease-in-out infinite;
}

.app[data-state="tracking"] .camera-frame__scan {
  opacity: 1;
}

.camera-corner {
  position: absolute;
  z-index: 5;
  width: 12px;
  height: 12px;
  border-color: rgba(255, 236, 225, 0.36);
  border-style: solid;
}

.camera-corner--tl {
  top: 10px;
  left: 10px;
  border-width: 1px 0 0 1px;
}

.camera-corner--tr {
  top: 10px;
  right: 10px;
  border-width: 1px 1px 0 0;
}

.camera-corner--bl {
  bottom: 10px;
  left: 10px;
  border-width: 0 0 1px 1px;
}

.camera-corner--br {
  right: 10px;
  bottom: 10px;
  border-width: 0 1px 1px 0;
}

.camera-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  background: rgba(6, 3, 8, 0.72);
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0.18em;
  backdrop-filter: blur(7px);
  transition: opacity 0.5s ease, visibility 0.5s;
}

.camera-loading.is-ready {
  visibility: hidden;
  opacity: 0;
}

.camera-loading__ring {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 214, 195, 0.18);
  border-top-color: var(--peach);
  border-radius: 50%;
  animation: button-spin 1.2s linear infinite;
}

.camera-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 5px 2px;
  color: var(--ink-muted);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.live-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(143, 229, 213, 0.8);
}

.live-chip i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(143, 229, 213, 0.8);
  animation: status-blink 2s ease-in-out infinite;
}

@keyframes camera-scan {
  0% { top: -30%; opacity: 0; }
  18% { opacity: 0.8; }
  55%, 100% { top: 110%; opacity: 0; }
}

/* Bloom readout */

.bloom-readout {
  position: absolute;
  right: var(--pad);
  bottom: 56px;
  width: 206px;
}

.bloom-readout__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.bloom-readout__head strong {
  color: var(--cream);
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.8;
  font-variant-numeric: tabular-nums;
}

.bloom-readout__track {
  position: relative;
  height: 1px;
  margin-top: 16px;
  background: rgba(255, 236, 225, 0.17);
}

.bloom-readout__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 210, 177, 0.7), var(--rose));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.14s linear;
  box-shadow: 0 0 12px rgba(255, 105, 147, 0.65);
}

.bloom-readout__tick {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: rgba(255, 236, 225, 0.2);
}

.bloom-readout__tick--a { left: 25%; }
.bloom-readout__tick--b { left: 50%; }
.bloom-readout__tick--c { left: 75%; }

.bloom-readout__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  color: rgba(246, 238, 231, 0.4);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.bloom-readout__foot span:last-child {
  color: var(--ink-faint);
}

/* Gesture legend */

.gesture-legend {
  position: absolute;
  bottom: 55px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 11px 18px;
  border: 1px solid rgba(255, 235, 225, 0.1);
  border-radius: 999px;
  background: rgba(9, 5, 12, 0.34);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.gesture-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.gesture-legend__num {
  color: rgba(255, 208, 176, 0.5);
  font-family: var(--serif);
  font-size: 10px;
  font-style: italic;
}

.gesture-legend__text {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.gesture-legend__text b {
  color: rgba(246, 238, 231, 0.72);
  font-weight: 400;
}

.gesture-legend__text small {
  color: var(--ink-faint);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.gesture-legend__rule {
  width: 1px;
  height: 13px;
  background: var(--line);
}

/* HUD camera button */

.enable-camera {
  position: absolute;
  bottom: 54px;
  left: var(--pad);
  display: flex;
  align-items: center;
  gap: 11px;
  height: 48px;
  padding: 0 20px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(9, 5, 12, 0.5);
  backdrop-filter: blur(14px);
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.15em;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.enable-camera:hover {
  color: var(--ink);
  border-color: rgba(255, 208, 176, 0.5);
  background: rgba(24, 12, 19, 0.7);
}

.enable-camera__icon {
  display: grid;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--peach);
  place-items: center;
}

.enable-camera__icon svg {
  width: 15px;
  height: 15px;
}

.app[data-state="tracking"] .enable-camera,
.bottombar__camera {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.bottombar {
  position: fixed;
  right: var(--pad);
  bottom: 16px;
  left: var(--pad);
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(246, 238, 231, 0.24);
  font-size: 7px;
  letter-spacing: 0.2em;
  pointer-events: none;
}

.bottombar__left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.bottombar__left i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 208, 176, 0.45);
}

.bottombar__coords {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.app[data-state="tracking"] .bottombar__coords {
  opacity: 1;
}

.bottombar__camera {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: rgba(246, 238, 231, 0.45);
  font-size: 7px;
  letter-spacing: 0.18em;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.4s ease, opacity 0.4s ease, visibility 0.4s;
}

.bottombar__camera svg {
  width: 14px;
  height: 14px;
}

.bottombar__camera:hover {
  color: var(--peach);
}

.app[data-state="pointer"] .bottombar__camera {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  top: 108px;
  left: 50%;
  z-index: 40;
  max-width: min(430px, calc(100vw - 40px));
  padding: 11px 18px;
  border: 1px solid rgba(255, 208, 176, 0.2);
  border-radius: 999px;
  background: rgba(13, 7, 13, 0.82);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(20px);
  color: rgba(246, 238, 231, 0.75);
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.45s ease, transform 0.55s var(--ease-out);
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[data-tone="warm"] {
  border-color: rgba(255, 208, 176, 0.32);
  color: var(--peach);
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .ambient__aurora {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .topbar__meta {
    display: none;
  }

  .intro__inner {
    width: min(410px, 49vw);
  }

  .hero-title {
    font-size: clamp(68px, 10.4vw, 128px);
  }

  .gesture-legend {
    gap: 13px;
    padding: 10px 15px;
  }
}

@media (max-width: 820px) {
  :root {
    --pad: 24px;
  }

  .app {
    min-height: 520px;
  }

  .topbar {
    height: 72px;
  }

  .brand__name {
    font-size: 9px;
  }

  .status-pill {
    min-width: 0;
    height: 28px;
    padding: 0 11px;
    font-size: 7px;
  }

  .intro::before {
    background:
      linear-gradient(180deg, rgba(3, 2, 5, 0.72) 0%, rgba(3, 2, 5, 0.48) 42%, rgba(3, 2, 5, 0.2) 70%, rgba(3, 2, 5, 0.55) 100%),
      linear-gradient(90deg, rgba(3, 2, 5, 0.82) 0%, rgba(3, 2, 5, 0.5) 45%, transparent 80%);
  }

  .intro__inner {
    top: 48%;
    right: 28px;
    width: min(390px, 72vw);
  }

  .intro__aside {
    display: none;
  }

  .intro__corner {
    bottom: 34px;
    right: var(--pad);
  }

  .hero-title {
    margin-top: 20px;
    font-size: clamp(64px, 15vw, 106px);
  }

  .intro__copy-wrap {
    margin-top: 28px;
  }

  .intro__actions {
    margin-top: 30px;
  }

  .intro__copy {
    font-size: 13px;
  }

  .camera-card {
    width: 194px;
    bottom: 48px;
    border-radius: 17px;
  }

  .camera-frame {
    border-radius: 11px;
  }

  .camera-meta {
    font-size: 6px;
    padding-top: 8px;
  }

  .bloom-readout {
    right: var(--pad);
    bottom: 51px;
    width: 142px;
  }

  .bloom-readout__head strong {
    font-size: 30px;
  }

  .bloom-readout__foot {
    font-size: 7px;
  }

  .gesture-legend {
    display: none;
  }

  .enable-camera {
    bottom: 49px;
    height: 43px;
    padding: 0 16px 0 11px;
    font-size: 8px;
  }

  .enable-camera__icon {
    width: 23px;
    height: 23px;
  }

  .bottombar {
    bottom: 10px;
    font-size: 6px;
  }

  .bottombar__coords {
    display: none;
  }
}

@media (max-width: 560px) {
  .app {
    min-height: 480px;
  }

  .brand__mark {
    width: 25px;
    height: 25px;
  }

  .brand__name {
    font-size: 8px;
  }

  .brand__name span {
    display: none;
  }

  .topbar {
    height: 66px;
  }

  .intro__inner {
    top: 44%;
    right: 22px;
    left: var(--pad);
    width: auto;
  }

  .intro__eyebrow {
    font-size: 8px;
    letter-spacing: 0.2em;
  }

  .hero-title {
    margin-top: 18px;
    font-size: clamp(58px, 19vw, 88px);
    line-height: 0.8;
  }

  .hero-title__line--two {
    padding-left: 0.45em;
  }

  .intro__copy-wrap {
    margin-top: 24px;
    gap: 14px;
  }

  .intro__copy {
    font-size: 12px;
    line-height: 1.95;
    letter-spacing: 0.05em;
  }

  .intro__hairline {
    height: 46px;
  }

  .intro__actions {
    gap: 13px;
    margin-top: 26px;
  }

  .btn--primary {
    min-width: 174px;
    height: 48px;
    padding-left: 20px;
    font-size: 11px;
  }

  .btn__arrow {
    width: 34px;
    height: 34px;
  }

  .btn--ghost {
    height: 38px;
    font-size: 10px;
  }

  .privacy {
    margin-top: 22px;
    font-size: 8px;
  }

  .intro__error {
    font-size: 10px;
  }

  .intro__corner {
    display: none;
  }

  .camera-card {
    bottom: 42px;
    left: 18px;
    width: 148px;
    padding: 6px;
  }

  .bloom-readout {
    right: 18px;
    bottom: 44px;
    width: 116px;
  }

  .bloom-readout__head {
    font-size: 7px;
  }

  .bloom-readout__head strong {
    font-size: 26px;
  }

  .bloom-readout__track {
    margin-top: 12px;
  }

  .bloom-readout__foot {
    margin-top: 8px;
    font-size: 6px;
  }

  .enable-camera {
    left: 18px;
    bottom: 42px;
  }

  .bottombar {
    padding: 0;
  }

  .bottombar__left {
    letter-spacing: 0.14em;
  }

  .bottombar__camera span {
    display: none;
  }

  .toast {
    top: 80px;
    font-size: 9px;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .app {
    min-height: 0;
  }

  .topbar {
    height: 62px;
  }

  .intro__inner {
    top: 52%;
    width: min(440px, 49vw);
  }

  .hero-title {
    margin-top: 12px;
    font-size: clamp(48px, 14vh, 88px);
    line-height: 0.78;
  }

  .intro__eyebrow {
    font-size: 8px;
  }

  .intro__copy-wrap,
  .privacy {
    display: none;
  }

  .intro__actions {
    margin-top: 22px;
  }

  .intro__aside,
  .intro__corner {
    display: none;
  }

  .btn--primary {
    height: 46px;
    min-width: 180px;
  }

  .btn__arrow {
    width: 34px;
    height: 34px;
  }

  .btn--ghost {
    height: 38px;
  }

  .camera-card {
    bottom: 36px;
    width: 178px;
  }

  .bloom-readout {
    right: var(--pad);
    bottom: 39px;
    width: 134px;
  }

  .enable-camera {
    bottom: 37px;
    height: 42px;
  }

  .gesture-legend {
    display: none;
  }

  .bottombar {
    bottom: 8px;
  }
}

@media (max-height: 650px) and (min-width: 821px) {
  .hero-title {
    font-size: clamp(64px, 8.2vw, 106px);
  }

  .intro__copy-wrap {
    margin-top: 24px;
  }

  .intro__actions {
    margin-top: 24px;
  }

  .privacy {
    margin-top: 20px;
  }
}

/* Portrait: give the flower breathing room beneath the copy */
@media (max-aspect-ratio: 3 / 4) {
  .ambient__halo {
    left: 50%;
    top: 60%;
    width: 120vw;
  }
}

/* Hide the intro copy once camera is starting, without flashing the UI */
.app[data-state="requesting"] .intro__actions .btn--ghost {
  opacity: 0.35;
  pointer-events: none;
}

/* Debug-only presentation mode */
html.ui-hidden .topbar,
html.ui-hidden .intro,
html.ui-hidden .tracking-ui,
html.ui-hidden .bottombar,
html.ui-hidden .toast,
html.ui-hidden .ambient__grain,
html.ui-hidden .ambient__rules {
  display: none !important;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  place-items: center;
}
