/* ==========================================================================
   SECOND SERVE PERFORMANCE
   Built to DESIGN-SYSTEM.md. Tokens extracted from the source model,
   with the three documented deviations applied.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */

:root {
  /* Color. Pure black and white. There is no gray in this system. */
  --black: #000000;
  --white: #ffffff;
  --accent: #8a4b3a;              /* clay. links, focus, price figure only */
  --scrim: rgba(0, 0, 0, 0.30);
  --hairline: rgba(255, 255, 255, 0.18);
  --hairline-dark: rgba(0, 0, 0, 0.14);

  /* Layout */
  --max-page-width: 2107px;
  --page-padding: 1vw;
  --mobile-gutter: 6vw;
  --measure: 46rem;               /* long form reading column */

  /* Type. Base raised from the model's 13px: this audience is 40 and over. */
  --base-font-size: 15px;
  --heading-font: "Playfair Display", "Times New Roman", Georgia, serif;
  --body-font: "Newsreader", Georgia, "Times New Roman", serif;
  --heading-tracking: -0.02em;
  --heading-leading: 1.2em;
  --body-leading: 1.5em;

  /* Scale, as rem multiples of base */
  --h1: 4;
  --h2: 2.8;
  --h3: 2.2;
  --h4: 1.6;
  --lead: 1.4;

  /* Motion */
  --fade-duration: 1.50s;
  --fade-delay: 0.6s;
  --fade-curve: ease;
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  font-family: var(--body-font);
  font-size: var(--base-font-size);
  font-weight: 400;
  line-height: var(--body-leading);
  letter-spacing: 0;
  background: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; border: 0; }
a { color: inherit; }
button { font: inherit; }

/* --------------------------------------------------------------------------
   3. TYPE SCALE

   Fluid formula carried over from the model:
     min( (V - 1) * 1.2vw + 1rem,
          max( (V - 1) * 0.012 * maxPageWidth + 1rem, V * 1rem ) )
   Leading tightens as size grows.
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
  font-family: var(--heading-font);
  font-weight: 400;
  font-style: normal;
  letter-spacing: var(--heading-tracking);
  text-transform: none;   /* uppercase is typed by hand, never transformed */
  margin: 0;
}

h1, .h1 {
  font-size: min(
    calc((var(--h1) - 1) * 1.2vw + 1rem),
    max(calc((var(--h1) - 1) * 0.012 * var(--max-page-width) + 1rem), calc(var(--h1) * 1rem))
  );
  line-height: calc(var(--heading-leading) * (1 + (1 - var(--h1)) / 25));
}

h2, .h2 {
  font-size: min(
    calc((var(--h2) - 1) * 1.2vw + 1rem),
    max(calc((var(--h2) - 1) * 0.012 * var(--max-page-width) + 1rem), calc(var(--h2) * 1rem))
  );
  line-height: calc(var(--heading-leading) * (1 + (1 - var(--h2)) / 25));
}

h3, .h3 {
  font-size: min(
    calc((var(--h3) - 1) * 1.2vw + 1rem),
    max(calc((var(--h3) - 1) * 0.012 * var(--max-page-width) + 1rem), calc(var(--h3) * 1rem))
  );
  line-height: calc(var(--heading-leading) * (1 + (1 - var(--h3)) / 25));
}

h4, .h4 {
  font-size: min(
    calc((var(--h4) - 1) * 1.2vw + 1rem),
    max(calc((var(--h4) - 1) * 0.012 * var(--max-page-width) + 1rem), calc(var(--h4) * 1rem))
  );
  line-height: calc(var(--heading-leading) * (1 + (1 - var(--h4)) / 25));
}

.lead {
  font-size: min(
    calc((var(--lead) - 1) * 1.2vw + 1rem),
    max(calc((var(--lead) - 1) * 0.012 * var(--max-page-width) + 1rem), calc(var(--lead) * 1rem))
  );
  line-height: 1.45em;
}

p { margin: 0 0 1.35em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--heading-font);
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  line-height: 1.4;
  margin: 0 0 1.6em;
  opacity: 0.62;
}

.rule {
  border: 0;
  border-top: 1px solid currentColor;
  opacity: 0.18;
  margin: 3.2em 0;
}

/* --------------------------------------------------------------------------
   4. SECTION THEMES

   Four themes, and they strictly alternate. Two same colored bands must
   never touch. The color change is the only divider on this site.
   -------------------------------------------------------------------------- */

.section {
  padding: clamp(4.5rem, 9vw, 10rem) var(--page-padding);
}

