/* ==========================================================================
   Calnan Mutyaba Fitness — stylesheet
   Implements: UX spec 03-ux-spec.md · NFR-2 (a11y), NFR-3 (responsive),
   NFR-9 (reduced motion), NFR-10 (token-driven maintainability)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --ink: #0c0d0f;
  --ink-2: #141619;
  --ink-3: #1c1f24;
  --bone: #f7f5f2;
  --bone-2: #eceae5;
  --white: #ffffff;

  /* Accent — large text, rules and numerals only (contrast note, UX §3) */
  --accent: #e8552b;
  --accent-soft: #ff7a52;
  --accent-deep: #c3421d;

  /* Text */
  --text-dark: #1a1c1f;
  --text-muted: #5a5f66;
  --text-light: #f2efeb;
  --text-light-muted: #a9afb7;

  /* Lines */
  --line-light: rgba(26, 28, 31, 0.12);
  --line-dark: rgba(242, 239, 235, 0.14);

  /* Type */
  --font-display: "Oswald", "Haettenschweiler", "Arial Narrow Bold", system-ui, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.125rem, 0.4vw + 1.05rem, 1.25rem);
  --step-2: clamp(1.35rem, 0.8vw + 1.15rem, 1.65rem);
  --step-3: clamp(1.75rem, 1.6vw + 1.35rem, 2.4rem);
  --step-4: clamp(2.1rem, 3vw + 1.4rem, 3.4rem);
  --step-5: clamp(2.75rem, 7vw, 5.5rem);

  /* Space */
  --space-xs: 0.5rem;
  --space-sm: 0.875rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --section-y: clamp(4rem, 9vw, 7.5rem);

  /* Shape */
  --radius: 4px;
  --radius-lg: 8px;
  --maxw: 1180px;
  --maxw-prose: 68ch;

  --shadow: 0 1px 2px rgba(12, 13, 15, 0.06), 0 8px 24px rgba(12, 13, 15, 0.07);
  --shadow-lift: 0 2px 4px rgba(12, 13, 15, 0.08), 0 18px 40px rgba(12, 13, 15, 0.12);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 92px; /* clears the sticky header on anchor jumps (FR-1) */
}

/* Smooth scrolling is opt-in only when motion is welcome (NFR-9) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--text-dark);
  background: var(--bone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: inherit; }

ul, ol { padding: 0; list-style: none; }

/* Visible, consistent focus for keyboard users only (NFR-2) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.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;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.section { padding-block: var(--section-y); }

.section--dark {
  background: var(--ink);
  color: var(--text-light);
}
.section--dark p { color: var(--text-light-muted); }

.section--tint { background: var(--bone-2); }

.section__head { max-width: var(--maxw-prose); margin-bottom: var(--space-lg); }
.section__head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: var(--space-sm);
}
.section--dark .eyebrow { color: var(--accent-soft); }

.section__title { font-size: var(--step-4); }
.section__lede {
  margin-top: var(--space-md);
  font-size: var(--step-1);
  color: var(--text-muted);
}
.section--dark .section__lede { color: var(--text-light-muted); }

.grid { display: grid; gap: var(--space-md); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;             /* ≥44px tap target (NFR-3) */
  padding: 0.9rem 1.9rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--accent); color: var(--white); }
.btn--primary:hover { background: var(--accent-soft); }

.btn--ghost-light { border-color: rgba(242, 239, 235, 0.45); color: var(--text-light); }
.btn--ghost-light:hover { border-color: var(--text-light); background: rgba(242, 239, 235, 0.08); }

.btn--ghost-dark { border-color: var(--text-dark); color: var(--text-dark); }
.btn--ghost-dark:hover { background: var(--text-dark); color: var(--bone); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-md); }
.btn-row--center { justify-content: center; }

/* --------------------------------------------------------------------------
   5. Skip link & header
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: transform 0.18s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}
/* .is-stuck is applied by main.js past 40px of scroll (STORY-2.1) */
.header.is-stuck {
  background: rgba(12, 13, 15, 0.94);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line-dark);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 76px;
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text-light);
  line-height: 1.15;
}
.brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.brand__text { display: flex; flex-direction: column; white-space: nowrap; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand__role {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  white-space: nowrap;
}

.nav__list { display: flex; align-items: center; gap: clamp(0.75rem, 1.6vw, 1.75rem); }

.nav__link {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-light-muted);
  transition: color 0.2s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s var(--ease);
}
.nav__link:hover { color: var(--text-light); }
/* Scroll-spy sets aria-current on the in-view section's link (FR-3) */
.nav__link[aria-current="true"] { color: var(--text-light); }
.nav__link:hover::after,
.nav__link[aria-current="true"]::after { transform: scaleX(1); }

