:root {
  --ink: #111513;
  --ink-soft: #202622;
  --paper: #f4f1e8;
  --sheet: #fffdf7;
  --line: #c9c7bc;
  --muted: #666d68;
  --signal: #ff5a1f;
  --signal-dark: #d83c07;
  --lime: #d8ff67;
  --warn: #ffd166;
  --danger: #ff806f;
  --focus: #1b67ff;
  --shadow: 0 16px 44px rgba(17, 21, 19, 0.12);
  --radius: 10px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(17, 21, 19, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 21, 19, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; }

button, input, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  color: white;
  background: rgba(17, 21, 19, 0.97);
  border-bottom: 3px solid var(--signal);
  backdrop-filter: blur(12px);
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.055em;
  font-size: 1.25rem;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--signal);
  transform: rotate(-3deg);
  font-size: 0.72rem;
  letter-spacing: -0.08em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: #dfe4e0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.nav-links a:hover { color: white; }

.menu-button {
  display: none;
  color: white;
  background: transparent;
  border: 1px solid #59605c;
  border-radius: 6px;
  padding: 8px 10px;
}

.hero {
  padding: 58px 0 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 42px;
  align-items: end;
}

.kicker {
  margin: 0 0 12px;
  color: var(--signal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 830px;
  margin-bottom: 16px;
  font-size: clamp(2.65rem, 7.4vw, 6.4rem);
  line-height: 0.91;
  letter-spacing: -0.075em;
  font-weight: 950;
}

.hero p {
  max-width: 700px;
  margin-bottom: 0;
  color: #454d48;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-note {
  padding: 20px 0 3px 22px;
  border-left: 4px solid var(--ink);
  color: var(--muted);
}

.hero-note strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

.tool-nav {
  margin: 8px 0 18px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tool-nav a {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--sheet);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 800;
}

.tool-nav a[aria-current="page"], .tool-nav a:hover {
  color: white;
  background: var(--ink);
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.input-panel { padding: clamp(20px, 4vw, 38px); }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.045em;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-group-title {
  margin: 30px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.input-group-title:first-of-type { margin-top: 0; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field { min-width: 0; }

.field label, .switch-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 760;
}

.field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .prefix, .input-wrap .suffix {
  position: absolute;
  color: #505852;
  font-weight: 750;
  pointer-events: none;
}

.input-wrap .prefix { left: 12px; }
.input-wrap .suffix { right: 12px; }

.field input, .field select {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid #8e938f;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 720;
}

.input-wrap.has-prefix input { padding-left: 28px; }
.input-wrap.has-suffix input { padding-right: 34px; }

.field input:hover, .field select:hover { border-color: var(--ink); }
.field input:focus, .field select:focus { border-color: var(--focus); outline: 2px solid rgba(27, 103, 255, 0.17); }

.checkbox-row {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--signal);
}

.result-panel {
  padding: clamp(22px, 4vw, 38px);
  color: white;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 90, 31, 0.24), transparent 37%),
    var(--ink);
  display: flex;
  flex-direction: column;
}

