/* ==========================================================================
   Earned Run Training Academy — premium athletic marketing site
   Palette: near-black #0d0f12 + gold #e8b923 (TODO-DREW may swap accent).
   Type: Oswald (condensed display headings) + Inter (body).
   ========================================================================== */

/* ---- Tokens ---- */
:root {
  --bg: #0d0f12;
  --bg-raised: #16191e;
  --bg-raised-2: #1c2027;
  --text: #f2f0ea;
  --text-dim: #a9a89f;
  --accent: #e8b923;
  --accent-soft: rgba(232, 185, 35, 0.14);
  /* Second, distinct color reserved for the "create an account / sign a waiver" action —
     kept off-gold on purpose so it reads as its own button when someone's being told
     "click the blue one" over the phone or in person, not a variant of Book/Membership. */
  --accent-2: #38bdf8;
  --border: #2a2e35;
  --maxw: 1100px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .wordmark, .btn, .stat-num, .step-num {
  font-family: "Oswald", "Inter", system-ui, sans-serif;
}

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Buttons ---- */
.btn {
  position: relative;
  display: inline-block;
  padding: 15px 34px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 5px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #16130a; }
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(232, 185, 35, 0.4), 0 0 0 1px rgba(232, 185, 35, 0.5);
}
.btn-primary:active { transform: translateY(-1px); }
/* stitch detail: dashed inset border echoing baseball seams */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1.5px dashed rgba(22, 19, 10, 0.45);
  border-radius: 3px;
  pointer-events: none;
}
.btn-outline { border: 2px solid var(--accent); color: var(--accent); }
.btn-outline:hover {
  background: var(--accent);
  color: #16130a;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(232, 185, 35, 0.35);
}

.btn-account { background: var(--accent-2); color: #0b1b26; }
.btn-account:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.4), 0 0 0 1px rgba(56, 189, 248, 0.5);
}
.btn-account:active { transform: translateY(-1px); }

