/* ── Landing page (shown to signed-out users) ── */
#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.landing {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 22px calc(env(safe-area-inset-bottom, 0px) + 36px);
  display: flex;
  flex-direction: column;
}

/* ── Nav ── */
.landing-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 0 4px;
}
.landing-nav-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  box-shadow: var(--shadow);
}
.landing-nav-name {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

/* ── Hero ── */
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 0 12px;
}
/* ── Hero visual — a live preview of the actual Home screen (wave, phase
 * label, play/dice buttons, category pills) instead of a static logo, so the
 * first thing a visitor sees is the product itself, not a description of it. */
.hero-visual {
  width: 100%;
  max-width: 260px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px 18px 18px;
  margin-bottom: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-wave {
  width: 100%;
  height: auto;
  max-height: 100px;
  overflow: visible;
}
.hero-wave-line {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 3;
  stroke-linecap: round;
}
.hero-wave-dot {
  fill: var(--primary);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--primary) 55%, transparent));
  animation: heroBreathDot 16s ease-in-out infinite;
}
@keyframes heroBreathDot {
  0%   { cy: 52px; }
  22%  { cy: 10px; }
  50%  { cy: 10px; }
  72%  { cy: 52px; }
  100% { cy: 52px; }
}
.hero-phase-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 10px;
  min-height: 15px;
}
.hero-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.hero-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-fill);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 45%, transparent);
}
.hero-play-btn svg { width: 18px; height: 18px; margin-left: 2px; }
.hero-dice-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-dice-btn svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  .hero-wave-dot { animation: none; }
}
.landing-hero-title {
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.18;
  color: var(--text);
  margin-bottom: 14px;
}
.landing-hero-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 28px;
}

.landing-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.landing-legal-note {
  font-size: 12px;
  color: var(--text-light);
  max-width: 280px;
  line-height: 1.5;
}
.landing-legal-note a {
  color: var(--text-muted);
  text-decoration: underline;
}

.auth-error {
  font-size: 13px;
  color: #c0392b;
  min-height: 18px;
  margin: 0;
  text-align: center;
}

/* ── Stats strip ── */
.landing-stats {
  margin: 8px 0 4px;
}

/* ── Science ── */
.landing-science {
  padding: 8px 0 4px;
}
.landing-science .section-label {
  text-align: center;
  margin-bottom: 16px;
}
.landing-science-p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
}
.landing-science-note {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
  line-height: 1.6;
}

/* ── Features ── */
.landing-features {
  margin: 24px 0 8px;
}
.landing-features .section-label {
  text-align: center;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}
.feature-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
}
.feature-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.feature-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Pattern list ── */
.landing-patterns {
  margin: 28px 0 8px;
}
.landing-patterns .section-label {
  text-align: center;
  margin-bottom: 6px;
}
.pattern-list {
  display: flex;
  flex-direction: column;
}
.pattern-list-item {
  padding: 14px 0;
  border-top: 1px solid var(--surface-2);
}
.pattern-list-item:first-child {
  border-top: none;
}
.pattern-list-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.pattern-list-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Honest note (replaces marketing "quote") ── */
.landing-honest {
  text-align: center;
  padding: 32px 8px;
}
.landing-honest-lead {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
}
.landing-honest-body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto;
}

/* ── Final CTA ── */
.landing-final-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 8px 0 28px;
}
.landing-final-cta h2 {
  font-family: var(--font-head);
  font-size: 23px;
  font-weight: 500;
  color: var(--text);
}

/* ── Footer ── */
.landing-footer {
  text-align: center;
  padding: 22px 0 4px;
  margin-top: 8px;
  border-top: 1px solid var(--surface-2);
}
.landing-footer-brand {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}
.landing-footer-links {
  font-size: 12px;
}
.landing-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.landing-footer-links a:hover { text-decoration: underline; }
.landing-footer-links span {
  margin: 0 8px;
  color: var(--text-light);
}

/* ── Shared legal-page layout (terms.html / privacy.html) ── */
.legal-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 22px 60px;
  min-height: 100vh;
  background: var(--bg);
}
.legal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 0 4px;
}
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.legal-back svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.legal-header {
  padding: 20px 0 8px;
}
.legal-header h1 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.legal-header p {
  font-size: 13px;
  color: var(--text-muted);
}
.legal-body h2 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin: 28px 0 10px;
}
.legal-body p,
.legal-body li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.legal-body ul {
  padding-left: 20px;
  margin: 8px 0;
}
.legal-body li { margin-bottom: 6px; }
.legal-body a { color: var(--primary-dark); }
:root[data-theme="dark"] .legal-body a { color: var(--primary-light); }

