/* ==========================================================================
   MedPrep AI — public marketing site design system
   Premium academic/science aesthetic: indigo/blue with teal accents, soft
   neutral grounds, controlled gradients, strong type hierarchy, generous space.
   ========================================================================== */

:root {
  /* Brand */
  --indigo-700: #3730a3;
  --indigo-600: #4f46e5;
  --indigo-500: #6366f1;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;

  /* Ink & neutrals */
  --ink-900: #0b1220;
  --ink-800: #111a2e;
  --ink-700: #1e293b;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --paper: #fbfcfe;
  --paper-2: #f6f8fc;
  --white: #ffffff;

  /* Semantic */
  --bg: var(--paper);
  --surface: var(--white);
  --text: var(--ink-800);
  --text-muted: var(--slate-600);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --primary: var(--indigo-600);
  --primary-ink: #ffffff;
  --ring: rgba(79, 70, 229, 0.45);

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #4f46e5 0%, #2563eb 52%, #0ea5b7 100%);
  --grad-brand-soft: linear-gradient(135deg, #eef2ff 0%, #eff6ff 50%, #ecfeff 100%);
  --grad-ink: radial-gradient(1200px 600px at 15% -10%, #1b2547 0%, #0b1220 60%);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Shadows (layered, soft) */
  --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --sh-md: 0 8px 24px -8px rgba(15, 23, 42, 0.14), 0 4px 8px -4px rgba(15, 23, 42, 0.08);
  --sh-lg: 0 30px 60px -18px rgba(24, 30, 80, 0.28), 0 12px 24px -12px rgba(15, 23, 42, 0.14);
  --sh-primary: 0 14px 30px -10px rgba(79, 70, 229, 0.55);

  /* Type scale (fluid) */
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 1.95rem);
  --step-3: clamp(1.95rem, 1.6rem + 1.8vw, 2.7rem);
  --step-4: clamp(2.5rem, 1.9rem + 3vw, 4rem);

  --container: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  font-weight: 780;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo-600);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--grad-brand);
  border-radius: 2px;
}

.muted { color: var(--text-muted); }
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.lead { font-size: var(--step-1); color: var(--text-muted); font-weight: 400; }

/* ---------- Buttons ---------- */
.btn {
  --_bg: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font: inherit;
  font-weight: 650;
  line-height: 1;
  padding: 0.9rem 1.35rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: var(--grad-brand);
  color: var(--primary-ink);
  box-shadow: var(--sh-primary);
}
.btn--primary:hover { box-shadow: 0 18px 40px -12px rgba(79, 70, 229, 0.7); }
.btn--ghost {
  background: var(--surface);
  color: var(--ink-800);
  border-color: var(--border-strong);
  box-shadow: var(--sh-sm);
}
.btn--ghost:hover { border-color: var(--indigo-500); color: var(--indigo-600); }
.btn--light { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.btn--light:hover { background: rgba(255, 255, 255, 0.22); }
.btn--lg { padding: 1.05rem 1.7rem; font-size: 1.02rem; }
.btn--block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(251, 252, 254, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
.brand .mark { width: 34px; height: 34px; }
.brand b { color: var(--indigo-600); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 1rem;
}
.nav-links a {
  color: var(--slate-600);
  font-weight: 550;
  padding: 0.5rem 0.7rem;
  border-radius: var(--r-sm);
  font-size: 0.97rem;
}
.nav-links a:hover { color: var(--ink-900); background: var(--slate-100); }
.nav-actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.nav-signin { color: var(--ink-800); font-weight: 600; padding: 0.6rem 0.5rem; }
.nav-signin:hover { color: var(--indigo-600); }
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--ink-800); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--grad-brand-soft);
  border-bottom: 1px solid var(--border);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