/* attention pulse on the hero CTA */
.btn-pulse { animation: pulse 2.6s var(--ease) infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 185, 35, 0.5); }
  50%      { box-shadow: 0 0 0 14px rgba(232, 185, 35, 0); }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.scrolled {
  background: rgba(13, 15, 18, 0.94);
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
  flex-wrap: wrap;
}
.wordmark {
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.wordmark span { color: var(--accent); }
.wordmark:hover { text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-family: "Oswald", sans-serif;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav .nav-cta {
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 7px 16px;
  border-radius: 4px;
}
.site-nav .nav-cta:hover { background: var(--accent); color: #16130a; }
.site-nav .nav-cta-account { color: var(--accent-2); border-color: var(--accent-2); }
.site-nav .nav-cta-account:hover { background: var(--accent-2); color: #0b1b26; }

/* Separates the account/membership links from Book Time, a different kind of action.
   A plain span (not a border on Book Time itself) so it doesn't fight that button's
   own box. Flex gap on .site-nav already spaces it evenly from both neighbors. */
.nav-divider { width: 1px; height: 24px; background: var(--border); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(232, 185, 35, 0.10), transparent 55%),
    linear-gradient(180deg, #101318, var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-field {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, 92vw);
  height: min(760px, 92vw);
  transform: translate(-50%, -46%);
  color: rgba(232, 185, 35, 0.10);
  z-index: 0;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 130px 24px 120px;
  text-align: center;
}
.hero-headline {
  margin: 0 0 20px;
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.02;
  text-transform: uppercase;
}
.hero-sub {
  margin: 0 auto 38px;
  max-width: 620px;
  color: var(--text-dim);
  font-size: 1.2rem;
}

/* staggered hero entrance */
.reveal-hero {
  opacity: 0;
  transform: translateY(22px);
}
.hero-ready .reveal-hero {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.hero-ready .reveal-hero[data-delay="1"] { transition-delay: 0.14s; }
.hero-ready .reveal-hero[data-delay="2"] { transition-delay: 0.28s; }
.hero-ready .reveal-hero[data-delay="3"] { transition-delay: 0.42s; }

/* two hero CTAs sit side by side; .btn is inline-block with no margin of its own */
.hero-inner .btn + .btn { margin-left: 14px; }

/* Booking is a different kind of action from the membership/create-account pair —
   the extra gap marks where that pair starts, set apart from Book Cage Time. */
.hero-inner .btn.btn-group-start { margin-left: 40px; }

/* One line under the CTAs. --text-dim is the palette's only dim text token (also used by
   .hero-sub), so size carries the hierarchy: 0.9rem against the subline's 1.2rem reads as
   support for the buttons rather than a second subline. */
.hero-note {
  margin: 26px auto 0;
  max-width: 520px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ==========================================================================
   Seam divider (baseball stitch motif)
   ========================================================================== */
.seam-divider { line-height: 0; background: var(--bg); }
.seam-divider svg { display: block; width: 100%; height: 40px; }
.seam-line {
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
}
.seam-stitch {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-dasharray: 2 12;
  stroke-linecap: round;
  opacity: 0.7;
}

/* ==========================================================================
   Stats band (count-up)
   ========================================================================== */
.stats {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  padding: 54px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-num {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ==========================================================================
   Sections (shared)
   ========================================================================== */
.section { padding: 92px 0; border-bottom: 1px solid var(--border); }
.section-heading {
  margin: 0 0 30px;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-heading::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  margin-top: 14px;
  background: var(--accent);
  border-radius: 2px;
}
.lede { font-size: 1.22rem; color: var(--text); max-width: 720px; }
.section p { max-width: 720px; color: var(--text-dim); }
.section .lede { color: var(--text); }

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Photo grid + lightbox
   ========================================================================== */
.photo-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.photo-slot {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-raised-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.photo-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232,185,35,0.06), transparent 60%);
  transition: opacity 0.3s var(--ease);
}
.photo-slot img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.photo-slot:hover { border-color: var(--accent); }
.photo-slot:hover img { transform: scale(1.05); }
/* Filtering toggles the `hidden` attribute. .photo-slot declares no `display`, so the
   UA rule already applies — this is belt-and-braces so a future `display` on .photo-slot
   cannot silently resurrect the invisible-but-clickable bug the lightbox had. */
.photo-slot[hidden] { display: none; }

/* ---- Gallery filter chips ---- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}
.chip {
  font-family: "Oswald", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #16130a;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 7, 9, 0.9);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.lightbox.open { opacity: 1; }
.lightbox-content {
  margin: 0;
  width: min(1100px, 88vw);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised-2);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-nav:hover { background: var(--accent); color: #16130a; }
/* Nav buttons hide when the filtered set has a single photo — same [hidden] discipline. */
.lightbox-nav[hidden] { display: none; }
.lightbox-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--text-dim);
  font-family: "Oswald", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.lightbox-close {
  position: absolute;
  top: 22px;
  right: 26px;
  width: 46px;
  height: 46px;
  font-size: 2rem;
  line-height: 1;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.lightbox-close:hover { background: var(--accent); color: #16130a; }

/* ==========================================================================
   How it works
   ========================================================================== */
.steps {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.step {
  position: relative;
  display: block;
  padding: 34px 28px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.step:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}
.step-icon { display: block; width: 48px; height: 48px; color: var(--accent); }
.step-icon svg { width: 100%; height: 100%; }
.step-num {
  position: absolute;
  top: 26px;
  right: 28px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--border);
}
.step-title {
  margin: 18px 0 8px;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.step-text { margin: 0; color: var(--text-dim); font-size: 0.98rem; }

/* ==========================================================================
   Mid-page CTA band
   ========================================================================== */
.cta-band {
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(232,185,35,0.10), transparent 60%),
    var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.cta-band-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 56px 24px;
  flex-wrap: wrap;
}
.cta-band-text {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   Hours & Location
   ========================================================================== */
.hours-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
}
.subhead {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}
.hours-table th { font-weight: 500; color: var(--text); }
.hours-table td { color: var(--text-dim); }
.hours-table tr.today {
  background: var(--accent-soft);
}
.hours-table tr.today th { color: var(--accent); font-weight: 700; }
.hours-table tr.today td::after {
  content: " • Today";
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85em;
}
.map-slot {
  aspect-ratio: 16 / 10;
  margin-bottom: 20px;
  background:
    repeating-linear-gradient(45deg, var(--bg-raised) 0 14px, var(--bg-raised-2) 14px 28px);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-slot iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.map-slot span {
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-family: "Oswald", sans-serif;
}
.address-block { font-style: normal; color: var(--text-dim); line-height: 1.9; }
.phone { color: var(--text-dim); }
.phone-link {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px dashed rgba(232, 185, 35, 0.5);
}
.phone-link:hover { text-decoration: none; border-bottom-style: solid; }

/* ==========================================================================
   FAQ accordion
   ========================================================================== */
.accordion { max-width: 780px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item h3 { margin: 0; }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text);
  font-family: "Oswald", sans-serif;
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: left;
  transition: color 0.2s var(--ease);
}
.faq-q:hover { color: var(--accent); }
.faq-icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}
.faq-icon::before, .faq-icon::after {
  content: "";
  position: absolute;
  background: var(--accent);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.faq-icon::before { top: 8px; left: 0; width: 18px; height: 2px; }
.faq-icon::after  { top: 0; left: 8px; width: 2px; height: 18px; }
.faq-q[aria-expanded="true"] .faq-icon::after { transform: scaleY(0); opacity: 0; }
.faq-a {
  padding: 0 4px 24px;
  color: var(--text-dim);
}
.faq-a p { margin: 0; color: var(--text-dim); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--bg); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 44px 24px;
  flex-wrap: wrap;
}
.footer-name {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-year { color: var(--text-dim); font-size: 0.85rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  /* The nav wraps to two rows on phones, so the header is much taller than on desktop —
     transparent-until-scrolled left hero text showing straight through it at the top
     of the page. Solid from the start here; desktop keeps the scroll-triggered fade. */
  .site-header {
    background: rgba(13, 15, 18, 0.94);
    border-bottom-color: var(--border);
    backdrop-filter: blur(8px);
  }
  .header-inner { min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .site-nav { gap: 14px; }
  .nav-divider { display: none; }
  .hero-inner { padding: 90px 24px 80px; }
  .hero-inner .btn + .btn { margin-left: 0; margin-top: 14px; }
  .hero-inner .btn.btn-group-start { margin-left: 0; margin-top: 28px; }
  .section { padding: 64px 0; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 32px 12px; }
  .steps { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.7rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-img { max-height: 68vh; }
  .hours-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   Reduced motion — disable ALL motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal, .reveal-hero { opacity: 1 !important; transform: none !important; }
  .btn-pulse { animation: none !important; }
}

/* The lightbox div carries `hidden`, but the .lightbox rule above sets display:flex,
   and an author display declaration overrides the UA stylesheet's [hidden]{display:none}.
   Without this the overlay stays in the layout — fixed, inset 0, z-index 100 — invisible
   only because opacity is 0, and opacity does not disable hit-testing. It swallowed every
   click on the page, including the nav at z-index 50. */
.lightbox[hidden] { display: none; }
