/* overrides.css — component polish layered on top of styles.css */

/* ── Voice mic ring ─────────────────────────────────────────────── */

/* ── Type card grid entrance ────────────────────────────────────── */

.type-card-grid {
  animation: fadeIn 240ms ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Wizard step entrance ───────────────────────────────────────── */

.wizard-step.is-active .step-inner {
  animation: stepIn 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Style card — 2-col on narrow ──────────────────────────────── */

@media (max-width: 480px) {
  .style-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── People grid — 2-col on narrow ─────────────────────────────── */

@media (max-width: 480px) {
  .people-all-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Review pager dots ──────────────────────────────────────────── */

.detail-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 4px;
}
.detail-pager-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-md);
  border: none;
  transition: all 160ms;
  padding: 0;
}
.detail-pager-dot.is-active {
  width: 18px;
  border-radius: 3px;
  background: var(--coral);
}

/* ── Voice transcript in review ─────────────────────────────────── */

.voice-transcript {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  padding: 12px 14px;
  background: var(--stone);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

/* ── Moment photo ───────────────────────────────────────────────── */

.moment-photo-preview {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--stone);
}
.moment-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.moment-photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(17,17,17,0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 120ms;
}
.moment-photo-remove:hover { background: rgba(220,38,38,0.85); }

.moment-photo-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--line-md);
  font-size: 13px;
  color: var(--muted);
  width: 100%;
  margin-top: 10px;
  transition: all 120ms;
}
.moment-photo-add:hover { border-color: var(--coral); color: var(--coral); }

/* ── Scrollbar ──────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(17,17,17,0.15); border-radius: 3px; }

/* ── Disabled button styling ────────────────────────────────────── */
/* Disabled state should read as "obviously can't click this" — a ghost
   button with dashed outline rather than a faded version of the active
   pill that's nearly identical in color. */
#wizardNextBtn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.email-form button[type=submit]:disabled {
  background: transparent !important;
  color: rgba(255, 90, 110, 0.35) !important;
  border: 1.5px solid rgba(255, 90, 110, 0.30) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}
#wizardNextBtn:disabled:hover,
.btn-primary:disabled:hover {
  background: transparent !important;
  transform: none !important;
}

/* ── Hero cards — 2×2 scatter, all visible ─────────────────────── */
@media (min-width: 901px) {
  .hero-card          { width: 200px; }
  .hero-card--1       { top: 12px;  left: 2%;   transform: rotate(-5deg); z-index: 1; }
  .hero-card--2       { top:  4px;  left: 47%;  transform: rotate(3deg);  z-index: 2; }
  .hero-card--3       { top: 254px; left: 8%;   transform: rotate(4deg);  z-index: 2; }
  .hero-card--4       { top: 244px; left: 50%;  transform: rotate(-4deg); z-index: 1; }
  /* keep rotation on hover */
  .hero-card--1:hover { transform: translateY(-5px) rotate(-5deg) !important; }
  .hero-card--2:hover { transform: translateY(-5px) rotate(3deg)  !important; }
  .hero-card--3:hover { transform: translateY(-5px) rotate(4deg)  !important; }
  .hero-card--4:hover { transform: translateY(-5px) rotate(-4deg) !important; }
}

/* ── Hero card entrance ─────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .hero-card { animation: cardFloat 320ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero-card--1 { animation-delay: 80ms; }
  .hero-card--2 { animation-delay: 180ms; }
  .hero-card--3 { animation-delay: 260ms; }
  .hero-card--4 { animation-delay: 340ms; }
  @keyframes cardFloat {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; }
  }
}

/* ── Generation progress subline: prominent while panels stream in ── */
#generatingSubline {
  transition: color 200ms ease, font-size 200ms ease, font-weight 200ms ease;
  font-variant-numeric: tabular-nums;
}
#generatingSubline.is-progress {
  font-size: 18px;
  font-weight: 600;
  color: var(--coral);
  letter-spacing: -0.01em;
}

