@import url("colors_and_type.css");

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--fg-1);
  font-family: var(--font-sans);
  overflow: hidden;
}

/* ============================================================
   Focus — one visible ring for every interactive element.
   Keyboard-only (:focus-visible) so pointer users keep the
   quiet look. Any element that clears its own outline below
   must still land here.
   ============================================================ */
:where(a, button, textarea, input, select, [role="button"], [tabindex]):focus-visible {
  outline: 1.5px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}
/* The composer clears its outline for the seamless card look, so it
   gets the ring on its container instead of the bare textarea. */
.composer:focus-within {
  box-shadow: 0 0 0 1.5px var(--color-focus-ring);
}

/* ============================================================
   Reduced motion — this app leans on ambient looping animation
   (breathe, gentle-pulse, 60s rotate). Honour the OS setting.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Stage — full viewport with quiet decoration
   ============================================================ */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* reserves the fixed brand-mark column (ends at x=126) on both sides so a
     centred .step can never slide under the wordmark at any viewport width */
  padding-inline: 148px;
  scrollbar-gutter: stable;
  overflow-x: hidden;
  overflow-y: auto;
}

.stage-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.stage-bg .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.stage-bg .blob.b1 { width: 520px; height: 520px; left: -180px; top: -160px; background: var(--tint-periwinkle); }
.stage-bg .blob.b2 { width: 460px; height: 460px; right: -140px; bottom: -120px; background: var(--tint-blush); opacity: 0.45; }
.stage-bg .blob.b3 { width: 360px; height: 360px; left: 30%; bottom: -180px; background: var(--tint-sky); opacity: 0.35; }

.stage-bg .corner-sprig {
  position: absolute;
  opacity: 0.35;
}
.stage-bg .corner-sprig.tl { top: 32px; left: 36px; transform: rotate(-18deg); }
.stage-bg .corner-sprig.br { right: 36px; bottom: 36px; transform: rotate(150deg); }

/* ============================================================
   Step container — centered, generous breathing room
   ============================================================ */
.step {
  position: relative;
  z-index: 2;
  margin: auto;
  padding: 20px 0;
  width: min(880px, 92%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--fg-2);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--color-action);
  opacity: 0.7;
}

.prompt {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  text-wrap: balance;
}
.prompt.xl { font-size: 56px; line-height: 64px; }
.prompt.lg { font-size: 40px; line-height: 52px; }
.prompt.md { font-size: 30px; line-height: 40px; }

.prompt-display {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--fg-1);
  letter-spacing: -0.005em;
  text-wrap: balance;
  flex-wrap: wrap;
  justify-content: center;
  white-space: normal;
}
.prompt-display.xl { font-size: 80px; line-height: 84px; }
.prompt-display.lg { font-size: 60px; line-height: 68px; }

.subline {
  font-size: 16px;
  line-height: 26px;
  color: var(--fg-2);
  max-width: 460px;
  text-wrap: balance;
}

/* ============================================================
   Choice cards — the soul of the flow
   ============================================================ */
.choices {
  display: grid;
  gap: 16px;
  width: 100%;
}
.choices.two-col { grid-template-columns: 1fr 1fr; }

.choice {
  position: relative;
  background: var(--color-white);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 24px 56px 24px 24px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--fg-1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    border-color var(--dur-base) var(--ease-soft),
    box-shadow var(--dur-base) var(--ease-soft),
    transform var(--dur-fast) var(--ease-soft),
    background var(--dur-base) var(--ease-soft);
}
.choice:hover {
  border-color: var(--color-action-border);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 12px 28px -16px rgba(76,58,143,0.18);
}
.choice:active { transform: scale(0.99); }
.choice.selected {
  border-color: var(--color-action);
  background: var(--color-action-tint);
  box-shadow: var(--shadow-input-active);
}

.choice .label {
  font-family: var(--font-serif);
  font-size: var(--type-h3-size);
  white-space: nowrap;
  line-height: var(--type-h3-line);
  font-weight: 500;
  color: var(--color-action);
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.choice .title {
  font-family: var(--font-sans);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  font-weight: 400;
  color: var(--fg-2);
}
.choice .desc {
  font-size: 14px;
  line-height: 22px;
  color: var(--fg-2);
}
.choice .arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-action);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-soft), transform var(--dur-base) var(--ease-soft);
}
.choice .arrow { display: none; }

/* ============================================================
   Buttons (reused from system)
   ============================================================ */
.btn {
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  padding: 16px 24px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft),
              opacity var(--dur-fast) var(--ease-soft);
}
.btn-primary { background: var(--color-action); color: #fff; }
.btn-primary:hover { background: var(--color-action-hover); }
.btn-primary:disabled { background: var(--color-action-disabled); cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--fg-2);
  padding: 12px 16px;
}
.btn-ghost:hover { color: var(--fg-1); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-action-border);
  color: var(--fg-1);
}
.btn-secondary:hover { background: var(--color-action-tint-08); }

