/* Welcome / onboarding (screens/welcome.js). Everything scoped under [data-screen="welcome"] / .wl- */

[data-screen='welcome'] {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
}

.wl {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 10px) var(--gutter) calc(var(--safe-bottom) + 20px);
}

/* ---------- Soft background shapes (like the video slides) ---------- */
.wl-deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.wl-blob, .wl-ring, .wl-dot { position: absolute; border-radius: 50%; transition: transform 0.9s var(--ease), opacity 0.6s ease; }
.wl-blob.sage {
  width: 380px; height: 380px;
  top: 70px; right: -190px;
  background: radial-gradient(circle at 35% 35%, var(--olive-100), var(--olive-50) 70%);
  opacity: 0.75;
}
.wl-blob.rose {
  width: 230px; height: 230px;
  bottom: 90px; left: -120px;
  background: radial-gradient(circle at 60% 40%, var(--rose-100), var(--rose-50) 70%);
  opacity: 0.7;
}
.wl-dot { width: 8px; height: 8px; }
.wl-dot.one { top: 30%; left: -34px; background: var(--rose); }
.wl-dot.two { top: 74%; right: -30px; width: 5px; height: 5px; background: color-mix(in srgb, var(--plum) 55%, transparent); }

/* The shapes drift as you move through the steps */
.wl[data-step='1'] .wl-blob.sage { transform: translate(-40px, -40px) scale(0.85); }
.wl[data-step='1'] .wl-blob.rose { transform: translate(400px, 60px) scale(0.85); }
.wl[data-step='2'] .wl-blob.sage { transform: translate(40px, 420px) scale(0.75); }
.wl[data-step='2'] .wl-blob.rose { transform: translate(-70px, -560px) scale(0.6); }
.wl[data-step='3'] .wl-blob.sage { transform: translate(-30px, 380px) scale(0.9); }
.wl[data-step='3'] .wl-blob.rose { transform: translate(40px, -480px) scale(0.55); }

/* ---------- Top bar ---------- */
.wl-top {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  min-height: 48px;
}
.wl-back { width: 44px; height: 44px; margin-left: -8px; color: var(--plum); }
.wl-back.gone, .wl-skip.gone { visibility: hidden; }
.wl-skip {
  justify-self: end;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 15px;
}
.wl-dots { display: flex; justify-content: center; gap: 6px; }
.wl-pip {
  width: 7px; height: 7px;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  transition: width 0.35s var(--ease), background 0.25s;
}
.wl-pip.done { background: var(--olive-100); }
.wl-pip.on { width: 22px; background: var(--olive); }

/* ---------- Body + step transitions ---------- */
.wl-body { flex: 1; display: flex; flex-direction: column; }
.wl-step { flex: 1; display: flex; flex-direction: column; }
.wl-step.in-fwd { animation: wl-in-fwd 0.45s var(--ease) both; }
.wl-step.in-back { animation: wl-in-back 0.45s var(--ease) both; }
@keyframes wl-in-fwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes wl-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.wl-step h1:focus { outline: none; }

.wl em { font-style: italic; color: var(--rose-ink); }

/* ---------- Step 1: splash ---------- */
.wl-splash { align-items: center; justify-content: center; text-align: center; padding: 8px 0 12px; }
.wl-splash.in-fwd { animation: none; }
.wl-logo {
  position: relative;
  isolation: isolate;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.wl-ring {
  inset: -40px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  opacity: 0.85;
  animation: wl-ring 1.2s var(--ease) 0.5s both;
}
@keyframes wl-ring { from { opacity: 0; transform: scale(0.82); } to { opacity: 0.85; transform: none; } }
.wl-logo .wl-dot { animation: wl-rise 0.6s var(--ease) 1s both; }
.wl-logo img {
  width: min(232px, 62vw);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
/* The shadow lives on the button so it stays underneath while the logo spins */
.wl-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  box-shadow: 0 22px 50px rgba(58, 26, 51, 0.14), 0 2px 6px rgba(58, 26, 51, 0.06);
  animation: wl-shadow 0.8s ease 0.45s both;
}
@keyframes wl-shadow { from { opacity: 0; } to { opacity: 1; } }
.wl-logo img.flip { animation: wl-flip 1.25s cubic-bezier(0.25, 0.75, 0.3, 1) 0.1s both; }
@keyframes wl-flip {
  0% { opacity: 0; transform: rotate(-180deg) scale(0.55); }
  50% { opacity: 1; transform: rotate(14deg) scale(1.04); }
  70% { transform: rotate(-6deg) scale(0.99); }
  86% { transform: rotate(2deg) scale(1); }
  100% { opacity: 1; transform: none; }
}

.wl-title {
  margin: 58px 0 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 42px;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--plum);
}
.wl-tagline {
  margin: 12px 0 0;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.25;
  color: var(--ink);
}
.wl-pillars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.wl-splash .wl-title,
.wl-splash .wl-tagline,
.wl-splash .wl-pillars { animation: wl-rise 0.7s var(--ease) both; }
.wl-splash .wl-title { animation-delay: 0.75s; }
.wl-splash .wl-tagline { animation-delay: 0.9s; }
.wl-splash .wl-pillars { animation-delay: 1.05s; }
.wl[data-step='0'] .wl-foot { animation: wl-rise 0.7s var(--ease) 1.15s both; }
@keyframes wl-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Steps 2 + 3: questions ---------- */
.wl-ask { padding-top: 28px; }
.wl-badge {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--olive-50);
  color: var(--olive-700);
}
.wl-badge.rose { background: var(--rose-50); color: var(--rose-ink); }
.wl-badge svg { width: 25px; height: 25px; }
.wl-q em { display: block; }
.wl-how .wl-q em { display: inline; }
.wl-q {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 38px;
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--plum);
}
.wl-sub { margin: 10px 0 0; max-width: 330px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }

