@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap');

/* ── Tokens ── */
:root {
  --bg: #0B0F1A;
  --bg-card: #111827;
  --bg-input: #1A2035;
  --border: #1E2D45;
  --border-light: #263352;
  --text: #F0F4FF;
  --text-muted: #6B7FA3;
  --text-dim: #3D506B;
  --accent: #00D084;
  --accent-dim: #00A366;
  --accent-bg: rgba(0,208,132,.08);
  --red: #FF4D6A;
  --red-bg: rgba(255,77,106,.08);
  --amber: #F59E0B;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 32px rgba(0,0,0,.3);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 740px; margin: 0 auto; padding: 0 24px; }

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11,15,26,.92);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 100;
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.logo {
  font-family: var(--font-mono);
  font-size: 15px; font-weight: 700;
  letter-spacing: -.02em;
  display: flex; align-items: center; gap: 2px;
}
.logo .dot { color: var(--accent); font-size: 18px; line-height: 1; }
.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav a {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  padding: 5px 10px; border-radius: 6px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--bg-card); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 20px; height: 1.5px; background: var(--text-muted); margin: 5px 0; }

/* ── Hero ── */
.hero { padding: 64px 0 48px; }
.hero-label {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-bg); border: 1px solid rgba(0,208,132,.2);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700; line-height: 1.2;
  letter-spacing: -.02em; margin-bottom: 16px;
}
.hero h1 .green { color: var(--accent); }
.hero p { color: var(--text-muted); font-size: 17px; max-width: 500px; }

/* ── Calculator Card ── */
.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
  max-width: 680px;
  margin: 0 auto 40px;
}
.calc-card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700; margin-bottom: 6px;
}
.calc-card .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }

/* ── Fields ── */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.field { }
.field label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 7px;
}
.field input, .field select {
  width: 100%; padding: 11px 14px;
  font-family: var(--font-mono); font-size: 14px;
  background: var(--bg-input); border: 1px solid var(--border-light);
  border-radius: var(--radius); outline: none; color: var(--text);
  transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--text-dim); }
.field select option { background: var(--bg-card); }

.input-prefix { position: relative; }
.input-prefix span {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-family: var(--font-mono); font-size: 14px;
  pointer-events: none;
}
.input-prefix input { padding-left: 28px; }

/* ── Results ── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 24px;
  display: none;
}
.results-grid.show { display: grid; }
.result-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.result-box .r-label {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 6px;
}
.result-box .r-val {
  font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700;
  color: var(--text); line-height: 1.1;
}
.result-box .r-val.green { color: var(--accent); }
.result-box .r-val.red { color: var(--red); }
.result-box .r-val.amber { color: var(--amber); }
.result-box .r-note { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Single big result */
.result-hero {
  margin-top: 24px; padding: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: none; text-align: center;
}
.result-hero.show { display: block; }
.result-hero .r-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.result-hero .r-val { font-family: var(--font-mono); font-size: 2.8rem; font-weight: 700; }
.result-hero .r-exp { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* ── Page hero (inner pages) ── */
.page-hero { padding: 48px 0 32px; }
.page-hero .hero-label { margin-bottom: 16px; }
.page-hero h1 {
  font-family: var(--font-display); font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 12px;
}
.page-hero p { color: var(--text-muted); font-size: 16px; max-width: 560px; }

/* ── Prose ── */
.prose { padding: 32px 0; }
.prose h2 {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 700;
  margin: 36px 0 12px; letter-spacing: -.01em;
}
.prose h2:first-child { margin-top: 0; }
.prose p { color: #A8B8D0; margin-bottom: 14px; font-size: 15px; line-height: 1.75; }
.prose ul { padding-left: 20px; margin-bottom: 14px; }
.prose li { font-size: 15px; color: #A8B8D0; margin-bottom: 6px; line-height: 1.7; }
.prose strong { color: var(--text); }
.formula {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px; margin: 20px 0;
  font-family: var(--font-mono); font-size: 13px; color: var(--text);
  line-height: 1.8;
}

/* ── FAQ ── */
.faq { padding: 32px 0; }
.faq h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  padding: 16px 0; font-size: 15px; font-weight: 500;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text);
}
.faq-item summary::after { content: '+'; font-size: 20px; color: var(--text-muted); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 0 16px; font-size: 14px; color: var(--text-muted); line-height: 1.75; }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: #A8B8D0; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .mono { font-family: var(--font-mono); color: var(--text); }
.data-table .green { color: var(--accent); font-family: var(--font-mono); }
.data-table .red { color: var(--red); font-family: var(--font-mono); }

/* ── Hub Grid ── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.calc-link {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .2s, transform .2s;
}
.calc-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.calc-link .cl-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.calc-link h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.calc-link p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ── Related ── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px; margin-top: 20px;
}
.related-card {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: border-color .15s, color .15s;
}
.related-card:hover { border-color: var(--accent); color: var(--accent); }
.related-card .arr { color: var(--text-dim); font-size: 16px; }

/* ── Divider ── */
.section-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px; margin-top: 64px;
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: 13px; color: var(--text-muted); max-width: 240px; line-height: 1.6; }
.footer-col h4 {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: 13px; color: var(--text-muted); transition: color .15s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim);
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .calc-card { padding: 24px 18px; }
  .field-grid { grid-template-columns: 1fr; }
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; align-items: flex-start; position: absolute; top: 58px; left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 12px; gap: 2px; z-index: 99; }
  .nav-toggle { display: block; }
  .hero { padding: 40px 0 32px; }
  .results-grid { grid-template-columns: 1fr 1fr; }
}