/* ── Out-of-credits callout (replaces the keepsake framing on 429) ── */
.out-of-credits-callout {
  background: var(--coral-soft);
  border: 1px solid rgba(255, 90, 110, 0.18);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 24px;
  max-width: 440px;
}
.ooc-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.75);
  color: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ooc-body { min-width: 0; }
.ooc-title {
  font: 600 16px/1.3 var(--font-display), -apple-system, Inter, sans-serif;
  color: var(--ink);
  margin: 2px 0 4px;
  letter-spacing: -0.01em;
}
.ooc-text {
  font: 400 14px/1.5 -apple-system, Inter, sans-serif;
  color: var(--muted);
  margin: 0;
}

/* ── Post-generation feedback form ──────────────────────────────── */
.gen-feedback {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid rgba(17,17,17,0.10);
  max-width: 440px;
  position: relative;
}
.gen-feedback::before {
  content: "Optional";
  position: absolute;
  top: -8px;
  left: 0;
  padding: 0 10px 0 0;
  background: var(--stone, #f7f4f2);
  font: 700 10px/1 -apple-system, Inter, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.gen-feedback-title {
  font: 600 16px/1.3 var(--font-display), -apple-system, Inter, sans-serif;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.gen-feedback-sub {
  font: 400 13px/1.5 -apple-system, Inter, sans-serif;
  color: var(--muted);
  margin: 0 0 14px;
}
.gen-feedback-rating {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.rating-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 600 13px/1 -apple-system, Inter, sans-serif;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms ease;
}
.rating-dot:hover { border-color: var(--coral); color: var(--coral); }
.rating-dot:active { transform: scale(0.94); }
.rating-dot.is-selected {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}
.gen-feedback-comment {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: 400 14px/1.5 -apple-system, Inter, sans-serif;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.gen-feedback-comment::placeholder { color: var(--faint); }
.gen-feedback-comment:focus { outline: none; border-color: var(--coral); }
.gen-feedback-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gen-feedback-hint {
  font: 400 12px/1.4 -apple-system, Inter, sans-serif;
  color: var(--faint);
}
.gen-feedback-hint.is-hidden { display: none; }
.gen-feedback-actions .btn-secondary {
  font: 600 14px/1 -apple-system, Inter, sans-serif;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.gen-feedback-actions .btn-secondary:hover:not(:disabled) {
  background: var(--ink);
  color: #fff;
}
.gen-feedback-actions .btn-secondary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.gen-feedback-success {
  font: 400 14px/1.5 -apple-system, Inter, sans-serif;
  color: var(--ink);
  background: var(--coral-soft);
  border-radius: 12px;
  padding: 12px 14px;
}

/* ── Extract-stage thinking phrase: cycles through pipeline phases ── */
.thinking-phrase {
  transition: opacity 280ms ease;
  will-change: opacity;
}
.thinking-phrase.is-fading { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .thinking-phrase { transition: none; }
}

/* ── Gallery loading placeholder — watercolor bloom ─────────────── */

.gallery-card-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--stone);
  overflow: hidden;
}
.gallery-card-placeholder .bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  will-change: transform, opacity;
}
.gallery-card-placeholder .bloom-1 {
  width: 75%; aspect-ratio: 1;
  top: -15%; left: -10%;
  background: radial-gradient(circle, rgba(255, 90, 110, 0.55), transparent 65%);
  animation: gallery-bloom 4.4s ease-in-out infinite;
}
.gallery-card-placeholder .bloom-2 {
  width: 70%; aspect-ratio: 1;
  bottom: -15%; right: -10%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.50), transparent 65%);
  animation: gallery-bloom 4.4s ease-in-out -1.5s infinite;
}
.gallery-card-placeholder .bloom-3 {
  width: 60%; aspect-ratio: 1;
  top: 25%; left: 30%;
  background: radial-gradient(circle, rgba(178, 240, 236, 0.60), transparent 65%);
  animation: gallery-bloom 4.4s ease-in-out -3s infinite;
}
/* Stagger across cards so 4 placeholders don't pulse in unison. */
.gallery-card:nth-child(2) .bloom-1 { animation-delay: -0.6s; }
.gallery-card:nth-child(2) .bloom-2 { animation-delay: -2.1s; }
.gallery-card:nth-child(2) .bloom-3 { animation-delay: -3.6s; }
.gallery-card:nth-child(3) .bloom-1 { animation-delay: -1.1s; }
.gallery-card:nth-child(3) .bloom-2 { animation-delay: -2.6s; }
.gallery-card:nth-child(3) .bloom-3 { animation-delay: -0.1s; }
.gallery-card:nth-child(4) .bloom-1 { animation-delay: -2s; }
.gallery-card:nth-child(4) .bloom-2 { animation-delay: -3.4s; }
.gallery-card:nth-child(4) .bloom-3 { animation-delay: -0.9s; }
@keyframes gallery-bloom {
  0%, 100% {
    transform: scale(0.7) translate(-3%, 0);
    opacity: 0.35;
  }
  50% {
    transform: scale(1.2) translate(4%, -3%);
    opacity: 1;
  }
}

/* ── Hero grain overlay ─────────────────────────────────────────── */
.hero { position: relative; }
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  filter: url(#hero-grain);
  opacity: 0.04;
  pointer-events: none;
  z-index: 5;
}

/* ── Scroll reveal ──────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Story step transcribing state ──────────────────────────────── */

/* Matches .story-mic-wrap's footprint so the panel doesn't collapse when
   the mic+ring is swapped for the polishing orb during transcription. */
.story-transcribing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  min-height: 300px;
  gap: 12px;
}

/* ── Boot page selector ─────────────────────────────────────────
   Both #landingPage and #createPage start with the `hidden` attribute
   so refreshing into the wizard doesn't flash the landing page. The
   inline preflight script at the top of <body> sets data-boot-page on
   <html>; this rule unhides the matching page before main JS runs. */
html[data-boot-page="landing"]  #landingPage { display: block; }
html[data-boot-page="creating"] #createPage  { display: flex;  }

/* ══════════════════════════════════════════════════════
   Legal / Help / Feedback overlays (PRD 01-03)
   ══════════════════════════════════════════════════════ */

.legal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 18, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* Above .sign-in-overlay (1000) since Terms/Privacy can be opened from
     inside the sign-in modal. Still below exit-confirm (1200). */
  z-index: 1100;
  padding: 40px 20px;
  overflow-y: auto;
}
.legal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 620px;
  padding: 44px 36px 36px;
  box-shadow: var(--sh-lg);
  line-height: 1.6;
  color: var(--ink-2);
}
.legal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  border-radius: var(--r-pill);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
}
.legal-close:hover { background: var(--stone); color: var(--ink); }
.legal-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--ink);
}
.legal-updated {
  margin: 0 0 24px;
  color: var(--faint);
  font-size: 13px;
}
.legal-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 24px 0 6px;
  color: var(--ink);
}
.legal-card p, .legal-card ul {
  margin: 0 0 4px;
  font-size: 15px;
}
.legal-card ul { padding-left: 22px; }
.legal-card li { margin: 2px 0; }
.legal-card a { color: var(--coral); text-decoration: none; }
.legal-card a:hover { text-decoration: underline; }

/* Help overlay — numbered step list */
.help-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  counter-reset: helpstep;
}
.help-steps li {
  position: relative;
  padding-left: 36px;
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.55;
}
.help-steps li::before {
  counter-increment: helpstep;
  content: counter(helpstep);
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--coral-dim);
  color: var(--coral);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.help-steps strong {
  display: block;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 2px;
}

/* Feedback overlay form */
.feedback-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin: 16px 0 6px;
}
.feedback-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-md);
  border-radius: var(--r-md);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 70px;
  background: var(--warm-white);
  color: var(--ink);
}
.feedback-textarea:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-dim);
}
.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.feedback-sent {
  text-align: center;
  padding: 14px 0 6px;
}
.feedback-sent-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
  margin: 0 auto 14px;
}
.feedback-sent .legal-title { font-size: 22px; margin-bottom: 8px; }
.feedback-sent p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
}

/* ── Share overlay (reuses .sign-in-overlay shell) ─────────────── */

