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

:root {
  --font-display: 'Space Mono', monospace;
  --font-body: 'IBM Plex Sans', sans-serif;
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-hover: #1a1a1a;
  --text: #e8e8e8;
  --text-muted: #888;
  --border: #222;
  --radius: 6px;
  --accent: #F43F5E;
  --accent-dim: rgba(244,63,94,0.15);
}

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

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}
.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* HERO */
.hero {
  text-align: center;
  padding: 4rem 2rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* TOOL */
.tool-section {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* MODE TABS */
.mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
}
.mode-tab {
  padding: 0.6rem 1.5rem;
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-tab:not(:last-child) { border-right: 1px solid var(--border); }
.mode-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* INPUTS */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.input-card h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 600;
}
.input-group { margin-bottom: 1rem; }
.input-group:last-child { margin-bottom: 0; }
.input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.input-group input[type="number"],
.input-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.9rem;
}
.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.slider-group { margin-bottom: 1rem; }
.slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.slider-group label span {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 0.8rem;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background: var(--border);
  height: 4px;
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* MODEL CHECKBOXES */
.model-list { display: flex; flex-direction: column; gap: 0.5rem; }
.model-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
}
.model-check:hover { background: var(--bg-hover); }
.model-check input[type="checkbox"] { accent-color: var(--accent); }
.model-check .model-name { font-size: 0.9rem; font-weight: 500; }
.model-check .model-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  margin-left: auto;
}

/* RESULTS */
.results-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.results-section h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--accent);
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.results-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.results-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.results-table td.cost {
  font-family: var(--font-display);
  font-weight: 700;
}
.results-table tr.cheapest td { color: var(--accent); }

/* SVG BAR CHART */
.chart-container { margin-top: 1rem; }
.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}
.bar-label {
  width: 160px;
  font-size: 0.8rem;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s;
  min-width: 2px;
}
.bar-value {
  width: 90px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1rem; }

/* PAGES */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.page-content h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 1.5rem;
}
.page-content h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
  color: var(--accent);
}
.page-content h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.page-content p { margin-bottom: 1rem; }
.page-content ul, .page-content ol { margin: 0.5rem 0 1rem 1.5rem; }
.page-content li { margin-bottom: 0.35rem; }
.page-content code {
  background: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 0.85em;
}
.page-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.page-content pre code { padding: 0; background: none; }

.blog-list { list-style: none; padding: 0; }
.blog-list li {
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.blog-list li:hover { border-color: var(--accent); }
.blog-list h3 { margin: 0 0 0.35rem; }
.blog-list p { color: var(--text-muted); margin: 0; font-size: 0.9rem; }
.blog-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }

/* FAQ Section */
.faq-section {
  max-width: 1000px;
  margin: 3rem auto 0;
  padding: 0 2rem;
}
.faq-section h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.faq-item:first-of-type { border-top: 1px solid var(--border); }
.faq-q {
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::after { content: '+'; color: var(--accent); font-size: 1.2rem; }
.faq-item.open .faq-q::after { content: '\2212'; }
.faq-a {
  display: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-top: 0.5rem;
  line-height: 1.6;
}
.faq-item.open .faq-a { display: block; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .calc-grid { grid-template-columns: 1fr; }
  .nav { padding: 1rem; }
  .nav-links { gap: 1rem; }
  .tool-section { padding: 0 1rem; }
  .bar-label { width: 100px; font-size: 0.7rem; }
  .bar-value { width: 70px; font-size: 0.7rem; }
}
