/*
 * WGYB components: foundations only. Requires tokens.css loaded first.
 * No raw color values in this file. Use var(--token).
 * Section components (hero, four rules, proof, pricing, FAQ, CTA band, form) are
 * pending the v6 decision and are listed in COMPONENTS.md, not built here.
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--charcoal);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* ---------- Grounds ----------
 * A ground sets background and the text, link, focus and button colors that sit on it.
 * Wrap every section in .section plus exactly one .ground-* class. */
:root, .ground-white {
  --bg: var(--white); --fg: var(--charcoal); --fg-muted: var(--muted);
  --link: var(--cobalt); --focus: var(--cobalt); --line: var(--rule);
  --btn-bg: var(--gold); --btn-fg: var(--charcoal); --btn-border: var(--charcoal);
  --btn-hover-bg: var(--charcoal); --btn-hover-fg: var(--gold);
}
.ground-cool  { --bg: var(--cool); }
.ground-warm  { --bg: var(--warm); }
.ground-tint  { --bg: var(--tint); }
.ground-cool, .ground-warm, .ground-tint, .ground-white {
  --fg: var(--charcoal); --fg-muted: var(--muted); --link: var(--cobalt); --focus: var(--cobalt);
  --line: var(--rule);
  --btn-bg: var(--gold); --btn-fg: var(--charcoal); --btn-border: var(--charcoal);
  --btn-hover-bg: var(--charcoal); --btn-hover-fg: var(--gold);
}
.ground-cobalt {
  --bg: var(--cobalt); --fg: var(--white); --fg-muted: var(--muted-dark);
  --link: var(--gold); --focus: var(--gold); --line: var(--rule-dark);
  --btn-bg: var(--gold); --btn-fg: var(--charcoal); --btn-border: var(--gold);
  --btn-hover-bg: var(--white); --btn-hover-fg: var(--cobalt);
}
.ground-charcoal {
  --bg: var(--charcoal); --fg: var(--white); --fg-muted: var(--muted-charcoal);
  --link: var(--gold); --focus: var(--gold); --line: var(--rule-dark);
  --btn-bg: var(--gold); --btn-fg: var(--charcoal); --btn-border: var(--gold);
  --btn-hover-bg: var(--white); --btn-hover-fg: var(--charcoal);
}
.ground-gold {
  --bg: var(--gold); --fg: var(--charcoal); --fg-muted: var(--charcoal);
  --link: var(--cobalt); --focus: var(--cobalt); --line: var(--charcoal);
  --btn-bg: var(--cobalt); --btn-fg: var(--white); --btn-border: var(--cobalt);
  --btn-hover-bg: var(--charcoal); --btn-hover-fg: var(--white);
}

.section { background: var(--bg); color: var(--fg); padding-block: var(--section-y); }
.container { width: 100%; max-width: var(--w-wide); margin-inline: auto; padding-inline: var(--gutter); }
.container--text { max-width: calc(var(--w-text) + 2 * var(--gutter)); }
.stack > * + * { margin-top: var(--s-5); }
.stack--lg > * + * { margin-top: var(--s-7); }

/* ---------- Type ----------
 * Element defaults carry the look. Use .t-* classes when the visual level differs from the semantic level. */
h1, h2, h3, .t-h1, .t-h2, .t-h3 {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--tracking-display);
  overflow-wrap: break-word;
}
h1, .t-h1 { font-weight: var(--display-weight-max); line-height: 1.02; font-size: var(--fs-h1); }
h2, .t-h2 { font-weight: var(--display-weight); line-height: 1; font-size: var(--fs-h2); }
h3, .t-h3 { font-weight: var(--display-weight); line-height: var(--lh-tight); font-size: var(--fs-h3); }
h4, .t-h4 { font-family: var(--font-text); font-weight: 700; font-size: var(--fs-body); line-height: 1.3; }
.t-lede { font-size: var(--fs-lede); line-height: 1.5; max-width: 34em; }
.t-body { font-size: var(--fs-body); }
.t-fine { font-size: var(--fs-small); line-height: 1.5; color: var(--fg-muted); }
.t-strong { font-weight: 700; }
p { max-width: 38em; }
.hl-gold { background: var(--gold); color: var(--charcoal); padding-inline: .12em; }
del.hl-strike { text-decoration: line-through; text-decoration-thickness: .075em; }

