/* "Showroom night": dark, glowing, celebratory. */
:root {
  --bg: #070b16;
  --bg-2: #0d1426;
  --card: rgba(255,255,255,0.055);
  --card-solid: #121a30;
  --line: rgba(255,255,255,0.1);
  --ink: #f4f7ff;
  --muted: #9aa7c2;
  --blue: #3d6bff;
  --teal: #19e3d0;
  --violet: #9b5cff;
  --gold: #ffc53d;
  --good: #2fe39a;
  --bad: #ff5a4e;
  --grad: linear-gradient(120deg, var(--blue), var(--violet) 55%, #ff4fa3);
  --grad-cool: linear-gradient(120deg, var(--teal), var(--blue));
  --radius: 20px;
  --glow: 0 10px 34px rgba(61,107,255,0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(155,92,255,0.28), transparent 60%),
    radial-gradient(800px 500px at -10% 10%, rgba(61,107,255,0.25), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 26px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 12px; }
b { font-weight: 700; }

.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.demo-banner {
  background: linear-gradient(90deg, #ffcf4a, #ffb02e);
  color: #3a2700;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 4px 8px;
  padding-top: max(4px, env(safe-area-inset-top));
}

.pad { padding: 18px 16px 32px; max-width: 720px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section { margin-top: 28px; }
.stack { display: grid; gap: 12px; }
.eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal);
  margin-bottom: 8px;
}

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  background: rgba(7,11,22,0.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.bar h1 { flex: 1; min-width: 0; font-size: 17px; margin: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; letter-spacing: 0.04em; }
.logo::before {
  content: ''; width: 26px; height: 26px; border-radius: 8px; background: var(--grad);
  box-shadow: 0 0 18px rgba(155,92,255,0.6);
}
.logo b { color: var(--teal); margin-left: -4px; }
.chip {
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.icon {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: #fff; font-size: 20px;
}

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* Hero */
.hero { position: relative; padding: 18px 0 8px; }
.hero h2 { font-size: 34px; line-height: 1.05; font-weight: 900; margin-bottom: 12px; }
.hero p { font-size: 17px; color: var(--muted); max-width: 32em; }
.hero-card {
  position: relative; overflow: hidden;
  border-radius: 26px; padding: 22px; margin-bottom: 20px;
  background: var(--grad); color: #fff; box-shadow: 0 20px 50px rgba(155,92,255,0.35);
}
.hero-card::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,0.14);
}
.hero-card h2 { font-size: 28px; position: relative; z-index: 1; }
.hero-card p { color: rgba(255,255,255,0.85); position: relative; z-index: 1; }
.hero-card .btn { position: relative; z-index: 1; background: #fff; color: #1a1240; border: 0; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 20px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: center;
}
.stat b { display: block; font-size: 26px; font-weight: 900; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* Stage strip (home / new journey) */
.stage-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 8px; }
.stage-pill {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--card); border: 1px solid var(--line);
}
.stage-pill em { font-style: normal; font-size: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 20px;
  border-radius: 16px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 700; text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: var(--glow); }
.btn.ghost { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); color: #fff; }
.btn.big { width: 100%; min-height: 60px; font-size: 18px; margin: 8px 0; border-radius: 18px; }
.btn.wide { width: 100%; justify-content: flex-start; text-align: left; gap: 14px; padding: 12px 16px; min-height: 68px; }
.btn.wide span { color: var(--muted); font-weight: 500; font-size: 14px; }
.btn.wide .who { display: grid; gap: 1px; flex: 1; color: var(--ink); font-weight: 700; font-size: 16px; }
.btn.wide .go { color: var(--muted); font-size: 22px; }
.btn.wide .avatar { color: #fff; font-weight: 900; font-size: 16px; }
.link { background: none; border: 0; color: var(--teal); padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--bad); }

.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 900; color: #fff; font-size: 16px;
}