.nav__cta { margin-left: var(--space-xs); }
.nav__cta .btn { min-height: 44px; padding: 0.6rem 1.25rem; font-size: 0.8rem; }

.nav-toggle {
  display: none;
  width: 48px; height: 48px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  color: var(--text-light);
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 22px; height: 2px;
  background: currentColor;
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }

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

/* --------------------------------------------------------------------------
   6. Hero (FR-5)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(100svh, 900px);
  padding-block: calc(76px + var(--space-xl)) var(--space-xl);
  background: var(--ink);
  color: var(--text-light);
  overflow: hidden;
}
/* Depth without an image request — keeps LCP text-only (NFR-1) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 78% 18%, rgba(232, 85, 43, 0.20), transparent 62%),
    radial-gradient(700px 480px at 8% 92%, rgba(232, 85, 43, 0.09), transparent 60%),
    linear-gradient(180deg, #101216 0%, #0c0d0f 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
  background-size: 92px 92px;
  opacity: 0.35;
  mask-image: radial-gradient(circle at 50% 45%, #000 10%, transparent 78%);
}
.hero__inner { position: relative; z-index: 1; max-width: 900px; }

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 1rem;
  margin-bottom: var(--space-md);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-light);
  background: rgba(242, 239, 235, 0.07);
  border: 1px solid var(--line-dark);
  border-radius: 100px;
}
.hero__kicker::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero__title { font-size: var(--step-5); }
.hero__title span { display: block; color: var(--accent-soft); }

.hero__lede {
  max-width: 62ch;
  margin-top: var(--space-md);
  font-size: var(--step-1);
  color: var(--text-light-muted);
}

.hero__actions { margin-top: var(--space-lg); }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--line-dark);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light-muted);
}

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  height: 100%;
  padding: var(--space-md);
  background: var(--white);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              border-color 0.25s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 85, 43, 0.4);
  box-shadow: var(--shadow-lift);
}
.card__title { font-size: var(--step-2); }
.card__body { color: var(--text-muted); font-size: 0.975rem; }

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  color: var(--accent-deep);
  background: rgba(232, 85, 43, 0.1);
  border-radius: var(--radius);
}
.card__icon svg { width: 24px; height: 24px; }

.card__cert-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--line-light);
  display: block;
  margin-bottom: var(--space-xs);
}

/* --------------------------------------------------------------------------
   YouTube click-to-play video wall
   -------------------------------------------------------------------------- */
.video-card { gap: var(--space-sm); }
.video-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink);
}
.video-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s var(--ease);
}
.video-card__media:hover .video-card__thumb { transform: scale(1.04); }
.video-card__media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-card__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(12, 13, 15, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.85);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.video-card__play::before {
  content: "";
  position: absolute;
  top: 50%; left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}
.video-card__media:hover .video-card__play {
  background: var(--accent-deep);
  transform: translate(-50%, -50%) scale(1.08);
}
.video-card__title { font-size: 0.95rem; color: var(--text-dark); }
.section--dark .video-card__title, .section--tint .video-card__title { color: inherit; }

.card__note {
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--line-light);
  font-size: var(--step--1);
  color: var(--text-muted);
}
.card__note strong { color: var(--text-dark); }

/* --------------------------------------------------------------------------
   8. About
   -------------------------------------------------------------------------- */
.about { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about__body > * + * { margin-top: var(--space-md); }
.about__body p { color: var(--text-muted); font-size: var(--step-1); }
.about__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: var(--ink);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  display: block;
}

.philosophy {
  padding: var(--space-md);
  background: var(--ink);
  color: var(--text-light);
  border-radius: var(--radius-lg);
}
.philosophy__steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
  margin: var(--space-sm) 0 var(--space-md);
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.philosophy p { color: var(--text-light-muted); font-size: 0.975rem; }

