/* Iron Apex Training — visual upgrade: motion, record strip, competition carousel.
   All motion is off for visitors who ask for reduced motion. */

/* ---------- Hero entrance (CSS only, no JS needed) ---------- */
@keyframes ia-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ia-zoom { from { transform: scale(1); } to { transform: scale(1.07); } }
@keyframes ia-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: ia-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.16s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.24s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.32s; }
  .hero-copy > :nth-child(6) { animation-delay: 0.4s; }
  .hero-photo img { animation: ia-zoom 22s ease-in-out 0.6s infinite alternate; will-change: transform; }
  .hero-video img,
  .hero-video video { animation: none; will-change: auto; }
  .hero-photo::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 5px;
    background: var(--red);
    transform-origin: left center;
    animation: ia-bar 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s both;
  }
}
.hero-photo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--red); z-index: 3; }

/* ---------- Scroll reveal (classes added by js/motion.js) ---------- */
.ia-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0s);
}
.ia-reveal.ia-in { opacity: 1; transform: none; }

/* ---------- Scroll progress bar + header ---------- */
.ia-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 60;
  pointer-events: none;
}
.site-header { transition: box-shadow 0.25s ease; }
.site-header.is-scrolled { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); }

/* ---------- Hover effects ---------- */
.brand-mark { transition: transform 0.25s ease; }
.brand:hover .brand-mark { transform: scale(1.06) rotate(-2deg); }

.site-nav ul a { position: relative; }
@media (min-width: 981px) {
  .site-nav ul a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 2px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
  }
  .site-nav ul a:hover::after,
  .site-nav ul a[aria-current="page"]::after { transform: scaleX(1); }
}

.btn { transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(200, 16, 46, 0.28); }
.btn-line:hover { box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18); }
.btn:active { transform: none; box-shadow: none; }

.svc { position: relative; transition: background-color 0.25s ease, padding 0.25s ease; }
.svc::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: center top;
  transition: transform 0.25s ease;
}
.svc h2, .svc h3 { transition: transform 0.25s ease; }
@media (hover: hover) and (min-width: 981px) {
  .svc:hover { background-color: rgba(255, 255, 255, 0.7); }
  .svc:hover::before { transform: scaleY(1); }
  .svc:hover h2, .svc:hover h3 { transform: translateX(14px); }
}

.journey picture, .photo-pair picture, .feature-photo picture { display: block; overflow: hidden; }
.journey img, .photo-pair img, .feature-photo img { transition: transform 0.6s ease; }
@media (hover: hover) {
  .journey:hover img, .photo-pair figure:hover img, .feature-photo:hover img { transform: scale(1.035); }
}

.band { position: relative; }
.band::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  height: 3px; width: 100%;
  background: var(--red);
}

/* ---------- Footer logo ---------- */
.foot-copy { display: flex; align-items: center; gap: 0.8rem; }
.foot-logo { width: 42px; height: 45px; flex-shrink: 0; }

/* ---------- Record strip (animated counters) ---------- */
.record-strip { background: var(--dark); color: var(--on-dark); padding: 2.6rem 0; }
.record-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}
.record-grid > div { border-left: 1px solid rgba(255, 255, 255, 0.18); padding: 0.2rem 1rem; }
.record-grid > div:first-child { border-left: 0; }
.record-num {
  display: block;
  font-family: var(--display);
  font-size: clamp(3.4rem, 8vw, 5.4rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
}
.record-num .ia-accent { color: var(--red); }
.record-label {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--cond);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-dim);
}

