/* ============================================================
   IBetter — Portal Design System
   Deep Navy Palette: Base #08141d · Primary #0f2230 · Accent #0284c7
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --pitch: #08141d;
  --carbon: #0f2230;
  --carbon-light: #173245;
  --carbon-elevated: #20455d;
  --accent: #0284c7;
  --accent-dim: rgba(2, 132, 199, 0.15);
  --accent-glow: rgba(2, 132, 199, 0.32);
  --accent-faint: rgba(2, 132, 199, 0.06);
  --accent-hover: #01a2e8;
  --text-primary: #eff8fc;
  --text-muted: #6b8a99;
  --text-dim: rgba(174, 207, 224, 0.55);
  --border: rgba(174, 207, 224, 0.2);
  --border-accent: rgba(2, 132, 199, 0.3);

  --font-heading: 'Poppins', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --radius-hard: 6px;
  --radius-soft: 10px;
}

/* --- Accessibility --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-hard);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--pitch);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* Subtle overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(2, 132, 199, 0.01) 2px,
    rgba(2, 132, 199, 0.01) 3px
  );
  pointer-events: none;
  z-index: 9999;
}

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

/* --- Focus Styles (WCAG 2.4.7) --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary:focus-visible,
.btn-light:focus-visible,
.nav-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--accent-dim);
}

/* --- Typography --- */
.heading-xl {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 1.0;
  letter-spacing: -0.04em;
}
.heading-lg {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.heading-md {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.3;
}
.drama-text {
  font-family: var(--font-body);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.02em;
}
.mono-text {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.section-tag {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-accent);
  background: var(--accent-faint);
}
.section-tag-light {
  color: var(--accent);
  opacity: 0.9;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.section-padding { padding: 5rem 0; }
.section-padding-sm { padding: 3rem 0; }

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.9rem 2.2rem;
  border: 1px solid var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
  z-index: -1;
}
.btn-primary:hover {
  color: var(--pitch);
  box-shadow: 0 0 30px var(--accent-glow);
}
.btn-primary:hover::before {
  transform: scaleX(1);
}
.btn-primary:active {
  transform: scale(0.98);
  transition-duration: 0.1s;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.85rem 2.2rem;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s var(--ease);
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-faint);
}
.btn-secondary:active {
  transform: scale(0.98);
}
.btn-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.85rem 2.2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s var(--ease);
}
.btn-light:hover {
  border-color: rgba(255,255,255,0.3);
  color: #fff;
  background: rgba(255,255,255,0.04);
}

/* ============================================================
   A. NAVBAR — "The Control Strip"
   ============================================================ */
.navbar {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(8, 20, 29, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  width: max-content;
  transition: all 0.4s var(--ease);
}
.navbar.scrolled {
  top: 0.75rem;
  background: rgba(8, 20, 29, 0.72);
  border-color: var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-brand img {
  height: 26px;
  width: auto;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  position: relative;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 50px;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
  display: flex;
  align-items: center;
  letter-spacing: 0.03em;
}
.nav-link:hover {
  color: var(--accent-hover);
  background: rgba(2, 132, 199, 0.06);
}
.nav-cta {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.55rem 1.4rem;
  border-radius: 50px;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav-signin {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  padding: 0.55rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.3s var(--ease);
}
.nav-signin:hover {
  color: var(--accent);
}
.nav-cta:hover {
  background: var(--accent);
  color: var(--pitch);
  box-shadow: 0 0 20px var(--accent-glow);
}
.nav-cta:active {
  transform: scale(0.98);
}
.network-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  padding-right: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.status-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2.5s ease-in-out infinite;
}

/* Mobile nav */
.nav-mobile-toggle {
  display: none;
  color: var(--text-primary);
  padding: 0.5rem;
}
.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8, 20, 29, 0.97);
  backdrop-filter: blur(20px);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}