.sign-in-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 18, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 40px 20px;
  overflow-y: auto;
}
.sign-in-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 440px;
  padding: 40px 32px 28px;
  box-shadow: var(--sh-lg);
}
.sign-in-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  border-radius: var(--r-pill);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
}
.sign-in-close:hover { background: var(--stone); color: var(--ink); }
.sign-in-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.sign-in-sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.share-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 4px;
}
.share-link-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--stone);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.share-link-input:focus {
  outline: none;
  border-color: var(--coral);
}
.share-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--coral);
  border: 1.5px solid var(--coral);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 160ms ease, color 160ms ease;
}
.share-copy-btn:hover {
  color: var(--coral-hover);
  border-color: var(--coral-hover);
}
/* Copied feedback: keep the outlined square, swap the icon to a check, and
   darken border + icon to coral-hover. No background change. */
.share-copy-btn.is-copied {
  color: var(--coral-hover);
  border-color: var(--coral-hover);
}
.share-copy-icon--copied { display: none; }
.share-copy-btn.is-copied .share-copy-icon--default { display: none; }
.share-copy-btn.is-copied .share-copy-icon--copied { display: inline; }

/* ── Step-7 completion actions (post-generation) ────────────────── */

.gen-completion-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.gen-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.gen-download-btn:hover { color: var(--ink); }

/* "Generate another" — a quiet coral text link with a forward arrow. */
.gen-restart-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--coral);
  background: none;
  border: none;
  cursor: pointer;
}
.gen-restart-link:hover { color: var(--coral-hover); }
.gen-restart-link svg { transition: transform 160ms ease; }
.gen-restart-link:hover svg { transform: translateX(2px); }

/* ── Step 5 likeness scope note ─────────────────────────────────── */

.step-likeness-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ── Header nav as buttons ──────────────────────────────────────── */

.site-nav-link--button {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

/* ── Footer legal nav ───────────────────────────────────────────── */

.site-footer-nav {
  display: inline-flex;
  gap: 18px;
  margin-left: 8px;
}
.site-footer-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}
.site-footer-link:hover { color: var(--ink); text-decoration: underline; }

/* Mobile: stack the 3 footer columns vertically and center them. The default
   flex row overlaps at <480px because the legal nav + wordmark + copy all
   compete for horizontal space. */
@media (max-width: 640px) {
  .site-footer { padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); }
  .site-footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }
  .site-footer-nav { margin-left: 0; flex-wrap: wrap; justify-content: center; gap: 14px 18px; }
  .site-footer-copy { margin: 0; }
}

/* ── Sign-in overlay form elements ──────────────────────────────── */

.site-nav-link--button {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.sign-in-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.sign-in-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-md);
  border-radius: var(--r-md);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  box-sizing: border-box;
}
.sign-in-input:focus { outline: none; border-color: var(--coral); }
.sign-in-form .btn-primary {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  justify-content: center;
}

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--line-md);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms, background 120ms;
}
.google-signin-btn:hover { border-color: var(--ink); background: var(--stone); }
.google-signin-icon { display: inline-flex; align-items: center; }

.signin-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.signin-divider::before,
.signin-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-md);
}
.signin-divider span { display: inline-block; padding: 0 2px; }

.sign-in-toggle {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.sign-in-toggle .link-button { margin-left: 4px; }

.sign-in-legal {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--coral);
  cursor: pointer;
  text-decoration: underline;
}
.link-button:hover { color: var(--coral-hover); }

/* ── Sign-in password rules ─────────────────────────────────────── */

.sign-in-pw-rules {
  list-style: none;
  margin: 4px 4px 8px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--muted, #6c6c72);
}
.sign-in-pw-rules li {
  position: relative;
  padding-left: 18px;
  line-height: 1.4;
}
.sign-in-pw-rules li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.5;
  box-sizing: border-box;
}
.sign-in-pw-rules li.is-met {
  color: #2d8a4e;
}
.sign-in-pw-rules li.is-met::before {
  background: #2d8a4e;
  border-color: #2d8a4e;
  opacity: 1;
}

/* ── Sign-in CTA ribbon (post-generation, anonymous) ────────────── */

