/* Prime Heal Homoeopathy — Marketing site
   Palette derived from the mobile app's design system. */

:root {
  --brand: #415738;
  --brand-dark: #2E3D26;
  --brand-light: #A5C093;
  --brand-tint: rgba(65, 87, 56, 0.08);
  --surface: #FCFBF8;
  --surface-alt: #F1EFE7;
  --surface-card: #FFFFFF;
  --ink: #262925;
  --ink-muted: #5B5F55;
  --ink-soft: #8A8F82;
  --border: rgba(38, 41, 37, 0.10);
  --border-strong: rgba(38, 41, 37, 0.18);
  --shadow: 0 2px 8px rgba(38, 41, 37, 0.04), 0 8px 24px rgba(38, 41, 37, 0.06);
  --shadow-hover: 0 4px 12px rgba(38, 41, 37, 0.08), 0 16px 40px rgba(38, 41, 37, 0.10);
  --radius: 14px;
  --radius-lg: 22px;
  --font-serif: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-w: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 500; color: var(--ink); line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin-bottom: 12px; }
h3 { font-size: 1.35rem; margin-bottom: 8px; }
p.lead { font-size: 1.15rem; color: var(--ink-muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 0.72rem; font-weight: 600; color: var(--brand); font-family: var(--font-sans); }
.section-sub { color: var(--ink-muted); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }
.tc { text-align: center; }
.italic { font-style: italic; font-family: var(--font-serif); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-weight: 600; font-size: 0.98rem; padding: 14px 28px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: all 0.2s ease; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--brand-tint); border-color: var(--brand); }
.btn-sm { padding: 10px 20px; font-size: 0.9rem; }

/* Header */
header { position: sticky; top: 0; z-index: 50; background: rgba(252, 251, 248, 0.85); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 36px; height: 36px; }
.brand-name { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 500; color: var(--ink); letter-spacing: 0.5px; }
.brand-tag { display: block; font-family: var(--font-sans); font-size: 0.62rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--brand); margin-top: -3px; }
nav.links { display: flex; align-items: center; gap: 32px; }
nav.links a { color: var(--ink-muted); font-weight: 500; font-size: 0.94rem; }
nav.links a:hover { color: var(--brand); }
.mobile-toggle { display: none; background: none; border: 0; font-size: 1.4rem; color: var(--ink); cursor: pointer; }

/* Hero */
.hero { padding: 88px 0 60px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; right: -260px; top: -160px; width: 640px; height: 640px; background: radial-gradient(circle, var(--brand-light) 0%, transparent 60%); opacity: 0.35; z-index: 0; }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: center; }
.hero h1 span { font-style: italic; color: var(--brand); }
.hero p.lead { margin: 22px 0 32px; max-width: 540px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--brand-tint); color: var(--brand); border-radius: 999px; font-size: 0.82rem; font-weight: 600; margin-bottom: 24px; }
.hero-visual { position: relative; }
.hero-visual .phone-mock { width: 100%; max-width: 320px; margin: 0 auto; background: var(--surface-card); border-radius: 32px; box-shadow: var(--shadow-hover); padding: 24px; border: 1px solid var(--border); transform: rotate(-2deg); transition: transform 0.4s ease; }
.hero-visual .phone-mock:hover { transform: rotate(0deg) scale(1.02); }
.hero-visual .phone-mock h3 { font-family: var(--font-serif); font-size: 1.4rem; margin-bottom: 4px; }
.hero-visual .phone-mock .subtag { font-size: 0.75rem; color: var(--brand); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 20px; }
.hero-visual .card-mini { background: var(--surface-alt); border-radius: 12px; padding: 14px; margin-bottom: 10px; font-size: 0.88rem; }
.hero-visual .card-mini strong { color: var(--brand); }
.hero-trust { display: flex; gap: 24px; margin-top: 32px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-muted); }
.hero-trust span::before { content: "✓ "; color: var(--brand); font-weight: 700; }

/* Sections */
section { padding: 72px 0; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head .eyebrow { display: inline-block; margin-bottom: 12px; }

/* Features grid */
.features { background: var(--surface-alt); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--surface-card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--border); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card .icon-circle { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 16px; }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { color: var(--ink-muted); font-size: 0.94rem; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step { text-align: center; }
.step-num { font-family: var(--font-serif); font-size: 3rem; color: var(--brand); opacity: 0.35; line-height: 1; margin-bottom: 8px; }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--ink-muted); font-size: 0.94rem; }