.verdict-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.verdict-label {
  color: #aeb6b1;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.verdict {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--lime);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.verdict.watch { background: var(--warn); }
.verdict.pass { background: var(--danger); }

.hero-metric {
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid #3a423d;
}

.hero-metric .label {
  color: #b9c0bc;
  font-size: 0.85rem;
  font-weight: 700;
}

.hero-metric .value {
  display: block;
  margin: 2px 0 5px;
  color: white;
  font-size: clamp(2.65rem, 6vw, 4.6rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.07em;
}

.hero-metric .context { color: #adb6b0; font-size: 0.85rem; }

.metric-list {
  display: grid;
  gap: 0;
  margin: 0 0 26px;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #303733;
}

.metric dt { color: #b7c0ba; font-size: 0.87rem; }
.metric dd { margin: 0; font-weight: 850; text-align: right; }
.metric dd.positive { color: var(--lime); }
.metric dd.negative { color: var(--danger); }

.result-note {
  margin-top: auto;
  padding: 14px;
  color: #d6dcd8;
  background: #202622;
  border-left: 3px solid var(--signal);
  font-size: 0.83rem;
}

.button-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #657069;
  border-radius: 6px;
  color: white;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 800;
}

.button.primary { color: var(--ink); background: white; border-color: white; }
.button:hover { border-color: white; }

.scenarios {
  margin: 24px 0 54px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.scenario {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.7);
}

.scenario span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scenario strong {
  display: block;
  margin-top: 3px;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.scenario small { color: var(--muted); }

.ad-space {
  display: none;
  min-height: 118px;
  margin: 32px 0;
  place-items: center;
  border: 1px dashed #aeb1a9;
  color: #838983;
  background: rgba(255,255,255,0.48);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.content-section {
  padding: 62px 0;
  border-top: 2px solid var(--ink);
}

.content-section.dark {
  color: white;
  background: var(--ink);
}

.content-grid {
  display: grid;
  grid-template-columns: 0.65fr 1.35fr;
  gap: clamp(30px, 7vw, 88px);
}

.sticky-title { align-self: start; position: sticky; top: 100px; }

.content-section h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.65rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.content-section h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.content-section p, .content-section li { color: #4f5752; }
.content-section.dark p, .content-section.dark li { color: #c7ceca; }

.rule-list { display: grid; gap: 12px; }

.rule {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.rule-number {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--signal-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.tool-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tool-card {
  min-height: 210px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid #46504a;
  color: white;
  text-decoration: none;
  background: #181e1a;
  transition: transform 160ms ease, border-color 160ms ease;
}

.tool-card:hover { transform: translateY(-3px); border-color: var(--signal); }
.tool-card span { color: var(--signal); font-size: 0.75rem; font-weight: 900; letter-spacing: 0.09em; }
.tool-card h3 { margin: 18px 0 8px; font-size: 1.35rem; }
.tool-card p { margin-bottom: 20px; font-size: 0.9rem; }
.tool-card b { margin-top: auto; font-size: 0.88rem; }

.faq { border-top: 1px solid var(--line); }

.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  padding: 19px 34px 19px 0;
  cursor: pointer;
  font-weight: 850;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; font-size: 1.3rem; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 36px 20px 0; margin: 0; }

.article-shell {
  width: min(860px, calc(100% - 32px));
  margin-inline: auto;
  padding: 58px 0 74px;
}

.article-shell h1 {
  font-size: clamp(2.55rem, 7vw, 5.2rem);
}

.article-shell .lede {
  color: #434b46;
  font-size: 1.12rem;
  max-width: 720px;
}

.mini-calculator {
  margin: 34px 0 46px;
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  border: 2px solid var(--ink);
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.mini-inputs, .mini-results { padding: clamp(22px, 4vw, 34px); }
.mini-results { color: white; background: var(--ink); }
.mini-results .hero-metric { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.mini-results .metric-list { margin-top: 24px; margin-bottom: 0; }

.prose { max-width: 740px; }
.prose h2 { margin: 46px 0 13px; font-size: 2rem; letter-spacing: -0.045em; }
.prose h3 { margin-top: 28px; }
.prose p, .prose li { color: #424a45; }
.prose li + li { margin-top: 8px; }
.formula {
  margin: 22px 0;
  padding: 18px 20px;
  border-left: 5px solid var(--signal);
  background: white;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.93rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.callout {
  margin: 28px 0;
  padding: 20px;
  border: 1px solid var(--ink);
  background: var(--lime);
  font-weight: 720;
}

.site-footer {
  padding: 40px 0;
  color: #c7ceca;
  background: #080b09;
  border-top: 3px solid var(--signal);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr 0.75fr;
  gap: 36px;
}

.site-footer .brand { color: white; margin-bottom: 12px; }
.site-footer p { max-width: 460px; color: #9da6a0; font-size: 0.86rem; }
.footer-links { display: grid; align-content: start; gap: 8px; }
.footer-links strong { margin-bottom: 6px; color: white; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-links a { color: #c7ceca; text-decoration: none; font-size: 0.88rem; }
.footer-links a:hover { color: white; }
.fine-print { margin-top: 34px; padding-top: 18px; border-top: 1px solid #303733; color: #7f8882; font-size: 0.78rem; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 12px 16px;
  color: white;
  background: var(--ink);
  border-left: 4px solid var(--lime);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .hero-note { max-width: 600px; }
  .calculator, .mini-calculator { grid-template-columns: 1fr; }
  .scenarios, .tool-cards { grid-template-columns: 1fr; }
  .scenario { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; }
  .scenario small { grid-column: 1 / -1; }
  .content-grid { grid-template-columns: 1fr; }
  .sticky-title { position: static; }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 22px, 1180px); }
  .nav { min-height: 60px; }
  .menu-button { display: inline-flex; }
  .nav-links {
    position: absolute;
    left: 11px;
    right: 11px;
    top: 61px;
    padding: 16px;
    display: none;
    align-items: flex-start;
    flex-direction: column;
    background: var(--ink);
    border: 1px solid #4b554f;
  }
  .nav-links.open { display: flex; }
  .hero { padding-top: 40px; }
  h1 { font-size: clamp(2.75rem, 15vw, 4.5rem); }
  .field-grid { grid-template-columns: 1fr; }
  .input-panel, .result-panel { padding: 22px 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
