/* ============================================================
   base.css: Reset, typography, layout utilities
   ------------------------------------------------------------
   Loaded after tokens.css. Provides the structural foundation
   shared across every site in the network.
   ============================================================ */

/* -- Modern reset --------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  /* Navy at the root so the very first paint -- before body
     parses or the wave canvas starts drawing -- is on-brand
     dark instead of the browser's default white. Prevents the
     FOUT-style white flash when navigating between pages. */
  background-color: var(--brand-navy);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  font-weight: var(--font-weight-normal);
  color: var(--color-text);
  /* Navy bg matches html so any moment before the first paint
     completes is on-brand. White-bg sections (Outcomes,
     Pricing top, etc.) still paint over this normally. */
  background-color: var(--brand-navy);
  min-height: 100vh;
  overflow-x: hidden;
  /* Start invisible; main.js stamps body[data-rendered] at the
     end of init(), which triggers the fade-in below. Pre-rendered
     pages already carry data-rendered in the saved HTML, so they
     paint at opacity 1 from the first frame -- no FOUT, no fade. */
  opacity: 0;
  transition: opacity 250ms ease;
}

body[data-rendered] {
  opacity: 1;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

input,
textarea,
select {
  font: inherit;
}

/* -- Typography ----------------------------------------- */
/* Matches HeyGuest's heading rules: all h1-h4 use --font-weight-light,
   responsive font-size steps at 48rem and 64rem breakpoints, plus
   a 1rem margin-bottom. Values come straight from heyguest-tailwind.css. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text);
}

h1, h2, h3, h4 { margin-bottom: var(--space-4); }

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

@media (min-width: 48rem) {
  h1 { font-size: var(--font-size-5xl); }
  h2 { font-size: var(--font-size-4xl); }
  h3 { font-size: var(--font-size-2xl); }
  h4 { font-size: var(--font-size-xl); }
}

@media (min-width: 64rem) {
  h1 { font-size: var(--font-size-6xl); }
  h2 { font-size: var(--font-size-5xl); }
  h3 { font-size: var(--font-size-3xl); }
  h4 { font-size: var(--font-size-2xl); }
}

p {
  line-height: var(--line-height-base);
  color: var(--color-text-muted);
}

strong { font-weight: var(--font-weight-semi); }

/* -- Focus ---------------------------------------------- */
/* Mouse-focus stays clean (no ring); keyboard / programmatic
   focus gets a visible accent ring with a translucent halo so
   the ring stays distinguishable on light, dark, AND accent-
   coloured backgrounds. The halo (box-shadow) doesn't affect
   layout because it's a paint-only effect. Modern browsers
   render outlines that follow border-radius, so pill buttons
   get pill-shaped focus rings automatically. */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
  /* Translucent black halo for contrast against bright accent
     fills; reads as a soft drop-shadow on light backgrounds. */
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
}

/* On accent-coloured buttons (.btn--primary fills with the
   accent), the default accent ring would blend into the button.
   Switch to the dark navy ring for guaranteed contrast. */
.btn--primary:focus-visible {
  outline-color: var(--brand-navy);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.45);
}

/* On dark-fill buttons (.btn--dark) the accent ring already
   contrasts against the navy background, so no override needed.
   The default :focus-visible rule applies. */

/* -- Container ------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--section-pad-x);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* -- Section base --------------------------------------- */
.section {
  padding-top: var(--section-pad-y-top);
  padding-bottom: var(--section-pad-y-bottom);
}

.section--dark {
  background-color: var(--dark-bg);
  color: var(--color-text-on-dark);
}

.section--alt {
  background-color: var(--section-bg-alt);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-text-on-dark);
}

.section--dark p {
  color: var(--color-text-on-dark-muted);
}

/* -- Visually hidden (a11y) ----------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -- Skip link ------------------------------------------ */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-5);
  background: var(--accent-color);
  color: var(--color-white);
  font-weight: var(--font-weight-semi);
  border-radius: var(--radius-md);
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: var(--space-4);
}

/* -- Reveal on scroll ----------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* -- Print stylesheet ----------------------------------- */
/* Hide decorative / interactive surfaces and force readable
   colours so a printed page is a clean text artefact rather
   than a dark, ink-hungry approximation of the screen. */
@media print {
  /* Hide everything that's not content. */
  .site-nav,
  .logos-bar,
  canvas.hero-wave,
  canvas.hero-wave--full,
  .hero-accordion,
  .modal-overlay,
  .site-footer__network,
  .skip-link {
    display: none !important;
  }

  /* Force everything onto a white background with black text. */
  html, body { background: #fff !important; color: #000 !important; }
  .hero,
  .outcomes,
  .products,
  .pricing,
  .testimonials,
  .network-hub,
  .bottom-cta,
  .contact-hero,
  .contact-form-section,
  .split,
  .site-footer {
    background: #fff !important;
    color: #000 !important;
  }
  h1, h2, h3, h4, h5, h6 { color: #000 !important; }

  /* Annotate links with their URLs so paper readers don't lose
     the destination -- skip in-page anchors. */
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444; }
  a[href^="#"]::after,
  a[href^="javascript:"]::after { content: ""; }

  /* Avoid breaking key blocks across pages. */
  h1, h2, h3, h4,
  .testimonial,
  .outcome,
  .vertical-card,
  .product-card,
  .pricing-module {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* No animations or transforms on paper. */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