/* Materia Medica pill */
.mm-block { background: var(--brand); color: #fff; border-radius: var(--radius-lg); padding: 56px; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
.mm-block h2, .mm-block h3 { color: #fff; }
.mm-block .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.mm-block .btn-ghost:hover { background: rgba(255,255,255,0.10); border-color: #fff; color: #fff; }
.mm-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.mm-stats .stat { padding: 20px; background: rgba(255,255,255,0.08); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.14); }
.mm-stats .stat b { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 500; display: block; }
.mm-stats .stat span { font-size: 0.85rem; opacity: 0.75; }

/* MM Independence callout — clarifies AI/Materia Medica separation */
.mm-independence {
  margin-top: 28px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid var(--brand-light);
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mm-independence-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.mm-independence-icon {
  width: 28px;
  height: 28px;
  color: var(--brand-light);
  flex-shrink: 0;
  display: inline-flex;
}
.mm-independence-icon svg { width: 100%; height: 100%; }
.mm-independence-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: #fff;
  margin: 0;
  line-height: 1.35;
}
.mm-independence-title em {
  color: var(--brand-light);
  font-style: italic;
}
.mm-independence-body {
  font-size: 0.94rem;
  line-height: 1.62;
  opacity: 0.92;
  margin: 0 0 14px;
}
.mm-independence-body strong {
  color: #fff;
  font-weight: 600;
  background: rgba(165, 192, 147, 0.18);
  padding: 1px 6px;
  border-radius: 4px;
}
.mm-independence-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mm-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.1px;
}
.mm-pill span[aria-hidden] { font-size: 0.95rem; }

@media (max-width: 780px) {
  .mm-independence { margin-top: 24px; padding: 18px; text-align: left; }
  .mm-independence-header { justify-content: flex-start; }
  .mm-independence-pills { justify-content: flex-start; }
}

/* Pricing */
.pricing-toggle { display: inline-flex; background: var(--surface-alt); border-radius: 999px; padding: 4px; margin: 0 auto 40px; }
.pricing-toggle button { background: none; border: 0; padding: 10px 22px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink-muted); font-family: var(--font-sans); font-size: 0.92rem; transition: all 0.2s; }
.pricing-toggle button.active { background: var(--surface-card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.pricing-toggle .save-badge { display: inline-block; margin-left: 6px; background: var(--brand); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.5px; }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { background: var(--surface-card); border-radius: var(--radius-lg); padding: 32px 28px; border: 1px solid var(--border); position: relative; transition: transform 0.2s; }
.plan.recommended { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint), var(--shadow); }
.plan.recommended::before { content: "MOST POPULAR"; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; padding: 4px 14px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; letter-spacing: 1.2px; }
.plan h3 { font-size: 1.5rem; margin-bottom: 4px; }
.plan .plan-sub { color: var(--ink-muted); font-size: 0.9rem; min-height: 40px; }
.plan .price { font-family: var(--font-serif); font-size: 2.4rem; margin: 20px 0 4px; color: var(--ink); }
.plan .price small { font-family: var(--font-sans); font-size: 0.9rem; color: var(--ink-muted); font-weight: 500; }
.plan .price-note { font-size: 0.85rem; color: var(--brand); font-weight: 600; margin-bottom: 20px; min-height: 20px; }
.plan ul { list-style: none; margin: 20px 0 28px; }
.plan ul li { padding: 6px 0; color: var(--ink-muted); font-size: 0.92rem; padding-left: 24px; position: relative; }
.plan ul li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.plan .btn { width: 100%; justify-content: center; }
.plan[data-billing="yearly"] .monthly-price,
.plan[data-billing="monthly"] .yearly-price { display: none; }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; color: var(--ink); display: flex; justify-content: space-between; align-items: center; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-serif); font-size: 1.6rem; color: var(--brand); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 12px; color: var(--ink-muted); font-size: 0.96rem; }