/* ── Delete-account page ── */
.delete-panel { margin-top: 8px; }
.delete-panel .profile-card { margin-bottom: 20px; }
.delete-action-block {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.delete-action-block h2 {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.delete-action-block p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.delete-action-block .btn-primary { width: 100%; }
.delete-action-block .btn-primary:disabled {
  opacity: .45;
  pointer-events: none;
}
.delete-confirm-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 100px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  margin-bottom: 12px;
  border: 1px solid var(--surface-2);
}
.delete-confirm-input:focus {
  outline: none;
  border-color: var(--primary);
}
.delete-status {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 10px 0 0;
  min-height: 16px;
}
#delete-done-panel p {
  font-size: 15px;
  color: var(--text);
  text-align: center;
  padding: 24px 0;
}

/* ══════════════════════════════════════════════════════════════════
   Responsive — landing / terms / privacy only.
   The in-app PWA views keep their own fixed mobile-first layout
   (see main.css #app); nothing here touches those selectors.
   ══════════════════════════════════════════════════════════════════ */

/* Small phones — tighten up further */
@media (max-width: 380px) {
  .feature-grid { grid-template-columns: 1fr; }
  .landing-hero-title { font-size: 28px; }
}

/* Tablet */
@media (min-width: 700px) {
  .landing {
    max-width: 680px;
    padding: 0 32px calc(env(safe-area-inset-bottom, 0px) + 48px);
  }
  .legal-page { max-width: 640px; padding: 0 32px 72px; }

  .landing-hero { padding: 44px 0 20px; }
  .landing-hero-title { font-size: 44px; }
  .landing-hero-sub { max-width: 440px; font-size: 16px; }

  .feature-grid { gap: 16px; }

  .pattern-list { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 32px; }
  .pattern-list-item:nth-child(-n+2) { border-top: none; }
}

/* Desktop */
@media (min-width: 1024px) {
  .landing {
    max-width: 1080px;
    padding: 0 48px calc(env(safe-area-inset-bottom, 0px) + 64px);
  }

  .landing-nav { padding: 32px 0 8px; }
  .landing-nav-logo { width: 36px; height: 36px; }
  .landing-nav-name { font-size: 19px; }

  .landing-hero { padding: 72px 0 44px; }
  .hero-visual { max-width: 320px; padding: 30px 24px 24px; }
  .landing-hero-title { font-size: 58px; }
  .landing-hero-sub { max-width: 520px; font-size: 17px; margin-bottom: 32px; }

  .landing-stats.stats-row {
    max-width: 560px;
    margin: 0 auto 8px;
  }

  .landing-features { margin: 48px 0 12px; }
  .landing-features .section-label { font-size: 12px; margin-bottom: 22px; }
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .feature-card { padding: 28px 22px; }
  .feature-desc { font-size: 13px; }

  .landing-science { padding: 24px 0 8px; }
  .landing-science-p,
  .landing-science-note {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
  .landing-science-p { font-size: 15.5px; margin-bottom: 16px; }

  .landing-patterns { margin: 52px 0 12px; }
  .landing-patterns .section-label { font-size: 12px; }
  .pattern-list { column-gap: 48px; }
  .pattern-list-name { font-size: 15px; }
  .pattern-list-desc { font-size: 13.5px; }

  .landing-honest { padding: 56px 10px; }
  .landing-honest-lead { font-size: 24px; }
  .landing-honest-body { max-width: 560px; font-size: 15px; }

  .landing-final-cta { padding: 12px 0 40px; }
  .landing-final-cta h2 { font-size: 29px; }

  .landing-footer { padding: 28px 0 8px; }

  .legal-page { max-width: 760px; padding: 0 48px 96px; }
  .legal-nav { padding: 32px 0 8px; }
  .legal-header { padding: 24px 0 12px; }
  .legal-header h1 { font-size: 38px; }
  .legal-header p { font-size: 14px; }
  .legal-body h2 { font-size: 21px; margin: 34px 0 12px; }
  .legal-body p,
  .legal-body li { font-size: 15.5px; line-height: 1.75; }
}
