/* ============================================================
   Marathon Web Theme — Component Layer
   Shared nav, footer, ticker, Carl, scroll-arrow components

   Requires: web-theme.css (loads tokens + foundation)
   Usage: <link rel="stylesheet" href="../shared/web-theme/web-components.css">
   ============================================================ */


/* ============================================================
   === NAVIGATION ===
   ============================================================ */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: all 0.3s ease;
}

/* Engine site pattern — cleaner than JS-driven opacity changes */
nav.scrolled {
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--divider);
  padding: 14px 0;
}

nav .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo img {
  height: 28px;
  width: auto;
}

.logo-text {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Nav links — engine site pattern; marketing site omits these but they're available */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  padding: 10px 24px;
  background: var(--magenta);
  color: white;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.nav-cta:hover {
  background: var(--magenta-light);
  transform: translateY(-1px);
}


/* --- Dual CTA Group (hero primary + secondary) --- */
.hero-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Force both buttons to the same width inside the group */
.hero-cta-group .hero-cta,
.hero-cta-group .hero-cta-secondary,
.hero-cta-group .inline-signup-trigger {
  min-width: 220px;
  justify-content: center;
  text-align: center;
}

.hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  background: transparent;
  color: var(--text-primary, #F0F0F5);
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.hero-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.08);
}

.hero-cta-secondary .arrow {
  transition: transform 0.2s ease;
}
.hero-cta-secondary:hover .arrow {
  transform: translateX(3px);
}

.hero-cta-secondary .arrow-down {
  transition: transform 0.2s ease;
}
.hero-cta-secondary:hover .arrow-down {
  transform: translateY(3px);
}


/* ============================================================
   === SCROLL ARROW ===
   Engine site: position: fixed, bottom: 32px, z-index: 100
   Marketing site: position: absolute, bottom: 40px, z-index: 10
   Shared base uses fixed + CSS custom property for z-index override
   ============================================================ */

.scroll-arrow {
  position: fixed;
  bottom: var(--scroll-arrow-bottom, 32px);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--scroll-arrow-z, 100);
  opacity: 0;
  transition: opacity 0.6s ease;
  cursor: pointer;
}

.scroll-arrow.visible {
  opacity: 1;
}

.scroll-arrow svg {
  width: 36px;
  height: 36px;
  animation: scrollBounce 1.8s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}


/* ============================================================
   === RESULTS TICKER / SCROLL TRACK ===
   Engine site: .results-scroller > .results-track-wrapper > .results-track
   Marketing site: .results-strip > .results-scroll-track > .results-scroll-inner
   Both patterns included; cards and animations are identical.
   ============================================================ */

/* --- Engine site container (.results-scroller) --- */
.results-scroller {
  background: var(--bg-card-alt);
  border-top: 1px solid rgba(232, 74, 138, 0.15);
  border-bottom: 1px solid rgba(232, 74, 138, 0.15);
  padding: 64px 0 40px;
  overflow: hidden;
  position: relative;
}

.results-scroller::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pink), transparent);
}

.results-scroller-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 0 32px;
}

.results-scroller-header p {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.results-track-wrapper {
  overflow: hidden;
}

.results-track {
  display: flex;
  gap: 20px;
  animation: resultsScroll 85s linear infinite;
  width: max-content;
  align-items: stretch;
}

.results-track:hover {
  animation-play-state: paused;
}

@keyframes resultsScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Privacy note (engine site) */
.results-privacy {
  text-align: center;
  padding: 32px 32px 0;
}

.results-privacy p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto;
  font-style: italic;
  opacity: 0.5;
}

/* --- Marketing site container (.results-strip) --- */
.results-strip {
  position: relative;
  z-index: 2;
  margin-top: 48px;
  padding: 24px 0 16px;
  background: linear-gradient(180deg, rgba(20, 20, 34, 0.95) 0%, rgba(16, 16, 28, 1) 40%, rgba(20, 20, 34, 0.95) 100%);
  border-top: 1px solid rgba(232, 74, 138, 0.25);
  border-bottom: 1px solid rgba(232, 74, 138, 0.25);
  overflow: hidden;
  box-shadow: 0 -8px 32px rgba(232, 74, 138, 0.06), 0 8px 32px rgba(232, 74, 138, 0.06);
}

