/* ============================
   CSS Custom Properties
   ============================ */
:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --surface-2: #16161a;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(0, 112, 243, 0.4);
  --accent: #0070f3;
  --accent-dim: rgba(0, 112, 243, 0.15);
  --accent-glow: rgba(0, 112, 243, 0.25);
  --text-primary: #f0f0f0;
  --text-secondary: #888899;
  --text-muted: #555566;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --nav-h: 64px;
  --transition: 0.2s ease;
}

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

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

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

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

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

ul {
  list-style: none;
}

/* ============================
   Typography
   ============================ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

code, pre {
  font-family: var(--font-mono);
}

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

.section {
  padding: 96px 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.section-label::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--accent);
}

.section-header {
  max-width: 560px;
  margin-bottom: 56px;
}

.section-header p {
  margin-top: 14px;
  font-size: 16px;
}

/* ============================
   Navbar
   ============================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background var(--transition), border-color var(--transition),
              backdrop-filter var(--transition);
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  transition: opacity var(--transition);
}

.nav-logo:hover { opacity: 0.8; }

.nav-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

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

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

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

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

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

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* ============================
   Buttons
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #0060d0;
  border-color: #0060d0;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--accent-dim);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 8px 14px;
  font-size: 13px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================
   Hero Section
   ============================ */
.hero {
  padding-top: calc(var(--nav-h) + 80px);
  padding-bottom: 96px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(0, 112, 243, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-bottom: 32px;
  letter-spacing: 0.04em;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  flex-wrap: wrap;
}

.stat-item {
  padding: 20px 36px;
  text-align: center;
  position: relative;
  flex: 1;
  min-width: 140px;
}

.stat-item + .stat-item {
  border-left: 1px solid var(--border);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  display: block;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

/* ============================
   Card Grid (What We Build)
   ============================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--border);
}

.feature-card {
  background: var(--surface);
  padding: 36px 32px;
  transition: background var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-dim);
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card:hover {
  background: var(--surface-2);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-card:hover .card-icon {
  border-color: var(--border-hover);
  box-shadow: 0 0 16px var(--accent-glow);
}

.card-icon {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: all var(--transition);
  position: relative;
  z-index: 1;
}

.card-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.feature-card h3 {
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.feature-card p {
  font-size: 14px;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent);
  margin-top: 20px;
  transition: gap var(--transition);
  position: relative;
  z-index: 1;
}

.card-link:hover { gap: 10px; }

.card-link svg {
  width: 14px;
  height: 14px;
}

/* ============================
   Terminal Section
   ============================ */
.terminal-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.terminal-text .section-label { margin-bottom: 16px; }
.terminal-text h2 { margin-bottom: 16px; }

.terminal-features {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.terminal-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.terminal-feature svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}

.terminal-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

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

.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}

.terminal-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  min-height: 300px;
}

.terminal-line {
  display: flex;
  gap: 12px;
}

.terminal-line.comment .t-text { color: var(--text-muted); }
.terminal-line.blank { height: 18px; }

.t-prompt { color: var(--text-muted); user-select: none; }
.t-keyword { color: #c678dd; }
.t-string { color: #98c379; }
.t-method { color: #61afef; }
.t-prop { color: #e06c75; }
.t-number { color: #d19a66; }
.t-comment { color: #5c6370; font-style: italic; }
.t-text { color: var(--text-primary); }

.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================
   Papers Section
   ============================ */
.papers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.paper-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 24px var(--accent-glow);
}

.paper-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.paper-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid;
}

.badge-blue {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.08);
}

.badge-purple {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.08);
}

.badge-green {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}

.badge-amber {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.badge-red {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
}

.paper-card h3 {
  font-size: 15px;
  margin-bottom: 10px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.paper-card p {
  font-size: 13px;
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.paper-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ============================
   CTA Banner
   ============================ */
.cta-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

.cta-banner h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.cta-banner p {
  max-width: 460px;
}

.cta-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

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

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

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

.footer-logo img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.footer-brand p {
  font-size: 13px;
  max-width: 220px;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.footer-social a {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.footer-social a:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  background: var(--accent-dim);
}

.footer-social svg {
  width: 15px;
  height: 15px;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--text-muted);
}

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

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ============================
   Page Header
   ============================ */
.page-header {
  padding-top: calc(var(--nav-h) + 72px);
  padding-bottom: 72px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse at top left, rgba(0, 112, 243, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.page-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 580px;
  margin-bottom: 12px;
}

.page-header p {
  max-width: 500px;
  font-size: 16px;
}

/* ============================
   Mobile Nav Menu
   ============================ */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  padding: 80px 24px 32px;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.mobile-menu a:hover { color: var(--text-primary); }

/* ============================
   Divider
   ============================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .terminal-section { grid-template-columns: 1fr; gap: 48px; }
  .papers-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .cards-grid { grid-template-columns: 1fr; }
  .papers-grid { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; padding: 36px 24px; }
  .hero-stats { flex-direction: row; }
  .stat-item + .stat-item { border-left: none; border-top: 1px solid var(--border); }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .page-header-inner { flex-direction: column; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; }
  .stat-item + .stat-item { border-left: none; border-top: 1px solid var(--border); }
}
