/* Shared design tokens, reset, and site chrome (header/nav/footer). Loaded by
   every page - page-specific styles live in calculator.css / also-by-us.css. */

:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --card: #ffffff;
  --border: #e2e0da;
  --text: #2a2a28;
  --muted: #6b6a64;
  --accent: #2f6f5e;
  --accent-soft: #e7f1ee;
  --accent-contrast: #ffffff;
  --caution: #a15a1f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b19;
    --card: #242422;
    --border: #37362f;
    --text: #ecebe6;
    --muted: #a3a199;
    --accent: #6fbfa7;
    --accent-soft: #24332e;
    --accent-contrast: #1b1b19;
    --caution: #c97a3d;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f5;
  --card: #ffffff;
  --border: #e2e0da;
  --text: #2a2a28;
  --muted: #6b6a64;
  --accent: #2f6f5e;
  --accent-soft: #e7f1ee;
  --accent-contrast: #ffffff;
  --caution: #a15a1f;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1b19;
  --card: #242422;
  --border: #37362f;
  --text: #ecebe6;
  --muted: #a3a199;
  --accent: #6fbfa7;
  --accent-soft: #24332e;
  --accent-contrast: #1b1b19;
  --caution: #c97a3d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }

/* Skip link + visually-hidden text, used on every page */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 16px; border-radius: 0 0 8px 0; font-size: 0.85rem; font-weight: 600;
}
.skip-link:focus { left: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Top nav bar: brand + language/theme toggles + page nav */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; margin: 0 0 20px; border-bottom: 1px solid var(--border);
}
.top-nav .brand {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em;
}
.top-nav .brand-real { color: var(--text); }
.top-nav .brand-cal { color: var(--accent); }
.brand-icon { flex-shrink: 0; }
.top-nav-right { display: flex; align-items: center; gap: 16px; }
.top-nav nav { display: flex; align-items: center; gap: 14px; }
.top-nav nav a { color: var(--accent); text-decoration: underline; font-size: 0.85rem; font-weight: 600; }
.top-nav nav a:hover { opacity: 0.8; }
.top-nav nav .nav-current { color: var(--text); font-size: 0.85rem; font-weight: 700; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0;
}
.theme-toggle:hover { border-color: var(--accent); }

.lang-toggle { display: flex; gap: 4px; }
.lang-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  font-size: 0.78rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.lang-btn.lang-active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.lang-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Footer */
footer { color: var(--muted); font-size: 0.75rem; margin-top: 20px; line-height: 1.5; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.footer-bottom nav { display: flex; gap: 14px; }
.footer-bottom nav a { color: var(--muted); text-decoration: none; font-size: 0.75rem; }
.footer-bottom nav a:hover { color: var(--accent); }
