/* CALION Ecosystem — Production Stylesheet
   Designed for High Performance, Zero External Dependencies, and Dark Terminal Aesthetics */

:root {
  --bg-base: #070a12;
  --bg-primary: #0b0f17;
  --bg-surface: #101726;
  --bg-surface-elevated: #162035;
  --bg-surface-hover: #1c2a47;
  --bg-code: #05080e;

  --border-subtle: #1e293b;
  --border-medium: #27364f;
  --border-accent: rgba(56, 189, 248, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-cyan-dark: #0284c7;
  --accent-cyan-glow: rgba(56, 189, 248, 0.15);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.12);

  --max-width: 1200px;
  --header-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Atmosphere */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(circle 800px at 50% -100px, rgba(56, 189, 248, 0.08), transparent 70%),
    radial-gradient(circle 600px at 90% 400px, rgba(16, 185, 129, 0.04), transparent 60%),
    radial-gradient(circle 600px at 10% 800px, rgba(56, 189, 248, 0.04), transparent 60%);
}

.site-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

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

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

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background-color: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.9;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.nav-link {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover, .nav-link:focus-visible {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--accent-cyan);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent-cyan);
  color: #070a12;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  background-color: #7dd3fc;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.35);
}

.btn-outline:hover {
  background-color: rgba(56, 189, 248, 0.08);
  border-color: var(--accent-cyan);
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.mobile-toggle:focus-visible {
  outline: 2px solid var(--accent-cyan);
}

/* Mobile Drawer */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background-color: rgba(7, 10, 18, 0.98);
  backdrop-filter: blur(20px);
  padding: 24px;
  z-index: 99;
  flex-direction: column;
  gap: 20px;
  transform: translateY(-10px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.mobile-nav.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav-link {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

/* Section Header */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 60px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.775rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  background-color: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 9999px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* HERO SECTION */
.hero {
  padding: 90px 0 80px;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.hero-title {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 24px;
}

.text-gradient {
  background: linear-gradient(135deg, #f8fafc 40%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 740px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

/* Feature Spec Bar */
.spec-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  background-color: rgba(16, 23, 38, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  padding: 8px;
  border-right: 1px solid var(--border-subtle);
}

.spec-item:last-child {
  border-right: none;
}

.spec-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.spec-val.accent {
  color: var(--accent-cyan);
}

.spec-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ECOSYSTEM SECTION */
.ecosystem-section {
  padding: 80px 0;
  position: relative;
}

.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.ecosystem-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.ecosystem-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.card-top {
  margin-bottom: 24px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.badge-live {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-planned {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-cyan);
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 20px;
}

.card-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.card-features li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-features li svg {
  flex-shrink: 0;
  color: var(--accent-cyan);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.card-domain {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: var(--text-muted);
}

.ecosystem-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* LEARNING SECTION */
.learning-section {
  padding: 80px 0;
  position: relative;
}

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

.learning-intro h2 {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.learning-intro p {
  font-size: 1.05rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

.learning-modules {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.module-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  transition: all 0.2s ease;
}

.module-item:hover {
  border-color: var(--border-accent);
  background-color: var(--bg-surface-elevated);
}

.module-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background-color: rgba(56, 189, 248, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.module-info h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.module-info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* TOOLS SECTION */
.tools-section {
  padding: 80px 0;
  position: relative;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.tool-preview-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.2s ease;
}

.tool-preview-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tool-tag {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--accent-cyan);
  background-color: rgba(56, 189, 248, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.tool-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.tool-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.tool-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-micro-pill {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--text-muted);
  background-color: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.tools-cta-box {
  text-align: center;
  padding: 32px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 720px;
  margin: 0 auto;
}

.tools-cta-box h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.tools-cta-box p {
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* ABOUT SECTION */
.about-section {
  padding: 80px 0;
  position: relative;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.about-card h3 {
  font-size: 1.25rem;
}

.about-card p {
  font-size: 0.925rem;
  line-height: 1.6;
}

/* FOOTER */
.footer {
  margin-top: auto;
  background-color: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 32px;
}

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

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 320px;
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--accent-cyan);
}

.footer-link-external {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-badges {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .ecosystem-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .learning-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

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

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

  .mobile-toggle {
    display: block;
  }

  .hero {
    padding: 60px 0 50px;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .spec-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .spec-item:nth-child(2) {
    border-right: none;
  }

  .ecosystem-grid,
  .ecosystem-secondary-grid,
  .tools-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

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

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