.gen-anon-ribbon {
  margin: 20px auto 0;
  max-width: 520px;
  padding: 20px 24px;
  text-align: center;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(17,17,17,0.05);
}
.gen-anon-ribbon h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.gen-anon-ribbon p {
  margin: 0 0 14px;
  color: var(--muted, #6c6c72);
  font-size: 14px;
  line-height: 1.45;
}
.gen-anon-ribbon-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.gen-anon-dismiss {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--muted, #6c6c72);
  cursor: pointer;
  text-decoration: underline;
}

/* ── Cooldown overlay (weekly quota exhausted) ──────────────────── */

.cooldown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 22, 0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cooldown-card {
  background: #fff;
  border-radius: 22px;
  max-width: 420px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.cooldown-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cooldown-card p {
  margin: 0 0 18px;
  color: var(--muted, #6c6c72);
  line-height: 1.5;
}

/* ── Album section ──────────────────────────────────────────────── */

.album-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}
.album-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.album-section-title {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.album-section-sub {
  margin: 4px 0 0;
  color: var(--muted, #6c6c72);
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.album-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 2px 8px rgba(17,17,17,0.04);
}
.album-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(17,17,17,0.08);
}
.album-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-color: #eeebe8;
}
.album-card-body {
  padding: 14px 14px 16px;
}
.album-card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-card-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #6c6c72);
}
.album-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted, #6c6c72);
}
.album-empty strong {
  display: block;
  font-size: 18px;
  color: var(--ink, #161616);
  margin-bottom: 6px;
}

/* ── Email-verification banner ──────────────────────────────────── */

.verify-banner {
  position: sticky;
  top: 56px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: #fff4d6;
  border-bottom: 1px solid #f0d98a;
  font-size: 14px;
  color: #3a2c08;
}
.verify-banner-text {
  flex: 1;
  min-width: 0;
}
.verify-banner-text strong {
  margin-right: 6px;
}
.verify-banner-resend {
  background: #161616;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}
.verify-banner-resend:hover {
  background: #2a2a2a;
}
.verify-banner-resend:disabled {
  opacity: 0.6;
  cursor: default;
}
.verify-banner-dismiss {
  background: none;
  border: none;
  color: #3a2c08;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

/* ── Pet slot extras (name + species) ───────────────────────────── */

.pet-name-input {
  margin-top: 6px;
  width: 100%;
  max-width: 140px;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: inherit;
}
.pet-name-input:focus {
  outline: none;
  border-bottom-color: var(--ink, #161616);
}
.pet-name-input::placeholder {
  color: var(--muted, #a0a0a8);
}
.pet-species-select {
  margin-top: 4px;
  padding: 3px 8px;
  font: inherit;
  font-size: 12px;
  background: #fff;
  border: 1px solid rgba(17,17,17,0.12);
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
}
.pet-species-select:focus {
  outline: none;
  border-color: var(--ink, #161616);
}

/* ── Mobile pass: iPhone 14/15/Pro Max (375-430px) ──────────────── */

/* Safe-area insets so the sticky header + sticky wizard footer stay
   clear of the notch / Dynamic Island / home-bar. */
@supports (padding: env(safe-area-inset-top)) {
  .site-header-inner,
  .wizard-bar-inner {
    padding-left:  max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .wizard-footer-inner {
    padding-bottom: env(safe-area-inset-bottom);
  }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* Headings linked from in-page hash routes (#how-it-works, #examples)
   need scroll-margin so they don't tuck under the sticky header. */
.hero, .how-it-works, .examples, .features, .final-cta,
.album-section, #how-it-works, #examples {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

/* Tap-target minimums on mobile per Apple HIG (44x44pt). */
@media (max-width: 640px) {
  .btn-primary,
  .btn-primary-lg,
  .site-nav-link,
  .site-nav-link--button,
  .btn-ghost,
  .gen-download-btn,
  .gen-restart-link {
    min-height: 44px;
  }
  .site-nav-menu-btn {
    width: 44px;
    height: 44px;
  }
}

/* Hero cards — the floating gallery was designed for desktop with
   absolute positioning + rotations. On phones, lay them out as a
   clean 2-col grid that uses the available width. */
@media (max-width: 640px) {
  .hero { padding-bottom: 24px; }
  .hero-visual {
    height: auto;
    margin-top: 8px;
  }
  .hero-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
    height: auto;
    padding: 0 4px;
  }
  .hero-card,
  .hero-card--1,
  .hero-card--2,
  .hero-card--3,
  .hero-card--4 {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    transform: none !important;
    z-index: auto;
  }
  /* Show all 4 — the desktop rule hides card-4 in the absolute layout.
     The grid here accommodates all four cleanly. */
  .hero-card--4 { display: block !important; }
  /* Slight tilt on each tile to keep the "warm scrapbook" feel. */
  .hero-card--1 { transform: rotate(-1.5deg) !important; }
  .hero-card--2 { transform: rotate(1.5deg) !important;  }
  .hero-card--3 { transform: rotate(1.5deg) !important;  }
  .hero-card--4 { transform: rotate(-1.5deg) !important; }
  /* Title legibility on small tiles — slightly smaller, with a tighter scrim. */
  .hero-card-title { font-size: 12px; }
  .hero-card-body { padding: 18px 10px 10px; }
}

/* Wizard step heading sizes settle a touch on small screens. */
@media (max-width: 640px) {
  .step-title { font-size: 26px; line-height: 1.18; }
  .step-eyebrow { margin-bottom: 8px; }
  /* Step 5 people grid — 2 columns instead of the desktop sprawl. */
  .people-all-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* Step 7 generating gallery — 1 column on phones for big readable panels. */
  .generating-gallery { grid-template-columns: 1fr !important; }
  /* Step 6 style grid: 2 cols instead of 3 — bigger preview cards. */
  .style-grid { grid-template-columns: repeat(2, 1fr) !important; max-width: 100% !important; }
}

/* Sticky wizard footer respects safe-area + keeps tap-target clearance. */
@media (max-width: 640px) {
  .wizard-footer-inner { padding-top: 10px; padding-bottom: 10px; }
  .wizard-footer { padding-bottom: env(safe-area-inset-bottom); }
}

/* Overlays — fit on small screens with room to breathe. */
@media (max-width: 640px) {
  .sign-in-card,
  .legal-card,
  .share-card,
  .cooldown-card,
  .exit-confirm-card,
  .moment-detail-frame,
  .example-detail-modal {
    max-width: calc(100vw - 24px) !important;
    margin: 12px;
    border-radius: 16px;
  }
  /* Sign-in overlay form inputs at full-width tap targets. */
  .sign-in-input { font-size: 16px; min-height: 44px; }
  .sign-in-pw-rules { grid-template-columns: 1fr; }
  /* Feedback textareas readable + tappable. */
  .feedback-textarea { min-height: 88px; font-size: 16px; }
}

/* Sign-in overlay: drop margin top so the close button isn't off-screen
   on short phones in landscape. */
@media (max-width: 640px) and (max-height: 720px) {
  .sign-in-overlay,
  .legal-overlay,
  .share-overlay { align-items: flex-start; padding-top: 20px; }
}

/* Verify banner stacks the resend button + dismiss on narrow screens
   instead of cramming them on one line. */
@media (max-width: 640px) {
  .verify-banner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
  }
  .verify-banner-text { flex: 1 1 100%; }
  .verify-banner-resend { margin-left: auto; }
}

/* Album grid is already auto-fill minmax(220px) — but bump min so cards
   fit 1-up on phones rather than awkward 1.5-col. */
@media (max-width: 640px) {
  .album-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .album-section { padding: 24px 16px 64px; }
  .album-section-header { flex-wrap: wrap; gap: 12px; }
}

/* iOS form inputs zoom on focus if font-size < 16px — bump everything. */
@media (max-width: 640px) {
  .context-input,
  .story-text-input,
  .review-title-input,
  .review-chip-input,
  .moment-title-input,
  .moment-details-input,
  .pet-name-input,
  .feedback-textarea {
    font-size: 16px !important;
  }
}

/* ── Reduced motion ─────────────────────────────────────────────── */

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