:root {
  --font: 'Outfit', -apple-system, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --bg1: #fafaf8;
  --bg2: #fff;
  --bg3: #f0efeb;
  --border: #e2e0da;
  --border2: #d4d2cc;
  --text1: #1a1a18;
  --text2: #5c5b56;
  --text3: #9c9a94;
  --accent: #2d6a5a;
  --accent-light: #e8f3ef;
}

html.dark {
  --bg1: #111110;
  --bg2: #1a1a19;
  --bg3: #222220;
  --border: #2e2e2b;
  --border2: #3a3a36;
  --text1: #e8e8e2;
  --text2: #a0a098;
  --text3: #6a6a62;
  --accent: #4daa8a;
  --accent-light: #1a2e26;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg1);
  color: var(--text1);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 32px 48px;
}

@media (max-width: 720px) {
  .shell { padding: 20px 14px 40px; }
}

/* ========== Header (matches Calculator's Header) ========== */
.appHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
  color: inherit;
}

.brandTitle {
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text1);
  line-height: 1.1;
  margin: 0;
}

.brandSubtitle {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
  margin-bottom: 0;
}

.controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.langSwitch {
  display: flex;
  gap: 2px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.langSwitch a {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.langSwitch a.active {
  background: var(--bg3);
  color: var(--text1);
}

.langSwitch a:hover:not(.active) { color: var(--text2); }

.themeToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  padding: 0;
}

.themeToggle:hover { color: var(--text1); }
.themeToggle svg { width: 18px; height: 18px; }
.themeToggle .icon-sun { display: none; }
.themeToggle .icon-moon { display: block; }
html.dark .themeToggle .icon-sun { display: block; }
html.dark .themeToggle .icon-moon { display: none; }

/* ========== Article body (centered, narrower than shell) ========== */
.articleWrap {
  max-width: 760px;
  margin: 0 auto;
}

.backLink {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.backLink:hover { text-decoration: underline; }

article h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

article .meta {
  color: var(--text3);
  font-size: 14px;
  margin-bottom: 32px;
}

article h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 12px;
  letter-spacing: -0.01em;
}

article h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 8px;
}

article p { margin: 0 0 16px; }

article ul, article ol {
  padding-inline-start: 24px;
  margin: 0 0 16px;
}

article li { margin-bottom: 6px; }

article strong { color: var(--text1); font-weight: 600; }

article code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--bg3);
  padding: 1px 6px;
  border-radius: 4px;
}

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 15px;
}

article th, article td {
  text-align: start;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

article th {
  font-weight: 600;
  background: var(--bg3);
  color: var(--text2);
}

article .callout {
  background: var(--accent-light);
  border-inline-start: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 4px;
  margin: 20px 0;
  font-size: 15px;
}

article .callout strong { color: var(--accent); }

/* ========== Footer (matches Calculator's Footer) ========== */
.appFooter {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .appFooter {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
  }
}

.footerBrand { display: flex; flex-direction: column; gap: 4px; }
.footerBrand .name { font-size: 14px; font-weight: 600; color: var(--text1); margin: 0; letter-spacing: -0.01em; }
.footerBrand .tagline { font-size: 12.5px; color: var(--text3); margin: 0; }
.footerBrand .copyright { font-size: 12px; color: var(--text3); margin: 4px 0 0; }

.footerLinkColumn { display: flex; flex-direction: column; gap: 6px; }
.footerLinkColumn .label { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; margin: 0; }
.footerLinkColumn .links { display: flex; flex-direction: column; gap: 4px; }
.footerLinkColumn a { font-size: 13.5px; color: var(--accent); text-decoration: none; width: fit-content; }
.footerLinkColumn a:hover { text-decoration: underline; }

.footerDisclaimer {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--text3);
  line-height: 1.5;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  margin: 0;
}

@media (max-width: 600px) {
  .shell { font-size: 16px; }
  article h1 { font-size: 26px; }
  article h2 { font-size: 19px; }
}

/* desktop font bumps */
@media (min-width: 1024px) {
  html, body { font-size: 18px; }
  .brandSubtitle { font-size: 14px; }
  .langSwitch a { font-size: 13px; }
  .footerBrand .name { font-size: 15px; }
  .footerBrand .tagline { font-size: 13px; }
  .footerLinkColumn .label { font-size: 13px; }
  .footerLinkColumn a { font-size: 14px; }
  .footerDisclaimer { font-size: 12.5px; }
  article .meta { font-size: 15px; }
}