.btn-skip {
  background: transparent;
  color: var(--color-action);
  font-weight: 500;
  padding: 12px 16px;
}
.btn-skip:hover { background: var(--color-action-tint); }

/* ============================================================
   Composer (used in the listener "stay with them" + sharer "say what's true")
   ============================================================ */
.composer {
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.composer textarea {
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 28px;
  color: var(--fg-1);
  width: 100%;
  min-height: 120px;
}
.composer textarea::placeholder {
  color: var(--fg-2);
  font-style: italic;
}
.composer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px dashed var(--border-soft);
  padding-top: 16px;
}
.composer-row .meta {
  font-size: 12px;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   Footer pagination — top breadcrumb dots
   ============================================================ */
.brand {
  position: fixed;
  top: 28px;
  left: 36px;
  z-index: 5;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--fg-1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-variant-ligatures: none;
  -webkit-font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "hlig" 0, "calt" 0;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "hlig" 0, "calt" 0;
  letter-spacing: 0.02em;
}
.brand .sprig-mini { opacity: 0.7; }

.path-dots {
  position: fixed;
  top: 36px;
  right: 36px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  text-transform: lowercase;
}
.path-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-soft);
  transition: background var(--dur-base) var(--ease-soft), transform var(--dur-base) var(--ease-soft);
}
.path-dots .dot.done { background: var(--color-action); opacity: 0.45; }
.path-dots .dot.active { background: var(--color-action); transform: scale(1.4); }
.path-dots .label {
  margin-left: 8px;
}

.back-link {
  display: none !important;
  position: fixed;
  top: 72px;
  left: 36px;
  z-index: 5;
  font-size: 12px;
  color: var(--fg-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color var(--dur-fast) var(--ease-soft), background var(--dur-fast) var(--ease-soft);
}
.back-link:hover { color: var(--fg-1); background: var(--color-action-tint); }

/* ============================================================
   Reveal animations — soft fade-up
   ============================================================ */
@keyframes softIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes softInSlow {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { animation: softIn 480ms var(--ease-soft) both; }
.reveal-slow { animation: softInSlow 720ms var(--ease-soft) both; }
.delay-1 { animation-delay: 120ms; }
.delay-2 { animation-delay: 240ms; }
.delay-3 { animation-delay: 360ms; }
.delay-4 { animation-delay: 520ms; }
.delay-5 { animation-delay: 700ms; }
.delay-6 { animation-delay: 900ms; }

/* ============================================================
   Outcome screens — listening room + final card
   ============================================================ */
.listening-room {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.dots-listening {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}
.dots-listening .d {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-action);
  opacity: 0.4;
  animation: breathe 2400ms var(--ease-soft) infinite;
}
.dots-listening .d:nth-child(2) { animation-delay: 300ms; }
.dots-listening .d:nth-child(3) { animation-delay: 600ms; }
@keyframes breathe {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.soul-orbits {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 8px auto;
}
.soul-orbits .center {
  position: absolute;
  inset: 50% 0 0 50%;
  width: 84px;
  height: 84px;
  margin: -40px 0 0 -40px;
  border-radius: 50%;
  background: var(--color-action);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  box-shadow: 0 0 0 8px rgba(76,58,143,0.08), 0 0 0 22px rgba(76,58,143,0.04);
  animation: gentle-pulse 3200ms var(--ease-soft) infinite;
}
@keyframes gentle-pulse {
  0%, 100% { box-shadow: 0 0 0 8px rgba(76,58,143,0.08), 0 0 0 22px rgba(76,58,143,0.04); }
  50% { box-shadow: 0 0 0 12px rgba(76,58,143,0.12), 0 0 0 30px rgba(76,58,143,0.06); }
}
.soul-orbits .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--color-action-border);
  opacity: 0.5;
  animation: rotate 60s linear infinite;
}
.soul-orbits .ring.r2 {
  inset: 32px;
  animation-direction: reverse;
  animation-duration: 80s;
}
@keyframes rotate { to { transform: rotate(360deg); } }
.soul-orbits .soul {
  position: absolute;
  width: 36px; height: 36px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid var(--color-white);
  box-shadow: 0 6px 18px -8px rgba(76,58,143,0.4);
}

/* ============================================================
   Listener — message preview card
   ============================================================ */
.message-card {
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.message-card .who {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.message-card .who .av {
  width: 42px; height: 42px;
  border-radius: 50%;
  background-size: cover; background-position: center;
}
.message-card .who .name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-1);
}
.message-card .who .time {
  font-size: 11px;
  color: var(--fg-2);
}
.message-card .body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 28px;
  color: var(--fg-1);
}
.message-card .ask-mode {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-action);
  letter-spacing: 0.01em;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--color-action-tint);
  align-self: flex-start;
}