.section--tight { padding-block: clamp(3rem, 5vw, 5.5rem); }
.section--flush { padding: 0; }

.theme-black       { background: var(--black); color: var(--white); }
.theme-black-bold  { background: var(--black); color: var(--white); }
.theme-white       { background: var(--white); color: var(--black); }

.theme-bright-inverse {
  background: var(--black);
  color: var(--white);
  position: relative;
}

.wrap {
  max-width: var(--max-page-width);
  margin: 0 auto;
  width: 100%;
}

.measure { max-width: var(--measure); }
.measure--center { max-width: var(--measure); margin-inline: auto; }
.center { text-align: center; }

/* --------------------------------------------------------------------------
   5. HEADER

   Fixed, inset, opaque white. Nav left, centered wordmark, actions right.
   The wordmark stays black because the header band is always white.
   -------------------------------------------------------------------------- */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--white);
  color: var(--black);
  padding: 0.1vw var(--page-padding);
}

.header__inner {
  max-width: var(--max-page-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  min-height: 79px;
}

.header__logo { justify-self: center; }
.header__logo img { height: 71px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-family: var(--heading-font);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  padding: 0.4em 0;
  display: inline-block;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}

.nav__link:hover { border-bottom-color: currentColor; }
.nav__link[aria-current="page"] { border-bottom-color: currentColor; }

/* dropdown folder */
.nav__folder { position: relative; }

.nav__panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 20rem;
  background: var(--white);
  border: 1px solid var(--hairline-dark);
  padding: 0.7rem 0;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.nav__folder:hover .nav__panel,
.nav__folder:focus-within .nav__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__panel a {
  display: block;
  padding: 0.65rem 1.3rem;
  font-family: var(--heading-font);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.nav__panel a:hover { background: var(--black); color: var(--white); }

.header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

/* mobile toggle */
.header__toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.6rem;
  cursor: pointer;
  font-family: var(--heading-font);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  color: inherit;
}

.header__spacer { height: 79px; }

/* --------------------------------------------------------------------------
   6. BUTTONS

   Two variants. Primary is solid fill. Secondary is a 1px outline in the
   current text color. There is no third style anywhere on this site.
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--heading-font);
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  line-height: 1;
  padding: 1.15em 2.6em;
  border-radius: 999px;
  border: 1px solid currentColor;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.theme-white .btn--primary {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}
.theme-white .btn--primary:hover { background: transparent; color: var(--black); }

.theme-black .btn--primary,
.theme-black-bold .btn--primary,
.theme-bright-inverse .btn--primary,
.footer .btn--primary {
  background: var(--white);
  border-color: var(--white);
  color: var(--black);
}
.theme-black .btn--primary:hover,
.theme-black-bold .btn--primary:hover,
.theme-bright-inverse .btn--primary:hover,
.footer .btn--primary:hover {
  background: transparent;
  color: var(--white);
}

.btn--secondary { background: transparent; color: inherit; }
.theme-white .btn--secondary:hover { background: var(--black); color: var(--white); }
.theme-black .btn--secondary:hover,
.theme-black-bold .btn--secondary:hover,
.theme-bright-inverse .btn--secondary:hover,
.footer .btn--secondary:hover { background: var(--white); color: var(--black); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.4rem;
}
.btn-row--center { justify-content: center; }

/* --------------------------------------------------------------------------
   7. MEDIA

   Every slot is filled, from Kevin's own court and gym. Nothing here is
   decorative. Each frame is doing a job that build-media.sh names in a
   comment above the command that produces it.

   Video is silent, muted, looping and autoplaying, and every one carries a
   poster so the first paint is a photograph rather than a black rectangle.
   site.js pauses all of it when the visitor asks for reduced motion, which
   leaves the poster on screen.
   -------------------------------------------------------------------------- */

.media {
  position: relative;
  background: var(--black);
  overflow: hidden;
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--hairline);
  pointer-events: none;
}

.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media--hero { height: min(86vh, 900px); }
.media--card { aspect-ratio: 16 / 9; }
.media--portrait { aspect-ratio: 4 / 5; }
.media--band { aspect-ratio: 2 / 1; }

/* A frame that runs inside the reading column instead of full bleed. Held
   narrower than the text so it reads as evidence beside the argument rather
   than as a second headline. */
.figure {
  margin: 3.2rem auto;
  max-width: 24rem;
}

