* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #0b0910; font-family: system-ui, sans-serif;
}

/* Live webcam behind everything, mirrored for a natural selfie view. */
#cam {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  z-index: 0;
}

/* Transparent flower canvas composited over the webcam. */
#canvas {
  position: absolute; top: 0; left: 0;
  display: block;
  z-index: 1;
}

.clean-btn {
  position: fixed; left: 25px; bottom: 15px;
  z-index: 2;
  font-size: 15px; color: #fff;
  text-shadow: 0 0 10px #000;
  user-select: none; cursor: pointer;
  text-decoration: underline; opacity: .5;
}
.clean-btn:hover { opacity: .9; }

/* Subtle maker credit, mirroring the clean button on the opposite corner. */
.credit {
  position: fixed; right: 25px; bottom: 15px;
  z-index: 2;
  font-size: 13px; color: #fff;
  text-shadow: 0 0 10px #000;
  text-decoration: none;
  user-select: none; opacity: .45;
  transition: opacity .2s ease;
}
.credit:hover { opacity: .9; }

.hidden { display: none !important; }

/* ───────────── Opt-in consent / privacy overlay (editorial botanical) ───────────── */
#intro {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: transparent; /* lets the demo flowers show in the side margins */
  overflow: hidden;
}
/* Restrained drifting glow — mostly one warm rose, a hint of violet. */
.intro-bg {
  position: fixed; inset: -25%; /* fixed so the -25% bleed never causes scroll/zoom */
  background:
    radial-gradient(45% 55% at 28% 32%, rgba(255, 105, 160, 0.20), transparent 72%),
    radial-gradient(50% 60% at 78% 72%, rgba(150, 110, 220, 0.14), transparent 74%);
  filter: blur(40px) saturate(115%);
  animation: introDrift 28s ease-in-out infinite alternate;
}
@keyframes introDrift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.00); }
  100% { transform: translate3d(2.5%, 2%, 0) scale(1.09); }
}
/* Fine grain for atmosphere. */
#intro::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05; mix-blend-mode: overlay;
}

.intro-card {
  position: relative; z-index: 1;
  max-width: 500px; width: 100%;
  padding: 44px 46px 34px;
  border-radius: 20px;
  color: #efeae4;
  /* Stronger, cleaner glass. */
  background: rgba(20, 17, 23, 0.55);
  -webkit-backdrop-filter: blur(28px) saturate(130%); backdrop-filter: blur(28px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.intro-kicker {
  display: flex; align-items: center;
  font: 600 11px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: #e79bbb; margin-bottom: 22px;
}

/* Solid, editorial title — one rose accent, no rainbow gradient. */
.intro-title {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-weight: 600; font-size: clamp(44px, 7vw, 62px);
  line-height: 0.96; letter-spacing: -0.02em; margin-bottom: 20px;
  color: #f3ede6;
}
.intro-title em { font-style: italic; color: #ff7faf; }

.intro-tagline {
  font: 400 17px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #cdc7d0; max-width: 42ch; margin-bottom: 30px;
}

/* Privacy as a clean list — text flows normally (no flexbox line-breaking). */
.intro-privacy { list-style: none; display: grid; gap: 12px; margin-bottom: 32px; }
.intro-privacy li {
  position: relative; padding-left: 18px;
  font: 400 13.5px/1.55 ui-sans-serif, system-ui, sans-serif; color: #9d98a6;
}
.intro-privacy li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: #ff7faf;
}
.intro-privacy a { color: #ffa6cd; text-underline-offset: 3px; }

.intro-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.intro-buttons button {
  flex: 1 1 auto; min-width: 168px;
  padding: 14px 22px; border-radius: 12px; border: 0;
  font: 600 15px/1 ui-sans-serif, system-ui, sans-serif; cursor: pointer;
}
/* Single warm rose — solid, no multi-hue sweep. */
#start-btn {
  color: #2a0e1b;
  background: #ff6aa1;
  box-shadow: 0 6px 20px rgba(255, 106, 161, 0.25);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
#start-btn:hover { transform: translateY(-1px); background: #ff7dad; box-shadow: 0 10px 26px rgba(255, 106, 161, 0.38); }
.intro-buttons .secondary {
  background: rgba(255, 255, 255, 0.04); color: #cdc7d0; font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: border-color .15s ease, background .15s ease;
}
.intro-buttons .secondary:hover { border-color: rgba(255, 255, 255, 0.34); background: rgba(255, 255, 255, 0.08); }
.intro-card button:focus-visible { outline: 2px solid #ffa6cd; outline-offset: 3px; }

.intro-foot { margin-top: 18px; font: 400 12px/1.5 ui-sans-serif, system-ui, sans-serif; color: #6b6774; }

/* Subtle back control shown after a choice is made. */
#mode-btn {
  position: fixed; left: 20px; top: 16px; z-index: 4;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 400 17px/1 ui-sans-serif, system-ui, sans-serif;
  color: #fff; background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer; opacity: 0.5;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .15s ease, background .15s ease;
}
#mode-btn:hover { opacity: 1; background: rgba(0, 0, 0, 0.45); }

/* Orchestrated staggered load-in. */
.intro-card > * { opacity: 0; transform: translateY(10px); animation: introIn .6s cubic-bezier(.2, .7, .2, 1) forwards; }
.intro-kicker  { animation-delay: .05s; }
.intro-title   { animation-delay: .12s; }
.intro-tagline { animation-delay: .20s; }
.intro-privacy { animation-delay: .28s; }
.intro-buttons { animation-delay: .36s; }
.intro-foot    { animation-delay: .44s; }
@keyframes introIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .intro-bg { animation: none; }
  .intro-card > * { animation: none; opacity: 1; transform: none; }
}

#status {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 2;
  color: #fff; background: rgba(0,0,0,0.5);
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; transition: opacity 1s ease;
  pointer-events: none; text-align: center; max-width: 90vw;
}

/* Reliable tapping on touch devices (no 300ms delay / double-tap zoom). */
.intro-buttons button, #mode-btn, .clean-btn, .credit { touch-action: manipulation; }

/* Mobile: let the intro scroll if it's taller than the viewport, shrink the
   card, and give the back button a bigger tap target. */
@media (max-width: 560px) {
  #intro { align-items: flex-start; overflow-y: auto; overflow-x: hidden; padding: 16px; }
  .intro-card { padding: 28px 22px 24px; border-radius: 16px; }
  .intro-title { font-size: clamp(34px, 12vw, 46px); }
  .intro-tagline { font-size: 15px; margin-bottom: 24px; }
  .intro-kicker { margin-bottom: 16px; }
  #mode-btn { left: 14px; top: 12px; width: 42px; height: 42px; font-size: 19px; opacity: 0.7; }
  .clean-btn { font-size: 16px; }
}
