/* =========================================================
   CONTRA LABS — CSS
   Palette: cream bg, warm darks, teal accents
   ========================================================= */

:root {
  --bg:          #fbfaf6;
  --bg-card:     #f0eee5;
  --bg-dark:     #2b2b29;
  --text:        #2b2b29;
  --text-mid:    #4a4545;
  --text-light:  #918989;
  --teal:        #296a6c;
  --teal-mid:    #387478;
  --teal-light:  #89b8bb;
  --teal-pale:   #c8e1dd;
  --border:      rgba(145, 137, 137, 0.35);
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --max-w:       1160px;
  --nav-h:       64px;
  --serif:       'Source Serif 4', Georgia, serif;
  --sans:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- UTILITIES ---- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 10px 20px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease, transform 0.12s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--teal);
  color: #fff;
}
.btn-primary:hover { background: #1e5658; }

.btn-nav {
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  padding: 8px 16px;
}
.btn-nav:hover { background: #1a1a18; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 13px;
}
.btn-outline:hover {
  border-color: var(--text);
  background: rgba(43,43,41,0.05);
}

/* ---- NAVIGATION ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(251, 250, 246, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 16px rgba(43,43,41,0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-mid);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 100px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(43,43,41,0.06);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
}
.nav-mobile.open { display: flex; }
.nav-mobile .nav-link {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.nav-mobile .btn { width: 100%; margin-top: 4px; }

/* ---- HERO ---- */
.hero {
  padding: calc(var(--nav-h) + 80px) 0 100px;
  text-align: center;
}

.hero-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid var(--teal-pale);
  background: rgba(200, 225, 221, 0.25);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 32px;
}

.hero-headline {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 820px;
  margin: 0 auto 28px;
}
.hero-headline em {
  font-style: italic;
  color: var(--teal);
}

.hero-sub {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-mid);
  margin-bottom: 40px;
  line-height: 1.8;
}

/* ---- ECOSYSTEM ---- */
.ecosystem {
  padding: 64px 0 0;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 28px;
}

.marquee-wrapper {
  overflow: hidden;
  margin-top: 8px;
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  padding: 16px 0 24px;
}

.marquee-track {
  display: flex;
  width: max-content;
}

.marquee-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: marquee 40s linear infinite;
}

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

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

.tag {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.tag-cat {
  background: transparent;
  border-color: transparent;
  color: var(--text-light);
  font-weight: 400;
  font-size: 12px;
}

/* ---- WHAT WE BUILD ---- */
.what-we-build {
  padding: 72px 0;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.eyebrow-text {
  font-family: var(--serif);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 400;
  font-style: italic;
  color: var(--text-mid);
  max-width: 700px;
  line-height: 1.55;
}

/* ---- PRODUCTS ---- */
.products {
  padding: 0 0 96px;
}

.products-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}
.products-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px 20px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); font-weight: 500; }
.tab-btn.active::after { transform: scaleX(1); }

.tab-content {
  display: none;
}
.tab-content.active { display: block; }

.product-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 360px;
}

.product-card-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 40px 32px;
  border-right: 1px solid var(--border);
  width: 200px;
  flex-shrink: 0;
}

.product-type {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.badge-beta {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-pale);
  padding: 3px 8px;
  border-radius: 100px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.product-card-body {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.product-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.product-desc {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-mid);
  max-width: 480px;
  line-height: 1.65;
}

.product-card-visual {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Arena visual */
.arena-visual { background: linear-gradient(135deg, rgba(41,106,108,0.08) 0%, transparent 70%); }

.arena-orb {
  position: absolute;
  border-radius: 50%;
}
.orb-1 {
  width: 140px; height: 140px;
  background: radial-gradient(circle, var(--teal-pale) 0%, rgba(200,225,221,0.2) 70%);
  left: 30px; top: 50%;
  transform: translateY(-50%);
  animation: float1 4s ease-in-out infinite;
}
.orb-2 {
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(137,184,187,0.5) 0%, rgba(137,184,187,0.1) 70%);
  right: 30px; top: 50%;
  transform: translateY(-50%);
  animation: float2 4s ease-in-out infinite;
}
.vs-badge {
  position: relative;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-mid);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 12px;
}