.results-strip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--magenta, #E84A8A), transparent);
}

.results-strip::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--magenta, #E84A8A), transparent);
}

.results-strip-header {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary, #e0e0f0);
  margin-bottom: 16px;
  padding: 0 32px;
}

/* Scroll track (marketing site) — uses mask-image fade edges */
.results-scroll-track {
  position: relative;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
}

.results-scroll-inner {
  display: flex;
  gap: 20px;
  width: max-content;
  align-items: stretch;
  animation: scrollResults 85s linear infinite;
}

.results-scroll-inner:hover {
  animation-play-state: paused;
}

@keyframes scrollResults {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Privacy note (marketing site) */
.results-strip .results-strip-privacy {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted, #8282a0);
  line-height: 1.5;
  max-width: 580px;
  margin: 12px auto 24px;
  padding: 0 20px;
  font-style: italic;
  opacity: 0.7;
}

/* --- Shared result card (identical between both sites) --- */
.results-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border, #333348);
  border-radius: 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
  cursor: default;
  width: auto;
  max-width: 420px;
}

.results-card:hover {
  border-color: rgba(232, 74, 138, 0.3);
  box-shadow: 0 0 24px rgba(232, 74, 138, 0.06);
}

.results-card-metric {
  font-family: var(--m, 'JetBrains Mono', monospace);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold, #C9A84C);
  line-height: 1;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  min-width: 64px;
  text-align: right;
}

.results-card-divider {
  width: 1px;
  height: 36px;
  background: var(--divider, #2a2a3e);
  flex-shrink: 0;
}

.results-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 260px;
}

.results-card-brand {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #F0F0F5);
  line-height: 1.3;
}

