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

:root {
  --bg: #0f1117;
  --bg2: #1a1d2e;
  --bg3: #232640;
  --accent: #6366f1;
  --accent2: #818cf8;
  --accent3: #a5b4fc;
  --text: #e2e8f0;
  --subtext: #94a3b8;
  --border: rgba(99,102,241,0.2);
  --glass: rgba(26,29,46,0.7);
  --red: #f87171;
  --green: #4ade80;
  --yellow: #fbbf24;
  --radius: 12px;
  --shadow: 0 4px 32px rgba(0,0,0,0.4);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--accent3); }
p { color: var(--subtext); margin-bottom: 1rem; }
strong { color: var(--text); }
a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--accent3); }

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

section { padding: 5rem 0; }
section:nth-child(even) { background: rgba(26,29,46,0.3); }

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-title {
  background: linear-gradient(135deg, var(--text) 0%, var(--accent3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--subtext);
  max-width: 700px;
  margin-bottom: 2.5rem;
}

/* ===== NAVBAR ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(15,17,23,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  transition: box-shadow 0.3s;
}

nav.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,0.5); }

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

.nav-logo {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--subtext);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--border);
}

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 0 4rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(129,140,248,0.08) 0%, transparent 60%);
  animation: heroPulse 8s ease-in-out infinite alternate;
}

@keyframes heroPulse {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.05); }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(99,102,241,0.15);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent3);
  margin-bottom: 1.25rem;
}

.hero-title { margin-bottom: 1.25rem; }

.hero-desc {
  font-size: 1.1rem;
  color: var(--subtext);
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--accent2); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--subtext); margin-top: 0.2rem; }

/* Induction coil SVG animation */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.coil-container {
  position: relative;
  width: 280px;
  height: 280px;
}

.coil-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: coilPulse 2s ease-in-out infinite;
}

.coil-ring:nth-child(1) { inset: 0; animation-delay: 0s; opacity: 0.8; }
.coil-ring:nth-child(2) { inset: 20px; animation-delay: 0.3s; opacity: 0.6; }
.coil-ring:nth-child(3) { inset: 40px; animation-delay: 0.6s; opacity: 0.5; }
.coil-ring:nth-child(4) { inset: 60px; animation-delay: 0.9s; opacity: 0.4; }
.coil-ring:nth-child(5) { inset: 80px; animation-delay: 1.2s; opacity: 0.3; }

@keyframes coilPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99,102,241,0); }
  50% { transform: scale(1.03); box-shadow: 0 0 20px 4px rgba(99,102,241,0.3); }
}

.coil-center {
  position: absolute;
  inset: 100px;
  background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, transparent 70%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.field-lines {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px dashed rgba(99,102,241,0.2);
  animation: fieldRotate 12s linear infinite;
}

@keyframes fieldRotate { to { transform: rotate(360deg); } }

/* ===== FORMULA CARDS ===== */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.formula-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.formula-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.3s;
}

.formula-card:hover {
  border-color: rgba(99,102,241,0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99,102,241,0.15);
}

.formula-card:hover::before { opacity: 1; }

.formula-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.formula-display {
  background: rgba(15,17,23,0.6);
  border-radius: 8px;
  padding: 1rem;
  margin: 0.75rem 0;
  text-align: center;
  font-size: 1.1rem;
  overflow-x: auto;
}

.formula-desc {
  font-size: 0.88rem;
  color: var(--subtext);
  margin: 0;
}

/* ===== VARIABLE TABLE ===== */
.var-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
  table-layout: fixed;
}

.var-table th:first-child,
.var-table td:first-child { width: 14%; }
.var-table th:last-child,
.var-table td:last-child  { width: 26%; }

.var-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: rgba(99,102,241,0.1);
  color: var(--accent3);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.var-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--subtext);
}

.var-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent3);
  font-weight: 600;
}

.var-table tr:hover td { background: rgba(99,102,241,0.05); }

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table thead tr { background: rgba(99,102,241,0.15); }
.data-table th {
  padding: 0.8rem 1.2rem;
  text-align: left;
  color: var(--accent3);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.75rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--subtext);
}

.data-table tbody tr:hover td { background: rgba(99,102,241,0.06); }
.data-table .highlight td { color: var(--text); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-green { background: rgba(74,222,128,0.15); color: var(--green); }
.badge-red   { background: rgba(248,113,113,0.15); color: var(--red); }
.badge-yellow{ background: rgba(251,191,36,0.15);  color: var(--yellow); }

/* ===== INFO BOXES ===== */
.info-box {
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 3px solid;
  background: var(--glass);
}

.info-box.note  { border-color: var(--accent);  background: rgba(99,102,241,0.08); }
.info-box.warn  { border-color: var(--yellow);  background: rgba(251,191,36,0.08); }
.info-box.tip   { border-color: var(--green);   background: rgba(74,222,128,0.08); }

.info-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.info-box.note .info-box-title  { color: var(--accent2); }
.info-box.warn .info-box-title  { color: var(--yellow); }
.info-box.tip  .info-box-title  { color: var(--green); }
.info-box p { margin: 0; font-size: 0.92rem; }

/* ===== STEP LIST ===== */
.step-list { list-style: none; counter-reset: steps; margin: 1.5rem 0; }
.step-list li {
  counter-increment: steps;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.step-list li::before {
  content: counter(steps);
  min-width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ===== CALCULATOR ===== */
.calculator {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}

.calc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.calc-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.calc-field input,
.calc-field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  color: var(--text);
  font-size: 0.95rem;
  font-family: 'JetBrains Mono', monospace;
  transition: border-color 0.2s;
  outline: none;
}

.calc-field input:focus,
.calc-field select:focus { border-color: var(--accent); }

.calc-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.calc-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }

.calc-result {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(99,102,241,0.1);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--accent3);
  display: none;
}

.calc-result.visible { display: block; }

/* ===== EFFICIENCY BAR ===== */
.eff-bars { margin: 1.5rem 0; }
.eff-item { margin-bottom: 1rem; }
.eff-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.eff-label span { color: var(--subtext); }

.eff-bar-bg {
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.eff-bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

.eff-bar-fill.induction { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.eff-bar-fill.gas       { background: linear-gradient(90deg, #f97316, #fb923c); }
.eff-bar-fill.ceran     { background: linear-gradient(90deg, #ec4899, #f472b6); }
.eff-bar-fill.electric  { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }

/* ===== TWO-COL LAYOUT ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin: 2rem 0;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== FOOTER ===== */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--subtext);
  font-size: 0.85rem;
}

footer strong { color: var(--accent2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  section { padding: 3.5rem 0; }
}

@media (max-width: 480px) {
  .formula-grid { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
}
