/* =============================================
   CosmicBrain AI — Design System & Styles
   ============================================= */

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --surface: #1e1e2a;
  --border: #2a2a3a;
  --border-light: #333348;
  --text: #e8e8f0;
  --text-secondary: #9595a8;
  --text-muted: #6b6b80;
  --accent: #22d3ee;
  --accent-light: #67e8f9;
  --accent-dim: rgba(34, 211, 238, 0.12);
  --accent-glow: rgba(34, 211, 238, 0.25);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.15);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251, 191, 36, 0.15);
  --red: #f87171;
  --gradient: linear-gradient(135deg, #22d3ee 0%, #06b6d4 50%, #3b82f6 100%);
  --gradient-text: linear-gradient(135deg, #67e8f9 0%, #22d3ee 40%, #60a5fa 100%);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

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

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

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

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

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

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  justify-content: center;
}
.btn-outline:hover { border-color: var(--accent); background: var(--accent-dim); }

.btn-sm { padding: 8px 20px; font-size: 0.875rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: all 0.3s ease;
  background: transparent;
}
.nav.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.logo-icon {
  font-size: 1.5rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-text { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.logo-ai { color: var(--accent-light); -webkit-text-fill-color: var(--accent-light); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

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

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 80%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}
.orb-1 { width: 600px; height: 600px; background: var(--accent); top: -200px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: #06b6d4; bottom: -100px; left: -100px; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: #60a5fa; top: 30%; left: 50%; animation-delay: -14s; opacity: 0.2; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: 24px;
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin-top: 24px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* ---- Sections ---- */
.section { padding: 120px 0; }
.section-dark { background: var(--bg-elevated); }

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

.section-tag {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-dim);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 16px;
  line-height: 1.7;
}

/* ---- Comparison ---- */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.comparison-card {
  padding: 36px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.comparison-old { background: rgba(248, 113, 113, 0.03); border-color: rgba(248, 113, 113, 0.15); }
.comparison-new { background: var(--accent-dim); border-color: rgba(34, 211, 238, 0.2); }

.comparison-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.comparison-icon { font-size: 1.5rem; }
.comparison-old .comparison-icon { color: var(--red); }
.comparison-new .comparison-icon {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.comparison-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.comparison-card li {
  padding-left: 24px;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.comparison-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.comparison-old li::before { background: rgba(248, 113, 113, 0.4); }
.comparison-new li::before { background: var(--accent); }

/* ---- Skills Grid ---- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.25s ease;
}
.skill-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.skill-icon { font-size: 2rem; margin-bottom: 16px; }

.skill-card h3 { margin-bottom: 8px; }
.skill-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

.skill-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.skill-accuracy { font-size: 0.85rem; font-weight: 600; color: var(--green); font-family: var(--mono); }

.skill-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.skill-status.available { background: var(--green-dim); color: var(--green); }
.skill-status.beta { background: var(--yellow-dim); color: var(--yellow); }

.skill-card-cta {
  border-style: dashed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.skill-card-cta .skill-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px dashed var(--border-light);
  font-size: 1.5rem;
  color: var(--text-muted);
}
.skill-link {
  margin-top: 16px;
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.skill-link:hover { text-decoration: underline; }

/* ---- Architecture ---- */
.architecture { max-width: 700px; margin: 0 auto; }

.arch-step {
  display: flex;
  gap: 28px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.arch-step:hover { border-color: var(--accent); }

.arch-number {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
  width: 60px;
}

.arch-content h3 { margin-bottom: 8px; }
.arch-content p { color: var(--text-secondary); font-size: 0.95rem; }

.arch-detail {
  margin-top: 16px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
.arch-detail code {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent-light);
}

.arch-connector {
  width: 2px;
  height: 32px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  margin: 0 auto;
}

/* ---- Models ---- */
.models-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  position: relative;
  transition: all 0.25s ease;
}
.model-card:hover { border-color: var(--border-light); transform: translateY(-4px); }

.model-card-featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.06) 0%, var(--bg-card) 100%);
  transform: scale(1.02);
}
.model-card-featured:hover { border-color: var(--accent-light); transform: scale(1.02) translateY(-4px); }

.model-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: var(--gradient);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.model-tier {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.model-card h3 { font-size: 1.75rem; margin-bottom: 12px; }
.model-desc { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 28px; }

.model-specs {
  list-style: none;
  margin-bottom: 28px;
  text-align: left;
}
.model-specs li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.model-specs li:last-child { border-bottom: none; }
.model-specs span { color: var(--text-muted); }
.model-specs strong { color: var(--text); font-weight: 600; }

/* ---- Code Block ---- */
.code-block {
  max-width: 740px;
  margin: 0 auto;
  background: #0d0d14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}
.code-dots { display: flex; gap: 6px; }
.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
}
.code-dots span:first-child { background: #f87171; }
.code-dots span:nth-child(2) { background: #fbbf24; }
.code-dots span:last-child { background: #34d399; }
.code-filename { font-family: var(--mono); font-size: 0.8rem; color: var(--text-muted); }

.code-block pre {
  padding: 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.code-kw { color: #06b6d4; }
.code-mod { color: #60a5fa; }
.code-str { color: #34d399; }
.code-comment { color: var(--text-muted); font-style: italic; }
.code-func { color: #fbbf24; }
.code-hl { color: #60a5fa; }

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-content .section-tag { margin-bottom: 16px; }
.about-content h2 { text-align: left; margin-bottom: 24px; }
.about-content p { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.7; }

.about-logos { margin-top: 32px; }
.partner-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.partners {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.partners span {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.about-card-icon {
  font-size: 2rem;
  margin-bottom: 20px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.about-card h4 { font-size: 1.25rem; margin-bottom: 12px; }
.about-card p { color: var(--text-secondary); line-height: 1.7; }

/* ---- CTA ---- */
.section-cta {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
  text-align: center;
}

.cta-content { max-width: 640px; margin: 0 auto; }
.cta-content p { color: var(--text-secondary); margin-top: 16px; font-size: 1.1rem; }

.cta-form {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cta-form input,
.cta-form select,
.cta-form textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}
.cta-form input::placeholder,
.cta-form textarea::placeholder { color: var(--text-muted); }
.cta-form input:focus,
.cta-form select:focus,
.cta-form textarea:focus { border-color: var(--accent); }

.cta-form select { appearance: none; cursor: pointer; }
.cta-form select option { background: var(--bg-card); color: var(--text); }

.cta-form .btn-lg { margin-top: 8px; width: 100%; justify-content: center; }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding-top: 64px;
  padding-bottom: 32px;
  background: var(--bg);
}

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

.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 12px; }

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

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .hero { padding: 100px 0 60px; }
  .hero-stats { flex-direction: column; align-items: flex-start; gap: 16px; }
  .stat-divider { width: 40px; height: 1px; }

  .comparison { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .models-grid { grid-template-columns: 1fr; }
  .model-card-featured { transform: none; }
  .model-card-featured:hover { transform: translateY(-4px); }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .arch-step { flex-direction: column; gap: 16px; }
  .arch-number { width: auto; }
}