.creds { margin-top: var(--space-md); display: grid; gap: var(--space-sm); }
.cred {
  padding: var(--space-sm) var(--space-md);
  background: var(--white);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
}
.cred__title { font-size: 1.05rem; }
.cred__meta { font-size: var(--step--1); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   9. Steps (FR-9)
   -------------------------------------------------------------------------- */
.steps { counter-reset: step; display: grid; gap: 0; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: var(--space-md);
  padding-block: var(--space-md);
  border-bottom: 1px solid var(--line-dark);
}
.step:last-child { border-bottom: 0; }
.step__num {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1;
  color: var(--accent);
}
.step__title { font-size: var(--step-2); margin-bottom: 0.35rem; }

/* --------------------------------------------------------------------------
   10. Program cards (FR-10)
   -------------------------------------------------------------------------- */
.program {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  height: 100%;
  padding: var(--space-lg) var(--space-md) var(--space-md);
  background: var(--white);
  border: 1px solid var(--line-light);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.program__title { font-size: var(--step-3); }
.program__for { font-size: var(--step--1); color: var(--text-muted); letter-spacing: 0.04em; }

.checklist { display: grid; gap: 0.6rem; margin-top: var(--space-xs); }
.checklist li {
  position: relative;
  padding-left: 1.75rem;
  font-size: 0.975rem;
  color: var(--text-dark);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 11px; height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.section--dark .checklist li { color: var(--text-light-muted); }
.section--dark .checklist li::before { border-color: var(--accent-soft); }

.checklist--two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem var(--space-md); }

.program__price {
  margin-top: auto;
  padding-top: var(--space-sm);
  font-size: var(--step--1);
  color: var(--text-muted);
  border-top: 1px solid var(--line-light);
}
.program .btn { width: 100%; }

/* --------------------------------------------------------------------------
   11. Results & testimonials (FR-13)
   -------------------------------------------------------------------------- */
.testimonial-placeholder {
  margin-top: var(--space-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius-lg);
  background: rgba(242, 239, 235, 0.03);
}
.testimonial-placeholder__label {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   12. FAQ (FR-14) — native <details>, works without JS (NFR-6)
   -------------------------------------------------------------------------- */
.faq { max-width: 62rem; margin-inline: auto; display: grid; gap: 0.75rem; }
.faq__item {
  background: var(--white);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.faq__item[open] { border-color: rgba(232, 85, 43, 0.45); box-shadow: var(--shadow); }

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  min-height: 60px;
  font-family: var(--font-display);
  font-size: var(--step-1);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "";
  flex: none;
  width: 12px; height: 12px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.22s var(--ease);
}
.faq__item[open] .faq__q::after { transform: rotate(-135deg) translateY(-3px); }
.faq__a { padding: 0 var(--space-md) var(--space-md); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   13. Contact & form (FR-15, FR-17, FR-18)
   -------------------------------------------------------------------------- */
.contact { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }

.contact__details { display: grid; gap: var(--space-md); }
.contact__line { display: grid; gap: 0.15rem; }
.contact__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
/* Large tappable phone/email — the fallback if the form ever fails (FR-22) */
.contact__value {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--text-light);
  text-decoration: none;
  word-break: break-word;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
a.contact__value:hover { color: var(--accent-soft); border-bottom-color: var(--accent-soft); }

.form {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md);
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
}
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
.field { display: grid; gap: 0.4rem; }

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
}
.field .opt { color: var(--text-light-muted); font-weight: 400; letter-spacing: 0.04em; text-transform: none; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 0.8rem 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-light);
  background: var(--ink-3);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6d747d; }

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.75rem;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 85, 43, 0.24);
}
.field :is(input, select, textarea)[aria-invalid="true"] { border-color: #ff6b6b; }

.field__error {
  font-size: 0.82rem;
  color: #ff9b9b;
  min-height: 0;
}
.field__error:empty { display: none; }

/* Honeypot — off-screen rather than display:none, which some bots skip (FR-21) */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
}

.form__consent { font-size: 0.82rem; color: var(--text-light-muted); }
.form__consent a { color: var(--text-light); }

.form__status {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  color: #ff9b9b;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: var(--radius);
}
.form__status:empty { display: none; }

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.footer { padding-block: var(--space-xl) var(--space-lg); background: #08090a; color: var(--text-light-muted); }
.footer__top { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-lg); padding-bottom: var(--space-lg); border-bottom: 1px solid var(--line-dark); }
.footer__name { font-family: var(--font-display); font-size: var(--step-3); color: var(--text-light); }
.footer__tag { margin-top: var(--space-xs); color: var(--accent-soft); letter-spacing: 0.06em; text-transform: uppercase; font-size: var(--step--1); }
.footer__links { display: flex; flex-wrap: wrap; gap: 0 var(--space-md); align-content: start; margin-block: calc(var(--space-sm) * -1); }
.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}
.footer__links a:hover { color: var(--text-light); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-sm); padding-top: var(--space-md); font-size: 0.82rem; }
.footer__bottom a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.footer__bottom a:hover { color: var(--text-light); }

