/* ========================================
   SubQ — Subquadratic
   Stylesheet inspired by autoresearch.lol
   ======================================== */

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

:root {
  --bg: #0A0A0B;
  --bg-card: #121214;
  --bg-elevated: #1A1A1E;
  --border: #222226;
  --border-light: #2A2A2E;
  --text: #F0F0F2;
  --text-secondary: #88889A;
  --text-muted: #5C5C6E;
  --accent: #7C5CFC;
  --accent-hover: #6A48E8;
  --accent-glow: rgba(124, 92, 252, 0.15);
  --purple-soft: #A29BFE;
  --green: #34D399;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1100px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 16px;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 28px;
  width: auto;
}

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

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  white-space: nowrap;
}

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

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-large {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-glow);
}

/* --- Hero --- */
.hero {
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}

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

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

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

.hero-text {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 480px;
}

.hero-stats {
  display: grid;
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Sections --- */
.section {
  padding: 80px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.section-dark {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin-bottom: 16px;
  max-width: 700px;
}

.section-desc {
  font-size: 1.05rem;
  max-width: 580px;
  margin-bottom: 40px;
}

/* --- Use Cases --- */
.context-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.context-bar-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 28px;
}

.context-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.context-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 1s ease;
}

.use-case-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

.use-case-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.use-case-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.use-case-card p {
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.token-count {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.token-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Architecture --- */
.arch-content {
  max-width: 680px;
  margin-bottom: 40px;
}

.arch-content p {
  font-size: 1.02rem;
  line-height: 1.75;
}

.arch-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.arch-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.arch-card h3 {
  margin-bottom: 8px;
}

.arch-card p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

.complexity {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.arch-card-old .complexity {
  color: var(--text-muted);
}

.arch-card-new .complexity {
  color: var(--accent);
}

.arch-divider {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 600;
}

.tech-report {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Benchmarks --- */
.table-wrapper {
  overflow-x: auto;
  margin: 32px 0 24px;
  -webkit-overflow-scrolling: touch;
}

.benchmark-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.benchmark-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.benchmark-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.benchmark-table td:first-child {
  min-width: 180px;
}

.benchmark-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.bench-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.model-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.model-badge-subq {
  background: var(--accent-glow);
  color: var(--accent);
}

.highlight {
  color: var(--accent) !important;
  font-weight: 700;
}

.bench-footnote {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.bench-validated {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 16px;
}

.bench-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bench-links .tech-report {
  font-size: 0.85rem;
}

/* --- Products --- */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.product-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color 0.2s, transform 0.2s;
}

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

.product-card h3 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.product-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.product-card > p {
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.product-features {
  list-style: none;
  margin-bottom: 24px;
}

.product-features li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

.product-features li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* --- Research --- */
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.research-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.2s;
}

.research-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.research-card:hover {
  border-color: var(--border-light);
}

.research-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.research-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.research-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.research-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  transition: opacity 0.2s;
}

.research-link:hover {
  opacity: 0.8;
}

/* --- About --- */
.about-text {
  max-width: 680px;
  font-size: 1.02rem;
  line-height: 1.75;
  margin-bottom: 32px;
}

.about-companies span {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.company-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.company-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* --- CTA --- */
.cta-section {
  padding: 80px 0;
  text-align: center;
}

.cta-content h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  margin-bottom: 12px;
}

.cta-content p {
  font-size: 1.05rem;
  margin-bottom: 28px;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
}

.footer-brand img {
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

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

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

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 0;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: color 0.2s;
}

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

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .products-grid,
  .use-case-cards {
    grid-template-columns: 1fr;
  }

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

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

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

  .arch-comparison {
    grid-template-columns: 1fr;
  }

  .arch-divider {
    text-align: center;
    transform: rotate(90deg);
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-cta {
    display: none;
  }

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

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .bench-links {
    flex-direction: column;
    align-items: flex-start;
  }

  .company-tags {
    gap: 8px;
  }

  .company-tag {
    font-size: 0.8rem;
    padding: 5px 12px;
  }
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll reveal for research cards (applied by JS) */
.research-card.visible {
  opacity: 1;
  transform: translateY(0);
}
