/* ============================================================================
   MrMEnglish — shared stylesheet (one source of truth for every page)
   Direction: warm & premium — soft depth, purple-tinted shadows, gentle motion.
   100% static, Iran-safe: self-hosted Vazirmatn, no foreign calls.
   ============================================================================ */

/* ---- self-hosted Vazirmatn (400 / 500 / 700) ---- */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
}

:root {
  /* accent (purple) */
  --accent: #6D28D9;
  --accent-dark: #5B21B6;
  --accent-tint: #F5F3FF;
  --accent-tint-2: #EDE9FE;
  /* neutrals */
  --ink: #1F2937;
  --muted: #6B7280;
  --surface: #FFFFFF;
  --soft: #F9FAFB;
  --border: #E5E7EB;
  /* spacing scale (4/8 base) */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px;
  /* rounding */
  --radius: 16px;
  --radius-btn: 12px;
  /* soft elevation system (purple-tinted = "premium") */
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, .06);
  --shadow-md: 0 4px 16px rgba(109, 40, 217, .10);
  --shadow-lg: 0 12px 32px rgba(109, 40, 217, .14);
  /* gradients */
  --grad-purple: linear-gradient(180deg, #6D28D9 0%, #5B21B6 100%);
}

* { box-sizing: border-box; }
/* prevent author CSS from overriding the hidden attribute on mobile */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 { font-weight: 700; line-height: 1.3; margin: 0 0 var(--s2); color: var(--ink); }
h1 { font-size: 32px; letter-spacing: -.01em; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
p { margin: 0 0 var(--s2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* keyboard focus — branded ring instead of the default UA outline
   (the outline follows each element's own border-radius) */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
img { max-width: 100%; }
code { font-family: 'Vazirmatn', monospace; }

.container { max-width: 980px; margin: 0 auto; padding: 0 var(--s3); }
.container.narrow { max-width: 720px; }

.lead { font-size: 18px; color: var(--ink); }
.subline { color: var(--muted); font-size: 17px; }
.muted { color: var(--muted); }
.muted-note { font-size: 14px; color: var(--muted); }
.more-link { margin-top: var(--s3); font-weight: 500; }
.soon { color: var(--muted); font-size: 16px; font-weight: 500; }

/* ---- skip link (visible only while focused) ---- */
.skip-link {
  position: fixed; top: var(--s1); inset-inline-start: var(--s1); z-index: 100;
  background: var(--accent-dark); color: #fff; font-weight: 500;
  padding: 10px 18px; border-radius: var(--radius-btn); box-shadow: var(--shadow-lg);
  transform: translateY(calc(-100% - var(--s2)));
}
.skip-link:focus { transform: none; }
.skip-link:hover { text-decoration: none; }

/* ---- header / tab nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 62px; gap: var(--s3);
}
.brand { display: flex; align-items: center; }
.brand img { display: block; }
.tabs { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.tabs a {
  display: block; padding: 7px 13px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 15px;
  transition: background .18s ease, color .18s ease;
}
.tabs a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--accent); background: var(--accent-tint); }

/* hamburger toggle — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 10px; margin: 0;
  background: transparent; border: 0; border-radius: 10px; cursor: pointer;
}
.nav-toggle:hover { background: var(--soft); }
.nav-toggle span {
  display: block; width: 100%; height: 2px; border-radius: 2px; background: var(--ink);
  transition: transform .22s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- buttons ---- */
.btn {
  display: inline-block; padding: 12px 24px; border-radius: var(--radius-btn);
  font-weight: 500; font-size: 16px; cursor: pointer; border: 1.5px solid transparent;
  font-family: inherit; line-height: 1.4;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn + .btn { margin-inline-start: var(--s2); }
.btn-primary { background: var(--grad-purple); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); text-decoration: none; color: #fff; }
.btn-soft { background: var(--accent-tint); color: var(--accent); }
.btn-soft:hover { background: var(--accent-tint-2); text-decoration: none; transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-tint); text-decoration: none; }

/* ---- sections + rhythm ---- */
section { padding: var(--s8) 0; }
/* anchored sections (e.g. #form) must clear the sticky header when jumped to */
section[id] { scroll-margin-top: 76px; }
section.soft { background: var(--soft); }
section.tint { background: var(--accent-tint); }
.section-label {
  color: var(--accent); font-weight: 500; font-size: 14px;
  letter-spacing: .06em; margin-bottom: var(--s1);
}

/* ---- hero (split + ringed photo) ---- */
.hero { padding: var(--s8) 0 var(--s6); position: relative; overflow: hidden; }
.hero .container { display: flex; gap: var(--s8); align-items: center; flex-wrap: wrap; }
.hero-text { flex: 1 1 340px; }
.hero.hero-narrow .container { display: block; }
.hero.hero-narrow .hero-text { max-width: 760px; }
.hero.hero-narrow { padding-bottom: var(--s2); }
.hero-name { color: var(--accent); font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.hero h1 { font-size: 38px; line-height: 1.22; }
.hero .lead { margin-top: var(--s2); }
.hero .subline { margin-top: var(--s2); }
.hero .btn-primary { margin-top: var(--s3); }

/* ringed photo */
.photo-wrap { flex: 0 0 280px; position: relative; width: 280px; height: 280px; margin: 0 auto; }
.photo-glow {
  position: absolute; inset: -10% -8% -4% -8%;
  background: radial-gradient(closest-side, rgba(109, 40, 217, .22), rgba(109, 40, 217, 0) 70%);
  filter: blur(6px); z-index: 0; border-radius: 44px;
}
.photo {
  position: relative; z-index: 1;
  width: 230px; height: 230px; margin: 25px auto 0;
  border-radius: 32px; overflow: hidden;
  background: var(--accent-tint);
  box-shadow: var(--shadow-lg), 0 0 0 6px #fff, 0 0 0 8px var(--accent-tint-2);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kw {
  position: absolute; z-index: 2; background: #fff; border: 1.5px solid var(--accent);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 500;
  color: var(--ink); white-space: nowrap; box-shadow: var(--shadow-sm);
}
/* staggered around the square's edges — top-right, left, right, bottom-left */
.kw-1 { top: 6px; right: 26px; }
.kw-2 { top: 56px; left: -30px; }
.kw-3 { bottom: 56px; right: -30px; }
.kw-4 { bottom: 6px; left: 26px; }

/* ---- trust strip / stats ---- */
.trust { display: flex; gap: var(--s3); flex-wrap: wrap; }
.trust .stat {
  flex: 1 1 150px; text-align: center; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s3) var(--s2); box-shadow: var(--shadow-sm);
}
.trust .num { font-size: 32px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.trust .lbl { color: var(--muted); font-size: 14px; }

/* ---- cards (shared) ---- */
.cards { display: flex; gap: var(--s3); flex-wrap: wrap; }
.card {
  flex: 1 1 250px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s3); box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card h3 { margin-bottom: var(--s1); }
.card p { color: var(--muted); font-size: 15px; }

/* offering cards (home) — clickable, with icon */
a.offer-card { display: flex; flex-direction: column; color: inherit; }
a.offer-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--accent-tint);
  color: var(--accent); display: grid; place-items: center; margin-bottom: var(--s2);
}
.card-icon svg { width: 24px; height: 24px; }
.card-link { color: var(--accent); font-weight: 500; margin-top: auto; padding-top: var(--s2); }

.focus-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---- promo / course card ---- */
.courses-grid { padding-top: 0; }
.course-card { display: flex; flex-direction: column; gap: var(--s1); }
.course-card > .btn { display: block; text-align: center; margin-top: var(--s2); }
.badge {
  display: inline-block; background: var(--accent-tint); color: var(--accent);
  font-weight: 700; font-size: 13px; padding: 4px 12px; border-radius: 999px;
  align-self: flex-start; margin-bottom: var(--s1);
}
.badge-promo { background: var(--grad-purple); color: #fff; }
.badge-bestseller {
  background: var(--accent-tint); color: var(--accent);
  font-size: 11px; padding: 2px 8px;
  vertical-align: middle; margin-bottom: 0; margin-inline-start: 6px;
}
.course-price { color: var(--muted); font-size: 15px; }
.promo {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  background: var(--accent-tint); border: 1px dashed var(--accent);
  border-radius: var(--radius-btn); padding: 10px var(--s2); margin: var(--s1) 0;
}
.promo-code { font-size: 19px; font-weight: 700; color: var(--accent-dark); letter-spacing: 1px; }
.copy-btn { font-size: 13px; padding: 7px 14px; }
.copy-btn.copied { background: var(--accent); color: #fff; }
.course-video { margin-top: var(--s1); }
.course-desc p {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 0;
}
.course-desc.expanded p { display: block; overflow: visible; }
.read-more-btn {
  background: none; border: none; padding: 0; margin-top: 2px;
  color: var(--accent); cursor: pointer; font-size: 13px;
  font-family: inherit; font-weight: 500;
}
.read-more-btn:hover { text-decoration: underline; }
.course-desc.expanded .read-more-btn { display: none; }

/* ---- pricing ---- */
.pricing .price-card { display: flex; flex-direction: column; }
.price-card.featured {
  border-color: var(--accent); box-shadow: var(--shadow-md);
  position: relative;
}
.price { font-size: 28px; font-weight: 700; color: var(--accent); margin: var(--s1) 0; }
.price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.price-card .btn { margin-top: auto; text-align: center; }
.section-cta { text-align: center; margin-top: var(--s3); }
.per-session { color: var(--muted); font-size: 14px; }

/* ---- social-proof trio ---- */
/* Compact, flat pills: one calm visual language across all three rows so a
   large number of items (countries / roles / companies) stays light, not busy. */
.proof-block { margin-top: var(--s3); }
.proof-block h3 { color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.chips, .flags { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .flag {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  flex: 1 1 auto;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 11px; font-size: 13px; color: var(--ink);
}
.chip-icon { width: 15px; height: 15px; flex: none; line-height: 0; color: var(--accent); }
.chip-icon svg { width: 100%; height: 100%; display: block; }
.flag-swatch {
  width: 19px; height: 13px; flex: none; line-height: 0; border-radius: 2px;
  overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}
.flag-swatch svg { width: 100%; height: 100%; display: block; }

/* standalone logo wall (e.g. narration «همکاری‌ها») keeps its boxed treatment */
.logowall { display: flex; flex-wrap: wrap; gap: var(--s2); }
.logo-box {
  min-width: 116px; height: 56px; padding: 0 20px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-btn);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.logo-box .wordmark {
  font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  color: var(--ink); white-space: nowrap;
}
/* …but inside the students trio, companies render as the same compact pills,
   wrapping naturally and growing to fill the row (≈3 per row on a phone). */
.proof-block .logowall { gap: 6px; }
.proof-block .logo-box {
  min-width: 0; height: auto; padding: 4px 11px;
  flex: 1 1 auto;
  border-radius: 999px; box-shadow: none;
}
.proof-block .logo-box .wordmark { font-weight: 700; font-size: 13px; letter-spacing: 0; }
/* «از شرکت‌های» — on desktop, split the pills into two roughly-equal rows that
   each grow to fill the width (counts are balanced by the generator). */
.proof-block .logowall-split { flex-direction: column; }
.proof-block .logowall-row { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 760px) {
  /* on phones, flatten back to one continuous wrap (≈3 per row) */
  .proof-block .logowall-split { flex-direction: row; flex-wrap: wrap; }
  .proof-block .logowall-row { display: contents; }
}

/* ---- reviews carousel ---- */
.reviews-carousel { position: relative; }
.reviews {
  display: flex; align-items: stretch; gap: var(--s3);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 2px;
  padding-block-end: var(--s1);
  scrollbar-width: thin; scrollbar-color: var(--accent-tint-2) transparent;
}
.reviews::-webkit-scrollbar { height: 6px; }
.reviews::-webkit-scrollbar-track { background: transparent; }
.reviews::-webkit-scrollbar-thumb { background: var(--accent-tint-2); border-radius: 999px; }
.reviews:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.review {
  flex: 0 0 86%; scroll-snap-align: start; min-width: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s3); margin: 0; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: var(--s2);
}
.review blockquote { margin: 0; font-style: normal; color: var(--ink); }
.review .who { margin-top: auto; color: var(--accent); font-weight: 700; font-size: 14px; }

/* nav arrows are injected by app.js (progressive enhancement) */
.rev-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  background: #fff; color: var(--accent); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); cursor: pointer; font-size: 22px; line-height: 1;
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.rev-nav:hover { background: var(--accent); color: #fff; }
.rev-nav[disabled] { opacity: 0; pointer-events: none; }
.rev-prev { inset-inline-start: -18px; }
.rev-next { inset-inline-end: -18px; }

@media (min-width: 760px) {
  .review { flex-basis: calc((100% - 2 * var(--s3)) / 3); }
}
@media (max-width: 760px) {
  .rev-nav { display: none; }
}

/* ---- form embed ---- */
.form-embed {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); min-height: 320px;
}
.form-embed iframe { width: 100%; height: 480px; border: 0; display: block; }
.form-embed.placeholder {
  border: 2px dashed var(--border); display: grid; place-items: center; padding: var(--s6) var(--s3);
}
.form-embed .ph-inner { text-align: center; display: flex; flex-direction: column; gap: var(--s1); color: var(--muted); }
.form-embed .ph-inner strong { color: var(--ink); font-size: 18px; }
.form-note { margin-top: var(--s2); color: var(--muted); font-size: 14px; }
.form-alt { margin-top: var(--s1); font-size: 14px; }
.form-alt a { color: var(--accent); font-weight: 600; }
/* the lead-form section is sized by app.js to fit the viewport (title → Bale link);
   trim its vertical padding so the whole section clears the fold on common heights */
#form { padding-block: var(--s6); }

/* ---- aparat embeds (lazy facade) ---- */
.embed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.embed.video {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--accent-tint); position: relative;
}
.embed.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.aparat-facade {
  display: grid; place-items: center; cursor: pointer; border: 1px solid var(--border);
  color: var(--accent); gap: var(--s1); transition: box-shadow .18s ease;
}
.aparat-facade:hover { box-shadow: var(--shadow-md); }
.aparat-facade .play-badge {
  width: 56px; height: 56px; border-radius: 50%; background: var(--grad-purple); color: #fff;
  display: grid; place-items: center; font-size: 20px; box-shadow: var(--shadow-md);
}
.aparat-facade .facade-label { font-size: 14px; font-weight: 500; }
.embed.video.placeholder { display: grid; place-items: center; color: var(--muted); border: 2px dashed var(--border); }
@keyframes skel-shimmer { to { background-position: -200% 0; } }
.video-skeleton { position: absolute; inset: 0; background: linear-gradient(90deg, #C4B5FD 25%, #A78BFA 50%, #C4B5FD 75%); background-size: 200% 100%; animation: skel-shimmer 1.4s linear infinite; }

/* ---- blog list ---- */
section.posts-section { padding-top: var(--s3); }
.posts { display: flex; flex-direction: column; gap: var(--s2); }
a.post {
  display: block; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s3); color: inherit; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
a.post:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.post h3 { margin-bottom: 4px; }
.post .meta { color: var(--muted); font-size: 13px; }
.post p { color: var(--muted); font-size: 15px; margin: var(--s1) 0 0; }

/* ---- blog article ---- */
.post-article { padding: var(--s8) 0; }
.post-eyebrow { color: var(--accent); font-weight: 500; font-size: 14px; letter-spacing: .06em; margin-bottom: var(--s1); }
.post-article h1 { font-size: 34px; line-height: 1.25; }
.post-meta { color: var(--muted); font-size: 14px; margin-bottom: var(--s4); }
.post-body { font-size: 17px; }
.post-body h2 { font-size: 24px; margin-top: var(--s6); }
.post-body h3 { font-size: 20px; margin-top: var(--s4); }
.post-body ul, .post-body ol { padding-inline-start: var(--s3); margin: 0 0 var(--s2); }
.post-body li { margin-bottom: var(--s1); }
.post-body blockquote {
  margin: var(--s3) 0; padding: var(--s2) var(--s3); background: var(--accent-tint);
  border-inline-start: 3px solid var(--accent); border-radius: 8px; color: var(--ink);
}
.post-body code { background: var(--soft); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .92em; direction: ltr; unicode-bidi: isolate; }
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }
.post-cta {
  margin-top: var(--s8); padding: var(--s4); background: var(--accent-tint);
  border-radius: var(--radius); text-align: center; box-shadow: var(--shadow-sm);
}
.post-cta h3 { margin-bottom: var(--s1); }
.post-cta p { color: var(--muted); }
.post-cta .btn { margin-top: var(--s2); }
/* lighter sibling of .post-cta — the low-commitment Bale join, sits above it */
.post-bale {
  margin-top: var(--s8); padding: var(--s4); background: var(--soft);
  border: 1px solid var(--border); border-radius: var(--radius); text-align: center;
}
.post-bale + .post-cta { margin-top: var(--s4); }
.post-bale h3 { margin-bottom: var(--s1); }
.post-bale p { color: var(--muted); }
.post-bale .btn { margin-top: var(--s2); }

/* ---- footer ---- */
.site-footer {
  background: var(--soft); border-top: 1px solid var(--border);
  color: var(--muted); padding: var(--s8) 0 var(--s4); margin-top: auto;
}
.foot-grid {
  display: grid; grid-template-columns: 1fr auto;
  gap: var(--s6); align-items: start;
}
.foot-brand { max-width: 520px; }
.foot-brand img { display: block; margin-bottom: var(--s2); }
.foot-tagline { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0; }
.foot-title { display: block; color: var(--ink); font-weight: 700; font-size: 14px; margin-bottom: var(--s2); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.foot-col a { color: var(--muted); font-size: 15px; transition: color .18s ease; }
.foot-col a:hover { color: var(--accent); text-decoration: none; }
.foot-social a { display: inline-flex; align-items: center; gap: 8px; }
.foot-social img { width: 20px; height: 20px; display: block; flex: none; }
.foot-bottom {
  margin-top: var(--s6); padding-top: var(--s4);
  border-top: 1px solid var(--border); text-align: center;
}
.copyright { color: var(--muted); font-size: 13px; margin: 0; }

/* ---- fixed mobile CTA (always visible on mobile; replaces the hero CTA) ---- */
.mobile-cta {
  position: fixed; z-index: 60; display: none;
  left: var(--s3); right: var(--s3);
  bottom: calc(var(--s2) + env(safe-area-inset-bottom, 0px));
  background: var(--grad-purple); padding: 14px var(--s3);
  border-radius: var(--radius-btn); box-shadow: var(--shadow-lg);
  transition: opacity .25s ease, transform .25s ease;
}
.mobile-cta a { display: block; text-align: center; color: #fff; font-weight: 700; }
.mobile-cta a:hover { text-decoration: none; }
/* slid out of view once the form's subtitle scrolls past — JS toggles this */
.mobile-cta.is-hidden { opacity: 0; transform: translateY(150%); pointer-events: none; }

/* ---- reveal-on-scroll motion ---- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, a.post, a.offer-card { transition: none; }
  .site-header nav, .nav-toggle span { transition: none; }
  .mobile-cta { transition: none; }
}

/* ---- responsive ---- */
@media (min-width: 760px) {
  h1 { font-size: 36px; }
  .hero h1 { font-size: 42px; }
}
@media (max-width: 760px) {
  section { padding: var(--s6) 0; }
  .site-header .container { min-height: 56px; flex-direction: row-reverse; }
  .nav-toggle { display: flex; }
  /* nav collapses into a dropdown panel under the header */
  .site-header nav {
    position: absolute; top: 100%; inset-inline: 0;
    background: #fff;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
    overflow: hidden; max-height: 0; opacity: 0; pointer-events: none;
    transition: max-height .28s ease, opacity .2s ease;
  }
  .site-header nav.open { max-height: 300px; opacity: 1; pointer-events: auto; }
  .tabs { flex-direction: column; gap: 2px; padding: var(--s2) var(--s3) var(--s3); }
  /* touch-action eliminates the 300ms tap delay browsers add on mobile */
  .tabs a { display: block; padding: 12px var(--s2); font-size: 16px; touch-action: manipulation; }
  .hero { padding-top: var(--s6); }
  .hero h1 { font-size: 30px; }
  /* the hero CTA + in-section CTAs are hidden on mobile; the fixed .mobile-cta bar replaces them */
  .hero .btn-primary { display: none; }
  .section-cta { display: none; }
  /* stack the home hero as: name -> headline -> photo.
     display:contents dissolves .hero-text so its children share the flex
     column with the photo, letting us order all three. */
  .hero:not(.hero-narrow) .container { flex-direction: column; align-items: stretch; gap: 0; }
  .hero:not(.hero-narrow) .hero-text { display: contents; }
  .hero:not(.hero-narrow) .hero-name { order: 1; }
  .hero:not(.hero-narrow) h1 { order: 2; }
  .hero:not(.hero-narrow) .lead { order: 3; }
  .hero:not(.hero-narrow) .photo-wrap { order: 4; }
  .embed-grid { grid-template-columns: 1fr; }
  .mobile-cta { display: block; }
  .foot-grid { grid-template-columns: 1fr; gap: var(--s4); }
  /* footer reserves the fixed CTA bar's clearance itself (in its own bg)
     so the last links clear the bar without a white strip below the footer */
  .site-footer { padding-top: var(--s6); padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
