/*
  CORE styles — shared by every funnel. Do not edit inside a funnel folder;
  edit core/ and run scripts/sync-core.sh so every funnel gets the change.
  Colours and fonts come from brand.css (loaded before this file).
  Page-specific styles come from layout.css (loaded after this file).
*/

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.7;
  font-optical-sizing: auto;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--link, var(--signal)); text-underline-offset: 0.18em; }

:focus-visible {
  outline: 3px solid var(--link, var(--signal));
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 0.5rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 50; }

/* ---------- Header: logo only ---------- */

.site-header {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 0;
}
.logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

/* ---------- Main column ---------- */

main {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 4rem;
}

h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; }
h1 { font-weight: 800; font-size: clamp(2.1rem, 6vw, 3.2rem); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-weight: 750; font-size: clamp(1.4rem, 3.6vw, 1.75rem); line-height: 1.15; letter-spacing: -0.01em; margin-top: 3rem; text-wrap: balance; }
h3 { font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
p { margin: 1rem 0 0; }

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--signal-ink);
  background: var(--signal);
  border: 0;
  border-radius: var(--radius, 6px);
  padding: 1rem 1.4rem;
  cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button.full { display: block; width: 100%; }
.button.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

.disclosure { margin-top: 2.5rem; font-size: 0.85rem; line-height: 1.55; color: var(--muted); }

/* ---------- Legal pages ---------- */

.legal h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.legal h2 { font-size: 1.25rem; margin-top: 2.25rem; }
.legal p, .legal li { font-size: 1rem; line-height: 1.65; }
.legal .updated { color: var(--muted); font-size: 0.9rem; }
.legal table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--rule); }
.legal th { font-family: var(--display); font-weight: 700; }
.legal .table-wrap { overflow-x: auto; }
.legal .table-wrap table { min-width: 34rem; }
.legal .draft-note + h1 { margin-top: 1.5rem; }

/* Legal drafts: delete this line from each legal page once reviewed */
.draft-note {
  background: var(--slip, #fff6cc);
  border-left: 4px solid var(--no, #a8392d);
  padding: 0.75rem 1rem;
  font-family: var(--display);
  font-size: 0.95rem;
}
.draft-note, .legal .draft-note { color: #1a1a1a; } /* always dark text on the light note; beats a skin's .skin p colour */

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 6.5rem;
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.site-footer a, .site-footer button {
  color: var(--muted);
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.site-footer p { margin-top: 0.75rem; }

/* ---------- Cookie banner (strict opt-in) ---------- */

.consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: var(--banner-bg, var(--ink));
  color: var(--banner-ink, var(--paper));
  font-family: var(--display);
  padding: 1rem var(--gutter);
}
.consent[hidden] { display: none; }
.consent-inner { max-width: 52rem; margin: 0 auto; display: grid; gap: 0.9rem; }
@media (min-width: 48rem) {
  .consent-inner { grid-template-columns: 1fr auto; align-items: center; }
}
.consent p { margin: 0; font-size: 0.92rem; line-height: 1.5; }
.consent a { color: var(--banner-ink, var(--paper)); }
.consent-actions { display: flex; gap: 0.6rem; }
.consent-actions button {
  flex: 1 1 0;
  min-width: 7.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1.5px solid var(--banner-ink, var(--paper));
  background: transparent;
  color: var(--banner-ink, var(--paper));
}
/* Accept and Decline carry equal weight on purpose (consent must be a free choice) */
.consent-actions button[data-consent="accept"] { background: var(--banner-ink, var(--paper)); color: var(--banner-bg, var(--ink)); }
/* A skin can restyle the banner with --banner-bg / --banner-ink in its brand.css */

/* ---------- Sticky CTA bar (sticky-cta.js): floats at the bottom like the cookie banner, never at the same time ---------- */

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 39; /* the cookie banner is 40 */
  background: var(--paper); border-top: 1px solid var(--rule);
  padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(110%); transition: transform 0.25s ease;
}
.sticky-cta.is-visible { transform: none; }
.sticky-cta-inner { max-width: 45rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.sticky-cta-label { display: flex; align-items: center; gap: 0.6rem; min-width: 0; font-family: var(--display); font-size: 0.85rem; line-height: 1.2; }
.sticky-cta-label b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-cta-thumb { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 6px; overflow: hidden; }
.sticky-cta-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sticky-cta-thumb.ph { min-height: 0; padding: 0; font-size: 0.55rem; }
.sticky-cta .button { flex: none; display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.8rem 1.3rem; font-size: 0.9rem; white-space: nowrap; }
@media (max-width: 22rem) { .sticky-cta-label b { display: none; } }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Opt-in form (lead-form.js): name, email, optional phone + SMS consent */
.lead-form { display: grid; gap: 0.6rem; margin-top: 1rem; }
.lead-form label.field { display: grid; gap: 0.3rem; font-family: var(--display); font-size: 0.85rem; font-weight: 600; }
.lead-form label.field span.opt { font-weight: 400; color: var(--muted); }
.lead-form input[type="text"], .lead-form input[type="email"], .lead-form input[type="tel"] {
  font: inherit; font-family: var(--display); font-size: 1rem; font-weight: 400;
  padding: 0.85rem 0.9rem; border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--field, #fff); color: var(--ink); width: 100%;
}
.lead-form input:focus-visible { outline: 3px solid var(--signal); outline-offset: 1px; }
.lead-form .check { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.85rem; line-height: 1.45; color: var(--muted); }
.lead-form .check input { margin-top: 0.2rem; width: 1.05rem; height: 1.05rem; flex: none; accent-color: var(--ink); }
.lead-form button {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem; cursor: pointer;
  color: var(--signal-ink); background: var(--signal);
  border: 0; border-radius: var(--radius); padding: 1rem 1.4rem;
}
.lead-form button:disabled { opacity: 0.7; cursor: progress; }
.lead-form .form-error { color: #b42318; font-size: 0.9rem; font-weight: 600; }

/* ---------- Motion kit (motion.js): reveal on scroll, count-up, marquee, reading progress ----------
   Only active when motion.js adds .motion to <html> (never when JS is off or the visitor prefers less motion).
   Skins can tune: --motion-distance (default 18px) and --motion-duration (default .65s). */

.motion [data-reveal] {
  opacity: 0;
  transform: translateY(var(--motion-distance, 18px));
  transition: opacity var(--motion-duration, 0.65s) cubic-bezier(.2, .7, .2, 1), transform var(--motion-duration, 0.65s) cubic-bezier(.2, .7, .2, 1);
  will-change: opacity, transform;
}
.motion [data-reveal].in { opacity: 1; transform: none; }
.motion .button { transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
.motion .button:hover { transform: translateY(-2px); }
.motion .button:active { transform: translateY(0); }

/* Marquee: a list with data-marquee scrolls sideways (cards keep their own width) */
.is-marquee { display: block !important; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; gap: 1rem; width: max-content; animation: marquee 40s linear infinite; }
.marquee-track > * { flex: 0 0 auto; width: min(20rem, 78vw); }
.is-marquee:hover .marquee-track, .is-marquee:active .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 0.5rem)); } }

/* Reading progress bar (body data-progress) */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 45; background: var(--signal); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
