:root {
  --bg: #0f1220;
  --bg-alt: #161a2e;
  --card: #1b2038;
  --border: #2a3153;
  --text: #eef0fb;
  --text-dim: #a7adc9;
  --accent: #7c5cff;
  --accent-2: #26d6c4;
  --accent-warn: #ffb454;
  --radius: 14px;
  --max-width: 960px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; transition: color 0.15s ease; }
a:hover { text-decoration: underline; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  0% { opacity: 0; transform: translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.brand span.dot { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  padding: 8px 11px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle:active { transform: scale(0.92); }

.nav-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 6px 20px 14px;
    z-index: 20;
  }
  .nav-links.open {
    display: flex;
    animation: fadeInUp 0.2s ease;
  }
  .nav-links a { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
}

main { padding: 40px 0 60px; animation: fadeInUp 0.45s ease; flex: 1 0 auto; width: 100%; }

h1 { font-size: 1.9rem; margin-bottom: 6px; }
h2 { font-size: 1.35rem; margin-top: 2.2em; }
h3 { font-size: 1.1rem; margin-top: 1.6em; }
p.lede { color: var(--text-dim); font-size: 1.05rem; margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}
.field input, .field select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.16);
}
.field input:hover, .field select:hover { border-color: #3a4278; }

button.calc-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 13px 22px;
  border-radius: 9px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.28);
}
button.calc-btn:hover {
  background: #8c6dff;
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
  transform: translateY(-1px);
}
button.calc-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.3);
}
button.calc-btn.pulse {
  animation: btnPulse 0.35s ease;
}
@keyframes btnPulse {
  0% { transform: scale(1); }
  40% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.result {
  margin-top: 22px;
  padding: 20px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--accent);
  display: none;
  opacity: 0;
  transform: translateY(10px);
}
.result.show {
  display: block;
  animation: popIn 0.35s ease forwards;
}
.result .figure {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent-2);
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}
.result .sub { color: var(--text-dim); font-size: 0.9rem; }

.disclaimer {
  font-size: 0.85rem;
  color: var(--text-dim);
  background: var(--bg-alt);
  border-left: 3px solid var(--accent-warn);
  padding: 12px 16px;
  border-radius: 6px;
  margin: 20px 0;
}
.disclaimer.info { border-left-color: var(--accent-2); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th { color: var(--text-dim); font-weight: 600; }
table tr { transition: background 0.15s ease; }
table tr:hover td { background: rgba(124, 92, 255, 0.06); }

.tool-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.tool-card h3 { margin-top: 0; }
.tool-card a.cta {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  transition: transform 0.15s ease;
}
.tool-card:hover a.cta { transform: translateX(3px); }

.ad-slot {
  margin: 32px 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.015);
}
.ad-slot .ad-slot-inner {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}

footer.site {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}
footer.site .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer.site a { color: var(--text-dim); }
footer.site a:hover { color: var(--text); }

.faq dt {
  font-weight: 600;
  margin-top: 16px;
}
.faq dd {
  margin: 6px 0 0 0;
  color: var(--text-dim);
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.byline {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 20px;
}

.sources {
  margin-top: 2.2em;
}
.sources h2 { margin-bottom: 0.4em; }
.sources ul {
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.sources li { margin-bottom: 6px; }
