/* ==========================================================================
   Mainstay Performance
   Design tokens and layout per design_handoff_mainstay_website/HANDOFF.md
   ========================================================================== */

:root {
  /* Brand colour */
  --coastal-blue: #477f9d;
  --coastal-blue-dark: #35617a;
  --deep-navy: #1c3040;
  --warm-cream: #f5f0e6;
  --card-cream: #fbf8f1;
  --deep-charcoal: #292d2f;
  --dune-gold: #c4a56a;
  --dune-gold-dark: #8b7942;

  /* Support */
  --ink-muted: #44576a;
  --border: #e3dccb;
  --border-photo: #ddd5c2;
  --border-pill: #d9d0bd;
  --mono-muted: #a2977d;
  --on-navy-muted: #b8c4ce;
  --footer-link: #c8cdd1;
  --footer-text: #9aa1a6;

  /* Type */
  --font-display: 'CY Grotesk STD', 'Space Grotesk', sans-serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rhythm */
  --gutter: 56px;
  --section-y: 88px;
  --radius-photo: 24px;
  --radius-card: 20px;
  --max-width: 1240px;
}

/* If the client licenses CY Grotesk STD, drop the files in assets/fonts/ and
   uncomment. The display stack already falls back to Space Grotesk.
@font-face {
  font-family: 'CY Grotesk STD';
  src: url('../fonts/CYGroteskGrandBold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
*/

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  /* `clip` contains stray overflow without making this a scroll container. */
  overflow-x: clip;
  /* Keep anchored sections clear of the sticky header. */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--warm-cream);
  color: var(--deep-navy);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--coastal-blue); text-decoration: none; }
a:hover { color: var(--coastal-blue-dark); }

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--coastal-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  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 {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  background: var(--deep-navy);
  color: var(--warm-cream);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  transition: top .15s ease;
}
.skip-link:focus { top: 16px; color: var(--warm-cream); }

/* ---------- Typography ---------- */

.h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5.2vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.h1 em { font-style: italic; color: var(--coastal-blue); }

.h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(27px, 3.4vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.h2--sm { font-size: clamp(26px, 3.2vw, 34px); }
.h2--xs { font-size: clamp(23px, 2.6vw, 28px); line-height: 1.3; }

.h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.eyebrow--gold { color: var(--dune-gold-dark); }
.eyebrow--blue { color: var(--coastal-blue); }

.lede {
  margin: 0;
  max-width: 520px;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--ink-muted);
}

.body,
.body-lg { margin: 0; color: var(--ink-muted); line-height: 1.65; }
.body { font-size: 16.5px; }
.body-lg { font-size: 17px; line-height: 1.6; }
.body-lg--narrow { max-width: 500px; }