.mobile-menu .nav-link {
  font-size: 1.3rem;
  color: var(--text-primary);
  padding: 0.75rem 2rem;
}
.mobile-menu .nav-link:hover { color: var(--accent); }
.mobile-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--text-primary);
  font-size: 1.5rem;
  padding: 0.5rem;
}

/* ============================================================
   B. HERO — "The Value Proposition"
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--pitch);
  overflow: hidden;
}

/* Spline 3D background */
.hero-spline-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-spline-bg iframe {
  width: 200%;
  height: 200%;
  margin-left: -50%;
  margin-top: calc(-50% + 40vh);
  border: none;
  opacity: 0.4;
}
/* Cover Spline watermark */
.hero-spline-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 200px;
  height: 60px;
  background: #08141d;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  padding-top: 6rem;
}
.hero-tagline {
  color: #fff;
  margin-bottom: 1.5rem;
}
.hero-tagline .line-bold {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}
.hero-tagline .line-italic {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.hero-subtitle {
  font-family: var(--font-body);
  font-style: normal;
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}
.hero-cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: float-down 2.5s ease-in-out infinite;
}
.hero-scroll-hint svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
}

/* ============================================================
   C. THE ENGINE — "Functional Prototypes"
   ============================================================ */
.engine {
  background: var(--pitch);
  position: relative;
  border-top: 1px solid var(--border);
}
.engine-header {
  text-align: center;
  margin-bottom: 4rem;
}
.engine-header .heading-lg {
  color: var(--text-primary);
}
.engine-header p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 1rem auto 0;
  font-size: 0.95rem;
}
.engine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Module Window — Terminal style */
.module-window {
  background: var(--carbon);
  border-radius: var(--radius-hard);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
.module-window:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(2, 132, 199, 0.06);
}
.module-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.window-dots {
  display: flex;
  gap: 5px;
}
.window-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.window-dots span:first-child { background: #ff5f57; opacity: 0.7; }
.window-dots span:nth-child(2) { background: #febc2e; opacity: 0.7; }
.window-dots span:nth-child(3) { background: var(--accent); opacity: 0.7; }
.module-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.module-title::before {
  content: '$ ';
  color: var(--accent);
  opacity: 0.5;
}
.module-body {
  padding: 1.25rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.module-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.module-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* Pipeline Module */
.pipeline-stages {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pipeline-stage {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.5rem;
  border-radius: var(--radius-hard);
  transition: all 0.4s var(--ease);
  position: relative;
}
.pipeline-stage.active {
  background: var(--accent-faint);
}
.stage-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
  transition: all 0.4s var(--ease);
  position: relative;
}
.pipeline-stage.completed .stage-indicator {
  background: var(--accent);
  border-color: var(--accent);
}
.pipeline-stage.active .stage-indicator {
  border-color: var(--accent);
  animation: pulse-dot 1s ease-in-out infinite;
}
.pipeline-stage.completed .stage-indicator::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.45rem;
  color: var(--pitch);
}
.stage-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  flex: 1;
  transition: color 0.3s;
}
.pipeline-stage.active .stage-name,
.pipeline-stage.completed .stage-name {
  color: var(--text-primary);
}
.stage-hash {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: rgba(255,255,255,0.15);
  transition: color 0.3s;
}
.pipeline-stage.active .stage-hash {
  color: var(--accent);
}
.pipeline-connector {
  width: 2px;
  height: 12px;
  background: var(--border);
  margin-left: calc(0.5rem + 4px);
}

/* JSON Module */
.json-preview {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.8;
  color: var(--text-dim);
  white-space: pre;
  overflow: hidden;
}
.json-preview .json-key { color: var(--accent); }
.json-preview .json-string { color: #7EC8E3; }
.json-preview .json-number { color: #C3E88D; }
.json-preview .json-bool { color: #C792EA; }
.json-preview .json-bracket { color: rgba(255,255,255,0.25); }
.json-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--accent);
  animation: blink-cursor 1s step-end infinite;
  vertical-align: text-bottom;
}

/* Viewport Module */
.viewport-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.viewport-btn {
  padding: 0.4rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-hard);
  transition: all 0.3s var(--ease);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.viewport-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-faint);
}
.viewport-frame {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.device-outline {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-hard);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  transition: all 0.5s var(--ease);
  overflow: hidden;
}
.device-outline.phone {
  width: 60px;
  height: 120px;
  border-radius: 8px;
}
.device-outline.tablet {
  width: 120px;
  height: 90px;
}
.device-outline.desktop {
  width: 180px;
  height: 110px;
}
.device-bar {
  height: 3px;
  border-radius: 1px;
  background: rgba(255,255,255,0.08);
  transition: all 0.5s var(--ease);
}
.device-bar.accent { background: var(--accent); opacity: 0.4; }
.device-block {
  flex: 1;
  border-radius: 2px;
  background: rgba(255,255,255,0.04);
  transition: all 0.5s var(--ease);
}
.device-row {
  display: flex;
  gap: 4px;
  flex: 1;
}