/* --------------------------------------------------------------------------
   8. PROGRAM CARD

   Full width image, black band beneath, uppercase title, subtitle in
   smaller caps, whole card is one link. No border, shadow, radius or lift.
   -------------------------------------------------------------------------- */

.card {
  display: block;
  text-decoration: none;
  color: var(--white);
  background: var(--black);
}

.card__body {
  padding: 2.3rem var(--page-padding) 2.8rem;
  text-align: center;
}

.card__title { margin: 0 0 0.55rem; }

.card__meta {
  font-family: var(--heading-font);
  font-size: 0.84rem;
  letter-spacing: 0.2em;
  opacity: 0.66;
  margin: 0;
}

.card:hover .card__title { text-decoration: underline; text-underline-offset: 0.14em; }

/* --------------------------------------------------------------------------
   9. COACH CARD

   Name is set in HTML over the image, not burned into the file. Looks the
   same, stays selectable, survives a title change without a re-export.
   -------------------------------------------------------------------------- */

.coach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: clamp(2rem, 4vw, 4rem);
  max-width: 62rem;
  margin-inline: auto;
  justify-content: center;
}

/* A single coach must not stretch to fill the grid track. */
.coach { max-width: 26rem; }

.coach__frame { position: relative; }

.coach__plate {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.6rem 1.4rem 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0));
  text-align: center;
  color: var(--white);
}

.coach__name {
  font-family: var(--heading-font);
  font-size: 1.55rem;
  letter-spacing: 0.06em;
  margin: 0 0 0.3rem;
}

.coach__role {
  font-family: var(--heading-font);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  opacity: 0.78;
  margin: 0;
}

.coach__action { margin-top: 1.6rem; text-align: center; }

/* --------------------------------------------------------------------------
   10. TESTIMONIAL

   No card, no quote marks, no photo, no stars. Italic body, then a
   hyphen prefixed attribution. Role based, never named.
   -------------------------------------------------------------------------- */

.testimonial-column {
  max-width: var(--measure);
  margin-inline: auto;
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
}

.testimonial p { font-style: italic; margin: 0 0 1rem; }

