/* ==========================================================================
   NitrAI — Technical & Minimal Design System
   Clean, authentic, publication-quality research lab UI
   ========================================================================== */

:root {
  /* Color Palette: Editorial Dark System */
  --bg-dark: #090a0d;
  --bg-surface: #12141a;
  --bg-surface-hover: #181b24;
  --bg-elevated: #1e212b;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  
  --accent-primary: #ffffff;
  --accent-primary-text: #090a0d;
  --accent-warm: #d97706;
  --accent-success: #10b981;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body.dark-theme {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Background Grid Pattern */
.grid-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.8) 0%, transparent 80%);
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.serif-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  color: #e4e4e7;
}

p {
  color: var(--text-muted);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 90px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  margin-bottom: 48px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.section-title {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.08rem;
  max-width: 640px;
  color: var(--text-muted);
}

/* Announcement Bar */
.announcement-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
  font-size: 0.85rem;
  text-align: center;
}

.announcement-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.banner-link {
  color: var(--text-main);
  text-decoration: underline;
  font-weight: 500;
  margin-left: 6px;
}

.banner-link:hover {
  color: var(--accent-warm);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(9, 10, 13, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-normal);
}

/* Scroll Progress Bar */
.scroll-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent-primary);
  transition: width 0.08s linear;
  z-index: 10;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-main);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.brand-tag {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

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

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-main);
  transition: width 0.25s ease;
}

.nav-item:hover {
  color: var(--text-main);
}

.nav-item:hover::after,
.nav-item.active::after {
  width: 100%;
}

