/* Comfort Focus — Comfort Companions brand */
:root {
  --linen: #F5F0E8;
  --linen-deep: #EBE4D8;
  --charcoal: #2C2C2C;
  --charcoal-soft: #4A4A4A;
  --sage: #8FAE8B;
  --sage-deep: #6F916B;
  --sage-light: #C5D9C2;
  --blush: #E8D5C4;
  --white: #FFFCFA;
  --shadow: 0 8px 32px rgba(44, 44, 44, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--linen);
  color: var(--charcoal);
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  padding-bottom: calc(24px + var(--safe-bottom));
}

.view { display: none; padding: 0 20px 32px; animation: fadeIn 0.35s ease; }
.view.active { display: block; }
.view[hidden] { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 8px;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--linen) 70%, transparent);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { font-size: 1.25rem; }
.brand-name { font-weight: 650; font-size: 1rem; letter-spacing: -0.01em; }
.spacer { width: 40px; }
.back-btn, .link-btn {
  background: none; border: none; color: var(--sage-deep);
  font: inherit; font-weight: 600; cursor: pointer; padding: 8px 4px;
  min-width: 40px; text-align: left;
}
.link-btn { text-align: right; color: var(--charcoal-soft); }

/* Hero */
.hero {
  text-align: center;
  padding: 24px 8px 40px;
  position: relative;
}
.hero-orb {
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--sage-light) 0%, transparent 70%);
  top: 20px; left: 50%; transform: translateX(-50%);
  pointer-events: none; opacity: 0.7;
}
.hero-companion {
  width: 140px; height: 140px;
  margin: 0 auto 20px;
  position: relative; z-index: 1;
}
.hero h1 {
  font-size: clamp(1.75rem, 6vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
  position: relative; z-index: 1;
}
.hero-sub {
  color: var(--charcoal-soft);
  font-size: 1rem;
  max-width: 340px;
  margin: 0 auto 28px;
  position: relative; z-index: 1;
}
.fine-print {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--charcoal-soft);
  opacity: 0.85;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-ghost {
  font: inherit; font-weight: 650; cursor: pointer;
  border-radius: 999px; padding: 14px 28px;
  border: none; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
}
.btn-primary {
  background: var(--sage);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(143, 174, 139, 0.4);
  width: 100%; max-width: 280px;
}
.btn-primary:hover { background: var(--sage-deep); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  background: var(--charcoal);
  color: var(--linen);
  width: 100%; max-width: 280px;
}
.btn-ghost {
  background: transparent;
  color: var(--charcoal-soft);
  width: 100%; max-width: 280px;
}
.btn-ghost:hover { color: var(--charcoal); }

.feature-row {
  display: grid;
  gap: 12px;
  margin-bottom: 40px;
}
.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.fc-ico { font-size: 1.5rem; }
.feature-card h3 { font-size: 1rem; margin: 6px 0 4px; }
.feature-card p { font-size: 0.875rem; color: var(--charcoal-soft); }

.site-footer {
  text-align: center;
  padding: 24px 0 8px;
  font-size: 0.8rem;
  color: var(--charcoal-soft);
}
.disclaimer { margin-top: 6px; opacity: 0.7; font-size: 0.75rem; }

/* Companion picker */
.section-lead {
  text-align: center;
  color: var(--charcoal-soft);
  margin: 8px 0 20px;
}
.companion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.companion-card {
  background: var(--white);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 16px 12px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
  font: inherit; color: inherit;
}
.companion-card:hover { transform: translateY(-2px); }
.companion-card.selected {
  border-color: var(--sage);
  background: linear-gradient(180deg, var(--sage-light) 0%, var(--white) 60%);
}
.companion-card .thumb {
  width: 80px; height: 80px;
  margin: 0 auto 8px;
}
.companion-card .cname { font-weight: 650; font-size: 0.95rem; }
.companion-card .ctag { font-size: 0.75rem; color: var(--charcoal-soft); }
.bottom-cta {
  position: sticky;
  bottom: calc(12px + var(--safe-bottom));
  margin-top: 24px;
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

/* Timer */
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  margin: 8px auto 16px;
  display: flex;
  width: fit-content;
}
.companion-stage {
  text-align: center;
  margin: 8px 0 12px;
}
.companion-svg {
  width: 160px; height: 160px;
  margin: 0 auto;
  transition: transform 0.4s ease;
}
.companion-svg.focusing { animation: breathe 3s ease-in-out infinite; }
.companion-svg.done { animation: celebrate 0.6s ease; }
.companion-mood {
  color: var(--charcoal-soft);
  font-size: 0.9rem;
  margin-top: 8px;
  min-height: 1.4em;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes celebrate {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.timer-display {
  font-size: clamp(3.5rem, 14vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 20px;
  color: var(--charcoal);
}

.preset-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.chip {
  font: inherit; font-weight: 600;
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  color: var(--charcoal);
  box-shadow: var(--shadow);
  min-width: 52px;
}
.chip.active {
  border-color: var(--sage);
  background: var(--sage-light);
  color: var(--sage-deep);
}
.chip:disabled { opacity: 0.5; cursor: not-allowed; }

.timer-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.sessions-left {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--charcoal-soft);
}

/* Done */
.done-card {
  text-align: center;
  padding: 48px 12px 24px;
}
.done-card h2 {
  font-size: 1.75rem;
  margin: 16px 0 8px;
  letter-spacing: -0.02em;
}
.done-card p { color: var(--charcoal-soft); margin-bottom: 8px; }
.done-streak { font-weight: 650; color: var(--sage-deep) !important; margin-bottom: 28px !important; }
.done-card .btn-primary, .done-card .btn-ghost { margin: 6px auto; display: flex; }

/* History */
.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.history-list li {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.history-list .h-meta { color: var(--charcoal-soft); font-size: 0.8rem; }
.empty-state {
  text-align: center;
  color: var(--charcoal-soft);
  padding: 48px 16px;
}

/* Pro */
.pro-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 22px;
  margin-top: 12px;
  box-shadow: var(--shadow);
  text-align: center;
}
.pro-card h2 { font-size: 1.5rem; margin-bottom: 8px; letter-spacing: -0.02em; }
.pro-card > p { color: var(--charcoal-soft); margin-bottom: 20px; }
.pro-perks {
  list-style: none;
  text-align: left;
  margin: 0 auto 24px;
  max-width: 260px;
}
.pro-perks li {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 0.95rem;
}
.pro-perks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--sage-deep);
  font-weight: 700;
}
.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.price-card {
  background: var(--linen);
  border: 2px solid var(--linen-deep);
  border-radius: var(--radius-sm);
  padding: 18px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  position: relative;
  transition: border-color 0.15s;
}
.price-card:hover, .price-card.featured {
  border-color: var(--sage);
}
.price-card .price {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.price-card .period {
  font-size: 0.8rem;
  color: var(--charcoal-soft);
}
.price-card .badge {
  position: absolute;
  top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--sage);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 44, 44, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none !important; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(44, 44, 44, 0.2);
  animation: fadeIn 0.25s ease;
}
.modal h3 { margin-bottom: 10px; font-size: 1.2rem; }
.modal p { color: var(--charcoal-soft); margin-bottom: 20px; }
.modal input[type="number"] {
  width: 100%;
  font: inherit;
  font-size: 1.5rem;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--linen-deep);
  border-radius: var(--radius-sm);
  background: var(--linen);
  color: var(--charcoal);
  margin-bottom: 16px;
}
.modal input:focus { outline: none; border-color: var(--sage); }
.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn-primary, .modal-actions .btn-ghost { flex: 1; max-width: none; }
.modal .btn-primary { max-width: none; }

/* SVG companion internals */
.companion-svg svg, .thumb svg, .hero-companion svg {
  width: 100%; height: 100%;
  display: block;
}

@media (min-width: 480px) {
  .feature-row { grid-template-columns: 1fr; }
}

/* Paywall closer CTAs */
.paywall-ctas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  grid-template-columns: none;
}
.paywall-ctas .btn-primary,
.paywall-ctas .btn-ghost {
  max-width: 100%;
  width: 100%;
}
.claim-safe {
  margin-top: 16px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

/* MoM post-session CTA */
.mom-cta {
  display: block;
  margin: 16px auto 8px;
  max-width: 300px;
  padding: 12px 16px;
  background: var(--linen-deep);
  border-radius: var(--radius-sm);
  color: var(--sage-deep);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
  transition: background 0.15s, color 0.15s;
}
.mom-cta:hover {
  background: var(--sage-light);
  color: var(--charcoal);
}