/* ---------- Links ---------- */
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* ---------- Focus ---------- */
:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); border-radius: var(--r-sm); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: var(--s-4); top: var(--s-4); z-index: 1000;
  padding: var(--s-3) var(--s-5); background: var(--charcoal); color: var(--white);
  font-weight: 700; text-decoration: none; border-radius: var(--r-sm);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- Buttons ----------
 * Primary: gold fill, charcoal text (cobalt fill on a gold ground). Secondary: outline in the ground's text color.
 * The Book a call button is a primary button with the data-book attribute. See book.js. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 52px; padding: 14px 26px;
  font: 700 17px/1.1 var(--font-text); letter-spacing: .005em; text-decoration: none; text-align: center;
  border: 2px solid var(--btn-border); border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg); cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--btn-hover-bg); border-color: var(--btn-hover-bg); color: var(--btn-hover-fg); text-decoration: none; }
.btn:focus-visible { outline-offset: 4px; border-radius: var(--r-pill); }
.btn--secondary { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn--secondary:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn--lg { min-height: 60px; padding: 18px 34px; font-size: 19px; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }

/* ---------- Header shell ----------
 * Matches build/partials/header.html: logo, five anchor links, Free Playbook link, one button.
 * The shared nav changes only in build/partials. This shell only styles it. */
.site-header { background: var(--white); color: var(--charcoal); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 200; }
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: var(--header-h); max-width: var(--w-wide); margin-inline: auto; padding-inline: var(--gutter);
}
.site-header .logo { display: block; flex: none; line-height: 0; }
.site-header .logo img { display: block; height: var(--logo-h); width: auto; }
.site-header .nav-links { display: none; align-items: center; gap: var(--s-6); }
.site-header .nav-links a { color: var(--charcoal); text-decoration: none; font-size: var(--fs-small); font-weight: 600; }
.site-header .nav-links a:hover { color: var(--cobalt); text-decoration: underline; }
.site-header .btn { min-height: 46px; padding: 10px 22px; font-size: var(--fs-small); }
@media (min-width: 1000px) { .site-header .nav-links { display: flex; } }
@media (max-width: 420px) { .site-header .btn { padding: 10px 16px; } }

/* ---------- Footer shell ----------
 * Matches build/partials/footer.html: logo, copyright, Book a call link, Free Playbook link. */
.site-footer { background: var(--charcoal); color: var(--white); --link: var(--gold); --focus: var(--gold); padding-block: var(--s-7); font-size: var(--fs-small); }
.site-footer .bar {
  display: flex; flex-wrap: wrap; gap: var(--s-5) var(--s-7); align-items: center; justify-content: space-between;
  max-width: var(--w-wide); margin-inline: auto; padding-inline: var(--gutter);
}
.site-footer .logo { display: block; line-height: 0; }
.site-footer .logo img { display: block; height: 40px; width: auto; }
.site-footer .copy { color: var(--muted-charcoal); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: var(--s-5); }
.site-footer .links a { color: var(--white); }
.site-footer .links a:hover { color: var(--gold); }

/* ---------- Placeholder marker ----------
 * Use for any proof or asset that does not exist yet. List each one in MISSING.md. */
.placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 160px; padding: var(--s-5);
  border: 2px dashed var(--charcoal); border-radius: var(--r-sm);
  background: var(--warm); color: var(--charcoal); font-weight: 600; font-size: var(--fs-small);
}
.placeholder--wide { aspect-ratio: 16 / 9; }

/* ---------- Motion ----------
 * Any animation must have a complete static state. Reduced motion removes all of it. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
}