.testimonial cite {
  font-style: normal;
  font-family: var(--heading-font);
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   11. LONG FORM
   -------------------------------------------------------------------------- */

.prose { max-width: var(--measure); margin-inline: auto; }
.prose h3 { margin: 2.6em 0 0.8em; }
.prose h4 { margin: 2.2em 0 0.6em; }
.prose ul { margin: 0 0 1.5em; padding-left: 1.15em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { font-weight: 600; }

/* Inline links only. Buttons carry their own color and must never be
   caught by these rules, or a white label lands on a white pill. */
.prose a:not(.btn) { color: var(--accent); }
.theme-black .prose a:not(.btn),
.theme-black-bold .prose a:not(.btn),
.theme-bright-inverse .prose a:not(.btn) { color: inherit; }

.blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  margin: 2.6em 0;
}

.theme-white .blocks { background: var(--hairline-dark); border-color: var(--hairline-dark); }

.block {
  background: var(--black);
  padding: 1.8rem 1.5rem;
}
.theme-white .block { background: var(--white); }

.block__index {
  font-family: var(--heading-font);
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  opacity: 0.55;
  margin: 0 0 0.6rem;
}

.block__name {
  font-family: var(--heading-font);
  font-size: 1.16rem;
  letter-spacing: 0;
  margin: 0;
}

.price {
  font-family: var(--heading-font);
  font-size: min(calc(1.8 * 1.2vw + 1rem), 3.4rem);
  color: var(--accent);
  letter-spacing: var(--heading-tracking);
  line-height: 1.1;
  display: block;
  margin-bottom: 0.9rem;
}
.theme-black .price,
.theme-black-bold .price { color: var(--white); }

.price-note {
  font-family: var(--heading-font);
  font-size: 0.84rem;
  letter-spacing: 0.18em;
  opacity: 0.7;
  margin: 0;
}

/* --------------------------------------------------------------------------
   12. FORMS
   -------------------------------------------------------------------------- */

.form { max-width: 34rem; }
.form--center { margin-inline: auto; }

.field { margin-bottom: 1.5rem; text-align: left; }

.field label {
  display: block;
  font-family: var(--heading-font);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  margin-bottom: 0.6rem;
  opacity: 0.75;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.95em 1em;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 0;
}

.theme-white .field input,
.theme-white .field textarea,
.theme-white .field select { border-color: rgba(0, 0, 0, 0.34); }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field textarea { min-height: 9rem; resize: vertical; }

.form__status {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  min-height: 1.4em;
}

/* --------------------------------------------------------------------------
   13. FOOTER

   Black. Logo left, subscribe center, links right. Centered copyright
   beneath, then small print at reduced size.
   -------------------------------------------------------------------------- */

.footer {
  background: var(--black);
  color: var(--white);
  padding: clamp(4rem, 7vw, 7rem) var(--page-padding) 3rem;
}

.footer__cols {
  max-width: var(--max-page-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.footer__logo img { width: min(15rem, 100%); }

.footer__heading {
  font-family: var(--heading-font);
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  margin: 0 0 1rem;
}

.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.footer__links a {
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
}
.footer__links a:hover { border-bottom-color: var(--white); }

.footer__base {
  max-width: var(--max-page-width);
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  text-align: center;
}

.footer__copyright {
  font-size: 0.86rem;
  opacity: 0.7;
  margin: 0 0 1.6rem;
}

.footer__smallprint {
  font-size: 0.76rem;
  line-height: 1.6;
  opacity: 0.48;
  max-width: 54rem;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   14. MOTION

   Fade only. One animation per section on entry. Nothing slides, scales
   or staggers. The header and buttons are never animated.
   -------------------------------------------------------------------------- */

.fade {
  opacity: 0;
  transition: opacity var(--fade-duration) var(--fade-curve) var(--fade-delay);
}

.fade.is-in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .fade { opacity: 1; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   15. RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 60rem) {
  .section { padding-inline: var(--mobile-gutter); }
  .card__body { padding-inline: var(--mobile-gutter); }
  .footer { padding-inline: var(--mobile-gutter); }

  .header { padding-block: 2.8vw; }
  .header__inner { grid-template-columns: auto 1fr auto; min-height: 61px; }
  .header__logo img { height: 53px; max-height: 53px; }
  .header__spacer { height: 96px; }

  .header__toggle { display: inline-block; justify-self: start; }
  .header__actions { display: none; }

  .nav {
    position: fixed;
    inset: 96px 0 0 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 2rem var(--mobile-gutter);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .nav.is-open { transform: translateX(0); }

  .nav > li { width: 100%; border-bottom: 1px solid var(--hairline-dark); }
  .nav__link { display: block; padding: 1.15rem 0; font-size: 1rem; }

  .nav__panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: 0;
    padding: 0 0 0.8rem 1rem;
    min-width: 0;
  }
  .nav__panel a { padding: 0.6rem 0; }

  .footer__cols { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .footer__links { justify-items: center; }
  .media--hero { height: 64vh; }

  /* Two to one is a letterbox on a phone. These carry a single subject each,
     so they are allowed to grow taller rather than shrink to a strip. */
  .media--band { aspect-ratio: 3 / 2; }
  .figure { max-width: none; }
}


/* --------------------------------------------------------------------------
   16. UTILITIES (replace former inline styles so the CSP needs no
   'unsafe-inline' for styles)
   -------------------------------------------------------------------------- */

.mt-14 { margin-top: 1.4rem; }
.mt-16 { margin-top: 1.6rem; }
.mt-18 { margin-top: 1.8rem; }
.mt-30 { margin-top: 3rem; }
.note-sm { font-size: 0.95rem; opacity: 0.75; }

/* --------------------------------------------------------------------------
   17. PHONE REFINEMENTS
   -------------------------------------------------------------------------- */

/* Poster shows while a video has not loaded, and never blank-flashes. */
video { background: var(--black); }

@media (max-width: 60rem) {
  /* Flush sections carry full-bleed media. The gutter above must not apply
     or the hero and image bands sit inside black side bars. */
  .section--flush { padding-inline: 0; }

  /* Finger-sized targets (44px minimum). */
  .header__toggle { min-height: 44px; min-width: 44px; padding-inline: 0.2rem; }
  .btn { min-height: 48px; padding-block: 1.25em; }
  .footer__links a { display: inline-block; padding: 0.7rem 0.25rem; }
  .nav__panel a { padding: 0.8rem 0; }

  /* Notched phones and the home indicator. */
  .header { padding-top: calc(2.8vw + env(safe-area-inset-top)); }
  .header__spacer { height: calc(96px + env(safe-area-inset-top)); }
  .nav { inset-block-start: calc(96px + env(safe-area-inset-top)); }
  .footer { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }

  /* Long words and URLs never push the page wider than the screen. */
  body { overflow-wrap: break-word; }
}

@media (max-width: 30rem) {
  .btn { padding-inline: 1.4em; letter-spacing: 0.12em; }
}