.fine-print {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.fine-print--email { letter-spacing: 0.04em; }

.link-underline {
  font-weight: 700;
  font-size: 16px;
  color: var(--deep-navy);
  border-bottom: 2px solid var(--dune-gold);
  padding-bottom: 2px;
}
.link-underline:hover { color: var(--coastal-blue); }

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

.btn {
  display: inline-block;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 16px 30px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn--sm { padding: 12px 26px; font-size: 14px; }
.btn--lg { padding: 17px 34px; font-size: 16px; }

.btn--primary { background: var(--coastal-blue); color: var(--warm-cream); }
.btn--primary:hover { background: var(--coastal-blue-dark); color: var(--warm-cream); }
.btn--glow { box-shadow: 0 8px 24px rgba(71, 127, 157, .3); }

.btn--outline-blue { border-color: var(--coastal-blue); color: var(--coastal-blue); }
.btn--outline-blue:hover { background: var(--coastal-blue); color: var(--warm-cream); }

.btn--outline-navy { border-color: var(--deep-navy); color: var(--deep-navy); }
.btn--outline-navy:hover { background: var(--deep-navy); color: var(--warm-cream); }

.btn--gold { background: var(--dune-gold); color: var(--deep-navy); }
.btn--gold:hover { background: #b3945a; color: var(--deep-navy); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 240, 230, .96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header__logo { display: block; flex: none; }
.site-header__logo img {
  height: 52px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 15px;
  font-weight: 600;
}
.site-nav > a { color: var(--deep-navy); }
.site-nav > a:hover { color: var(--coastal-blue); }
.site-nav > a.btn { color: var(--warm-cream); }

/* Hamburger — desktop-hidden, shown at the nav breakpoint */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 18px; height: 2px;
  margin: 0 auto;
  background: var(--deep-navy);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Section shell ---------- */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-y) var(--gutter);
}
/* Full-bleed background; the inner .section keeps content on the same
   centred measure as the rest of the page. */
.band { width: 100%; }
.band--alt {
  background: var(--card-cream);
  border-top: 1px solid var(--border);
}
.band--navy { background: var(--deep-navy); color: var(--warm-cream); }
.band--charcoal { background: var(--deep-charcoal); color: var(--footer-text); }
.section__intro { max-width: 640px; margin-bottom: 48px; }
.section__intro .h2 { margin-top: 12px; }
.section__intro .body-lg { margin-top: 18px; }

.stack { display: flex; flex-direction: column; gap: 20px; }
.stack--tight { gap: 12px; }
.stack > p { margin: 0; }

.inline-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ---------- Photos ---------- */

.photo {
  margin: 0;
  border-radius: var(--radius-photo);
  overflow: hidden;
  border: 1px solid var(--border-photo);
  background: var(--border-photo);
}
.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo--hero { height: 460px; }
.photo--coaching { height: 400px; }
.photo--about { height: 420px; }

/* All four sources are portrait shots dropped into landscape containers, so a
   centred cover-crop cuts the subject's head off. Each value is tuned to the
   head position in that frame (measured at 13-28% from the top) and holds up
   at the shortest container the responsive rules produce. */
/* B/W deadlift: head sits ~15% down the frame, so keep the crop high. */
.photo--hero img { object-position: 50% 12%; }
.photo--fill img { object-position: 50% 18%; }
/* Pull-up shot: head and bar sit ~15% down the frame. */
.photo--coaching img { object-position: 50% 18%; }
/* Seated bench portrait: head sits ~12% down the frame. */
.photo--about img { object-position: 50% 12%; }
.photo--fill { border-radius: var(--radius-card); min-height: 340px; position: relative; }
.photo--fill img { position: absolute; inset: 0; }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--gutter);
  align-items: center;
  padding-bottom: 84px;
}
.hero__copy { display: flex; flex-direction: column; gap: 24px; }
.hero__founder { max-width: 520px; margin-top: -8px; }
.hero__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.hero__media { position: relative; }