@keyframes float1 { 0%,100%{transform:translateY(calc(-50% - 4px))} 50%{transform:translateY(calc(-50% + 4px))} }
@keyframes float2 { 0%,100%{transform:translateY(calc(-50% + 4px))} 50%{transform:translateY(calc(-50% - 4px))} }

/* Benchmark visual */
.benchmark-visual { background: var(--bg); }
.benchmark-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
}
.bar {
  width: 24px;
  background: var(--teal-pale);
  border-radius: 4px 4px 0 0;
  transition: background 0.2s;
}
.bar.active { background: var(--teal); }

/* Data visual */
.data-visual { background: var(--bg); }
.data-dots { display: flex; flex-direction: column; gap: 12px; }
.dot-row { display: flex; gap: 12px; }
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border);
}
.dot.active { background: var(--teal); }

/* Agents visual */
.agents-visual { background: radial-gradient(circle at center, rgba(41,106,108,0.06) 0%, transparent 70%); }
.agent-pulse { position: relative; width: 80px; height: 80px; }
.pulse-ring {
  position: absolute;
  inset: -20px;
  border: 1px solid var(--teal-pale);
  border-radius: 50%;
  animation: pulse-out 2s ease-out infinite;
}
.pulse-core {
  position: absolute;
  inset: 0;
  background: var(--teal-pale);
  border-radius: 50%;
  animation: pulse-in 2s ease-in-out infinite;
}

@keyframes pulse-out { 0%{opacity:1;transform:scale(1)} 100%{opacity:0;transform:scale(1.6)} }
@keyframes pulse-in  { 0%,100%{transform:scale(1)} 50%{transform:scale(0.95)} }

/* ---- METHODOLOGY ---- */
.methodology {
  background: var(--bg-dark);
  padding: 96px 0;
  color: #fff;
}

.methodology .section-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 560px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  max-width: 540px;
  line-height: 1.65;
  margin-bottom: 56px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.method-card {
  padding: 40px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s ease;
}
.method-card:hover { background: rgba(255,255,255,0.07); }

.method-icon {
  width: 44px; height: 44px;
  background: rgba(200,225,221,0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-light);
  margin-bottom: 20px;
}

.method-title {
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.method-desc {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  line-height: 1.65;
}

/* ---- STATS ---- */
.stats {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 56px;
}
.section-title em {
  font-style: italic;
  color: var(--teal);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}

.stat-item {
  padding: 32px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.stat-number {
  font-family: var(--serif);
  font-size: clamp(32px, 3vw, 44px);
  font-weight: 700;
  color: var(--teal);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.45;
}

/* ---- CTA BANNER ---- */
.cta-banner {
  padding: 80px 0;
  text-align: center;
  background: var(--teal-pale);
}

.cta-title {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--teal);
  margin-bottom: 28px;
}

/* ---- PHILOSOPHY ---- */
.philosophy {
  padding: 120px 0;
}

.philosophy-eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 24px;
}

.philosophy-headline {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 68px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 700px;
  margin-bottom: 32px;
}

.philosophy-body {
  font-size: 17px;
  font-weight: 300;
  color: var(--text-mid);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 48px;
}

.philosophy-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 64px 0;
}

.philosophy-sub-headline {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.25;
}

/* ---- FOOTER ---- */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.65);
  padding: 64px 0 40px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.footer-logo .logo-text { color: #fff; }

.footer-tagline {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
  margin-top: 16px;
}

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

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

.footer-col-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

.footer-link {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-link:hover { color: #fff; }

.footer-bottom {
  padding-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .container { padding: 0 20px; }

  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .hero { padding: calc(var(--nav-h) + 56px) 0 72px; }

  .product-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .product-card-meta {
    flex-direction: row;
    width: 100%;
    padding: 20px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .product-type {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 11px;
  }
  .badge-beta {
    writing-mode: horizontal-tb;
    transform: none;
  }
  .product-card-body { padding: 32px 24px; }
  .product-card-visual {
    width: 100%;
    height: 160px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .method-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }

  .products-tabs {
    gap: 0;
  }
  .tab-btn {
    font-size: 13px;
    padding: 12px 14px;
  }

  .hero-sub { font-size: 16px; }
}