label { display: grid; gap: 8px; font-weight: 700; }
input[type=text], input:not([type]), select {
  min-height: 54px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.06); font-weight: 500; color: var(--ink);
  font-size: 17px;
}
input::placeholder { color: #6f7c98; }
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
select option { color: #000; }

/* Journey list */
.list { display: grid; gap: 10px; }
.row {
  display: grid; gap: 6px; text-align: left; width: 100%;
  padding: 16px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.row span { color: var(--muted); font-size: 14px; }
.row b { font-size: 16px; }
.dots { display: flex; gap: 5px; }
.dots i { width: 100%; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.12); }
.dots i.on { background: var(--grad-cool); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions .btn { flex: 1 1 140px; }

/* Consent */
.handoff {
  background: var(--grad-cool); color: #04121f;
  text-align: center; font-weight: 900; padding: 12px; letter-spacing: 0.01em;
}
.consent h2 { font-size: 28px; }
.consent ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.consent li {
  position: relative; padding: 12px 14px 12px 42px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
}
.consent li::before {
  content: '\2713'; position: absolute; left: 14px; top: 11px; color: var(--teal); font-weight: 900;
}
.check {
  display: flex; gap: 12px; align-items: flex-start; font-weight: 400;
  background: rgba(155,92,255,0.12); border: 1px solid rgba(155,92,255,0.45); border-radius: 16px; padding: 16px;
}
.check input { width: 26px; height: 26px; margin-top: 1px; flex: none; accent-color: var(--violet); }
.sigwrap { margin-top: 18px; }
#sig {
  width: 100%; height: 170px; display: block; touch-action: none;
  background: #fff; border: 0; border-radius: 16px; box-shadow: 0 0 0 3px rgba(25,227,208,0.35);
}
.sigrow { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; margin-top: 6px; }

/* Camera */
.cam { position: relative; min-height: calc(100vh - 24px); background: #000; color: #fff; display: flex; flex-direction: column; }
#live { width: 100%; flex: 1; min-height: 52vh; object-fit: cover; background: #111; transition: filter 0.15s; }
#live.flash { filter: brightness(2.5); }
.cam-top { position: absolute; top: 10px; left: 12px; right: 12px; display: grid; gap: 10px; }
.progress-seg { display: flex; gap: 5px; }
.progress-seg i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.25); }
.progress-seg i.done { background: var(--teal); }
.progress-seg i.now { background: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.8); }
.prompt {
  background: rgba(7,11,22,0.62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px; padding: 14px 16px;
  animation: drop-in 0.45s cubic-bezier(.2,.9,.3,1.2) both;
}
.prompt .head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.stage-badge {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; background: var(--grad); box-shadow: 0 0 20px rgba(155,92,255,0.6);
}
.prompt .tag { font-size: 11px; font-weight: 800; color: var(--teal); letter-spacing: 0.12em; text-transform: uppercase; }
.prompt h2 { font-size: 22px; margin: 2px 0 0; }
.prompt p { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.35; }
.prompt .k { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: #c5cee3; margin-bottom: 2px; }
.prompt .muted { color: #c5cee3; font-size: 14px; font-weight: 500; }
.rec-timer {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(255,90,78,0.92); padding: 8px 16px; border-radius: 999px; font-weight: 800;
  box-shadow: 0 0 24px rgba(255,90,78,0.7);
}
.fallback { padding: 16px; display: grid; gap: 10px; }
.controls {
  background: linear-gradient(180deg, rgba(13,20,38,0.96), var(--bg));
  border-top: 1px solid var(--line);
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
}
.seg { display: flex; background: rgba(255,255,255,0.08); border-radius: 999px; padding: 4px; width: max-content; margin: 0 auto 14px; }
.seg button { border: 0; background: none; color: #fff; padding: 8px 22px; border-radius: 999px; font-weight: 700; }
.seg button.on { background: #fff; color: #0d1426; }
.shoot { display: flex; align-items: center; justify-content: space-between; max-width: 320px; margin: 0 auto 12px; }
.shot-count {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); font-weight: 800; font-size: 15px;
}
.shot-count.pop { animation: pop 0.35s ease; }
.shutter {
  width: 80px; height: 80px; border-radius: 50%;
  border: 5px solid #fff; background: #fff; box-shadow: inset 0 0 0 4px #0d1426, 0 0 28px rgba(255,255,255,0.35);
  transition: transform 0.12s, border-radius 0.2s;
}
.shutter:active { transform: scale(0.92); }
.shutter.video { background: var(--bad); box-shadow: inset 0 0 0 4px #0d1426, 0 0 28px rgba(255,90,78,0.55); }
.shutter.recording { border-radius: 24px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }
.thumbs { display: flex; gap: 8px; overflow-x: auto; min-height: 64px; align-items: center; }
.thumb {
  position: relative; flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: #222;
  border: 2px solid rgba(255,255,255,0.2); animation: pop 0.35s ease;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb i { position: absolute; left: 6px; bottom: 4px; font-style: normal; font-size: 12px; }
.thumb button {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,0.6); color: #fff; line-height: 1; padding: 0;
}

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 20; background: rgba(3,6,14,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--card-solid); color: var(--ink); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto;
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 26px 26px 0 0; padding: 0 18px calc(18px + env(safe-area-inset-bottom));
  animation: slide-up 0.35s cubic-bezier(.2,.9,.3,1) both;
}
.sheet .handoff { margin: 0 -18px 16px; border-radius: 26px 26px 0 0; }
.sheet h2 { margin-top: 16px; }
.stars { display: flex; justify-content: center; gap: 4px; margin: 18px 0; }
.stars button { border: 0; background: none; font-size: 48px; color: rgba(255,255,255,0.18); padding: 4px; transition: transform 0.15s, color 0.15s; }
.stars button.on { color: var(--gold); text-shadow: 0 0 18px rgba(255,197,61,0.7); transform: scale(1.1); }
.full { width: 100%; max-height: 50vh; object-fit: contain; background: #000; border-radius: 16px; margin-top: 16px; }
dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 15px; }
dt { color: var(--muted); }
dd { margin: 0; }
.sig { max-width: 220px; height: 70px; object-fit: contain; border-radius: 10px; background: #fff; }
.statuses { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.statuses .btn { flex: 1 1 90px; min-height: 44px; padding: 8px 10px; }

/* Library */
.filters { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.filters button {
  flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: 8px 15px; font-weight: 700;
}
.filters button.on { background: #fff; color: #0d1426; border-color: #fff; }
.filters small { opacity: 0.6; margin-left: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  aspect-ratio: 3 / 4; background: #1a2238; color: #fff; text-align: left;
  transition: transform 0.15s;
}
.tile:active { transform: scale(0.97); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile i { position: absolute; top: 8px; right: 10px; font-style: normal; }
.tile .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85)); font-size: 13px; line-height: 1.3;
}
.tile .st { position: absolute; top: 8px; left: 8px; }
.tile .private {
  position: absolute; top: 38px; left: 8px; font-size: 11px; font-weight: 800;
  background: rgba(0,0,0,0.65); padding: 3px 9px; border-radius: 999px;
}
.st { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.9); color: #0d1426; }
.st-new { background: #e4e9f5; color: #0d1426; }
.st-approved { background: var(--good); color: #032417; }
.st-edited { background: #7d9bff; color: #06123d; }
.st-posted { background: var(--grad); color: #fff; }
.st-revoked { background: var(--bad); color: #fff; }

/* Keepsake */
.celebrate { text-align: center; padding: 10px 0 4px; }
.celebrate .big-emoji { font-size: 64px; line-height: 1; display: block; margin-bottom: 8px; animation: pop 0.6s ease both; }
.celebrate h2 { font-size: 34px; font-weight: 900; }
.progress { height: 12px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; margin: 14px 0; }
#bar { height: 100%; width: 0; background: var(--grad); transition: width 0.2s; box-shadow: 0 0 16px rgba(155,92,255,0.8); }
.reel { width: 100%; max-height: 70vh; background: #000; border-radius: 18px; display: block; margin: 8px auto; }
.collage { width: 100%; border-radius: 18px; display: block; margin-top: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #fff; color: #0d1426; font-weight: 700; padding: 12px 20px; border-radius: 999px; z-index: 30;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4); animation: slide-up 0.3s ease both;
}

/* Confetti and stage-complete burst */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
.burst {
  position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; pointer-events: none;
}
.burst div {
  background: rgba(7,11,22,0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 24px; padding: 18px 26px; text-align: center;
  animation: pop 0.4s ease both;
}
.burst b { display: block; font-size: 40px; line-height: 1.1; }
.burst span { font-weight: 800; font-size: 18px; }

@keyframes fall {
  to { transform: translate3d(var(--dx, 0), 110vh, 0) rotate(var(--rot, 720deg)); opacity: 0.9; }
}
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes drop-in { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { animation-name: toast-in; }
@keyframes toast-in { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}

@media (min-width: 720px) {
  .modal { align-items: center; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--line); }
  .hero h2 { font-size: 44px; }
}