.wl-form { margin-top: 28px; }
.wl-input {
  min-height: 58px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 20px;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-1);
}
.wl-input::placeholder { color: var(--muted); font-weight: 400; opacity: 0.8; }
.wl-input:focus { box-shadow: inset 0 0 0 2px var(--olive), var(--shadow-1); }
.wl-greet {
  min-height: 28px;
  margin: 14px 2px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 21px;
  color: var(--rose-ink);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
}
.wl-greet.show { opacity: 1; transform: none; }

.wl-chips { margin-top: 26px; gap: 10px; }
.wl-chips .chip {
  min-height: 46px;
  padding: 0 20px;
  font-size: 15.5px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.wl-chips .chip[aria-pressed='true'] { background: var(--olive-600); color: var(--on-olive); box-shadow: var(--shadow-1); padding-left: 14px; }
.wl-chips .chip[aria-pressed='true']::before {
  content: '';
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.2 4.2L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.2 4.2L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wl-count { margin: 18px 2px 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Step 4: how it works ---------- */
.wl-how { padding-top: 14px; }
.wl-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.wl-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: rgba(252, 249, 244, 0.86);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: wl-rise 0.55s var(--ease) both;
  animation-delay: calc(0.08s + var(--i) * 0.08s);
}
.wl-ic {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--olive-50);
  color: var(--olive-700);
}
.wl-ic.rose { background: var(--rose-50); color: var(--rose-ink); }
.wl-ic svg { width: 22px; height: 22px; }
.wl-row-text { display: flex; flex-direction: column; min-width: 0; }
.wl-row-text .eyebrow { font-size: 10px; letter-spacing: 0.14em; color: var(--muted); }
.wl-row-title {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.15;
  color: var(--plum);
}
.wl-row-body { margin-top: 3px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }

/* ---------- Footer ---------- */
.wl-foot { padding-top: 18px; }
.wl-cta { min-height: 54px; font-size: 16px; }
.wl-cta svg { width: 18px; height: 18px; }
.wl-note { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* iPhone Safari only: install before scanning (a Home Screen app has its own storage) */
.wl-install {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--olive-50);
  text-align: left;
}
.wl-install[hidden] { display: none; }
.wl-install-ic {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--olive-700);
}
.wl-install-ic svg { width: 18px; height: 18px; }
.wl-install p { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wl-install strong { font-size: 14px; font-weight: 600; color: var(--plum); }
.wl-install span { font-size: 13px; line-height: 1.38; color: var(--ink-2); }

/* Short phones (iPhone SE): tighten so step 4 fits without fuss */
@media (max-height: 700px) {
  .wl-title { font-size: 36px; margin-top: 44px; }
  .wl-logo img { width: min(190px, 52vw); }
  .wl-q { font-size: 33px; }
  .wl-how { padding-top: 6px; }
  .wl-list { margin-top: 14px; gap: 8px; }
  .wl-row { padding: 9px 14px; }
  .wl-row-title { font-size: 18.5px; }
  .wl-row-body { font-size: 13px; }
  .wl[data-step='3'] .wl-note { display: none; }
  .wl-install:not([hidden]) ~ .wl-note { display: none; }
  .wl-install { margin-bottom: 10px; padding: 10px 12px; }
  .wl-foot { padding-top: 14px; }
  .wl-ring { inset: -36px; }
}
/* iPhone SE in Safari (about 548px tall): keep the splash CTA on screen with the install tip */
@media (max-height: 600px) {
  .wl-logo img { width: min(150px, 42vw); }
  .wl-ring { inset: -28px; }
  .wl-title { margin-top: 34px; font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .wl-logo img.flip, .wl-logo::after, .wl-ring, .wl-logo .wl-dot, .wl-step, .wl-row,
  .wl-splash .wl-title, .wl-splash .wl-tagline, .wl-splash .wl-pillars, .wl[data-step='0'] .wl-foot { animation: none !important; }
  .wl-blob, .wl-ring, .wl-dot { transition: none; }
}
