/* ═══════════════════════════════════════════════════════════════
   OPALGO — Main Stylesheet
   Design System: Dark Navy + Cyan Accent
═══════════════════════════════════════════════════════════════ */

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

:root {
  --bg-deep:      #071524;
  --bg-dark:      #0B1E35;
  --bg-mid:       #112742;
  --bg-card:      #0f2038;
  --bg-card-hover:#142b4a;
  --accent:       #00B4D8;
  --accent-light: #48CAE4;
  --accent-dim:   rgba(0,180,216,0.12);
  --accent-glow:  rgba(0,180,216,0.25);
  --text-primary: #F0F4F8;
  --text-secondary:#8BA3B8;
  --text-muted:   #4E6A84;
  --border:       rgba(0,180,216,0.15);
  --border-card:  rgba(0,180,216,0.1);
  --red:          #ef4444;
  --amber:        #f59e0b;
  --green:        #22c55e;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --section-pad:  100px;
  --container:    1200px;
  --radius:       12px;
  --radius-lg:    20px;
  --transition:   0.3s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

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

/* ── Grid Background ──────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,180,216,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,180,216,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── Typography ───────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 24px;
  color: var(--text-primary);
}
.section-title.centered { text-align: center; }

.section-body {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 32px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 48px;
  text-align: center;
}

.accent { color: var(--accent); }

/* ── Layout ───────────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

section {
  padding: var(--section-pad) 0;
  position: relative;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: 8px; }
.btn-primary.btn-full { width: 100%; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.btn-ghost.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: 8px; }


/* ═══════════════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════════════ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0;
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.3s ease;
}
#navbar.scrolled {
  background: rgba(7, 21, 36, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  flex: 1;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: var(--transition);
}
.nav-links a:hover { color: var(--text-primary); background: var(--accent-dim); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile menu */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(7,21,36,0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px 32px 32px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; font-size: 1rem; }
  .nav-right .btn-primary { display: none; }
  .nav-hamburger { display: flex; }
}


/* ═══════════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════════ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 32px 80px;
  position: relative;
  overflow: hidden;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 32px;
}
.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: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.08;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-title .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 28px 48px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
  display: block;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  z-index: 1;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.1); }
}


/* ═══════════════════════════════════════════════════════════════
   PROBLEM
═══════════════════════════════════════════════════════════════ */
#problem {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.problem-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(24px);
}
.problem-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.problem-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.problem-icon {
  width: 52px;
  height: 52px;
  color: var(--accent);
  margin-bottom: 20px;
}
.problem-icon svg { width: 100%; height: 100%; }

.problem-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}
.problem-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}


/* ═══════════════════════════════════════════════════════════════
   PLATFORM
═══════════════════════════════════════════════════════════════ */
.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.feature-item.visible { opacity: 1; transform: translateX(0); }

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-icon.cyan {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border);
}
.feature-icon svg { width: 18px; height: 18px; }

.feature-item strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.feature-item span {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

#platformCanvas {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}


/* ═══════════════════════════════════════════════════════════════
   HOW IT WORKS
═══════════════════════════════════════════════════════════════ */
#how-it-works {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps-container {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 56px;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  position: relative;
  opacity: 0;
  transform: translateY(20px);
}
.step.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.step:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.step-number {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.2;
  line-height: 1;
  margin-bottom: 16px;
}
.step:hover .step-number { opacity: 0.6; }

.step-content h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--accent);
}
.step-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.step-connector {
  display: flex;
  align-items: center;
  padding: 0 4px;
  margin-top: 60px;
  flex-shrink: 0;
  width: 60px;
}
.step-connector svg { width: 60px; height: 24px; }


/* ═══════════════════════════════════════════════════════════════
   MODULES
═══════════════════════════════════════════════════════════════ */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(24px);
  display: flex;
  flex-direction: column;
}
.module-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.module-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 20px 48px rgba(0,0,0,0.4);
}

.module-canvas-wrap {
  width: 100%;
  height: 180px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-card);
  overflow: hidden;
  position: relative;
}
.module-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.module-info {
  padding: 24px 28px;
  flex: 1;
}

.module-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  display: inline-block;
  margin-bottom: 12px;
}

.module-info h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.module-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
}

.module-benefit {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--accent-light);
}
.benefit-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}


/* ═══════════════════════════════════════════════════════════════
   ECOSYSTEM
═══════════════════════════════════════════════════════════════ */
#ecosystem {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ecosystem-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.ecosystem-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ecosystem-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 14px 16px;
  background: var(--accent-dim);
  border-radius: 8px;
  border-left: 2px solid var(--accent);
}
.eco-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 7px;
}

#ecosystemCanvas {
  width: 100%;
  max-width: 480px;
  height: auto;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}


/* ═══════════════════════════════════════════════════════════════
   WHY OPALGO
═══════════════════════════════════════════════════════════════ */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.why-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
}
.why-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.why-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.why-num {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.08;
  position: absolute;
  top: 20px;
  right: 24px;
  line-height: 1;
  pointer-events: none;
}
.why-card:hover .why-num { opacity: 0.15; }

.why-card h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.why-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}


/* ═══════════════════════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════════════════════ */
#contact {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}
.contact-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.contact-info-item svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.form-group input,
.form-group textarea {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
  resize: vertical;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-note {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}


/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
#footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.footer-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}
.footer-nav a:hover { color: var(--accent); }

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
}


/* ═══════════════════════════════════════════════════════════════
   FADE-IN ANIMATION UTILITY
═══════════════════════════════════════════════════════════════ */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .platform-grid,
  .ecosystem-inner,
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .platform-visual,
  #platformCanvas {
    height: 300px;
  }

  #ecosystemCanvas {
    max-width: 100%;
    width: 100%;
  }

  .steps-container {
    flex-direction: column;
    align-items: stretch;
  }
  .step-connector { display: none; }
}

@media (max-width: 768px) {
  :root { --section-pad: 64px; }

  .container { padding: 0 20px; }

  .problem-grid,
  .modules-grid,
  .why-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .hero-stats {
    gap: 24px;
    padding: 20px 24px;
  }
  .stat-divider { display: none; }

  .footer-inner { flex-direction: column; align-items: flex-start; }

  .nav-inner { gap: 16px; }
}

@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; align-items: center; }
  .btn-ghost.btn-lg, .btn-primary.btn-lg { width: 100%; }
  .contact-form { padding: 24px; }
}
