/* ── Inference Abstraction Website Styles ── */
/* Light mode theme matching command-center light variant */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-blue: #2563eb;
  --accent-green: #16a34a;
  --accent-yellow: #ca8a04;
  --accent-red: #dc2626;
  --accent-purple: #9333ea;
  --accent-cyan: #0891b2;
  --accent-orange: #ea580c;
  --accent-teal: #0d9488;
  --accent-pink: #db2777;
  --border-color: #cbd5e1;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  /* SVG-specific (light backgrounds for inline SVG rects) */
  --svg-bg: #f8fafc;
  --svg-card: #ffffff;
  --svg-secondary: #f1f5f9;
  --svg-border: #cbd5e1;
  --svg-code-bg: #f1f5f9;
}

/* ── Splash Screen ── */
.splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  color: #22c55e;
  letter-spacing: 0.02em;
}

.splash-cursor {
  display: inline-block;
  width: 10px;
  height: 1.4rem;
  background: #22c55e;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}

.splash-done {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  color: #22c55e;
  margin-left: 0.5rem;
  display: none;
}

.splash-done.show {
  display: inline;
}

.splash-cursor-end {
  display: none;
}

.splash-cursor-end.show {
  display: inline-block;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

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

html {
  scroll-behavior: smooth;
  zoom: 1.25;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-icon {
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.1rem;
  list-style: none;
  flex-wrap: nowrap;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-parent {
  gap: 0.5rem;
}

.nav-parent a {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-links a.active {
  color: var(--accent-purple);
  border-bottom: 2px solid var(--accent-purple);
  border-radius: 6px 6px 0 0;
}

/* ── Sub-navigation ── */
.subnav {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

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

.subnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 36px;
  display: flex;
  align-items: center;
}

.subnav-links {
  display: flex;
  gap: 0.1rem;
  list-style: none;
  flex-wrap: nowrap;
}

.subnav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.subnav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.subnav-links a.active {
  color: var(--accent-purple);
  border-bottom: 2px solid var(--accent-purple);
  border-radius: 4px 4px 0 0;
}

/* ── Mobile Menu ── */
.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
}

.nav-mobile {
  display: none;
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  box-shadow: var(--shadow);
}

.nav-mobile.open {
  display: block;
}

.nav-mobile li a {
  display: block;
  padding: 0.6rem 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
}

.nav-mobile li:last-child a { border-bottom: none; }

.nav-mobile li a:hover {
  color: var(--accent-purple);
}

@media (max-width: 768px) {
  .nav-burger { display: block; }
}

/* ── Hero ── */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.75;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-purple);
  background: rgba(147, 51, 234, 0.08);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.hero h1 span {
  color: var(--accent-blue);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: left;
  max-width: 750px;
  margin: 0 auto;
}

.hero-grid-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.hero-grid-title span {
  color: var(--accent-blue);
}

.hero-grid-blurb {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.hero-feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Sections ── */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
  scroll-margin-top: 100px;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-number {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-purple);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Diagram Container ── */
.diagram {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-caption {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.diagram-caption-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.diagram-caption-line {
  width: 24px;
  height: 2px;
  border-radius: 1px;
}

/* ── Key Points ── */
.key-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.key-point {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  border-left: 3px solid var(--accent-blue);
  box-shadow: var(--shadow);
}

.key-point-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.key-point-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Scroll-Driven Animations ── */
@keyframes scrollFadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Scroll-driven: title grow + fade-in (JS-powered) ── */

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  opacity: 0.3;
  transition: font-size 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.6s ease;
  will-change: font-size, opacity;
}

.section-title.in-view {
  font-size: 2rem;
  opacity: 1;
}

.section-number {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.section-number.in-view {
  opacity: 1;
  transform: translateY(0);
}

.section-subtitle {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
}

.section-subtitle.in-view {
  opacity: 1;
  transform: translateY(0);
}

.diagram {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.diagram.in-view {
  opacity: 1;
  transform: scale(1);
}

.key-point {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.key-point.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger key-point children */
.key-point:nth-child(2) {
  transition-delay: 0.1s;
}

.key-point:nth-child(3) {
  transition-delay: 0.2s;
}

/* ── SVG Common Styles ── */
.topo-srv-label {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  fill: var(--text-primary);
}

.topo-srv-addr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7px;
  font-weight: 500;
  fill: var(--text-muted);
}

.topo-gpu-name {
  font-family: 'Inter', sans-serif;
  font-size: 7px;
  font-weight: 700;
  fill: var(--text-primary);
}

.topo-gpu-index {
  font-family: 'Inter', sans-serif;
  font-size: 7px;
  font-weight: 700;
  fill: var(--text-muted);
}

.topo-gauge-label {
  font-family: 'Inter', sans-serif;
  font-size: 5.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  fill: var(--text-muted);
  opacity: 0.6;
}

.topo-gpu-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 800;
}

.topo-latency-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
}

.topo-client-name {
  font-family: 'Inter', sans-serif;
  font-size: 8px;
  font-weight: 700;
  fill: var(--text-primary);
}

.topo-mode-badge-text {
  font-family: 'Inter', sans-serif;
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topo-label {
  font-family: 'Inter', sans-serif;
  font-size: 8px;
  font-weight: 600;
  fill: var(--text-secondary);
}

.topo-label-sm {
  font-family: 'Inter', sans-serif;
  font-size: 6.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  fill: var(--text-muted);
}

.topo-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 500;
}

.topo-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 6.5px;
  font-weight: 600;
}

.topo-leader-badge {
  font-size: 8px;
}

.topo-bootstrap-label {
  font-family: 'Inter', sans-serif;
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.topo-section-title {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  fill: var(--text-primary);
}

.topo-section-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 8px;
  font-weight: 500;
  fill: var(--text-secondary);
}

/* ── Sequence Diagram Styles ── */
.seq-line {
  font-family: 'Inter', sans-serif;
}

.seq-actor {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
}

.seq-msg {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7px;
  font-weight: 500;
}

.seq-note {
  font-family: 'Inter', sans-serif;
  font-size: 6.5px;
  font-weight: 600;
}

/* ── Integration Cards ── */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.integration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.integration-card:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.integration-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.integration-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.integration-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.integration-card-type {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.integration-badge {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

.integration-badge-soon {
  color: var(--accent-yellow);
  background: rgba(202, 138, 4, 0.1);
}

.integration-badge-active {
  color: var(--accent-green);
  background: rgba(22, 163, 74, 0.1);
}

.integration-card-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Install Block ── */
.install-block {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.install-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.install-code {
  background: #1e293b;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.install-code code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: #22c55e;
  white-space: nowrap;
  overflow-x: auto;
}

.install-copy {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.install-copy:hover {
  background: rgba(255, 255, 255, 0.2);
}

.install-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Responsive ── */

/* Large tablets / small laptops */
@media (max-width: 1024px) {
  html { zoom: 1; }

  .hero h1 { font-size: 2.5rem; }
  .hero-subtitle { font-size: 1rem; }

  .section { padding: 3.5rem 1.5rem; }

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

/* Tablets */
@media (max-width: 768px) {
  html { zoom: 1; }

  .nav-inner { height: 48px; }
  .nav-logo { font-size: 0.95rem; }
  .nav-parent { display: none; }

  .subnav { display: none !important; }

  .hero {
    min-height: 50vh;
    padding: 5rem 1.5rem 3rem;
  }
  .hero h1 { font-size: 2rem; }
  .hero-subtitle { font-size: 0.9rem; max-width: 100%; }
  .hero-features {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
  .hero-feature { font-size: 0.8rem; }
  .hero-bg { display: none; }

  .section {
    padding: 2.5rem 1rem;
    scroll-margin-top: 56px;
  }
  .section-title.in-view { font-size: 1.5rem; }
  .section-subtitle { font-size: 0.85rem; }

  .diagram {
    padding: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .diagram svg {
    min-width: 600px;
  }

  .key-points {
    grid-template-columns: 1fr;
  }

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

  .install-code {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .install-code code {
    font-size: 0.75rem;
    overflow-x: auto;
  }

  .footer { padding: 2rem 1rem; }
}

/* Phones */
@media (max-width: 480px) {
  .hero {
    min-height: auto;
    padding: 4.5rem 1rem 2rem;
  }
  .hero h1 { font-size: 1.6rem; }
  .hero-badge { font-size: 0.65rem; }

  .section { padding: 2rem 0.75rem; }
  .section-title.in-view { font-size: 1.3rem; }

  .diagram { padding: 0.5rem; }
  .diagram svg { min-width: 500px; }

  .key-point { padding: 1rem; }
  .key-point-title { font-size: 0.8rem; }
  .key-point-text { font-size: 0.75rem; }

  .install-code { padding: 0.75rem 1rem; }
  .install-code code { font-size: 0.65rem; }

  .splash-text { font-size: 1rem; }
  .splash-cursor { height: 1rem; }
}

/* Very small phones */
@media (max-width: 360px) {
  .hero h1 { font-size: 1.3rem; }
  .hero-subtitle { font-size: 0.8rem; }
  .section-title.in-view { font-size: 1.1rem; }
  .diagram svg { min-width: 400px; }
}