/* ---------- Competition carousel ---------- */
.competition { padding: 4.6rem 0 4rem; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.competition h2 { font-size: clamp(2.6rem, 5vw, 3.8rem); margin: 0.15rem 0 0; }
.car-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.car-controls { display: flex; align-items: center; gap: 0.5rem; }
.car-controls[hidden] { display: none; }
.car-btn {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
}
.car-btn:hover { background: var(--ink); color: #fff; }
.car-btn svg { width: 20px; height: 20px; }
.car-btn .i-play { display: none; }
.car-btn[data-paused="true"] .i-play { display: block; }
.car-btn[data-paused="true"] .i-pause { display: none; }

.ctrack {
  --gap: 1.1rem;
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
}
.ctrack::-webkit-scrollbar { display: none; }
.ctrack:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.cslide {
  flex: 0 0 calc((100% - 2 * var(--gap)) / 3);
  scroll-snap-align: start;
  margin: 0;
}
.cslide figure { margin: 0; position: relative; overflow: hidden; background: #111; aspect-ratio: 4 / 5; }
.cslide img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transition: transform 0.6s ease; }
@media (hover: hover) { .cslide figure:hover img { transform: scale(1.04); } }
.cslide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2.2rem 1rem 0.9rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
  font-family: var(--cond);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cslide-ph figure {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 0.6rem;
  color: var(--on-dark-dim);
  background: linear-gradient(160deg, #1a1a1a, #2b2b2b);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  padding: 1.5rem;
}
.cslide-ph img { width: 96px; height: auto; object-fit: contain; }
.cslide-ph strong { color: #fff; font-family: var(--cond); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.9rem; font-weight: 600; }
.cslide-ph span { font-size: 0.9rem; }

.cdots { display: flex; justify-content: center; gap: 0.2rem; margin-top: 1.1rem; flex-wrap: wrap; }
.cdots[hidden] { display: none; }
.cdot {
  width: 28px; height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.cdot::before { content: ""; width: 10px; height: 10px; background: #bdb7ad; transition: background 0.2s ease, transform 0.2s ease; }
.cdot[aria-current="true"]::before { background: var(--red); transform: scale(1.35); }

@media (max-width: 980px) {
  .cslide { flex-basis: calc((100% - var(--gap)) / 2); }
  .record-strip { padding: 2.2rem 0; }
  .competition { padding: 3.4rem 0 3rem; }
}
@media (max-width: 540px) {
  .cslide { flex-basis: 82%; }
  .record-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .record-grid > div { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.18); padding-top: 1.2rem; }
  .record-grid > div:first-child { border-top: 0; padding-top: 0; }
  .car-controls .car-btn { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .ia-reveal { opacity: 1; transform: none; transition: none; }
  .ia-progress { display: none; }
  .hero-copy > *, .hero-photo img, .hero-photo::after { animation: none; }
  .hero-video video { display: none; }
  .btn:hover, .brand:hover .brand-mark { transform: none; }
  .svc:hover h2, .svc:hover h3, .cslide figure:hover img, .journey:hover img, .photo-pair figure:hover img, .feature-photo:hover img { transform: none; }
  .ctrack { scroll-behavior: auto; }
}

/* Caption sits below the photo so it never covers the athlete */
.cslide:not(.cslide-ph) figure { aspect-ratio: auto; background: none; overflow: visible; }
.cslide:not(.cslide-ph) picture { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #111; }
.cslide:not(.cslide-ph) figcaption {
  position: static;
  padding: 0.7rem 0 0;
  color: var(--ink);
  background: none;
  font-size: 0.82rem;
  line-height: 1.35;
}
.cslide-fit picture { background: #fff; }
.cslide-fit-dark picture { background: #111; }

/* Slide shown whole (e.g. a side-by-side graphic) instead of cropped to 4:5 */
.cslide-fit img { object-fit: contain; object-position: center; }

/* Caption and photo links (promoter sites + NPC News galleries) */
.clink-photo { display: block; color: inherit; text-decoration: none; }
.clink-photo:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.cslide figcaption a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.cslide figcaption a:hover { color: var(--red); }


/* About page — Service / Before the stage gallery */
.service-section { padding: 4.2rem 0 4.6rem; border-top: 1px solid var(--line); background: var(--bg-2); }
.service-section h2 { font-size: clamp(2.6rem, 5vw, 3.8rem); margin: 0.15rem 0 0.8rem; }
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  align-items: start;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}
.service-card {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0.7rem;
}
.service-card picture { display: block; background: #111; }
.service-card img { width: 100%; height: auto; }
.service-card figcaption {
  margin: 0.7rem 0.15rem 0.15rem;
  font-family: var(--cond);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--ink);
}
/* Tiny source (army-02, 260px): never stretch past native size */
.service-card.is-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100%;
}
.service-card.is-small picture {
  background: transparent;
  width: 260px;
  max-width: 100%;
  margin-inline: auto;
}
.service-card.is-small img {
  width: 260px !important;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}
/* Very tall dress-blues portrait: keep the face and rank in frame without dominating the row */
.service-card.is-tall picture { aspect-ratio: 3 / 4; overflow: hidden; }
.service-card.is-tall img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
}
@media (max-width: 980px) {
  .service-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .service-grid { grid-template-columns: 1fr; }
  .service-section { padding: 3.2rem 0 3.4rem; }
}
@media (hover: hover) {
  .service-card picture { overflow: hidden; }
  .service-card:hover img { transform: scale(1.035); }
  .service-card.is-small:hover img { transform: none; }
  .service-card img { transition: transform 0.6s ease; }
}
@media (prefers-reduced-motion: reduce) {
  .service-card:hover img { transform: none; }
}



/* Gods of Iron Pro Gym page */
.gym-intro { padding: 2.6rem 0 2.2rem; }
.gym-intro h1 { font-size: clamp(2.7rem, 5.5vw, 4.2rem); margin: 0.15rem 0 1rem; }
.gym-intro .lede { margin-bottom: 1.2rem; }
.gym-facts { margin: 0 0 1.6rem; color: var(--ink); max-width: 40rem; }
.gym-facts p { margin: 0 0 0.85rem; }
.gym-facts strong { font-family: var(--cond); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.82rem; display: block; margin-bottom: 0.15rem; color: var(--red); }
.gym-pricing { margin: 1.6rem 0 0; padding: 1.15rem 1.2rem; max-width: 40rem; background: var(--bg-2); border: 1px solid var(--line); }
.gym-pricing h2 { font-size: 1.15rem; margin: 0 0 0.5rem; letter-spacing: 0.06em; }
.gym-pricing p { margin: 0; }
.gym-photos { padding: 0 0 4.4rem; }
.gym-photos h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin: 0.15rem 0 0.8rem; }
.gym-credit { margin: 0 0 1.6rem; color: var(--muted); }
.gym-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  padding: 0;
  list-style: none;
}
.gym-card { margin: 0; background: var(--bg-2); border: 1px solid var(--line); padding: 0.7rem; }
.gym-card a { color: inherit; text-decoration: none; display: block; }
.gym-card a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.gym-card picture { display: block; background: #111; overflow: hidden; aspect-ratio: 4 / 5; }
.gym-card img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.gym-card.is-tall img { object-position: center 22%; }
.gym-card.is-floor img { object-position: center 30%; }
.gym-card figcaption {
  margin: 0.7rem 0.15rem 0.15rem;
  font-family: var(--cond);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}
.gym-card a:hover figcaption { color: var(--red); }
@media (max-width: 640px) {
  .gym-grid { grid-template-columns: 1fr; }
}
@media (hover: hover) {
  .gym-card img { transition: transform 0.6s ease; }
  .gym-card a:hover img { transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  .gym-card a:hover img { transform: none; }
}
@media (max-width: 1080px) and (min-width: 981px) {
  .site-nav a { letter-spacing: 0.08em; font-size: 0.74rem; }
}

/* YouTube page */
.yt-intro { padding: 2.6rem 0 2.2rem; }
.yt-intro h1 { font-size: clamp(2.7rem, 5.5vw, 4.2rem); margin: 0.15rem 0 1rem; }
.yt-intro .lede { margin-bottom: 1.2rem; }
.yt-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.2rem; }
.yt-videos { padding: 0 0 4.4rem; }
.yt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  padding: 0;
  list-style: none;
}
.yt-card { margin: 0; background: var(--bg-2); border: 1px solid var(--line); padding: 0.7rem; }
.yt-embed {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #111;
  overflow: hidden;
}
.yt-poster {
  display: block;
  position: absolute;
  inset: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.yt-poster img,
.yt-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  object-position: center;
}
.yt-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  transition: background 0.2s ease;
  pointer-events: none;
}
.yt-poster:hover::after,
.yt-poster:focus-visible::after { background: rgba(0, 0, 0, 0.12); }
.yt-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--red);
  z-index: 1;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.yt-play-icon::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 20px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 18px;
  border-color: transparent transparent transparent #fff;
}
.yt-card h2 {
  font-family: var(--font);
  font-size: 0.95rem;
  letter-spacing: 0;
  line-height: 1.35;
  font-weight: 600;
  text-transform: none;
  margin: 0.75rem 0.15rem 0.4rem;
}
.yt-watch {
  display: inline-block;
  margin: 0 0.15rem 0.1rem;
  font-family: var(--cond);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--red);
}
.yt-watch:hover { color: var(--red); }
@media (max-width: 980px) {
  .yt-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .yt-grid { grid-template-columns: 1fr; }
}
@media (hover: hover) {
  .yt-poster img { transition: transform 0.6s ease; }
  .yt-poster:hover img { transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  .yt-poster::after,
  .yt-poster img { transition: none; }
  .yt-poster:hover img { transform: none; }
}
@media (max-width: 1280px) and (min-width: 981px) {
  .site-nav { gap: 1rem; }
  .site-nav ul { gap: 0.95rem; }
  .site-nav a { letter-spacing: 0.07em; font-size: 0.72rem; }
}

/* About page — Stage Time */
.stage-section { padding: 4.2rem 0 4.6rem; border-top: 1px solid var(--line); }
.stage-section h2 { font-size: clamp(2.6rem, 5vw, 3.8rem); margin: 0.15rem 0 0.8rem; }
.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  align-items: start;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}
.stage-card {
  margin: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 0.7rem;
}
.stage-card picture { display: block; background: #111; }
.stage-card img { width: 100%; height: auto; }
.stage-card figcaption {
  margin: 0.7rem 0.15rem 0.15rem;
  font-family: var(--cond);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--ink);
}
.stage-card figcaption a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.stage-card figcaption a:hover { color: var(--red); }
@media (max-width: 980px) {
  .stage-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .stage-grid { grid-template-columns: 1fr; }
  .stage-section { padding: 3.2rem 0 3.4rem; }
}
@media (hover: hover) {
  .stage-card picture { overflow: hidden; }
  .stage-card img { transition: transform 0.6s ease; }
  .stage-card:hover img { transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  .stage-card:hover img { transform: none; }
}

/* Header logo — metallic shine sweep + soft glow (CSS only). */
@media (prefers-reduced-motion: no-preference) {
  .brand-mark {
    position: relative;
    animation: ia-logo-glow 4.8s ease-in-out infinite;
  }
  .brand-mark::after {
    content: "";
    position: absolute;
    top: -30%;
    bottom: -30%;
    left: 0;
    width: 55%;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
      115deg,
      transparent 0%,
      transparent 38%,
      rgba(255, 255, 255, 0.08) 44%,
      rgba(255, 255, 255, 0.42) 50%,
      rgba(255, 236, 236, 0.16) 54%,
      rgba(200, 16, 46, 0.14) 58%,
      transparent 66%
    );
    transform: translateX(-160%) skewX(-22deg);
    animation: ia-logo-shine 4.8s ease-in-out infinite;
  }
  @keyframes ia-logo-shine {
    0%, 18% { transform: translateX(-160%) skewX(-22deg); opacity: 0; }
    22% { opacity: 1; }
    42% { transform: translateX(260%) skewX(-22deg); opacity: 1; }
    48%, 100% { transform: translateX(260%) skewX(-22deg); opacity: 0; }
  }
  @keyframes ia-logo-glow {
    0%, 18% {
      box-shadow: 0 0 0 0 rgba(200, 16, 46, 0);
    }
    30% {
      box-shadow:
        0 0 8px 1px rgba(200, 16, 46, 0.28),
        0 0 14px 3px rgba(255, 255, 255, 0.16);
    }
    48%, 100% {
      box-shadow: 0 0 0 0 rgba(200, 16, 46, 0);
    }
  }
}