.results-card-result {
  font-size: 12.5px;
  color: var(--text-muted, #8282a0);
  line-height: 1.35;
}

/* Brand-specific fonts — shared across all Marathon web properties.
   Each brand gets a font approximating its logo typeface.
   Supports both .results-card-brand (marketing site) and .results-item-brand (engine site).
   Google Fonts required: Black Ops One, Creepster, Anton, Montserrat, Bebas Neue,
   Barlow Condensed, Cormorant Garamond, Playfair Display, Oswald, Rajdhani, Space Grotesk */

[data-brand="danger-coffee"]  .results-card-brand,
[data-brand="danger-coffee"]  .results-item-brand { font-family: 'Black Ops One', sans-serif; font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em; }

[data-brand="bones-coffee"]   .results-card-brand,
[data-brand="bones-coffee"]   .results-item-brand { font-family: 'Creepster', 'Anton', sans-serif; font-size: 16px; text-transform: uppercase; letter-spacing: 0.02em; }

[data-brand="duer"]           .results-card-brand,
[data-brand="duer"]           .results-item-brand { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 0.10em; }

[data-brand="fightcamp"]      .results-card-brand,
[data-brand="fightcamp"]      .results-item-brand { font-family: 'Bebas Neue', sans-serif; font-size: 17px; text-transform: uppercase; letter-spacing: 0.06em; }

[data-brand="sea-to-summit"]  .results-card-brand,
[data-brand="sea-to-summit"]  .results-item-brand { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; }

[data-brand="qure"]           .results-card-brand,
[data-brand="qure"]           .results-item-brand { font-family: 'Cormorant Garamond', 'Playfair Display', serif; font-weight: 700; font-size: 16px; letter-spacing: 0.02em; text-transform: uppercase; }

[data-brand="decked"]         .results-card-brand,
[data-brand="decked"]         .results-item-brand { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 0.08em; }

[data-brand="gld"]            .results-card-brand,
[data-brand="gld"]            .results-item-brand { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; }

[data-brand="tracksmith"]     .results-card-brand,
[data-brand="tracksmith"]     .results-item-brand { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 0.03em; }

[data-brand="henson"]         .results-card-brand,
[data-brand="henson"]         .results-item-brand { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; }

[data-brand="mkc"]            .results-card-brand,
[data-brand="mkc"]            .results-item-brand { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; }

[data-brand="supply"]         .results-card-brand,
[data-brand="supply"]         .results-item-brand { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; }

[data-brand="earthling"]      .results-card-brand,
[data-brand="earthling"]      .results-item-brand { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 0.03em; }


/* ============================================================
   === CTA SECTION ===
   Both sites share structure; engine has bg/border, marketing omits them.
   Shared base includes both; sites can override via CSS vars.
   ============================================================ */

.cta-section {
  padding: 140px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  /* engine site adds these; marketing site omits — override to none if not wanted */
  background: var(--cta-bg, var(--bg-secondary));
  border-top: var(--cta-border, 1px solid var(--divider));
  border-bottom: var(--cta-border, 1px solid var(--divider));
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* engine: 1000px/1000px — marketing: 800px/800px. Use the larger value. */
  width: 1000px;
  height: 1000px;
  background: radial-gradient(
    circle,
    rgba(232, 74, 138, 0.08) 0%,
    rgba(201, 168, 76, 0.04) 30%,
    transparent 60%
  );
  pointer-events: none;
}

/* h2: engine site uses font-hero + clamp(32→56px)
        marketing uses clamp(48→96px) + weight 800.
   Shared base matches engine site; override per-site with [data-site] if needed. */
.cta-section h2 {
  font-family: var(--font-hero);
  font-size: clamp(32px, 4vw, 56px);
  margin-bottom: 24px;
}

.cta-section p {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 48px;
}

/* .cta-button defined in web-theme.css (foundation layer) */

.cta-sub {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}


/* ============================================================
   === FOOTER ===
   Both sites are nearly identical; engine has more generous padding.
   Shared base uses engine site values (60px/32px).
   ============================================================ */

footer {
  padding: 60px 0 32px;
  border-top: 1px solid var(--divider);
}

.footer-main {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--divider);
}

.footer-brand {
  max-width: 280px;
}

.footer-logo {
  height: 24px;
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 56px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-bottom {
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 0;
}


/* .reveal animations defined in web-theme.css (foundation layer) */

/* ============================================================
   === CARL THE CAMEL MASCOT ===
   Marketing site has fuller implementation (stages, bubble, particles).
   Engine site has a lean version. Full marketing-site spec included here;
   engine site only uses the base + carlFloat.
   ============================================================ */

.carl-mascot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  pointer-events: none;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  filter: drop-shadow(0 4px 16px rgba(232, 74, 138, 0.35));
}

.carl-mascot.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.carl-mascot.visible:hover {
  opacity: 1;
}

.carl-mascot.visible svg {
  animation: carlFloat 3s ease-in-out infinite;
}

@keyframes carlFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* Interaction animations */
.carl-mascot.carl-bounce {
  animation: carlBounce 0.6s ease;
}

.carl-mascot.carl-wiggle {
  animation: carlWiggle 0.8s ease;
}

.carl-mascot.carl-celebrate {
  animation: carlCelebrate 1s ease;
}

@keyframes carlBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-12px) scale(1.05); }
}

@keyframes carlWiggle {
  0%, 100% { transform: translateY(0)   scale(1)    rotate(0);     }
  20%       { transform: translateY(-8px)  scale(1.08) rotate(-5deg); }
  40%       { transform: translateY(-14px) scale(1.1)  rotate(5deg);  }
  60%       { transform: translateY(-8px)  scale(1.08) rotate(-3deg); }
  80%       { transform: translateY(-4px)  scale(1.05) rotate(2deg);  }
}