.nav-item.active {
  color: var(--text-main);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.3rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  border: 1px solid transparent;
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

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

.btn-primary:hover {
  background: #e4e4e7;
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
}

.btn-tertiary {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.btn-tertiary:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
}

.badge-warm {
  background: rgba(217, 119, 6, 0.12);
  color: var(--accent-warm);
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.badge-subtle {
  background: var(--bg-surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Cards & Surfaces */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Hero Section */
.hero-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-success);
}

.hero-title {
  font-size: 3.2rem;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.12rem;
  line-height: 1.65;
  margin-bottom: 32px;
  color: var(--text-muted);
}

/* Command Box */
.hero-command-box {
  background: #050608;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 36px;
}

.command-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.command-tabs {
  display: flex;
  gap: 6px;
}

.cmd-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cmd-tab.active, .cmd-tab:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

.cmd-badge {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.command-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.command-body code {
  font-family: var(--font-mono);
  color: #e4e4e7;
  font-size: 0.9rem;
}

.copy-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
}

.copy-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.copy-tooltip {
  position: absolute;
  top: -28px;
  right: 0;
  background: var(--accent-primary);
  color: var(--accent-primary-text);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
}

.copy-btn.copied .copy-tooltip {
  opacity: 1;
  top: -30px;
}

/* Stats Strip */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
}

/* Terminal Card */
.terminal-card {
  background: #050608;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.window-controls {
  display: flex;
  gap: 6px;
}

.control {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27272a;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.terminal-status {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-success);
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  min-height: 260px;
  background: #050608;
}

.term-line {
  margin-bottom: 6px;
  line-height: 1.5;
}

.term-line.comment { color: var(--text-dim); }
.term-line.prompt-line { color: var(--text-main); }
.prompt-arrow { color: var(--accent-warm); font-weight: bold; }
.prompt-cmd { color: #fff; }
.term-line.info { color: #60a5fa; }
.term-line.think-start, .term-line.think-end { color: #a78bfa; font-weight: 600; }
.term-line.think-content { color: #c4b5fd; padding-left: 12px; font-style: italic; }
.term-line.success { color: var(--accent-success); font-weight: 600; }
.term-line.code-out { color: #e4e4e7; }
.term-line.code-out.indent { padding-left: 16px; }

.keyword { color: #f43f5e; }
.func { color: #38bdf8; }
.type { color: #fbbf24; }

.terminal-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--text-main);
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.terminal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.vram-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meter-bar {
  width: 80px;
  height: 4px;
  background: var(--bg-surface-hover);
  border-radius: 2px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: var(--text-muted);
}

/* Mission Section Grid */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.mission-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.card-checklist {
  list-style: none;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.card-checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.card-checklist li i {
  color: var(--text-main);
  font-size: 0.75rem;
}

/* Models Section */
.model-switcher-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.model-tab-btn {
  display: flex;
  flex-direction: column;
  padding: 12px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.model-tab-btn.active {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.tab-name { font-weight: 600; font-size: 0.95rem; }
.tab-sub { font-size: 0.75rem; color: var(--text-dim); }

.model-detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.model-card-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 36px;
}

.model-header-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.model-title {
  font-size: 2rem;
  margin-bottom: 12px;
}

.model-size {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.model-description {
  font-size: 1rem;
  margin-bottom: 24px;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.spec-box {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.spec-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.spec-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.capabilities-block h4 {
  font-size: 1rem;
  margin-bottom: 14px;
}

.capability-list {
  list-style: none;
}

.capability-list li {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.capability-list li i {
  color: var(--text-main);
  font-size: 1rem;
  margin-top: 3px;
}

.model-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

/* Model Preview Box */
.model-preview-box {
  background: #050608;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 8px 14px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.code-preview {
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.haystack-visual {
  padding: 14px;
  background: #050608;
}

.haystack-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.haystack-cell {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.haystack-cell.needle {
  background: var(--accent-warm);
}

.haystack-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.vram-savings-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  padding: 16px;
  border-radius: var(--radius-md);
}

.savings-header {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.savings-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.metric-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.metric-lbl { font-size: 0.78rem; color: var(--text-dim); }
.savings-sub { font-size: 0.75rem; color: var(--text-dim); }

/* Technical Diagram Component (Clean HTML/SVG Node Flow) */
.tech-diagram-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin-bottom: 28px;
}

.diagram-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.flow-node {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.flow-node.highlight {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.flow-node .node-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.flow-node .node-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.flow-arrow {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.pipeline-steps-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.pipeline-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.pipeline-step-card.active, .pipeline-step-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.step-content h4 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.78rem;
  line-height: 1.4;
}

.step-detail-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
}

.step-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* Calculator Section */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-main);
}

.custom-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
}

.custom-select:focus {
  border-color: var(--border-strong);
}

.custom-range {
  width: 100%;
  accent-color: var(--text-main);
}

.range-val {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.calc-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-content: start;
}

.result-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  padding: 18px;
  border-radius: var(--radius-md);
}

.result-card.full-width {
  grid-column: span 2;
}

.res-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.res-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.res-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.compat-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--accent-success);
}

/* Playground Terminal */
.playground-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.prompt-selector-sidebar h4 {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.prompt-preset-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  padding: 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.prompt-preset-btn.active, .prompt-preset-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.preset-title {
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.preset-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.playground-terminal {
  background: #050608;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  height: 440px;
}

.pg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 8px 14px;
}

.pg-tabs span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pg-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.pg-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Quickstart */
.quickstart-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.qs-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.qs-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.qs-tab.active {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}

.qs-content pre {
  background: #050608;
  padding: 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
}

/* Waitlist Card */
.waitlist-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  max-width: 720px;
  margin: 0 auto;
}

.waitlist-card h2 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.waitlist-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 28px auto 12px auto;
}

.waitlist-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.waitlist-input:focus {
  border-color: var(--border-strong);
}

.waitlist-note {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Footer */
.footer {
  background: #050608;
  padding: 64px 0 24px 0;
}

.footer-container {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
  margin-bottom: 48px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.footer-status {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer-col h4 {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.footer-col a:hover {
  color: var(--text-main);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.footer-bottom-links a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 16px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  padding: 32px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-header {
  margin-bottom: 16px;
}

.modal-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.paper-abstract {
  margin-bottom: 16px;
}

.paper-abstract h4 {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Scroll-Triggered Reveal Animations */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children reveal */
[data-reveal].revealed .mission-card,
[data-reveal].revealed .pipeline-step-card,
[data-reveal].revealed .prompt-preset-btn {
  opacity: 0;
  animation: staggerFadeUp 0.45s ease forwards;
}

[data-reveal].revealed .mission-card:nth-child(1),
[data-reveal].revealed .pipeline-step-card:nth-child(1),
[data-reveal].revealed .prompt-preset-btn:nth-child(2) { animation-delay: 0.05s; }
[data-reveal].revealed .mission-card:nth-child(2),
[data-reveal].revealed .pipeline-step-card:nth-child(2),
[data-reveal].revealed .prompt-preset-btn:nth-child(3) { animation-delay: 0.12s; }
[data-reveal].revealed .mission-card:nth-child(3),
[data-reveal].revealed .pipeline-step-card:nth-child(3),
[data-reveal].revealed .prompt-preset-btn:nth-child(4) { animation-delay: 0.19s; }
[data-reveal].revealed .pipeline-step-card:nth-child(4),
[data-reveal].revealed .prompt-preset-btn:nth-child(5) { animation-delay: 0.26s; }

@keyframes staggerFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Terminal line-by-line typing reveal */
.term-line-anim {
  opacity: 0;
  animation: termLineIn 0.3s ease forwards;
}

@keyframes termLineIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* Floating AI Support Chat Widget */
.chat-widget-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1500;
}

.chat-widget-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--accent-primary-text);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.2s ease, background 0.2s ease;
  position: relative;
}

.chat-widget-btn:hover {
  transform: scale(1.06);
  background: #e4e4e7;
}

.chat-badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-success);
  border: 2px solid var(--bg-dark);
}

.chat-drawer {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 360px;
  height: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.chat-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
}

.chat-close-btn:hover {
  color: var(--text-main);
}

.chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #050608;
}

.chat-msg {
  display: flex;
  max-width: 85%;
}

.chat-msg.bot {
  align-self: flex-start;
}

.chat-msg.user {
  align-self: flex-end;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.chat-msg.bot .msg-bubble {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 2px;
}

.chat-msg.user .msg-bubble {
  background: var(--accent-primary);
  color: var(--accent-primary-text);
  font-weight: 500;
  border-bottom-right-radius: 2px;
}

.chat-input-form {
  display: flex;
  padding: 10px;
  background: var(--bg-dark);
  border-top: 1px solid var(--border-subtle);
  gap: 6px;
}

#chat-input-field {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
}

#chat-input-field:focus {
  border-color: var(--border-strong);
}

.chat-send-btn {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.chat-send-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

@media (max-width: 640px) {
  .chat-widget-container {
    bottom: 20px;
    right: 16px;
  }
  .chat-drawer {
    width: calc(100vw - 32px);
    right: 0;
    bottom: 56px;
    height: 420px;
  }
}

/* Pipeline step card smooth active border transition */
.pipeline-step-card {
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pipeline-step-card:hover {
  transform: translateY(-2px);
}

/* Smoother spec-box hover */
.spec-box {
  transition: background 0.2s ease, border-color 0.2s ease;
}

.spec-box:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

/* Focus ring for accessibility */
.btn:focus-visible,
.custom-select:focus-visible,
.waitlist-input:focus-visible {
  outline: 2px solid var(--text-main);
  outline-offset: 2px;
}

/* Responsive Adjustments & Mobile Optimization */
.desktop-only {
  display: inline;
}

@media (max-width: 1024px) {
  .hero-container, .model-card-grid, .calc-grid, .playground-grid, .footer-container {
    grid-template-columns: 1fr;
  }
  .hero-title { font-size: 2.6rem; }
  .mission-grid, .pipeline-steps-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .diagram-flow {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-arrow {
    text-align: center;
    transform: rotate(90deg);
    margin: 4px 0;
  }
}

@media (max-width: 768px) {
  .nav-action-btn {
    display: none !important;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .nav-links {
    display: none;
  }
  .desktop-only {
    display: none;
  }
}

@media (max-width: 640px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .container {
    padding: 0 16px;
  }

  .section {
    padding: 48px 0;
  }

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

  .section-subtitle {
    font-size: 0.95rem;
  }

  /* Header & Announcement Bar */
  .announcement-bar {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .nav-container {
    height: 60px;
    padding: 0 16px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .brand-tag {
    font-size: 0.55rem;
  }

  /* Hero Mobile Layout */
  .hero-section {
    padding: 36px 0;
  }

  .hero-container {
    gap: 28px;
  }

  .hero-status-pill {
    font-size: 0.72rem;
    padding: 4px 10px;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: 1.85rem;
    line-height: 1.22;
    margin-bottom: 16px;
    word-break: break-word;
    letter-spacing: -0.03em;
  }

  .hero-subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 24px;
  }

  /* Hero Command Box Mobile Fix */
  .hero-command-box {
    margin-bottom: 24px;
  }

  .command-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }

  .command-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .command-body {
    padding: 10px 12px;
    gap: 8px;
  }

  .command-body code {
    font-size: 0.78rem;
    word-break: break-all;
    overflow-x: auto;
  }

  .hero-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .stat-divider {
    display: none;
  }

  /* Terminal Card Mobile */
  .terminal-body {
    padding: 12px;
    font-size: 0.75rem;
    min-height: 220px;
  }

  .terminal-header {
    padding: 8px 12px;
  }

  .terminal-title {
    font-size: 0.72rem;
  }

  /* Model Specs & Swiper Mobile */
  .model-switcher-tabs {
    flex-direction: column;
    gap: 8px;
  }

  .model-tab-btn {
    width: 100%;
  }

  .model-detail-card {
    padding: 20px 16px;
  }

  .model-title {
    font-size: 1.5rem;
  }

  .specs-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .model-actions {
    flex-direction: column;
    gap: 8px;
  }

  .model-actions .btn {
    width: 100%;
  }

  /* Calculator & Playground Mobile */
  .calc-grid, .playground-grid {
    padding: 16px;
  }

  .calc-results {
    grid-template-columns: 1fr;
  }

  .result-card.full-width {
    grid-column: span 1;
  }

  .playground-terminal {
    height: 380px;
  }

  .pg-body {
    padding: 12px;
    font-size: 0.75rem;
  }

  /* Quickstart Mobile */
  .quickstart-box {
    padding: 16px;
  }

  .qs-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .qs-content pre {
    padding: 14px;
    font-size: 0.78rem;
  }

  /* Waitlist & Footer Mobile */
  .waitlist-card {
    padding: 32px 16px;
  }

  .waitlist-card h2 {
    font-size: 1.6rem;
  }

  .waitlist-form {
    flex-direction: column;
    gap: 8px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-links-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-bottom-links a {
    margin: 0 8px;
  }
}