/* --------------------------------------------------------------------------
   15. Legal / confirmation pages
   -------------------------------------------------------------------------- */
.page-head { padding-block: calc(76px + var(--space-xl)) var(--space-lg); background: var(--ink); color: var(--text-light); }
.page-head__title { font-size: var(--step-4); }
.page-head p { color: var(--text-light-muted); margin-top: var(--space-sm); }

.prose { max-width: var(--maxw-prose); }
.prose > * + * { margin-top: var(--space-md); }
.prose h2 { font-size: var(--step-3); margin-top: var(--space-lg); }
.prose h3 { font-size: var(--step-1); margin-top: var(--space-md); }
.prose p, .prose li { color: var(--text-muted); }
.prose ul { display: grid; gap: 0.5rem; padding-left: 1.25rem; list-style: disc; }
.prose a { color: var(--accent-deep); }

.confirm { display: grid; gap: var(--space-md); place-items: start; }
.confirm__tick {
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  border-radius: 50%;
  background: rgba(232, 85, 43, 0.14);
  color: var(--accent);
}
.confirm__tick svg { width: 32px; height: 32px; }

/* --------------------------------------------------------------------------
   16. Reveal animation — NFR-6.
   The hidden state is scoped to `.js`, a class set by an inline head script.
   With JS off (or if main.js fails to load) content is simply visible.
   -------------------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

/* --------------------------------------------------------------------------
   17. Responsive (UX §5)
   -------------------------------------------------------------------------- */
@media (max-width: 1099px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr; }
}

@media (max-width: 899px) {
  /* The toggle only exists as a control when JS can operate it (NFR-6) */
  .js .nav-toggle { display: inline-flex; }

  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    padding: var(--space-md) clamp(1.25rem, 5vw, 3rem) var(--space-lg);
    background: rgba(12, 13, 15, 0.985);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-dark);
  }
  /* Collapsed only under JS; without it the nav stays open and usable */
  .js .nav { display: none; }
  /* .is-open is toggled by main.js alongside aria-expanded (FR-2) */
  .js .nav.is-open { display: block; }

  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__item { border-bottom: 1px solid var(--line-dark); }
  .nav__link { display: block; padding: 0.95rem 0; font-size: 0.95rem; }
  .nav__link::after { display: none; }
  .nav__cta { margin: var(--space-md) 0 0; }
  .nav__cta .btn { width: 100%; min-height: 52px; }
}

@media (max-width: 639px) {
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .checklist--two { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; gap: var(--space-xs); }
  .btn { width: 100%; }
  .nav__cta .btn, .footer .btn { width: 100%; }
  .hero__meta { gap: var(--space-xs) var(--space-md); }

  /* Below this width the brand name/role no longer fit on one line each
     next to the nav-toggle button — let them wrap instead of pushing the
     toggle off-screen (found via live-site audit, 390px viewport). */
  .brand { flex-shrink: 1; min-width: 0; }
  .brand__name, .brand__role, .brand__text { white-space: normal; }
  .brand__name { font-size: 0.92rem; }
}

/* --------------------------------------------------------------------------
   18. Reduced motion (NFR-9) & print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover { transform: none; }
}

@media print {
  .header, .nav, .skip-link, .btn, .form { display: none !important; }
  body { background: #fff; color: #000; }
  .section--dark, .hero { background: #fff !important; color: #000 !important; }
}

/* --------------------------------------------------------------------------
   Training app entry (section#app)
   Added when the client application became a second surface. Reuses the
   existing card/grid/btn system — these are the only new rules needed.
   -------------------------------------------------------------------------- */

/* Distinguishes the login link from section anchors: it leaves the site. */
.nav__link--login {
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 0.35em 0.85em;
  white-space: nowrap;
}

.nav__link--login:hover,
.nav__link--login:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.app-cta {
  margin-top: var(--space-lg);
}

.app-note {
  margin-top: var(--space-md);
  text-align: center;
  font-size: var(--step--1);
  color: var(--text-light-muted);
}

.app-note a {
  color: var(--accent-soft);
}

@media (max-width: 900px) {
  /* Inside the open mobile panel the boxed link reads as a stray button. */
  .nav__link--login {
    border: 0;
    padding: 0;
  }
}

/* .card was only ever used on light sections, so it hard-codes a white
   background while .section--dark sets light text — giving light-on-white,
   which is unreadable. Give cards a dark surface inside dark sections. */
.section--dark .card {
  background: var(--ink-3);
  border-color: var(--line-dark);
}

.section--dark .card__title { color: var(--text-light); }
.section--dark .card__body { color: var(--text-light-muted); }
