/* Detection Lab — Landing page styles */

html { scroll-behavior: smooth; }

/* ---- Header ---- */
.landing-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.landing-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.landing-header__logo {
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  text-decoration: none;
}
.landing-header__nav {
  display: flex;
  gap: 4px;
  list-style: none;
  align-items: center;
}
.landing-header__nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.landing-header__nav a:hover {
  background: var(--bg-primary);
  color: var(--accent);
}
.landing-header__cta {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 18px !important;
  border-radius: 24px !important;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s;
}
.landing-header__cta:hover {
  background: var(--accent-hover) !important;
}
.landing-header__menu {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
}

/* ---- Sections ---- */
.landing-section {
  padding: 64px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.landing-section--alt {
  background: var(--bg-primary);
}
.landing-section--alt > .landing-section {
  padding-top: 0;
  padding-bottom: 0;
}
.landing-section--full {
  max-width: none;
}
.landing-section__title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.landing-section__sub {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
}

/* ---- Hero (dark gradient) ---- */
.landing-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  padding: 0;
}
.landing-hero__inner {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px 64px;
}
.landing-hero__content {
  flex: 1;
  min-width: 0;
}
.landing-hero__badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.landing-hero__h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  color: var(--text-on-dark);
}
.landing-hero__sub {
  font-size: 17px;
  color: var(--text-on-dark-muted);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 520px;
}
.landing-hero__actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.landing-hero__proof {
  font-size: 13px;
  color: var(--text-on-dark-muted);
}
.landing-hero__visual {
  flex: 0 0 420px;
}
.landing-hero__code {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 24px;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #d4d4d4;
  overflow-x: auto;
  white-space: pre;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.landing-hero__code .cmt { color: #6a9955; }
.landing-hero__code .key { color: #9cdcfe; }
.landing-hero__code .str { color: #ce9178; }
.landing-hero__code .num { color: #b5cea8; }
.landing-hero__code .kw  { color: #569cd6; }
.landing-hero__code .punc { color: #808080; }

/* ---- Stats Bar ---- */
.stats-bar {
  background: var(--bg-dark);
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  padding: 0;
}
.stats-bar__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 20px 24px;
}
.stats-bar__item {
  text-align: center;
}
.stats-bar__number {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-on-dark);
  letter-spacing: -0.02em;
}
.stats-bar__label {
  font-size: 13px;
  color: var(--text-on-dark-muted);
  margin-top: 2px;
}

/* ---- Buttons ---- */
.btn-landing {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 28px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}
.btn-landing--primary {
  background: var(--accent);
  color: #fff;
}
.btn-landing--primary:hover {
  background: var(--accent-hover);
}
.btn-landing--secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-landing--secondary:hover {
  background: rgba(99, 102, 241, 0.08);
}
/* Light-on-dark hero buttons */
.btn-landing--hero-primary {
  background: var(--accent);
  color: #fff;
}
.btn-landing--hero-primary:hover {
  background: var(--accent-hover);
}
.btn-landing--hero-secondary {
  background: transparent;
  color: #e0e7ff;
  border: 2px solid rgba(165, 180, 252, 0.4);
}
.btn-landing--hero-secondary:hover {
  border-color: #a5b4fc;
  background: rgba(99, 102, 241, 0.1);
}
.btn-landing--white {
  background: #fff;
  color: var(--accent);
}
.btn-landing--white:hover {
  background: #f0f0f0;
}
.btn-landing--ghost-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.btn-landing--ghost-white:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ---- 3-col / 4-col grids ---- */
.landing-grid--2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.landing-grid--3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.landing-grid--4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ---- Product cards ---- */
.product-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.product-card--new {
  border: 2px solid var(--accent);
}
.product-card__badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 12px;
  text-transform: uppercase;
}
.product-card__icon {
  font-size: 36px;
  margin-bottom: 16px;
}
.product-card__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.product-card__question {
  font-size: 15px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.product-card__text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}
.product-card__uses {
  list-style: none;
  margin-bottom: 20px;
}
.product-card__uses li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.product-card__uses .check {
  color: var(--success);
  font-weight: 700;
}

/* ---- Use Case cards ---- */
.use-case-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.use-case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.use-case-card__icon {
  font-size: 32px;
  margin-bottom: 12px;
}
.use-case-card__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.use-case-card__text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- How It Works ---- */
.steps {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.step {
  flex: 1;
  text-align: center;
  position: relative;
}
.step__number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.step__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step__text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.step-arrow {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 20px;
  font-size: 24px;
  color: var(--text-muted);
}

/* ---- Tabs (generic) ---- */
.landing-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  justify-content: center;
}
.landing-tab {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.landing-tab:first-child {
  border-radius: 8px 0 0 8px;
}
.landing-tab:last-child {
  border-radius: 0 8px 8px 0;
}
.landing-tab--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---- Signals Grid ---- */
.signals-category {
  margin-bottom: 32px;
}
.signals-category__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.signals-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.signal-chip {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: transform 0.12s;
}
.signal-chip:hover {
  transform: translateY(-2px);
}
.signal-chip__icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.signal-chip__name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.signal-chip__desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ---- Comparison Table ---- */
.comparison-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 700px;
}
.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.comparison-table thead th {
  font-weight: 700;
  font-size: 14px;
  background: var(--bg-primary);
}
.comparison-table .col-highlight {
  background: var(--accent-light);
}
.comparison-table thead .col-highlight {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}
.comparison-table .row-label {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.comparison-table .val-good {
  color: var(--success);
  font-weight: 600;
}
.comparison-table .val-bad {
  color: var(--warning);
}
.comparison-table .val-neutral {
  color: var(--text-secondary);
}

/* ---- Code Example ---- */
.code-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}
.code-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  background: #2d2d3d;
  color: #888;
  border: none;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}
.code-tab--active {
  background: #1a1a2e;
  color: #d4d4d4;
}
.code-example {
  background: #1a1a2e;
  border-radius: 0 8px 8px 8px;
  padding: 24px;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #d4d4d4;
  overflow-x: auto;
  white-space: pre;
}
.code-example .cmt { color: #6a9955; }
.code-example .key { color: #9cdcfe; }
.code-example .str { color: #ce9178; }
.code-example .num { color: #b5cea8; }
.code-example .kw  { color: #569cd6; }
.code-example .tag { color: #808080; }
.code-example .attr { color: #9cdcfe; }

/* ---- Research cards ---- */
.research-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.research-card__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.research-card__year {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.research-card__text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- CTA Footer ---- */
.landing-cta-footer {
  background: linear-gradient(135deg, #4f46e5, #312e81);
  padding: 72px 24px;
  text-align: center;
  color: #fff;
}
.landing-cta-footer__title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}
.landing-cta-footer__sub {
  font-size: 16px;
  opacity: 0.85;
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.landing-cta-footer__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Footer ---- */
.landing-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
}
.landing-footer a {
  color: #cbd5e1;
  text-decoration: none;
  margin: 0 12px;
}
.landing-footer a:hover {
  color: #fff;
}
.landing-footer__links {
  margin-bottom: 12px;
}

/* ---- Animations ---- */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.fade-in.is-visible {
  opacity: 1;
}

/* Stagger cascade for child elements */
.stagger > :nth-child(1) { transition-delay: 0s; }
.stagger > :nth-child(2) { transition-delay: 0.1s; }
.stagger > :nth-child(3) { transition-delay: 0.2s; }
.stagger > :nth-child(4) { transition-delay: 0.3s; }
.stagger > :nth-child(5) { transition-delay: 0.4s; }
.stagger > :nth-child(6) { transition-delay: 0.5s; }

/* Typing cursor for hero code block */
.typing-cursor::after {
  content: '\2588';
  animation: blink 1s step-end infinite;
  color: var(--accent);
  font-weight: 400;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ---- Mobile ---- */
@media (max-width: 900px) {
  .landing-hero__inner {
    flex-direction: column;
    padding: 48px 24px 40px;
    gap: 32px;
  }
  .landing-hero__visual {
    flex: none;
    width: 100%;
    max-width: 480px;
  }
  .landing-hero__h1 {
    font-size: 32px;
  }
  .landing-grid--2 {
    grid-template-columns: 1fr;
  }
  .landing-grid--3 {
    grid-template-columns: 1fr;
  }
  .landing-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    flex-direction: column;
    gap: 24px;
  }
  .step-arrow {
    transform: rotate(90deg);
    padding-top: 0;
  }
  .signals-chips {
    grid-template-columns: 1fr;
  }
  .landing-header__nav {
    display: none;
  }
  .landing-header__menu {
    display: block;
  }
  .landing-header__nav--open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  .stats-bar__inner {
    gap: 24px;
    flex-wrap: wrap;
  }
  .stats-bar__number {
    font-size: 20px;
  }
}
@media (max-width: 520px) {
  .landing-grid--4 {
    grid-template-columns: 1fr;
  }
  .landing-section {
    padding: 40px 16px;
  }
  .landing-hero__inner {
    padding: 32px 16px;
  }
  .stats-bar__inner {
    gap: 16px;
    padding: 16px;
  }
}

/* ================================================================
   RED / BLUE MODE TOGGLE
   ================================================================ */

/* ---- Content visibility ---- */
.blue-content, .red-content { display: contents; }
body[data-mode="blue"] .red-content,
body[data-mode="red"] .blue-content { display: none !important; }

/* ---- Mode toggle component ---- */
.mode-toggle {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3px;
  gap: 2px;
}
.mode-toggle__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
}
.mode-toggle__opt:hover {
  color: var(--text-primary);
}
.mode-toggle__opt--active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.mode-toggle__opt--active:hover {
  color: #fff;
}
.mode-toggle__icon {
  font-size: 15px;
  line-height: 1;
}
.mode-toggle__label {
  line-height: 1;
}

/* ---- Red mode accent overrides ---- */
body[data-mode="red"] {
  --accent: #ef4444;
  --accent-hover: #dc2626;
  --accent-light: rgba(239, 68, 68, 0.1);
}

/* Hero gradient */
body[data-mode="red"] .landing-hero {
  background: linear-gradient(135deg, #0f172a 0%, #2d1019 50%, #7f1d1d 100%);
}
/* Hero badge */
body[data-mode="red"] .landing-hero__badge {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}
/* Hero code border */
body[data-mode="red"] .landing-hero__code {
  border-color: rgba(239, 68, 68, 0.2);
}
/* Stats bar border */
body[data-mode="red"] .stats-bar {
  border-top-color: rgba(239, 68, 68, 0.15);
}
/* Hero secondary button */
body[data-mode="red"] .btn-landing--hero-secondary {
  color: #fee2e2;
  border-color: rgba(252, 165, 165, 0.4);
}
body[data-mode="red"] .btn-landing--hero-secondary:hover {
  border-color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}
/* Secondary button hover */
body[data-mode="red"] .btn-landing--secondary:hover {
  background: rgba(239, 68, 68, 0.08);
}
/* Comparison highlight column */
body[data-mode="red"] .comparison-table .col-highlight {
  background: rgba(239, 68, 68, 0.06);
}
body[data-mode="red"] .comparison-table thead .col-highlight {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent);
}
/* CTA footer gradient */
body[data-mode="red"] .landing-cta-footer {
  background: linear-gradient(135deg, #dc2626, #7f1d1d);
}
/* Typing cursor */
body[data-mode="red"] .typing-cursor::after {
  color: #ef4444;
}

/* ---- Toggle responsive ---- */
@media (max-width: 520px) {
  .mode-toggle__label {
    display: none;
  }
  .mode-toggle__opt {
    padding: 6px 10px;
  }
}