/* ============================================================
   "Heard" final card
   ============================================================ */
.heard-card {
  background: var(--color-white);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 24px 60px -28px rgba(76,58,143,0.25);
}
.heard-card .souls {
  display: flex;
  margin-bottom: 4px;
}
.heard-card .souls .av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid var(--color-white);
  margin-left: -12px;
  box-shadow: 0 4px 14px -6px rgba(76,58,143,0.3);
}
.heard-card .souls .av:first-child { margin-left: 0; }
.heard-card .number {
  font-family: var(--font-display);
  font-size: 96px;
  line-height: 1;
  color: var(--color-action);
}
.heard-card .number-label {
  font-size: 13px;
  color: var(--fg-2);
  letter-spacing: 0.02em;
}

/* ============================================================
   Notes carousel (replies) — for the "with words back" path
   ============================================================ */
.note {
  background: var(--color-white);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 24px 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.note .from {
  font-size: 12px;
  color: var(--fg-2);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.note .from .av {
  width: 22px; height: 22px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

/* iOS-style text notification card (interactive) */
.text-notif {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  max-width: 380px;
  background: rgba(245, 244, 240, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 12px 16px;
  text-align: left;
  font: inherit;
  color: var(--fg-1);
  box-shadow: 0 12px 32px -16px rgba(45, 32, 88, 0.25);
  transition: transform var(--dur-base) var(--ease-soft), box-shadow var(--dur-base) var(--ease-soft);
  animation: notif-slide-in 600ms var(--ease-soft) both;
}
.text-notif:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -16px rgba(45, 32, 88, 0.32);
}
.text-notif-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-2);
  text-transform: uppercase;
}
.text-notif-app { font-weight: 500; }
.text-notif-body {
  margin-top: 8px;
}
.text-notif-from {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg-1);
  margin-bottom: 4px;
}
.text-notif-preview {
  font-size: 13px;
  line-height: 18px;
  color: var(--fg-2);
}
@keyframes notif-slide-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Listener "all caught up" screen
   ============================================================ */
.caught-up-arc {
  position: relative;
  width: 220px;
  height: 110px;
}
.caught-up-arc .cu-soul {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid var(--color-white);
  box-shadow: 0 6px 16px -8px rgba(45, 32, 88, 0.28);
  animation: cu-rise 720ms var(--ease-soft) both;
}
.caught-up-arc .cu-soul:nth-child(1) {
  left: 0;       top: 36px;
}
.caught-up-arc .cu-soul:nth-child(2) {
  left: 82px;    top: 0;
  width: 64px;
  height: 64px;
}
.caught-up-arc .cu-soul:nth-child(3) {
  right: 0;      top: 36px;
}
.caught-up-arc .cu-heart {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  animation: cu-pulse 2400ms var(--ease-soft) infinite;
}
@keyframes cu-rise {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cu-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.85; }
  50%      { transform: translateX(-50%) scale(1.12); opacity: 1; }
}
.caught-up-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--color-action-tint);
  color: var(--color-action);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.note .text {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 26px;
  color: var(--fg-1);
}

/* small SVG inline icon helper */
.icon-inline {
  width: 16px; height: 16px;
  stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  fill: none;
}

/* ============================================================
   Mobile — let the page scroll, scale type, stack rows
   ============================================================ */
@media (max-width: 720px) {
  html, body { overflow: auto; height: auto; }
  .stage {
    width: 100%;
    min-height: 100vh;
    /* dvh shrinks with the on-screen keyboard on iOS/Android; vh above is
       the fallback for browsers that don't support it. Without this the
       stage stays sized to the pre-keyboard viewport and content below the
       fold (the send button) can end up hidden behind the keyboard. */
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  /* Make chrome static on mobile so it doesn't overlap content */
  .brand {
    position: static !important;
    align-self: flex-start;
    margin: 20px 0 0 20px;
  }
  .back-link {
    position: static !important;
    align-self: flex-start;
    margin: 12px 0 24px 20px;
  }
  .step {
    width: min(560px, 100%);
    margin: auto;
    gap: 20px;
  }
  .prompt-display.xl { font-size: 36px !important; line-height: 1.2; flex-wrap: wrap; justify-content: center; white-space: normal !important; }
  .prompt-display.xl span:last-child { font-size: 1.4em !important; }
  .prompt-display.lg { font-size: 36px; line-height: 1.15; }
  .prompt.lg { font-size: 24px; line-height: 32px; }
  .prompt.md { font-size: 22px; line-height: 30px; }

  .choices.two-col { grid-template-columns: 1fr; }
  .message-card, .heard-card, .composer { width: 100%; }
  .heard-card { padding: 28px 24px; }
  .text-notif { max-width: 100%; }
}
