/* ===== DESIGN TOKENS ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.08);
  --gold-primary: #d4a853;
  --gold-light: #f0d48a;
  --gold-dark: #b8922e;
  --gold-glow: rgba(212, 168, 83, 0.25);
  --text-primary: #f0ece4;
  --text-secondary: rgba(240, 236, 228, 0.6);
  --text-muted: rgba(240, 236, 228, 0.35);
  --accent-emerald: #34d399;
  --accent-blue: #60a5fa;
  --accent-rose: #fb7185;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-gold: 0 0 40px rgba(212, 168, 83, 0.08);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

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

/* Ambient background */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(212, 168, 83, 0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(96, 165, 250, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===== UTILITY ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ===== HEADER / NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.4s var(--transition-smooth), backdrop-filter 0.4s;
}
.navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--bg-primary);
}
.logo-text { font-family: var(--font-display); font-size: 1.25rem; color: var(--text-primary); font-weight: 600; }
.logo-text span { color: var(--gold-primary); }

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--text-secondary); font-size: 0.875rem;
  font-weight: 500; transition: color 0.3s; letter-spacing: 0.3px;
}
.nav-links a:hover { color: var(--gold-primary); }
.nav-cta {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: var(--bg-primary); border: none; padding: 10px 24px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.875rem;
  cursor: pointer; transition: transform 0.3s, box-shadow 0.3s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--gold-glow); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 120px 24px 80px;
  position: relative;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  padding: 8px 20px; border-radius: 100px; font-size: 0.8rem;
  color: var(--gold-primary); margin-bottom: 32px;
  animation: fadeInUp 0.8s var(--transition-smooth) both;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-emerald); animation: pulse-dot 2s infinite; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1; font-weight: 700;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s 0.1s var(--transition-smooth) both;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light), var(--gold-primary));
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary); max-width: 600px; margin: 0 auto 40px;
  animation: fadeInUp 0.8s 0.2s var(--transition-smooth) both;
}
.hero-actions {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  animation: fadeInUp 0.8s 0.3s var(--transition-smooth) both;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: var(--bg-primary); border: none; padding: 14px 36px;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: all 0.3s var(--transition-smooth);
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px var(--gold-glow); }
.btn-secondary {
  background: var(--bg-glass); color: var(--text-primary);
  border: 1px solid var(--border-glass); padding: 14px 36px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: all 0.3s; text-decoration: none;
}
.btn-secondary:hover { border-color: var(--gold-primary); color: var(--gold-primary); }

/* Floating orbs in hero */
.hero-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; opacity: 0.4;
}
.hero-orb-1 { width: 300px; height: 300px; background: var(--gold-primary); top: 10%; left: 10%; animation: float-orb 8s ease-in-out infinite; }
.hero-orb-2 { width: 200px; height: 200px; background: var(--accent-blue); bottom: 20%; right: 15%; animation: float-orb 10s ease-in-out infinite reverse; }

/* ===== SECTION COMMON ===== */
section { padding: 100px 0; position: relative; z-index: 1; }
.section-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 3px;
  color: var(--gold-primary); font-weight: 600; margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; margin-bottom: 16px; line-height: 1.2;
}
.section-desc { color: var(--text-secondary); max-width: 560px; margin-bottom: 48px; font-size: 1.05rem; }
.text-center { text-align: center; }
.text-center .section-desc { margin-left: auto; margin-right: auto; }

/* ===== CALCULATOR SECTION ===== */
.calculator-section { padding: 80px 0 100px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 40px;
  backdrop-filter: blur(10px);
  position: relative; overflow: hidden;
}
.calc-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.form-group { margin-bottom: 24px; }
.form-label {
  display: block; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-secondary);
  margin-bottom: 8px; font-weight: 600;
}
.form-input {
  width: 100%; padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 1.05rem; font-family: var(--font-body);
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}
.form-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.1);
}
.form-input::placeholder { color: var(--text-muted); }

.input-with-prefix {
  position: relative;
}
.input-prefix {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--gold-primary); font-weight: 600; font-size: 1.1rem;
}
.input-with-prefix .form-input { padding-left: 38px; }

.form-select {
  width: 100%; padding: 14px 18px; appearance: none;
  background: rgba(255,255,255,0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23d4a853' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 18px center;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 1rem; font-family: var(--font-body);
  transition: border-color 0.3s; outline: none; cursor: pointer;
}
.form-select:focus { border-color: var(--gold-primary); }
.form-select option { background: var(--bg-secondary); color: var(--text-primary); }

.calc-btn {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: var(--bg-primary); border: none; border-radius: var(--radius-sm);
  font-size: 1.05rem; font-weight: 700; cursor: pointer;
  transition: all 0.3s var(--transition-smooth);
  font-family: var(--font-body); letter-spacing: 0.5px;
}
.calc-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px var(--gold-glow); }
.calc-btn:active { transform: translateY(0); }