.floating-card {
  position: absolute;
  left: -22px;
  bottom: 32px;
  max-width: 280px;
  margin: 0;
  background: var(--warm-cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 22px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  box-shadow: 0 12px 32px rgba(28, 48, 64, .1);
}
.floating-card strong { color: var(--deep-navy); }

/* ---------- Membership ---------- */

.membership__grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.card {
  background: var(--warm-cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 36px 38px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.card__actions {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.card__actions .fine-print { font-size: 12.5px; letter-spacing: 0.04em; }

.perks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.perks li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.55;
  color: var(--deep-navy);
}
.perks strong { color: var(--deep-navy); }

.check {
  flex: none;
  width: 22px; height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: rgba(196, 165, 106, .25);
  color: var(--dune-gold-dark);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

/* Sub-list inside a perk (the 1:1 "Core Pillars"). */
.perks__sub {
  margin: 10px 0 0;
  padding: 0 0 0 18px;
  display: grid;
  gap: 8px;
  font-size: 15.5px;
  color: var(--ink-muted);
}
/* .perks li is a flex row; undo that for the nested items so the bold
   label and its sentence flow as one line of text. */
.perks__sub li {
  display: list-item;
  list-style: disc;
  gap: 0;
  font-size: 15.5px;
  color: var(--ink-muted);
}
.perks__sub li::marker { color: var(--dune-gold-dark); }

/* ---------- Coaching / About ---------- */

.coaching {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--gutter);
  align-items: center;
}
.about {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--gutter);
  align-items: center;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pills li {
  border: 1px solid var(--border-pill);
  background: var(--warm-cream);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--deep-navy);
}

/* ---------- Offerings ---------- */

/* Two offerings stacked inside one section. */
.offering + .offering { margin-top: 80px; }
.offering__head { margin-bottom: 28px; }
.offering__head .h2 { margin-top: 12px; }

/* ---------- Closing CTA ---------- */

.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.cta .h2 { max-width: 560px; }
.cta .btn { margin-top: 10px; }

/* ---------- Newsletter ---------- */

.newsletter {
  padding-block: 80px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.newsletter .h2 { color: var(--warm-cream); }
.newsletter__sub { font-size: 15.5px; line-height: 1.6; color: var(--on-navy-muted); }

.newsletter__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Row 1: first + last name. Row 2: email + subscribe. */
.newsletter__row {
  display: flex;
  gap: 10px;
}
.newsletter__form input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  padding: 15px 18px;
  border: 1px solid rgba(245, 240, 230, .35);
  border-radius: 999px;
  background: rgba(245, 240, 230, .08);
  color: var(--warm-cream);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}

.newsletter__form input::placeholder { color: rgba(245, 240, 230, .6); }
.newsletter__form input:focus-visible {
  border-color: var(--dune-gold);
  outline: 2px solid rgba(196, 165, 106, .5);
  outline-offset: 1px;
}
.newsletter__form input[aria-invalid="true"] { border-color: #e0917f; }
.newsletter__form button { flex: none; border: none; padding: 15px 28px; font-size: 14px; }

.newsletter__status {
  margin: 0;
  min-height: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--on-navy-muted);
}
.newsletter__status:not(:empty) { margin-top: 4px; }
.newsletter__status[data-state="error"] { color: #f0b0a0; }
.newsletter__status[data-state="ok"] { color: var(--dune-gold); }

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

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.site-footer p { margin: 0; }
.site-footer { font-size: 13.5px; }
.site-footer__links { display: flex; gap: 24px; font-weight: 600; flex-wrap: wrap; }
.site-footer__links a { color: var(--footer-link); }
.site-footer__links a:hover { color: var(--warm-cream); }

/* ==========================================================================
   Responsive — the prototype was desktop-only; these rules are additive.
   ========================================================================== */

@media (max-width: 1080px) {
  :root { --gutter: 40px; --section-y: 72px; }
  .photo--hero { height: 420px; }
}

/* Collapse the nav before the links crowd the logo. Kept above the layout
   breakpoint below so the drawer and the single-column layout never
   disagree about which mode the page is in. */
@media (max-width: 1000px) {
  .nav-toggle { display: grid; place-items: center; }

  .site-header__inner { flex-wrap: wrap; }

  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0 16px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav > a {
    padding: 12px 4px;
    font-size: 17px;
    border-bottom: 1px solid var(--border);
  }
  .site-nav > a.btn {
    margin-top: 12px;
    padding: 14px 26px;
    font-size: 15px;
    border-bottom: none;
  }
}

@media (max-width: 900px) {
  .hero,
  .membership__grid,
  .coaching,
  .about,
  .newsletter {
    grid-template-columns: 1fr;
  }

  .hero { gap: 40px; }
  .hero__media { order: 2; }

  /* Pull the overlap inboard so it can't clip off-screen. */
  .floating-card {
    left: 16px;
    right: 16px;
    bottom: -20px;
    max-width: none;
  }
  .hero__media { margin-bottom: 32px; }

  /* Photo goes first in Coaching so every section reads text-then-image. */
  .coaching .photo--coaching { order: 2; }
  .about .photo--about { order: 2; }

  .membership__grid { gap: 24px; }
  .photo--fill { height: 320px; }
}

@media (max-width: 640px) {
  :root { --gutter: 22px; --section-y: 56px; --radius-photo: 18px; }

  body { font-size: 16px; }

  .site-header__logo img { height: 42px; }

  .hero { padding-bottom: 56px; }
  .photo--hero { height: 340px; }
  .photo--coaching,
  .photo--about { height: 340px; }
  .photo--fill { height: 280px; }

  .hero__actions { gap: 14px; }
  .hero__actions .btn { width: 100%; }

  .card { padding: 28px 24px; }
  .card__actions .btn { flex: 1 1 auto; }

  .offering + .offering { margin-top: 56px; }
  .cta .btn { width: 100%; }

  .section__intro { margin-bottom: 32px; }

  .newsletter { padding-block: 56px; }
  .newsletter__row { flex-direction: column; }
  .newsletter__form input,
  .newsletter__form button { width: 100%; }

  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .site-footer__links { gap: 18px; }
}

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