/* =============================================
   Light Knot — Dark Mode Stylesheet
   Aesthetic: Compute-heavy, intimidatingly smart
   Colors: Deep blacks, neon accent (laser blue)
   Typography: Inter (body), JetBrains Mono (technical)
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #08090C;
  --bg-elevated: #0E1015;
  --bg-card: #12141B;
  --bg-surface: #181B24;
  --border: #1F2330;
  --border-accent: rgba(56, 189, 248, 0.15);
  --text-primary: #E4E6ED;
  --text-secondary: #8B90A0;
  --text-muted: #555A6B;
  --accent: #38BDF8;
  --accent-bright: #7DD3FC;
  --accent-dim: rgba(56, 189, 248, 0.08);
  --accent-glow: rgba(56, 189, 248, 0.12);
  --accent-glow-strong: rgba(56, 189, 248, 0.25);
  --green: #34D399;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

/* --- Thank You Banner --- */
.thank-you-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 0;
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}

.thank-you-banner.visible {
  transform: translateY(0);
}

.thank-you-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.thank-you-close {
  background: none;
  border: none;
  color: rgba(8, 9, 12, 0.6);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.thank-you-close:hover {
  color: var(--bg);
}

/* --- Container --- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: background 0.4s ease, padding 0.3s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(8, 9, 12, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.625rem 0;
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-mark {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.9;
}

.logo-text {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.nav-link {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

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

.nav-cta {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-cta:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.875rem 2rem;
  border-radius: 6px;
  transition: all 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.btn-accent {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.btn-accent:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 24px var(--accent-glow-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-text {
  max-width: 680px;
  padding-top: 6rem;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.hero-headline {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 1.75rem;
  color: #fff;
}

.hero-subhead {
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  font-weight: 400;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  opacity: 0.35;
}

.hero-visual-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    var(--bg) 0%,
    rgba(8, 9, 12, 0.85) 30%,
    rgba(8, 9, 12, 0.4) 70%,
    rgba(8, 9, 12, 0.6) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* --- Sections --- */
.section {
  padding: 8rem 0;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: #fff;
}

.section-subtitle {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 620px;
  margin-bottom: 3.5rem;
}

.math {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--accent);
}

/* --- The Problem --- */
.section-problem {
  border-top: 1px solid var(--border);
}

.problem-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 2rem;
}

.problem-lead {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.problem-body p {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.problem-body em {
  font-style: italic;
  color: var(--text-primary);
}

.problem-stat-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  transition: border-color 0.3s ease;
}

.stat-card:hover {
  border-color: var(--border-accent);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* --- The Engine --- */
.section-engine {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.engine-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-top: 2rem;
  margin-bottom: 4rem;
}

.engine-body p {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

/* Terminal */
.engine-terminal {
  background: #0C0D11;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #FF5F56; }
.terminal-dot.yellow { background: #FFBD2E; }
.terminal-dot.green { background: #27C93F; }

.terminal-title {
  margin-left: 0.75rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 1rem 1.25rem;
}

.terminal-line {
  white-space: pre-wrap;
  color: var(--text-muted);
}

.t-prompt {
  color: var(--green);
  margin-right: 0.5rem;
}

.t-dim {
  color: var(--text-muted);
  opacity: 0.7;
}

.t-accent {
  color: var(--green);
  font-weight: 600;
}

/* Engine video row */
.engine-video-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.engine-video-row.two-up {
  grid-template-columns: repeat(2, 1fr);
}

.engine-vid-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vid-wrap {
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  aspect-ratio: 1;
}

.vid-wrap .card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vid-caption {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-align: center;
}

/* --- Discovery Pipeline --- */
.section-pipeline {
  border-bottom: 1px solid var(--border);
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pipeline-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 32px var(--accent-dim);
}

.pipeline-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.pipeline-icon svg {
  width: 100%;
  height: 100%;
}

.pipeline-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.pipeline-card p {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* --- Team --- */
.section-team {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  transition: border-color 0.3s ease;
}

.team-card:hover {
  border-color: var(--border-accent);
}

.team-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.team-role {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.team-card p {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* --- Contact --- */
.section-contact {
  padding: 8rem 0 10rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.contact-body {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-top: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.875rem 1rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  align-self: flex-start;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand .logo-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-legal {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero {
    min-height: 100vh;
    min-height: 100svh;
  }

  .hero-text {
    max-width: none;
  }

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

  .engine-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .engine-video-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .vid-wrap {
    aspect-ratio: 16 / 10;
  }

  .pipeline-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .section {
    padding: 5rem 0;
  }
}

@media (max-width: 700px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.3s ease;
    z-index: 1001;
  }

  .nav-links.open {
    right: 0;
  }

  .hero-headline {
    font-size: 2.25rem;
  }

  .hero-headline br {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .engine-terminal {
    font-size: 0.6875rem;
  }
}