/* ============================================================
   D. STATS STRIP
   ============================================================ */
.stats {
  background: var(--carbon);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}
.stat-number {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ============================================================
   E. METHODOLOGY — "Sticky Stacking Logic"
   ============================================================ */
.methodology {
  background: var(--pitch);
  position: relative;
  border-top: 1px solid var(--border);
}
.methodology-header {
  text-align: center;
  margin-bottom: 3rem;
}
.methodology-header .heading-lg {
  color: var(--text-primary);
}
.methodology-header p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 1rem auto 0;
  font-size: 0.95rem;
}
.methodology-stack {
  position: relative;
  min-height: 180vh;
}
.method-card {
  position: sticky;
  top: 120px;
  background: var(--carbon);
  border-radius: var(--radius-hard);
  padding: 3rem 3.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: start;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.method-card:nth-child(2) {
  top: 160px;
  background: var(--carbon-light);
}
.method-card:nth-child(3) {
  top: 200px;
  background: var(--carbon-elevated);
  border-color: var(--border-accent);
}
.method-card:nth-child(3) .method-number { color: var(--accent); opacity: 0.2; }
.method-number {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(4rem, 8vw, 6rem);
  line-height: 1;
  color: var(--text-primary);
  opacity: 0.06;
}
.method-content { padding-top: 0.5rem; }
.method-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}
.method-subtitle {
  font-family: var(--font-heading);
  font-style: normal;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}
.method-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 480px;
}

/* ============================================================
   F. TECH STACK — "The Arsenal"
   ============================================================ */
.tech-stack {
  background: var(--carbon);
  overflow: hidden;
  border-top: 1px solid var(--border);
}
.tech-stack-header {
  text-align: center;
  margin-bottom: 3rem;
}
.tech-stack-header .heading-lg { color: var(--text-primary); }
.tech-stack-header p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 1rem auto 0;
  font-size: 0.9rem;
}
.marquee-container {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 10%, black 90%, transparent 100%);
}
.marquee-track {
  display: flex;
  gap: 1rem;
  animation: marquee-scroll 40s linear infinite;
  width: max-content;
}
.marquee-track:hover { animation-play-state: paused; }
.tech-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  transition: all 0.4s var(--ease);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.tech-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-faint);
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.1);
}
.tech-chip svg {
  width: 18px;
  height: 18px;
  opacity: 0.3;
  transition: opacity 0.4s var(--ease);
  fill: currentColor;
}
.tech-chip:hover svg { opacity: 1; }

/* ============================================================
   G. CTA
   ============================================================ */