@keyframes carlCelebrate {
  0%   { transform: translateY(0)    scale(1)    rotate(0);    }
  15%  { transform: translateY(-30px) scale(1.15) rotate(-8deg); }
  30%  { transform: translateY(-10px) scale(1.05) rotate(5deg);  }
  45%  { transform: translateY(-20px) scale(1.12) rotate(-5deg); }
  60%  { transform: translateY(-5px)  scale(1.02) rotate(3deg);  }
  100% { transform: translateY(0)    scale(1)    rotate(0);    }
}

/* Progressive scroll stage animations */
.carl-mascot.carl-walking svg {
  animation: carlWalk 0.6s ease-in-out infinite;
}

@keyframes carlWalk {
  0%, 100% { transform: translateY(0)   rotate(0deg);  }
  25%       { transform: translateY(-2px) rotate(-2deg); }
  75%       { transform: translateY(-2px) rotate(2deg);  }
}

.carl-mascot.carl-stage-2 .carl-shades {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.carl-mascot.carl-stage-3 .carl-smile {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.carl-mascot.carl-stage-3 svg {
  animation: carlGroove 1s ease-in-out infinite;
}

@keyframes carlGroove {
  0%, 100% { transform: translateY(0)   rotate(0deg);  }
  25%       { transform: translateY(-3px) rotate(-3deg); }
  50%       { transform: translateY(-1px) rotate(0deg);  }
  75%       { transform: translateY(-3px) rotate(3deg);  }
}

.carl-mascot.carl-stage-4 .carl-board {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.carl-mascot.carl-stage-4 svg {
  animation: carlSkate 1.2s ease-in-out infinite;
}

@keyframes carlSkate {
  0%, 100% { transform: translateX(0)   rotate(0deg);  }
  25%       { transform: translateX(3px)  rotate(2deg);  }
  50%       { transform: translateX(0)   rotate(0deg);  }
  75%       { transform: translateX(-3px) rotate(-2deg); }
}

/* Carl speech bubble */
.carl-bubble {
  position: fixed;
  bottom: 110px;
  right: 34px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  max-width: 380px;
  min-width: 220px;
  white-space: normal;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.carl-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.carl-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}

/* Carl particles */
.carl-particles {
  position: absolute;
  bottom: 50px;
  right: 25px;
  width: 50px;
  height: 50px;
  pointer-events: none;
}

.carl-particle {
  position: absolute;
  font-size: 16px;
  animation: carlParticleFloat 1.5s ease-out forwards;
  opacity: 0;
}

@keyframes carlParticleFloat {
  0%   { opacity: 1; transform: translateY(0)    scale(0.5); }
  50%  { opacity: 1; transform: translateY(-30px) scale(1);   }
  100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}


/* ============================================================
   === RESPONSIVE OVERRIDES ===
   ============================================================ */

/* --- 900px: nav + footer adjustments --- */
@media (max-width: 900px) {
  .nav-links {
    gap: 16px;
  }

  .nav-link {
    display: none;
  }

  .nav-cta {
    min-height: 44px;
  }

  .footer-link {
    display: flex;
    align-items: center;
    padding: 8px 0;
    min-height: 44px;
  }

  .footer-col {
    gap: 0;
  }

  .scroll-arrow {
    bottom: 24px;
  }
}

/* --- 768px: results ticker adjustments (marketing site) --- */
@media (max-width: 768px) {
  .results-scroll-inner {
    animation-duration: 30s;
  }

  .results-card {
    width: 150px;
    padding: 12px 11px 10px;
  }
}

/* --- 600px: footer collapses to single column + cta/scroll-arrow --- */
@media (max-width: 600px) {
  .scroll-arrow {
    bottom: 20px;
  }

  .scroll-arrow svg {
    width: 28px;
    height: 28px;
  }

  .cta-section {
    padding: 80px 0;
  }

  .footer-main {
    flex-direction: column;
    gap: 32px;
  }

  .footer-links {
    flex-direction: column;
    gap: 24px;
  }
}
