/* ========================================
   Scrapling — Main Stylesheet
   Inspired by autoresearch.lol aesthetic
   ======================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0f172a;
  --bg-card: #111827;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-dark: #1d4ed8;
  --cyan: #06b6d4;
  --teal: #14b8a6;
  --border-color: #1e293b;
  --border-accent: rgba(59, 130, 246, 0.2);
  --glow-accent: rgba(59, 130, 246, 0.08);
  --max-width: 1200px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-light);
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
  height: 64px;
}

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

.nav-logo canvas {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.nav-logo-text {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.nav-logo-text span {
  color: var(--accent);
}

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

.nav-links a {
  font-family: var(--font-sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent-light);
}

.nav-cta {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent) !important;
  font-size: 12px !important;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-cta:hover {
  background: var(--accent);
  color: #fff !important;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--glow-accent) 0%, transparent 70%);
  pointer-events: none;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.4;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
  background: rgba(59, 130, 246, 0.05);
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.hero-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 24px;
  letter-spacing: -2px;
}

.hero-title .gradient {
  background: linear-gradient(135deg, var(--accent-light), var(--accent), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title .subtitle {
  display: block;
  font-family: var(--font-sans);
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-secondary);
  -webkit-text-fill-color: var(--text-secondary);
  margin-top: 12px;
}

.hero-desc {
  font-size: clamp(16px, 1.5vw, 20px);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 48px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border-color);
}

.hero-stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 4px;
}

.hero-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* ========================================
   SECTION COMMON
   ======================================== */

.section {
  padding: 100px 24px;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-title .gradient {
  background: linear-gradient(135deg, var(--accent-light), var(--accent), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========================================
   SHOWCASE — Adaptive Parsing
   ======================================== */

.showcase {
  background: var(--bg-secondary);
}

.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.showcase-image {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #0a0e17 100%);
}

.showcase-image-placeholder svg {
  width: 60%;
  height: 60%;
  opacity: 0.6;
}

.showcase-info .section-label {
  display: inline-block;
}

.showcase-info h2 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
}

.showcase-info p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
  font-size: 15px;
}

.showcase-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.showcase-spec {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.showcase-spec-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.showcase-spec-value {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
}

/* ========================================
   FEATURES GRID
   ======================================== */

.features {
  background: var(--bg-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.feature-card {
  background: var(--bg-card);
  padding: 48px 32px;
  transition: background 0.3s ease;
}

.feature-card:hover {
  background: #1a2332;
}

.feature-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 18px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========================================
   CODE SHOWCASE (inspired by autoresearch)
   ======================================== */

.code-section {
  background: var(--bg-secondary);
  overflow: hidden;
}

.code-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.code-wrapper {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 48px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #0d1117;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #161b22;
  border-bottom: 1px solid var(--border-color);
}

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

.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27c93f; }

.code-body {
  padding: 20px 24px;
  text-align: left;
  overflow-x: auto;
}

.code-body pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #e6edf3;
}

.code-body .kw { color: #ff7b72; }
.code-body .fn { color: #d2a8ff; }
.code-body .str { color: #a5d6ff; }
.code-body .cm { color: #8b949e; font-style: italic; }
.code-body .op { color: #79c0ff; }
.code-body .num { color: #79c0ff; }

/* ========================================
   PERFORMANCE TABLE
   ======================================== */

.performance {
  background: var(--bg-primary);
}

.perf-table {
  max-width: 700px;
  margin: 0 auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.perf-row {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.perf-row:last-child {
  border-bottom: none;
}

.perf-row.header {
  background: rgba(59, 130, 246, 0.05);
}

.perf-rank {
  flex: 0 0 48px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.perf-name {
  flex: 1;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.perf-time {
  flex: 0 0 120px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: right;
  font-family: var(--font-mono);
}

.perf-vs {
  flex: 0 0 100px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

.perf-row.highlight .perf-name {
  color: var(--accent-light);
}

/* ========================================
   FEATURES LIST (Full detail)
   ======================================== */

.detail-features {
  background: var(--bg-secondary);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 28px;
  transition: all 0.3s ease;
}

.detail-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

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

.detail-card-icon {
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.detail-card h3 {
  font-size: 15px;
  font-weight: 600;
}

.detail-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========================================
   CTA SECTION
   ======================================== */

.cta-section {
  background: var(--bg-primary);
  text-align: center;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  border-top: 1px solid var(--border-color);
  padding: 48px 24px;
  background: var(--bg-primary);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-size: 14px;
  color: var(--text-muted);
}

.footer-logo span {
  color: var(--accent);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-light);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 968px) {
  .showcase-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .showcase-image {
    order: -1;
  }

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

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

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

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 23, 0.98);
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero-stats {
    flex-direction: column;
    gap: 24px;
  }

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

  .perf-rank {
    flex: 0 0 36px;
  }

  .perf-time {
    flex: 0 0 80px;
  }

  .perf-vs {
    flex: 0 0 80px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .section {
    padding: 60px 24px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .showcase-specs {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

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

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
