/* envibe: mobile-only. Dark, glassy, gradient-y. On desktop it's a phone-width column. */

:root {
  --bg: #0b0b14;
  --ink: #f5f5ff;
  --muted: rgba(245, 245, 255, 0.6);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.12);
  --grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 55%, #f97316 100%);
  --grad-cool: linear-gradient(135deg, #6366f1, #22d3ee);
  --yes: linear-gradient(135deg, #22c55e, #10b981);
  --no: linear-gradient(135deg, #f43f5e, #e11d48);
  --some: linear-gradient(135deg, #6366f1, #3b82f6);
  --idk: linear-gradient(135deg, #a855f7, #d946ef);
  --radius: 24px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #05050a; }
body {
  font-family: system-ui, -apple-system, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  display: flex;
  justify-content: center;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
/* floating glow blobs */
.phone::before, .phone::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 380px; height: 380px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.14;
  animation: drift 14s ease-in-out infinite alternate;
}
.phone::before { background: #cbd5e1; top: -140px; left: -120px; }
.phone::after { background: #fdba74; bottom: -160px; right: -140px; animation-delay: -7s; }

.view {
  flex: 1;
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px calc(104px + var(--safe-b));
  display: flex;
  flex-direction: column;
}
.hidden { display: none !important; }

/* buttons & inputs */
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
.btn {
  background: var(--grad);
  color: white;
  font-weight: 800;
  font-size: 17px;
  border-radius: 18px;
  padding: 15px 18px;
  box-shadow: 0 10px 30px -8px rgba(236, 72, 153, 0.6);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:active { transform: scale(0.97); }
.btn.big { width: 100%; font-size: 18px; padding: 18px; }
.btn.ghost { background: var(--glass); border: 1px solid var(--line); box-shadow: none; backdrop-filter: blur(12px); }
.link { color: var(--muted); font-weight: 600; padding: 10px; font-size: 14px; }
input {
  font: inherit;
  font-size: 17px; /* 16px+ stops iOS zoom */
  color: var(--ink);
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input::placeholder { color: rgba(255, 255, 255, 0.35); }
input:focus { border-color: #a855f7; box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.2); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.error { color: #fb7185; font-weight: 600; min-height: 1.2em; margin: 6px 0 0; text-align: center; font-size: 14px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* auth */
.hero { text-align: center; margin: 3vh 0 24px; }
.pill {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--glass-2);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
h1.wordmark { font-size: 64px; letter-spacing: -3px; padding-bottom: 6px; }
h1 { font-size: 46px; font-weight: 900; margin: 0; letter-spacing: -2px; line-height: 1; }
.tag { font-size: 18px; font-weight: 500; color: var(--muted); margin: 12px 0 0; line-height: 1.4; }
.fine { font-size: 13px; color: var(--muted); text-align: center; margin: 4px 0 0; }

/* asking */
.ask-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ask-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.counter { margin: 0; font-weight: 600; color: var(--muted); font-size: 13px; }
.progress { height: 8px; background: var(--glass-2); border-radius: 99px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width 0.5s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 12px rgba(236, 72, 153, 0.8); }
.qcard {
  position: relative;
  flex: 1;
  min-height: 220px;
  margin: 20px 0;
  border-radius: 32px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.25), rgba(236, 72, 153, 0.12) 60%, rgba(255,255,255,0.04));
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 60px -20px rgba(139, 92, 246, 0.5);
}
.qcard::before { content: attr(data-label); position: absolute; top: 18px; left: 22px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.qcard.pop { animation: pop 0.4s cubic-bezier(.2,1.4,.4,1); }
.qcard.out { animation: out 0.22s ease-in forwards; }
.question { font-size: 28px; font-weight: 800; text-align: center; line-height: 1.2; margin: 0; letter-spacing: -0.5px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  border-radius: 20px;
  padding: 18px 8px;
  font-size: 18px;
  font-weight: 800;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.1s, filter 0.1s;
}
.choice:active { transform: scale(0.95); filter: brightness(1.2); }
.choice[data-a="Yes"] { background: var(--yes); box-shadow: 0 10px 24px -10px #22c55e; }
.choice[data-a="No"] { background: var(--no); box-shadow: 0 10px 24px -10px #f43f5e; }
.choice[data-a="Sometimes"] { background: var(--some); box-shadow: 0 10px 24px -10px #6366f1; }
.choice[data-a="IDK"] { background: var(--idk); box-shadow: 0 10px 24px -10px #a855f7; }
.open { display: flex; gap: 10px; }
.open .btn { padding: 0 22px; font-size: 22px; }
.skip { align-self: center; margin-top: 8px; }

/* profile */
.ptitle { text-align: center; margin: 6px 0 18px; }
.ptitle .avatar { margin: 0 auto 14px; }
.ptitle h2 { font-size: 28px; font-weight: 900; margin: 0; line-height: 1.1; letter-spacing: -0.5px; }
.ptitle.user { color: var(--muted); font-weight: 700; margin: 0; font-size: 14px; }
.section { margin-top: 18px; }
.section h3 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; margin: 0 0 10px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--glass-2); border: 1px solid var(--line); border-radius: 99px; padding: 7px 13px; font-weight: 600; font-size: 13px; }
.section:nth-of-type(2) .chip { border-color: rgba(168, 85, 247, 0.5); }
.section:nth-of-type(3) .chip { border-color: rgba(236, 72, 153, 0.5); }
.section:nth-of-type(4) .chip { border-color: rgba(249, 115, 22, 0.5); }
.summary { font-size: 16px; line-height: 1.5; margin: 0; color: rgba(245, 245, 255, 0.85); }
.empty { text-align: center; margin: auto 0; }
.empty .art { margin: 0 auto 8px; }
.empty p { font-size: 17px; font-weight: 500; color: var(--muted); line-height: 1.5; margin: 0 0 20px; }
.row { display: flex; gap: 10px; margin-top: 18px; }
.row .btn { flex: 1; }

/* matches */
.title { font-size: 30px; font-weight: 900; margin: 0 0 4px; letter-spacing: -1px; }
.subtitle { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.match { margin-bottom: 14px; animation: rise 0.4s both; }
.match:nth-child(2) { animation-delay: 0.06s; }
.match:nth-child(3) { animation-delay: 0.12s; }
.match:nth-child(4) { animation-delay: 0.18s; }
.match:nth-child(5) { animation-delay: 0.24s; }
.match-head { display: flex; align-items: center; gap: 12px; }
/* initials avatars */
.avatar {
  flex: none;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 900;
  color: white;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(255, 255, 255, 0.25);
}
.avatar[data-hue="1"] { background: linear-gradient(135deg, #6366f1, #22d3ee); }
.avatar[data-hue="2"] { background: linear-gradient(135deg, #f97316, #facc15); }
.avatar[data-hue="3"] { background: linear-gradient(135deg, #10b981, #6366f1); }
.avatar.lg { width: 112px; height: 112px; font-size: 46px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(255,255,255,0.3), 0 0 40px rgba(236, 72, 153, 0.5); }

/* Higgsfield visuals live in public/assets/. Edges fade out so they melt into the dark background.
   If a file is missing, a soft gradient shows instead. */
.art {
  background-size: cover;
  background-position: center;
  background-color: transparent;
  mix-blend-mode: screen; /* the art's black background turns see-through */
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
}
.art-hero {
  width: calc(100% + 40px);
  margin: -10px -20px 10px;
  aspect-ratio: 3 / 2;
  background-image: url("assets/hero.jpg"), radial-gradient(rgba(255,255,255,.08), transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at center, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at center, #000 55%, transparent 100%);
  animation: breathe 6s ease-in-out infinite;
}
.art-profile, .art-locked, .art-empty { width: 220px; height: 220px; animation: breathe 6s ease-in-out infinite; }
.art-profile { background-image: url("assets/empty-profile.jpg"), radial-gradient(rgba(255,255,255,.08), transparent 70%); }
.art-locked { background-image: url("assets/locked.jpg"), radial-gradient(rgba(255,255,255,.08), transparent 70%); }
.art-empty { background-image: url("assets/no-matches.jpg"), radial-gradient(rgba(255,255,255,.08), transparent 70%); }
.match-name { font-weight: 800; font-size: 18px; }
.match-title { font-weight: 500; color: var(--muted); font-size: 13px; margin-top: 2px; }
.score {
  margin-left: auto;
  flex: none;
  font-weight: 900; font-size: 16px;
  background: var(--grad);
  color: white;
  border-radius: 99px;
  padding: 7px 12px;
}
.why { margin: 14px 0 10px; font-size: 15px; line-height: 1.45; color: rgba(245, 245, 255, 0.85); }
.ice-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ice { background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.35); border-radius: 16px; padding: 11px 13px; font-size: 14px; font-weight: 600; }

/* tab bar */
.tabs {
  position: absolute; left: 14px; right: 14px; bottom: calc(12px + var(--safe-b));
  display: flex;
  padding: 6px;
  background: rgba(20, 20, 36, 0.75);
  border: 1px solid var(--line);
  border-radius: 26px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.8);
}
.tabs button { flex: 1; padding: 8px 0; border-radius: 20px; font-size: 11px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; transition: background 0.2s, color 0.2s; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button:first-child.active svg { fill: currentColor; }
.tabs button.active { background: var(--glass-2); color: var(--ink); }

/* sign-up agreement + legal links + account */
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: left; padding: 2px 2px 4px; }
.agree input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; padding: 0; accent-color: #ec4899; }
.agree a, .legal-links a { color: var(--ink); }
.legal-links { display: flex; justify-content: center; gap: 18px; font-size: 13px; margin: 14px 0 0; }
.legal-links a { color: var(--muted); text-decoration: none; }
.account { display: flex; flex-direction: column; align-items: center; margin-top: 28px; gap: 0; }
.link.danger { color: #fb7185; }
.report { display: block; margin: 8px 0 -6px auto; font-size: 12px; padding: 6px 0; }

/* bottom sheet */
.sheet-wrap { position: absolute; inset: 0; z-index: 30; background: rgba(5, 5, 10, 0.6); backdrop-filter: blur(6px); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: #15152a; border-top: 1px solid var(--line); border-radius: 28px 28px 0 0; padding: 24px 20px calc(24px + var(--safe-b)); animation: rise 0.25s ease-out; }
.sheet h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.sheet p { color: var(--muted); margin: 0 0 14px; line-height: 1.45; font-size: 15px; }
.sheet .row { margin-top: 8px; }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #be123c); box-shadow: 0 10px 30px -8px rgba(244, 63, 94, 0.6); }
.btn:disabled { opacity: 0.6; }

/* toast + loading */
.toast {
  position: absolute; left: 20px; right: 20px; top: calc(env(safe-area-inset-top, 0px) + 16px);
  background: var(--grad); color: white; font-weight: 800; text-align: center;
  padding: 14px; border-radius: 18px; z-index: 20; animation: drop 0.3s ease-out;
  box-shadow: 0 16px 30px -10px rgba(236, 72, 153, 0.7);
}
.loading {
  position: absolute; inset: 0; background: rgba(11, 11, 20, 0.85); backdrop-filter: blur(10px); z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; gap: 6px;
}
.spinner {
  width: 56px; height: 56px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, #8b5cf6, #ec4899, #f97316);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  animation: spin 0.9s linear infinite;
}

@keyframes breathe { 50% { transform: scale(1.03); filter: brightness(1.12); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 50% { translate: 0 -8px; } }
@keyframes drift { to { transform: translate(60px, 80px) scale(1.15); } }
@keyframes pop { from { transform: scale(0.9) translateY(12px); opacity: 0; } }
@keyframes out { to { transform: translateX(-110%) rotate(-10deg); opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } }

/* email sign-in + invites */
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.center { text-align: center; }
.sent-title { margin: 4px 0 0; font-size: 22px; font-weight: 800; }
#sent .link { align-self: center; }
#invite { text-transform: uppercase; letter-spacing: 2px; }
.invites { margin-top: 28px; padding: 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 20px; background: rgba(255,255,255,.04); }
.invites:empty { display: none; }
.invites h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.invites .muted { font-size: 13px; margin-bottom: 8px; }
.invite { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.07); }
.invite code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: 2px; }
.invite span { color: var(--muted); font-size: 13px; }
.invite.used code { color: var(--muted); text-decoration: line-through; }
.invite .link { padding: 4px 8px; }


/* ---------- multiple choice ---------- */
.choices.pick { grid-template-columns: 1fr; gap: 10px; }
.choices.pick .choice { padding: 16px 18px; font-size: 17px; text-align: left; border-radius: 18px; }
.choice[data-i="0"]:not([data-a="Yes"]):not([data-a="No"]):not([data-a="Sometimes"]):not([data-a="IDK"]) { background: linear-gradient(135deg, #0ea5e9, #6366f1); box-shadow: 0 10px 24px -10px #0ea5e9; }
.choice[data-i="1"]:not([data-a="Yes"]):not([data-a="No"]):not([data-a="Sometimes"]):not([data-a="IDK"]) { background: linear-gradient(135deg, #ec4899, #f43f5e); box-shadow: 0 10px 24px -10px #ec4899; }
.choice[data-i="2"]:not([data-a="Yes"]):not([data-a="No"]):not([data-a="Sometimes"]):not([data-a="IDK"]) { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 10px 24px -10px #f97316; }
.choice[data-i="3"]:not([data-a="Yes"]):not([data-a="No"]):not([data-a="Sometimes"]):not([data-a="IDK"]) { background: linear-gradient(135deg, #10b981, #14b8a6); box-shadow: 0 10px 24px -10px #10b981; }

/* ---------- caught up for today ---------- */
.done { text-align: center; margin: auto 0; }
.done .art { margin: 0 auto 6px; }
.done h3 { font-size: 26px; font-weight: 900; margin: 0 0 6px; letter-spacing: -0.5px; }

/* ---------- motion ---------- */
/* Views and cards glide in whenever they appear. */
.view:not(.hidden) { animation: viewIn 0.38s cubic-bezier(.2,.8,.2,1) both; }
#email-form:not(.hidden), #sent:not(.hidden), #join-form:not(.hidden), .done:not(.hidden) { animation: rise 0.4s cubic-bezier(.2,.8,.2,1) both; }
.hero .art-hero { animation: heroIn 0.9s cubic-bezier(.2,.8,.2,1) both, breathe 6s ease-in-out 0.9s infinite; }
.hero .wordmark { animation: rise 0.6s 0.15s cubic-bezier(.2,.8,.2,1) both; }
.hero .tag { animation: rise 0.6s 0.25s cubic-bezier(.2,.8,.2,1) both; }

/* Answer buttons cascade in, then the tapped one pops while the rest fade. */
.choice { animation: rise 0.35s cubic-bezier(.2,.8,.2,1) both; transition: transform 0.18s, opacity 0.2s, filter 0.1s; }
.choice:nth-child(2) { animation-delay: 0.05s; }
.choice:nth-child(3) { animation-delay: 0.1s; }
.choice:nth-child(4) { animation-delay: 0.15s; }
.choices.answered .choice { pointer-events: none; }
.choices.answered .choice:not(.chosen) { opacity: 0.25; transform: scale(0.96); }
.choices.answered .choice.chosen { transform: scale(1.04); filter: brightness(1.15); }
.open:not(.hidden) { animation: rise 0.35s 0.05s both; }
.counter { transition: opacity 0.2s; }

/* Profile builds itself section by section; chips pop in. */
.ptitle, .section, .invites, .account { animation: rise 0.45s cubic-bezier(.2,.8,.2,1) both; }
.section:nth-of-type(1) { animation-delay: 0.05s; }
.section:nth-of-type(2) { animation-delay: 0.1s; }
.section:nth-of-type(3) { animation-delay: 0.15s; }
.section:nth-of-type(4) { animation-delay: 0.2s; }
.section:nth-of-type(5) { animation-delay: 0.25s; }
.section:nth-of-type(6) { animation-delay: 0.3s; }
.invites { animation-delay: 0.2s; }
.account { animation-delay: 0.25s; }
.chip { animation: chipIn 0.35s cubic-bezier(.2,1.4,.4,1) both; }
.chip:nth-child(2) { animation-delay: 0.04s; }
.chip:nth-child(3) { animation-delay: 0.08s; }
.chip:nth-child(4) { animation-delay: 0.12s; }
.chip:nth-child(5) { animation-delay: 0.16s; }
.chip:nth-child(6) { animation-delay: 0.2s; }
.invite { animation: rise 0.35s both; }

/* Tab bar: icons bounce when selected. */
.tabs button.active svg { animation: tabBounce 0.4s cubic-bezier(.2,1.6,.4,1); }
.tabs { animation: rise 0.4s 0.1s both; }

.loading:not(.hidden) { animation: fadeIn 0.2s both; }
.btn { transition: transform 0.12s, filter 0.15s, opacity 0.2s; }

@keyframes viewIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
@keyframes heroIn { from { opacity: 0; transform: scale(0.85); filter: blur(10px); } }
@keyframes chipIn { from { opacity: 0; transform: scale(0.6); } }
@keyframes tabBounce { 40% { transform: translateY(-4px) scale(1.15); } }
@keyframes fadeIn { from { opacity: 0; } }

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