.cta {
  background: var(--pitch);
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
}
.cta-inner {
  text-align: center;
  position: relative;
  z-index: 2;
}
.cta-inner .heading-lg { color: var(--text-primary); }
.cta-inner .drama-text {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--accent);
  margin-top: 0.5rem;
}
.cta-inner p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 1.5rem auto 2.5rem;
  font-size: 0.95rem;
}
.cta-geometric {
  position: absolute;
  width: 400px;
  height: 400px;
  border: 1px solid var(--border);
  opacity: 0.3;
  pointer-events: none;
}
.cta-geometric:nth-child(1) { top: -100px; right: -100px; }
.cta-geometric:nth-child(2) { bottom: -150px; left: -80px; width: 500px; height: 500px; }

/* ============================================================
   H. FOOTER
   ============================================================ */
.footer {
  background: var(--pitch);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.footer-brand img { height: 32px; width: auto; }
.footer-tagline {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 280px;
  letter-spacing: 0.01em;
}
.footer-links {
  display: flex;
  gap: 3rem;
}
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0.6;
}
.footer-col a {
  display: block;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.3rem 0;
  transition: color 0.3s;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.15);
  text-underline-offset: 2px;
}
.footer-col a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copyright {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.footer-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ============================================================
   ANIMATIONS & KEYFRAMES
   ============================================================ */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { opacity: 0.5; box-shadow: 0 0 0 4px transparent; }
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes float-down {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Section entrance (GSAP handles, this is fallback) */
.gsap-reveal {
  opacity: 0;
  transform: translateY(40px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .navbar { padding: 0.4rem 0.4rem 0.4rem 1rem; gap: 0.5rem; }
  .nav-link { font-size: 0.7rem; padding: 0.4rem 0.6rem; }
  .nav-cta { font-size: 0.65rem; padding: 0.45rem 1rem; }
  .nav-brand img { height: 22px; }
  .engine-grid { grid-template-columns: 1fr 1fr; }
  .engine-grid .module-window:last-child {
    grid-column: 1 / -1;
  }
  .method-card { padding: 2.5rem; gap: 2rem; }
}

@media (max-width: 768px) {
  .navbar {
    top: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 0;
    padding: 0.6rem 1.25rem;
    justify-content: space-between;
  }
  .nav-links, .network-status { display: none; }
  .navbar .nav-cta, .navbar .nav-signin { display: none; }
  .nav-mobile-toggle { display: flex; }

  .hero { min-height: 90vh; }
  .hero-content { padding-top: 5rem; }
  .hero-cta-group { flex-direction: column; align-items: center; }
  .hero-spline-bg { display: none; }

  .engine-grid { grid-template-columns: 1fr; }
  .engine-grid .module-window:last-child { max-width: none; }
  .module-body { min-height: 240px; }

  .stats-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  .method-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 2rem;
    position: relative;
    top: auto !important;
  }
  .method-number { font-size: 3rem; }
  .methodology-stack { min-height: auto; }

  .footer-top { flex-direction: column; align-items: center; text-align: center; }
  .footer-links { flex-direction: column; gap: 2rem; align-items: center; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; }

  .cta .heading-lg { font-size: 2rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .section-padding { padding: 3rem 0; }
  .hero-tagline .line-bold { font-size: 2.8rem; }
  .hero-tagline .line-italic { font-size: 1.8rem; }
}

/* ============================================================
   iBetter.ai — Custom Additions
   Icon logo + text brand, AI configurator, solutions grid
   ============================================================ */

/* --- Nav brand: icon + "iBetter.ai" text --- */
.nav-brand { gap: 0.6rem; }
.nav-brand .nav-icon { height: 48px; width: auto; }
.nav-brand-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}
@media (max-width: 1024px) { .nav-brand .nav-icon { height: 40px; } }

/* --- Footer brand: icon + text --- */
.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.footer-icon { height: 32px; width: auto; border-radius: 3px; margin-bottom: 0; }
.footer-brand-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* --- AI Configurator --- */
.configurator-section { background: var(--carbon); border-top: 1px solid var(--border); }
.configurator-window {
  background: var(--pitch);
  border: 1px solid var(--border);
  border-radius: var(--radius-hard);
  overflow: hidden;
  max-width: 860px;
  margin: 0 auto;
}
.configurator-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.configurator-title {
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--text-dim); letter-spacing: 0.04em;
}
.configurator-title::before { content: '$ '; color: var(--accent); opacity: 0.5; }
.configurator-body { padding: 2.5rem; }
.configurator-step { display: block; }
.configurator-step.hidden { display: none; }
.cfg-step-heading {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 1.1rem; color: var(--text-primary);
  margin-bottom: 0.3rem; letter-spacing: -0.02em;
}
.cfg-step-sub {
  font-family: var(--font-body); font-size: 0.7rem;
  color: var(--text-dim); margin-bottom: 1.75rem;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.cfg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.cfg-grid-4 { grid-template-columns: repeat(4, 1fr); }
.cfg-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cfg-btn {
  padding: 1.1rem 0.75rem;
  background: var(--carbon); border: 1px solid var(--border);
  border-radius: var(--radius-soft); cursor: pointer;
  text-align: center; transition: all 0.3s var(--ease);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-family: inherit;
}
.cfg-btn:hover { border-color: var(--accent); background: var(--accent-faint); }
.cfg-btn.selected { border-color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 16px var(--accent-glow); }
.cfg-btn-icon { font-size: 1.5rem; line-height: 1; }
.cfg-btn-label {
  font-family: var(--font-body); font-size: 0.75rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
  transition: color 0.3s;
}
.cfg-btn:hover .cfg-btn-label, .cfg-btn.selected .cfg-btn-label { color: var(--accent); }
.cfg-btn-sub { font-family: var(--font-body); font-size: 0.65rem; color: var(--text-dim); margin-top: -0.2rem; }
.cfg-checkbox-btn {
  display: block; padding: 1rem 1.1rem;
  background: var(--carbon); border: 1px solid var(--border);
  border-radius: var(--radius-soft); cursor: pointer;
  transition: all 0.3s var(--ease);
}
.cfg-checkbox-btn:hover { border-color: var(--accent); background: var(--accent-faint); }
.cfg-checkbox-btn.selected { border-color: var(--accent); background: var(--accent-dim); }
.cfg-checkbox-inner { display: flex; align-items: center; gap: 0.9rem; }
.cfg-checkbox-inner input { display: none; }
.cfg-checkbox-icon { font-size: 1.4rem; flex-shrink: 0; }
.cfg-checkbox-title { font-family: var(--font-heading); font-weight: 600; font-size: 0.88rem; color: var(--text-primary); margin-bottom: 0.1rem; }
.cfg-checkbox-sub { font-family: var(--font-body); font-size: 0.7rem; color: var(--text-dim); }
.cfg-action { display: flex; justify-content: center; margin-top: 2rem; }
.cfg-get-rec:disabled { opacity: 0.35; cursor: not-allowed; }
.cfg-get-rec:disabled::before { display: none; }
.cfg-results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.cfg-result-card {
  background: var(--carbon); border: 1px solid var(--border);
  border-radius: var(--radius-soft); padding: 1.4rem;
  transition: border-color 0.3s var(--ease);
}
.cfg-result-card:hover { border-color: var(--border-accent); }
.cfg-result-icon { font-size: 1.6rem; margin-bottom: 0.6rem; }
.cfg-result-title { font-family: var(--font-heading); font-weight: 700; font-size: 0.92rem; color: var(--text-primary); margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.cfg-result-desc { font-family: var(--font-body); font-size: 0.75rem; color: var(--text-muted); line-height: 1.7; }

/* --- AI Solutions Grid --- */
.ai-solutions { background: var(--pitch); border-top: 1px solid var(--border); }
.solutions-grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.solution-window {
  background: var(--carbon); border: 1px solid var(--border);
  border-radius: var(--radius-hard); overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.solution-window:hover {
  transform: translateY(-4px); border-color: var(--border-accent);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(0,255,136,0.05);
}
.solution-window-body { padding: 1.75rem; }
.solution-icon { font-size: 2rem; margin-bottom: 0.9rem; }
.solution-category { font-family: var(--font-heading); font-size: 0.62rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 0.4rem; opacity: 0.7; }
.solution-title { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; color: var(--text-primary); margin-bottom: 0.65rem; letter-spacing: -0.02em; line-height: 1.3; }
.solution-desc { font-size: 0.84rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 1.1rem; }
.solution-features { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1.25rem; }
.solution-feature { font-family: var(--font-body); font-size: 0.67rem; color: var(--text-dim); letter-spacing: 0.01em; }
.solution-feature::before { content: '// '; color: var(--accent); opacity: 0.35; }
.solution-link { font-family: var(--font-body); font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; display: inline-flex; align-items: center; gap: 0.35rem; transition: opacity 0.3s; text-decoration: underline; text-underline-offset: 3px; }
.solution-link:hover { opacity: 0.7; }

/* --- Solutions page --- */
.solutions-hero { padding: 10rem 0 5rem; border-bottom: 1px solid var(--border); }
.solutions-body { padding: 5rem 0; background: var(--pitch); }

/* --- Footer 4-column layout --- */
.footer-links-extended { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.footer-contact-info { font-family: var(--font-body); font-size: 0.8rem; color: var(--text-dim); padding: 0.25rem 0; line-height: 1.6; }
.footer-contact-info a { color: var(--text-dim); transition: color 0.3s; }
.footer-contact-info a:hover { color: var(--accent); }

/* Responsive additions */
@media (max-width: 768px) {
  .cfg-grid { grid-template-columns: repeat(2, 1fr); }
  .cfg-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .cfg-grid-2 { grid-template-columns: 1fr; }
  .cfg-results-grid { grid-template-columns: 1fr; }
  .solutions-grid-6 { grid-template-columns: 1fr; }
  .footer-links-extended { flex-direction: column; gap: 2rem; }
  .configurator-body { padding: 1.5rem; }
}
@media (max-width: 480px) {
  .cfg-grid { grid-template-columns: 1fr; }
  .cfg-grid-4 { grid-template-columns: 1fr 1fr; }
}

/* --- Active nav link (current page) --- */
.nav-link.active {
  color: var(--accent);
  background: rgba(2, 132, 199, 0.06);
}
.nav-link.active::before {
  opacity: 1;
  max-width: 2rem;
  margin-right: 0.3rem;
}
.mobile-menu .nav-link.active { color: var(--accent); }

/* ============================================================
   THEME SYSTEM — light / dark / system
   ============================================================ */

/* Light mode vars — triggered by system preference */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    --pitch: #f8fafc;
    --carbon: #ffffff;
    --carbon-light: #f0f7fc;
    --carbon-elevated: #e4f1f7;
    --accent: #0284c7;
    --accent-hover: #0369a1;
    --accent-dim: rgba(2, 132, 199, 0.1);
    --accent-glow: rgba(2, 132, 199, 0.12);
    --accent-faint: rgba(2, 132, 199, 0.04);
    --text-primary: #0f2b3d;
    --text-muted: #6b8a99;
    --text-dim: rgba(15, 43, 61, 0.45);
    --border: rgba(174, 207, 224, 0.72);
    --border-accent: rgba(2, 132, 199, 0.22);
  }
  html:not([data-theme="dark"]) body { background: var(--pitch); color: var(--text-primary); }
  html:not([data-theme="dark"]) body::after { opacity: 0; }
  html:not([data-theme="dark"]) .navbar {
    background: rgba(248, 250, 252, 0.9);
    box-shadow: 0 8px 32px rgba(15, 43, 61, 0.07);
  }
  html:not([data-theme="dark"]) .navbar.scrolled {
    background: rgba(248, 250, 252, 0.9);
    box-shadow: 0 4px 20px rgba(15, 43, 61, 0.07);
  }
  html:not([data-theme="dark"]) .mobile-menu { background: rgba(248, 250, 252, 0.99); }
  html:not([data-theme="dark"]) .theme-toggle:hover { background: rgba(2, 132, 199, 0.07); }
}

/* Light mode vars — explicit override */
html[data-theme="light"] {
  --pitch: #f8fafc;
  --carbon: #ffffff;
  --carbon-light: #f0f7fc;
  --carbon-elevated: #e4f1f7;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-dim: rgba(2, 132, 199, 0.1);
  --accent-glow: rgba(2, 132, 199, 0.12);
  --accent-faint: rgba(2, 132, 199, 0.04);
  --text-primary: #0f2b3d;
  --text-muted: #6b8a99;
  --text-dim: rgba(15, 43, 61, 0.45);
  --border: rgba(174, 207, 224, 0.72);
  --border-accent: rgba(2, 132, 199, 0.22);
}
html[data-theme="light"] body { background: var(--pitch); color: var(--text-primary); }
html[data-theme="light"] body::after { opacity: 0; }
html[data-theme="light"] .navbar {
  background: rgba(248, 250, 252, 0.9);
  box-shadow: 0 8px 32px rgba(15, 43, 61, 0.07);
}
html[data-theme="light"] .navbar.scrolled {
  background: rgba(248, 250, 252, 0.9);
  box-shadow: 0 4px 20px rgba(15, 43, 61, 0.07);
}
html[data-theme="light"] .mobile-menu { background: rgba(248, 250, 252, 0.99); }
html[data-theme="light"] .theme-toggle:hover { background: rgba(2, 132, 199, 0.07); }

/* Theme toggle button */
.theme-toggle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease);
  padding: 0;
}
.theme-toggle:hover {
  border-color: var(--border-accent);
  color: var(--text-muted);
  background: rgba(2, 132, 199, 0.06);
}
.theme-toggle svg { width: 14px; height: 14px; display: block; }

/* Icon visibility — show only the icon for current theme mode */
.theme-toggle .tt-icon { display: none; }
.theme-toggle[data-theme-mode="system"] .tt-system { display: block; }
.theme-toggle[data-theme-mode="light"]  .tt-light  { display: block; }
.theme-toggle[data-theme-mode="dark"]   .tt-dark   { display: block; }
/* Default to system icon while JS is loading */
.theme-toggle:not([data-theme-mode]) .tt-system { display: block; }

/* ============================================================
   LIGHT MODE — Hero overrides
   Spline iframe fades to near-invisible; text adapts
   ============================================================ */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .hero { background: var(--pitch); }
  html:not([data-theme="dark"]) .hero-spline-bg { opacity: 0.07; }
  html:not([data-theme="dark"]) .hero-tagline { color: var(--text-primary); }
  html:not([data-theme="dark"]) .hero-tagline .line-italic { color: var(--accent); }
  html:not([data-theme="dark"]) .btn-light:hover { border-color: rgba(0,0,0,0.25); color: var(--text-primary); background: rgba(0,0,0,0.04); }
}
html[data-theme="light"] .hero { background: var(--pitch); }
html[data-theme="light"] .hero-spline-bg { opacity: 0.07; }
html[data-theme="light"] .hero-tagline { color: var(--text-primary); }
html[data-theme="light"] .hero-tagline .line-italic { color: var(--accent); }
html[data-theme="light"] .btn-light:hover { border-color: rgba(0,0,0,0.25); color: var(--text-primary); background: rgba(0,0,0,0.04); }

/* --- Reduced Motion (WCAG 2.3.3) --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .gsap-reveal { opacity: 1 !important; transform: none !important; }
  .marquee-track { animation: none !important; }
  .hero-scroll-hint { animation: none !important; }
}