.hero::before { width: 520px; height: 520px; top: -180px; right: -120px; background: radial-gradient(circle, rgba(99,102,241,0.5), transparent 65%); }
.hero::after { width: 460px; height: 460px; bottom: -200px; left: -140px; background: radial-gradient(circle, rgba(20,184,166,0.4), transparent 65%); }
.hero-motif {
  position: absolute;
  top: -30px;
  right: -40px;
  width: clamp(280px, 30vw, 460px);
  height: auto;
  opacity: 0.14;
  z-index: 0;
  pointer-events: none;
}
@media (max-width: 1024px) { .hero-motif { display: none; } }
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
}
.hero h1 { margin-bottom: 0.4em; }
.hero .grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { font-size: var(--step-1); color: var(--slate-600); max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.1rem 1.5rem; margin-top: 1.6rem; }
.trust-item { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.94rem; color: var(--slate-600); font-weight: 550; }
.trust-item svg { width: 20px; height: 20px; color: var(--teal-500); flex: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border-strong);
  color: var(--indigo-700);
  font-weight: 650;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--r-pill);
  box-shadow: var(--sh-sm);
  margin-bottom: 1.1rem;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); box-shadow: 0 0 0 4px rgba(20,184,166,0.18); }

/* Product mockup (browser frame) */
.mockup {
  position: relative;
  border-radius: var(--r-xl);
  background: var(--white);
  box-shadow: var(--sh-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.mockup-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  background: var(--slate-100);
  border-bottom: 1px solid var(--border);
}
.mockup-bar .dots { display: flex; gap: 0.35rem; }
.mockup-bar .dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.mockup-bar .url {
  margin-left: 0.6rem;
  font-size: 0.76rem;
  color: var(--slate-500);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.28rem 0.75rem;
}
.mockup-body { display: block; background: #fff; }
.mockup-body svg { width: 100%; height: auto; display: block; }
.float-chip {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--sh-md);
  border-radius: var(--r-md);
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-800);
}
.float-chip svg { width: 26px; height: 26px; }
.float-chip.tl { top: -18px; left: -18px; }
.float-chip.br { bottom: -18px; right: -14px; }

/* ---------- Logo strip / value ---------- */
.valuebar { border-bottom: 1px solid var(--border); background: var(--surface); }
.valuebar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding-block: 2rem; }
.value { text-align: center; }
.value .n { font-size: var(--step-2); font-weight: 800; color: var(--indigo-600); letter-spacing: -0.03em; }
.value .l { font-size: 0.9rem; color: var(--slate-600); font-weight: 550; }

/* ---------- Feature cards ---------- */
.grid-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.7rem 1.6rem;
  box-shadow: var(--sh-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: var(--border-strong); }
