/* ============================================================
   Capitan Fitness: Graphite & Ember design system
   Dark is the default theme; light is applied via [data-theme="light"].
   Every token below has a value in both modes for legible contrast.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Brand constants */
  --ink: #14151A;
  --slate: #2A2D36;
  --bone: #F5F2EC;
  --ember: #E8552B;

  /* Type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* Layout */
  --container: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 2px;
  --section-pad: clamp(64px, 10vw, 140px);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* Dark theme (default) */
:root,
[data-theme="dark"] {
  --bg: #14151A;
  --bg-alt: #181A21;
  --surface: #1F222B;
  --text: #F5F2EC;
  --text-muted: rgba(245, 242, 236, 0.62);
  --line: rgba(245, 242, 236, 0.13);
  --line-strong: rgba(245, 242, 236, 0.26);
  --accent: #E8552B;
  --accent-hover: #F06B45;
  --on-accent: #14151A;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

/* Light theme */
[data-theme="light"] {
  --bg: #F5F2EC;
  --bg-alt: #EFEBE1;
  --surface: #FFFFFF;
  --text: #14151A;
  --text-muted: rgba(20, 21, 26, 0.62);
  --line: rgba(20, 21, 26, 0.14);
  --line-strong: rgba(20, 21, 26, 0.28);
  --accent: #D8481F;
  --accent-hover: #BF3D17;
  --on-accent: #FFFFFF;
  --shadow: 0 18px 50px rgba(20, 21, 26, 0.12);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--text-muted); max-width: 56ch; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-pad); }
.section--alt { background: var(--bg-alt); }
.section-head { max-width: 60ch; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head .eyebrow { margin-bottom: 20px; }
.section-head p { margin-top: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 78px;
}
.nav__logo { display: flex; align-items: center; }
.nav__logo svg, .nav__logo img { height: 38px; width: auto; }
.nav__logo .logo--dark { display: none; }
[data-theme="light"] .nav__logo .logo--light { display: none; }
[data-theme="light"] .nav__logo .logo--dark { display: block; }

.nav__links { display: flex; align-items: center; gap: 34px; }
.nav__links a {
  font-size: 0.95rem;
  color: var(--text-muted);
  position: relative;
  padding-block: 4px;
  transition: color 0.2s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.nav__links a:hover::after { width: 100%; }

.nav__actions { display: flex; align-items: center; gap: 14px; }

/* Theme toggle */
.theme-toggle {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Mobile nav */
.nav__burger { display: none; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); }
.nav__burger span { display: block; width: 18px; height: 2px; background: var(--text); position: relative; }
.nav__burger span::before, .nav__burger span::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--text); transition: transform 0.25s var(--ease); }
.nav__burger span::before { top: -6px; }
.nav__burger span::after { top: 6px; }

@media (max-width: 860px) {
  .nav__links {
    position: fixed;
    inset: 78px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 24px var(--gutter) 32px;
    transform: translateY(-130%);
    transition: transform 0.35s var(--ease);
    box-shadow: var(--shadow);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { font-size: 1.15rem; padding-block: 12px; width: 100%; }
  .nav__burger { display: grid; }
  .nav__cta { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(72px, 12vw, 150px) var(--section-pad); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { margin-block: 22px 26px; }
.hero h1 .accent { color: var(--accent); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.hero__meta { display: flex; gap: 36px; margin-top: 52px; flex-wrap: wrap; }
.hero__meta .stat { display: flex; flex-direction: column; gap: 4px; }
.hero__meta .stat b { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.hero__meta .stat span { font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
}

/* ---------- Media placeholder frames ---------- */
/* Styled stand-ins so the layout reads as intentional until real
   photography is dropped into /public/media/images/. */
.media-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ember) 22%, var(--slate)) 0%, var(--slate) 60%);
  aspect-ratio: 4 / 5;
}
.media-frame--wide { aspect-ratio: 16 / 10; }
.media-frame img, .media-frame video { width: 100%; height: 100%; object-fit: cover; }
.media-frame__tag {
  position: absolute;
  left: 14px; bottom: 14px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone);
  background: rgba(20, 21, 26, 0.55);
  border: 1px solid rgba(245, 242, 236, 0.2);
  padding: 6px 10px;
  border-radius: var(--radius);
}
.media-frame__chevrons { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0.5; }
.media-frame__chevrons svg { width: 64px; height: auto; }

/* ---------- Approach cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--bg); padding: clamp(28px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; transition: background 0.25s var(--ease); }
.card:hover { background: var(--surface); }
.card__num { font-family: var(--font-display); font-size: 1rem; color: var(--accent); font-weight: 700; letter-spacing: 0.1em; }
.card h3 { margin-top: 6px; }
.card p { color: var(--text-muted); font-size: 0.98rem; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.about__body p + p { margin-top: 18px; }
.about__creds { margin-top: 32px; display: grid; gap: 12px; }
.about__creds li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-muted); }
.about__creds li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 5px; background: var(--accent); clip-path: polygon(0 35%, 50% 0, 100% 35%, 100% 55%, 50% 20%, 0 55%); }
@media (max-width: 820px) { .about__grid { grid-template-columns: 1fr; } }

/* ---------- Testimonials ---------- */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.quote { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 3vw, 38px); display: flex; flex-direction: column; gap: 22px; }
.quote p { font-family: var(--font-display); font-size: 1.18rem; line-height: 1.4; letter-spacing: -0.01em; }
.quote .mark { color: var(--accent); font-family: var(--font-display); font-size: 2.4rem; line-height: 0.6; font-weight: 700; }
.quote footer { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.9rem; }
.quote footer b { color: var(--text); font-weight: 600; }

/* ---------- Location ---------- */
.location__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 64px); align-items: center; }
.location__facts { display: grid; gap: 22px; margin-top: 30px; }
.location__facts div { border-top: 1px solid var(--line); padding-top: 16px; }
.location__facts dt { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.location__facts dd { font-family: var(--font-display); font-size: 1.15rem; }
.location__links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
@media (max-width: 820px) { .location__grid { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 6vw, 72px); }
.contact__aside p { color: var(--text-muted); margin-top: 18px; }
.contact__aside .direct { margin-top: 34px; display: grid; gap: 16px; }
.contact__aside .direct a { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; }
.contact__aside .direct a:hover { color: var(--accent); }

.form { display: grid; gap: 20px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.field input, .field textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 130px; }
/* Honeypot: hidden from humans, catches naive bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__note { font-size: 0.86rem; color: var(--text-muted); }
.form__status { font-size: 0.95rem; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); display: none; }
.form__status.is-visible { display: block; }
.form__status.is-visible { border-color: var(--accent); color: var(--text); background: var(--surface); }
@media (max-width: 760px) { .contact__grid { grid-template-columns: 1fr; } .form .row { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(48px, 7vw, 80px) 36px; background: var(--bg-alt); }
.footer__top { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
.footer__brand svg, .footer__brand img { height: 40px; width: auto; }
.footer__brand .logo--dark { display: none; }
[data-theme="light"] .footer__brand .logo--light { display: none; }
[data-theme="light"] .footer__brand .logo--dark { display: block; }
.footer__brand p { color: var(--text-muted); margin-top: 18px; max-width: 38ch; font-size: 0.95rem; }
.footer__col h4 { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 18px; }
.footer__col a { display: block; padding-block: 7px; color: var(--text); transition: color 0.2s var(--ease); }
.footer__col a:hover { color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: clamp(40px, 6vw, 64px); padding-top: 28px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 0.85rem; }
@media (max-width: 760px) { .footer__top { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* Accessible focus ring */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }
