/* =========================================================
   BLACK BELT CODE LABS — CalcPhi Design System
   Shared across all 100 calculator pages
   ========================================================= */

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

:root {
  --bg:        #0a0f1e;
  --surface:   #111827;
  --card:      #161f35;
  --border:    #1e2d4a;
  --accent:    #22d3a5;
  --accent2:   #3b82f6;
  --gold:      #f59e0b;
  --text:      #f1f5f9;
  --muted:     #64748b;
  --soft:      #94a3b8;
  --danger:    #f43f5e;
  --radius:    16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(34,211,165,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(59,130,246,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(245,158,11,0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,15,30,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 18px; color: var(--text);
  text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  font-size: 12px; font-weight: 500; color: var(--muted);
  text-decoration: none; padding: 5px 10px; border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--accent); background: rgba(34,211,165,0.08);
}
.nav-home {
  font-size: 12px; font-weight: 600; color: var(--accent) !important;
  border: 1px solid rgba(34,211,165,0.3);
  border-radius: 6px; padding: 4px 10px !important;
}
@media (max-width: 600px) { .nav-links { display: none; } }

/* ── WRAPPER ── */
.wrapper { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── HEADER ── */
header { padding: 36px 0 0; text-align: center; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,211,165,0.1);
  border: 1px solid rgba(34,211,165,0.25);
  border-radius: 100px; padding: 5px 14px;
  font-size: 12px; font-weight: 500; color: var(--accent);
  letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 20px;
}
.badge::before { content: '●'; font-size: 8px; animation: pulse 2s infinite; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15; color: var(--text); margin-bottom: 14px;
}
h1 em { font-style: italic; color: var(--accent); }

.subtitle {
  font-size: 16px; color: var(--soft);
  max-width: 540px; margin: 0 auto 36px;
  line-height: 1.6; font-weight: 300;
}

/* ── CARDS ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px; position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,211,165,0.4), transparent);
}
.card-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 24px;
}

/* ── MAIN GRID ── */
.main-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 20px;
}
@media (max-width: 720px) { .main-grid { grid-template-columns: 1fr; } }

/* ── SLIDERS ── */
.field { margin-bottom: 28px; }
.field:last-child { margin-bottom: 0; }
.field-header {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 10px;
}
.field-label { font-size: 14px; font-weight: 500; color: var(--soft); }
.field-value {
  font-family: 'DM Serif Display', serif;
  font-size: 20px; color: var(--text);
  min-width: 100px; text-align: right;
}
.field-value span {
  font-size: 13px; color: var(--muted);
  font-family: 'DM Sans', sans-serif; font-weight: 400;
}

input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 4px;
  border-radius: 4px; background: var(--border);
  outline: none; cursor: pointer; margin-bottom: 6px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(34,211,165,0.15);
  cursor: pointer; transition: box-shadow 0.2s, transform 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 8px rgba(34,211,165,0.2); transform: scale(1.1);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
}
.range-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted);
}

/* ── RESULTS CARD ── */
.results-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; position: relative; overflow: hidden;
}
.results-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent);
}

/* ── CORPUS / RESULT DISPLAY ── */
.corpus-display {
  text-align: center; padding: 24px 0 20px;
  border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.corpus-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.corpus-amount {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1.1; margin-bottom: 4px;
  transition: all 0.4s ease;
}
.corpus-sub { font-size: 13px; color: var(--muted); }

/* ── STATS ROW ── */
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.stat-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px;
}
.stat-box-label {
  font-size: 11px; color: var(--muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
}
.stat-box-value {
  font-family: 'DM Serif Display', serif; font-size: 18px; transition: all 0.3s ease;
}
.stat-box-value.green { color: var(--accent); }
.stat-box-value.blue  { color: var(--accent2); }
.stat-box-value.gold  { color: var(--gold); }
.stat-box-value.red   { color: var(--danger); }

/* ── PROGRESS BAR ── */
.progress-section { margin-bottom: 24px; }
.progress-header {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.progress-bar-bg { height: 8px; background: var(--border); border-radius: 100px; overflow: hidden; }
.progress-bar-fill {
  height: 100%; border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
  background: linear-gradient(90deg, var(--accent2), var(--accent));
}
.progress-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--soft); }
.legend-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 5px; vertical-align: middle;
}

/* ── CHART SECTION ── */
.chart-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.chart-section::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,0.4), transparent);
}
.chart-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.chart-title { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--text); }
.chart-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.04); padding: 4px; border-radius: 8px;
}
.chart-tab {
  padding: 5px 14px; border-radius: 5px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: none; background: transparent;
  color: var(--muted); transition: all 0.2s;
}
.chart-tab.active { background: var(--accent); color: #000; }
.chart-wrap { height: 260px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 10px 14px; text-align: left; font-size: 11px;
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 10px 14px; color: var(--soft); }
tbody td:first-child { color: var(--text); font-weight: 500; }
tbody td.positive { color: var(--accent); }
tbody td.negative { color: var(--danger); }

/* ── FAQ ── */
.faq-section { margin: 32px 0; }
.faq-heading {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 20px; color: var(--text);
}
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; overflow: hidden;
}
.faq-q {
  padding: 16px 20px; font-size: 15px; font-weight: 500;
  cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; background: var(--card); transition: background 0.2s;
  user-select: none;
}
.faq-q:hover { background: rgba(34,211,165,0.05); }
.faq-q .arrow { color: var(--accent); font-size: 18px; transition: transform 0.3s; flex-shrink: 0; }
.faq-item.open .faq-q .arrow { transform: rotate(45deg); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 20px; background: var(--surface);
  color: var(--soft); font-size: 14px; line-height: 1.7;
}
.faq-item.open .faq-a { max-height: 400px; padding: 16px 20px 20px; }

/* ── INFO BANNER ── */
.info-banner {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm); padding: 14px 18px;
  font-size: 13px; color: var(--soft); margin-bottom: 20px;
  display: flex; gap: 10px; align-items: flex-start;
}
.info-banner::before { content: 'ℹ'; color: var(--accent2); font-weight: bold; flex-shrink: 0; }

/* ── FOOTER ── */
footer {
  text-align: center; padding: 32px 20px;
  font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--border); margin-top: 20px;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-brand { font-family: 'DM Serif Display', serif; color: var(--soft); font-size: 15px; margin-bottom: 6px; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
header           { animation: fadeUp 0.6s ease both; }
.main-grid       { animation: fadeUp 0.6s 0.1s ease both; }
.chart-section   { animation: fadeUp 0.6s 0.2s ease both; }
.faq-section     { animation: fadeUp 0.6s 0.3s ease both; }

/* ── UTILITIES ── */
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