/* Results */
.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 40px;
  backdrop-filter: blur(10px);
}
.result-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  opacity: 0; transform: translateX(20px);
  transition: all 0.5s var(--transition-smooth);
}
.result-item.visible { opacity: 1; transform: translateX(0); }
.result-item:last-child { border-bottom: none; }
.result-label { font-size: 0.9rem; color: var(--text-secondary); }
.result-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--gold-primary); }
.result-item.highlight { background: rgba(212,168,83,0.05); margin: 0 -20px; padding: 20px; border-radius: var(--radius-sm); }
.result-item.highlight .result-value { font-size: 2rem; }

/* ===== FLOW DIAGRAM ===== */
.diagram-section { padding: 100px 0; overflow: hidden; }
.flow-diagram {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: wrap; padding: 40px 0;
  position: relative;
}
.flow-node {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  min-width: 180px;
  text-align: center;
  position: relative;
  transition: all 0.5s var(--transition-smooth);
  opacity: 0;
  transform: translateY(30px);
  cursor: pointer;
}
.flow-node.visible { opacity: 1; transform: translateY(0); }
.flow-node:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 30px var(--gold-glow);
  transform: translateY(-4px);
}
.flow-node.active {
  border-color: var(--gold-primary);
  box-shadow: 0 0 40px var(--gold-glow);
  background: rgba(212, 168, 83, 0.06);
}
.flow-node-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, rgba(212,168,83,0.15), rgba(212,168,83,0.05));
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 1.5rem;
  transition: transform 0.3s;
}
.flow-node:hover .flow-node-icon { transform: scale(1.1); }
.flow-node-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.flow-node-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; }

.flow-arrow {
  display: flex; align-items: center; padding: 0 8px;
  color: var(--gold-primary); font-size: 1.5rem;
  opacity: 0; transition: opacity 0.5s 0.2s;
}
.flow-arrow.visible { opacity: 0.5; }
.flow-arrow svg { width: 40px; height: 20px; }

/* Detail panel */
.flow-detail-panel {
  margin-top: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  min-height: 120px;
  transition: all 0.4s var(--transition-smooth);
  opacity: 0;
  transform: translateY(10px);
}
.flow-detail-panel.visible { opacity: 1; transform: translateY(0); }
.flow-detail-title { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 12px; color: var(--gold-primary); }
.flow-detail-text { color: var(--text-secondary); line-height: 1.7; }
.flow-detail-formula {
  background: rgba(212,168,83,0.06);
  border: 1px solid rgba(212,168,83,0.15);
  border-radius: var(--radius-sm);
  padding: 16px 20px; margin-top: 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.9rem;
  color: var(--gold-light);
}

/* ===== FEATURES GRID ===== */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: all 0.4s var(--transition-smooth);
  position: relative; overflow: hidden;
}
.feature-card:hover {
  border-color: rgba(212,168,83,0.2);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}
.feature-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  opacity: 0; transition: opacity 0.4s;
}
.feature-card:hover::after { opacity: 1; }
.feature-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, rgba(212,168,83,0.12), rgba(212,168,83,0.04));
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; font-size: 1.3rem;
}
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* ===== STATS BAR ===== */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding: 60px 0;
}
.stat-item { text-align: center; }
.stat-value {
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 700;
  color: var(--gold-primary); margin-bottom: 4px;
}
.stat-label { font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border-glass);
  padding: 60px 0 30px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 12px; line-height: 1.6; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-secondary); margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { text-decoration: none; color: var(--text-muted); font-size: 0.9rem; transition: color 0.3s; }
.footer-col a:hover { color: var(--gold-primary); }
.footer-bottom {
  border-top: 1px solid var(--border-glass);
  padding-top: 24px; display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--text-muted);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}
@keyframes float-orb {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ripple {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s var(--transition-smooth); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .calc-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .flow-diagram { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
  .features-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .calc-card, .results-card { padding: 28px 20px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(212,168,83,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,168,83,0.5); }

/* ===== MOBILE NAV TOGGLE ===== */
.mobile-toggle {
  display: none; background: none; border: none; color: var(--text-primary);
  font-size: 1.5rem; cursor: pointer;
}
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
}

/* Particle canvas */
#particles-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 40px;
}
.comparison-table th {
  text-align: left; padding: 14px 20px;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px;
  color: var(--gold-primary); border-bottom: 1px solid var(--border-glass);
}
.comparison-table td {
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.95rem; color: var(--text-secondary);
}
.comparison-table tr:hover td { background: rgba(212,168,83,0.02); }
