/* ─────────────────────────────────────────────────────────────────────────────
 * marketing.css — shared component layer for the PUBLIC pages only
 * (index.html, coach-profile.html, privacy.html, terms.html).
 *
 * Sits on top of theme.css (the token layer). The three CoachDesk apps do NOT
 * load this file, so nothing here can regress them. Page-unique layout — and
 * coach-profile.html's JS-coupled component classes — stay in each page's own
 * <style> block. Load order per page: theme.css → marketing.css → page <style>.
 * ────────────────────────────────────────────────────────────────────────── */

/* ── Reset + base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Visible keyboard focus everywhere. */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

/* Skip-to-content — visually hidden until focused. */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  transform: translateY(-160%);
  background: var(--primary); color: #fff;
  padding: 10px 16px; border-radius: 10px;
  font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-md);
  transition: transform .18s ease;
}
.skip-link:focus-visible { transform: translateY(0); text-decoration: none; outline-offset: 4px; }

/* ── Layout container ────────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-6); }
.container--narrow { max-width: 760px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 44px; padding: 0 var(--space-5);
  border-radius: 10px; border: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-800));
  color: #fff;
  box-shadow: 0 6px 18px rgba(108,99,255,.32);
}
.btn--primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn--ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn--lg { height: 52px; padding: 0 var(--space-8); font-size: 15px; border-radius: 12px; }
.btn--block { width: 100%; }

/* ── Nav (landing) ───────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.nav.is-scrolled {
  border-bottom-color: rgba(229,231,235,.8);
  box-shadow: 0 6px 24px rgba(15,16,36,.06);
  background: rgba(255,255,255,.88);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: var(--space-4); }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand__link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__wordmark { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -.02em; color: var(--brand-navy); white-space: nowrap; display: inline-block; }
.brand__wordmark .x { color: var(--primary); }
.brand__tagline { margin-left: 12px; font-size: 14px; font-style: italic; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__sep { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
.nav__link { color: var(--text); font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.nav__link:hover { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.nav__anchor { color: var(--text-muted); }

/* Hamburger toggle — desktop-hidden, shown ≤940px. */
.nav__toggle {
  display: none;
  width: 44px; height: 44px; flex: 0 0 auto;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; color: var(--text);
}
.nav__toggle:hover { border-color: var(--primary); color: var(--primary-dark); }
.nav__toggle svg { width: 22px; height: 22px; display: block; }

/* ── Mobile drawer ───────────────────────────────────────────────────────── */
.nav__drawer {
  position: fixed; inset: 0; z-index: 100;
  visibility: hidden; opacity: 0;
  transition: opacity .2s ease, visibility .2s ease;
}
.nav__drawer.is-open { visibility: visible; opacity: 1; }
.nav__drawer-backdrop { position: absolute; inset: 0; background: rgba(15,16,36,.42); backdrop-filter: blur(2px); }
.nav__drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(320px, 86vw);
  background: var(--card);
  box-shadow: -12px 0 40px rgba(15,16,36,.18);
  padding: var(--space-5) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--space-2);
  transform: translateX(100%);
  transition: transform .24s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.nav__drawer.is-open .nav__drawer-panel { transform: none; }
.nav__drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.nav__drawer-close {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 10px; cursor: pointer; color: var(--text-muted);
  font-size: 22px; line-height: 1;
}
.nav__drawer-close:hover { background: var(--primary-light); color: var(--primary-dark); }
.nav__drawer-panel .nav__link { font-size: 16px; padding: 12px 14px; color: var(--text); }
.nav__drawer-sep { height: 1px; background: var(--border); margin: var(--space-2) 0; }
.nav__drawer-panel .btn { margin-top: var(--space-2); }

/* ── Footer (shared: landing + legal) ────────────────────────────────────── */
.footer { background: var(--footer-bg); color: rgba(255,255,255,.78); padding: var(--space-16) 0 var(--space-8); }
.footer__grid { display: grid; gap: var(--space-8); grid-template-columns: 1.4fr 1fr 1fr 1fr; margin-bottom: var(--space-10); }
.footer__brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer__wordmark { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: -.02em; color: #fff; white-space: nowrap; display: inline-block; }
.footer__wordmark .x { color: var(--primary); }
.footer__motto { color: var(--on-dark); font-style: italic; font-weight: 500; font-size: 14px; margin: 0 0 10px; }
.footer__tag { color: rgba(255,255,255,.6); font-size: 14px; max-width: 320px; margin: 0; }
.footer__col h5 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.5); margin: 0 0 16px; font-weight: 700; }
.footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer__col a { color: rgba(255,255,255,.78); font-size: 14px; }
.footer__col a:hover { color: #fff; text-decoration: none; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: var(--space-6); font-size: 13px; color: rgba(255,255,255,.5); display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

/* ── Legal-page primitives (privacy + terms) ─────────────────────────────── */
.topbar { padding-top: var(--space-6); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; }
.back-link:hover { color: var(--primary-dark); }
.brand-lockup {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 520px; margin: 8px auto 0; padding: 36px 40px;
  background: var(--primary-light); border-radius: 16px; text-decoration: none;
}
.brand-lockup:hover { text-decoration: none; }
.brand-lockup__row { display: inline-flex; align-items: center; gap: 12px; }
.brand-lockup__logo { height: clamp(36px, 8vw, 48px); width: auto; display: block; }
.brand-lockup__motto { font-style: italic; font-weight: 500; font-size: 16px; color: var(--text-muted); }
.legal-head { padding: 28px 0 24px; text-align: center; }
.legal-head h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 10px; }
.legal-head .meta { color: var(--text-muted); font-size: 14px; }
.disclaimer {
  background: var(--warning-light); border: 1px solid #f3d8b3; color: #6b3d09;
  padding: 16px 18px; border-radius: var(--radius); margin: 24px 0 40px; font-size: 14.5px;
}
.disclaimer strong { color: var(--warning); }
article { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 40px; margin-bottom: 64px; box-shadow: var(--shadow); }
article h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 36px 0 12px; padding-top: 8px; }
article h2:first-child { margin-top: 0; }
article h3 { font-size: 17px; font-weight: 700; margin: 24px 0 8px; }
article p { margin: 0 0 14px; color: var(--text); line-height: 1.65; }
article ul { margin: 0 0 16px; padding-left: 20px; }
article li { margin-bottom: 6px; line-height: 1.65; }
article strong { color: var(--text); }
.toc { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 32px; }
.toc h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); margin: 0 0 12px; }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { margin-bottom: 4px; font-size: 14.5px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 940px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
}
@media (max-width: 780px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .footer__brand-col { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .container { padding: 0 18px; }
  article { padding: 24px; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip-link, .nav__drawer, .nav__drawer-panel { transition: none; }
}