/* CTA */
.cta-band { text-align: center; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; padding: 72px 40px; border-radius: var(--radius-lg); }
.cta-band h2 { color: #fff; margin-bottom: 12px; }
.cta-band p { color: rgba(255,255,255,0.85); max-width: 520px; margin: 0 auto 32px; font-size: 1.1rem; }
.cta-band .btn-primary { background: #fff; color: var(--brand); }
.cta-band .btn-primary:hover { background: var(--surface-alt); color: var(--brand-dark); }

/* Footer */
footer { background: var(--ink); color: #ccc; padding: 56px 0 32px; margin-top: 72px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
footer h4 { color: #fff; font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 18px; }
footer a { color: #bbb; font-size: 0.9rem; }
footer a:hover { color: #fff; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 10px; }
.footer-brand p { font-size: 0.9rem; color: #bbb; margin-top: 12px; max-width: 320px; }
.footer-brand .brand-name { color: #fff; font-size: 1.5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; text-align: center; font-size: 0.85rem; color: #999; }

/* Responsive */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-trust { justify-content: center; }
  .grid-3, .steps, .pricing { grid-template-columns: 1fr; }
  .mm-block { grid-template-columns: 1fr; padding: 36px; text-align: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  nav.links { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--surface-card); flex-direction: column; padding: 20px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); gap: 4px; }
  nav.links.open { display: flex; }
  nav.links a { padding: 12px 0; width: 100%; }
  nav.links a.btn { padding: 12px 20px; margin-top: 8px; justify-content: center; text-align: center; }
  nav.links a.btn-primary { background: var(--brand); color: #fff; }
  .mobile-toggle { display: block; }
  section { padding: 56px 0; }
  .cta-band { padding: 48px 24px; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; text-align: left; }
  .plan { padding: 28px 22px; }
  h1 { font-size: 2.2rem; }
}

/* Legal doc styling */
.doc-page { max-width: 780px; margin: 40px auto; padding: 40px 24px 72px; }
.doc-page h1 { font-size: 2.2rem; margin-bottom: 8px; }
.doc-page .meta { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 32px; }
.doc-page h2 { font-size: 1.35rem; margin-top: 32px; margin-bottom: 10px; color: var(--brand); }
.doc-page p, .doc-page li { color: var(--ink-muted); font-size: 0.96rem; margin-bottom: 12px; }
.doc-page ul { margin-left: 24px; }
.doc-page pre { background: var(--surface-alt); padding: 16px; border-radius: 8px; font-family: monospace; font-size: 0.85rem; white-space: pre-wrap; }

/* ==== Install Guide Section ==== */
.install-section { padding: 88px 0 64px; background: var(--surface-alt); }
.install-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.install-step {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.install-step:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.install-step .step-num {
  position: absolute;
  top: -16px;
  left: 28px;
  width: 40px;
  height: 40px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(65, 87, 56, 0.25);
}
.install-step .step-icon {
  width: 44px;
  height: 44px;
  color: var(--brand);
  margin: 8px 0 18px;
}
.install-step .step-icon svg { width: 100%; height: 100%; }
.install-step h3 { margin-bottom: 10px; color: var(--ink); }
.install-step p { color: var(--ink-muted); font-size: 0.96rem; line-height: 1.6; }
.install-step code {
  background: var(--brand-tint);
  color: var(--brand-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: monospace;
}
.install-safety {
  margin-top: 40px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.92rem;
  background: var(--surface-card);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 16px 24px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.install-safety span[aria-hidden] { margin-right: 6px; }

/* ==== Download CTA buttons ==== */
.download-cta {
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.btn-download, .btn-ios {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-radius: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  min-width: 240px;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
  text-align: left;
}
.btn-download {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.btn-download:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); color: var(--brand-dark); }
.btn-download[data-state="loading"] { opacity: 0.75; cursor: wait; }
.btn-download[data-state="disabled"] { opacity: 0.55; cursor: not-allowed; }
.btn-ios {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
}
.btn-ios:hover { background: rgba(255,255,255,0.08); border-color: #fff; }
.dl-icon { width: 24px; height: 24px; flex-shrink: 0; display: inline-flex; }
.dl-icon svg { width: 100%; height: 100%; }
.dl-label { display: flex; flex-direction: column; line-height: 1.2; }
.dl-title { font-size: 1rem; font-weight: 600; }
.dl-meta { font-size: 0.78rem; opacity: 0.75; font-weight: 400; margin-top: 2px; }
.download-status { margin-top: 24px; font-size: 0.85rem; opacity: 0.85; }

/* ==== iOS Waitlist Modal ==== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(38, 41, 37, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: modal-fade-in .18s ease-out;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 40px 32px 32px;
  max-width: 440px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modal-scale-in .22s ease-out;
}
.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--brand);
  background: var(--brand-tint);
  border-radius: 16px;
  padding: 12px;
}
.modal-icon svg { width: 100%; height: 100%; }
.modal-title { margin-bottom: 8px; color: var(--ink); }
.modal-body { color: var(--ink-muted); margin-bottom: 20px; font-size: 0.98rem; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.6rem;
  cursor: pointer;
  border-radius: 8px;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}
.modal-close:hover { background: var(--surface-alt); color: var(--ink); }
.waitlist-form {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.waitlist-form input[type="email"] {
  flex: 1;
  min-width: 180px;
  padding: 13px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  font-size: 0.96rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.waitlist-form input[type="email"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.waitlist-form input[type="email"][aria-invalid="true"] {
  border-color: #c0392b;
}
.waitlist-msg {
  min-height: 20px;
  font-size: 0.88rem;
  margin: 8px 0 12px;
}
.waitlist-msg.success { color: var(--brand); font-weight: 500; }
.waitlist-msg.error { color: #c0392b; }
.modal-fineprint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 8px; }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-scale-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* Mobile install guide */
@media (max-width: 780px) {
  .install-steps { grid-template-columns: 1fr; gap: 32px; }
  .install-section { padding: 64px 0 40px; }
  .btn-download, .btn-ios { width: 100%; min-width: 0; }
  .download-cta { gap: 12px; }
  .modal { padding: 32px 24px 24px; }
  .waitlist-form { flex-direction: column; }
  .waitlist-form input[type="email"], .waitlist-form button { width: 100%; }
}