.card h3 { margin-bottom: 0.35rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.98rem; }
.ico {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  margin-bottom: 1.1rem;
  background: var(--grad-brand-soft);
  border: 1px solid var(--border);
}
.ico svg { width: 28px; height: 28px; }
.tag {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-500);
  background: rgba(20,184,166,0.1);
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-pill);
}
.tag.learn { color: var(--indigo-600); background: rgba(79,70,229,0.1); }
.tag.exam { color: #b45309; background: rgba(245,158,11,0.12); }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; counter-reset: step; }
.step { position: relative; padding: 1.4rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.step .num {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; color: #fff; background: var(--grad-brand);
  margin-bottom: 0.9rem; box-shadow: var(--sh-primary);
}
.step h3 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.step p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

/* ---------- Split (preview) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.checklist { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 0.8rem; }
.checklist li { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--slate-600); }
.checklist svg { width: 22px; height: 22px; color: var(--teal-500); flex: none; margin-top: 1px; }
.checklist b { color: var(--ink-900); font-weight: 650; }

/* ---------- Trial band ---------- */
.band {
  position: relative;
  overflow: hidden;
  background: var(--grad-ink);
  color: #e7ecf7;
  border-radius: var(--r-xl);
  padding: clamp(2.2rem, 5vw, 3.6rem);
  box-shadow: var(--sh-lg);
}
.band h2 { color: #fff; }
.band .lead { color: #b9c4dd; }
.band::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 240px at 90% 10%, rgba(45,212,191,0.22), transparent 60%),
    radial-gradient(500px 240px at 10% 110%, rgba(99,102,241,0.28), transparent 60%);
  pointer-events: none;
}
.band-inner { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; justify-content: space-between; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; max-width: 760px; margin-inline: auto; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 1.9rem; box-shadow: var(--sh-sm); position: relative; }
.plan.featured { border-color: var(--indigo-500); box-shadow: var(--sh-md); }
.plan .ribbon { position: absolute; top: 1.2rem; right: 1.2rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--indigo-600); background: rgba(79,70,229,0.1); padding: 0.28rem 0.6rem; border-radius: var(--r-pill); }
.plan .price { font-size: var(--step-2); font-weight: 800; color: var(--ink-900); letter-spacing: -0.03em; margin: 0.4rem 0 0.2rem; }
.plan .price small { font-size: 0.9rem; color: var(--slate-500); font-weight: 600; }
.soon { color: var(--slate-500); font-weight: 600; }

/* ---------- Mobile app store ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 1rem; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--r-md);
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--ink-700);
  position: relative;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.store-btn[aria-disabled="true"] { opacity: 0.62; cursor: default; }
.store-btn:not([aria-disabled="true"]):hover { transform: translateY(-2px); }
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn .st-top { font-size: 0.68rem; opacity: 0.8; display: block; line-height: 1.1; }
.store-btn .st-main { font-size: 1.02rem; font-weight: 700; display: block; line-height: 1.15; }
.store-btn .soon-pill { position: absolute; top: -9px; right: -6px; background: var(--teal-500); color: #04201c; font-size: 0.64rem; font-weight: 800; padding: 0.14rem 0.45rem; border-radius: var(--r-pill); letter-spacing: 0.03em; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin-inline: auto; display: grid; gap: 0.8rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 1.2rem;
  box-shadow: var(--sh-sm);
  transition: border-color 0.2s ease;
}
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  list-style: none;
  cursor: pointer;
  font-weight: 650;
  color: var(--ink-900);
  padding: 1.1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { width: 20px; height: 20px; color: var(--slate-500); transition: transform 0.2s ease; flex: none; }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq .ans { padding: 0 0 1.1rem; color: var(--text-muted); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-900); color: #aeb8cf; padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer a { color: #aeb8cf; font-weight: 500; display: block; padding: 0.32rem 0; }
.site-footer a:hover { color: #fff; }
.footer-brand .brand { color: #fff; margin-bottom: 0.8rem; }
.footer-brand .brand b { color: var(--teal-400); }
.footer-brand p { color: #8b97b3; font-size: 0.92rem; max-width: 34ch; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-top: 2.5rem; padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.85rem; color: #8b97b3; }
.disclaimer { max-width: 70ch; }

/* ---------- Mobile nav drawer ---------- */
/* Visibility is controlled by the [hidden] attribute (toggled in app.js); the
   base rule must NOT force display:none or the menu could never open. */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu .scrim { position: absolute; inset: 0; background: rgba(11,18,32,0.5); backdrop-filter: blur(2px); }
.mobile-menu .panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(84vw, 340px);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  padding: 1.2rem;
  display: flex; flex-direction: column; gap: 0.3rem;
  transform: translateX(8px);
}
.mobile-menu .panel a { padding: 0.85rem 0.7rem; border-radius: var(--r-md); color: var(--ink-800); font-weight: 600; }
.mobile-menu .panel a:hover { background: var(--slate-100); }
.mobile-menu .panel .btn { margin-top: 0.5rem; }
.mobile-menu .close { align-self: flex-end; width: 44px; height: 44px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); cursor: pointer; display: grid; place-items: center; }
.mobile-menu .close svg { width: 22px; height: 22px; stroke: var(--ink-800); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Legal/simple pages ---------- */
.doc { max-width: 780px; margin-inline: auto; }
.doc h1 { font-size: var(--step-3); }
.doc h2 { font-size: var(--step-1); margin-top: 2rem; }
.doc p, .doc li { color: var(--slate-600); }
.doc .note { background: var(--paper-2); border: 1px solid var(--border); border-left: 4px solid var(--indigo-500); border-radius: var(--r-md); padding: 1rem 1.2rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 560px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
}
@media (max-width: 860px) {
  .nav-links, .nav-actions { display: none; }
  .nav-toggle { display: inline-flex; }
  .grid-features { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split .split-media { order: -1; }
  .valuebar-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
  .plans { grid-template-columns: 1fr; }
  .band-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .stores .store-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
