/* Investing & ETFs - main stylesheet
   Light editorial theme. Footer background and anchor-ad background share
   one token (--footer-bg) so the reserved anchor padding always matches. */

:root {
  --bg: #ffffff;
  --surface: #f5f7fb;
  --surface-2: #ebeef5;
  --text: #101828;
  --muted: #5b6779;
  --border: #e3e8f0;
  --primary: #1d4ed8;
  --primary-600: #1e40af;
  --primary-50: #eef4ff;
  --accent: #0e9f6e;
  --accent-50: #e7f7f0;
  --warn: #b45309;
  --warn-50: #fff7ed;
  --footer-bg: #0b1220;
  --footer-text: #c7d2e2;
  --footer-muted: #8b98ad;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.10);
  --container: 1140px;
  --font-head: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.has-anchor { padding-bottom: 32px; }

img { max-width: 100%; height: auto; display: block; }

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

a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 2000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.93);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header.is-scrolled { box-shadow: var(--shadow-sm); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

.brand-mark { flex-shrink: 0; }

.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-name span { color: var(--primary); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.main-nav a {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--muted);
  padding: 8px 11px;
  border-radius: 8px;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.main-nav a.is-active { color: var(--primary); background: var(--primary-50); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search { display: flex; align-items: center; }

.header-search input {
  font-family: var(--font-body);
  font-size: 0.9rem;
  width: 170px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}
.header-search input::placeholder { color: var(--muted); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface); text-decoration: none; }
.icon-btn svg { width: 19px; height: 19px; }

.nav-toggle { display: none; }

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 10px 20px 16px;
}
.mobile-menu.is-open { display: block; }
.mobile-menu a {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--text);
  padding: 11px 4px;
  border-bottom: 1px solid var(--surface-2);
}
.mobile-menu a:last-child { border-bottom: 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-600); }
.btn--ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface); }
.btn--sm { padding: 9px 16px; font-size: 0.9rem; }

/* ---------- hero ---------- */

.hero { padding: 52px 0 44px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-50);
  color: var(--primary-600);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
  margin: 0 0 16px;
}

.hero h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.hero-sub {
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 26px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero-trust li { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

/* ---------- sections ---------- */

.section { padding: 38px 0; }
.section--tight { padding: 26px 0; }

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

.section-head h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-head .more {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}

.section-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 10px;
}

/* ---------- featured + cards ---------- */

.featured {
  display: grid;
  grid-template-columns: 44% 1fr;
  gap: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  align-items: center;
}

.featured img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.card-img { display: block; }
.card-img img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
  flex: 1;
}

.chip {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--primary-600);
  background: var(--primary-50);
  border-radius: 999px;
  padding: 4px 11px;
}

.card-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.35;
  margin: 0;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--primary); text-decoration: none; }

.card-excerpt {
  font-size: 0.93rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta, .article-meta {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.featured .card-title { font-size: 1.3rem; }
.featured .card-excerpt { font-size: 0.98rem; -webkit-line-clamp: 4; }

/* ---------- tools + faq + newsletter ---------- */

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

.tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.tool-card h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.tool-card p { color: var(--muted); font-size: 0.95rem; margin: 0 0 16px; }

.faq-list { display: grid; gap: 12px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 4px 18px;
}
.faq-item summary {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  padding: 12px 0;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: " +"; color: var(--primary); font-weight: 800; }
.faq-item[open] summary::after { content: " -"; }
.faq-item p { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }

.newsletter {
  background: linear-gradient(135deg, var(--primary-600), var(--primary));
  border-radius: 16px;
  padding: 34px;
  color: #fff;
  text-align: center;
}
.newsletter h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 8px;
}
.newsletter p { margin: 0 0 20px; opacity: 0.92; font-size: 0.98rem; }
.newsletter form {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
}
.newsletter input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  min-width: 0;
}
.newsletter .form-note { font-size: 0.85rem; margin: 14px 0 0; opacity: 0.85; }
.newsletter .form-note.is-success { font-weight: 700; opacity: 1; }

/* ---------- ad slots (placeholder mode) ----------
   Placeholders carry no box, no background and no fixed size: only the
   centered "advertisement" word marks the position. When a real creative
   is moved in, the word disappears (pure CSS, no JS class toggling). */

/* home page: single ad position, above the hero grid */
.ad-slot-top { padding: 14px 16px 0; }
.ad-slot-top .ad-unit { margin: 0 0 14px; }

.ad-unit {
  margin: 18px 0;
  padding: 0;
  text-align: center;
}

.ad-ph {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a94a6;
  white-space: nowrap;
}

.ad-unit:has(.ad-slot iframe) .ad-ph,
.ad-unit:has(.ad-slot ins[data-ad-status="filled"]) .ad-ph { display: none; }

.ad-slot { width: 100%; height: auto; }

/* the JS breakpoint marker that receives a real frame; must fill the unit */
.ad-unit [data-ad-anchor] { width: 100%; }

/* ---------- anchor (bottom bar) ---------- */

.ad-anchor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: transparent;
}
.ad-anchor[hidden] { display: none; }

.ad-anchor__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 6px 16px;
  text-align: center;
}

.ad-unit--anchor { margin: 0; }

/* ---------- interstitial (dormant until re-enabled) ---------- */

.ad-inter { position: fixed; inset: 0; z-index: 1000; }
.ad-inter[hidden] { display: none; }
/* Backstop: the interstitial is invisible until a real creative is present,
   even if the controller is bypassed. */
.ad-inter:not(:has(.ad-slot iframe, .ad-slot ins[data-ad-status="filled"])) { display: none; }

.ad-inter__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.74);
}

.ad-inter__card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  margin: 24px auto;
  padding: 22px;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
}

.ad-inter__card .ad-unit { margin: 0 0 14px; }

.ad-inter__close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.ad-inter__close:hover { background: var(--surface); }

.ad-inter__note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  text-align: center;
}

/* ---------- back to top / home ---------- */

.fab-stack {
  position: fixed;
  right: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.fab.is-visible { opacity: 1; visibility: visible; transform: none; }
.fab:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.fab svg { width: 20px; height: 20px; }

.fab--home { position: fixed; right: 16px; bottom: 130px; }
.fab--top { position: fixed; right: 16px; bottom: 130px; }
body:not(.is-home) .fab--top { bottom: 186px; }

/* ---------- article page ---------- */

.article-wrap { padding: 30px 0 70px; }

.article-head { max-width: 760px; margin: 0 auto 22px; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

.article-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.5rem, 3.6vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin: 10px 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-cover {
  max-width: 760px;
  margin: 0 auto 24px;
}
.article-cover img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 14px;
}

.toc {
  max-width: 760px;
  margin: 0 auto 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}
.toc p {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin: 3px 0; font-size: 0.93rem; }

.prose { max-width: 760px; margin: 0 auto; }

.prose h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.28rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 1.9em 0 0.6em;
  scroll-margin-top: 84px;
}
.prose h2:first-child { margin-top: 0; }

.prose p { margin: 0 0 1.15em; }

.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.35em; }
.prose li { margin: 0.35em 0; }

.prose strong { font-weight: 700; }

.prose img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 12px;
  margin: 26px 0;
}

.prose .formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 1.15em;
  overflow-x: auto;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.3em;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  min-width: 520px;
}

.prose th, .prose td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose tr:last-child td { border-bottom: 0; }
.prose th {
  font-family: var(--font-head);
  font-weight: 700;
  background: var(--surface);
  white-space: nowrap;
}
.prose td:first-child { font-weight: 600; white-space: nowrap; }

.disclaimer {
  max-width: 760px;
  margin: 30px auto 0;
  background: var(--warn-50);
  border: 1px solid #fde3c3;
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.92rem;
  color: #7c4a12;
}

.cta-strip {
  max-width: 760px;
  margin: 34px auto 0;
  background: linear-gradient(135deg, var(--primary-600), var(--primary));
  border-radius: 16px;
  padding: 26px 28px;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.cta-strip h2 { font-family: var(--font-head); font-size: 1.2rem; margin: 0 0 4px; }
.cta-strip p { margin: 0; font-size: 0.93rem; opacity: 0.92; }
.cta-strip .btn { background: #fff; color: var(--primary-600); }
.cta-strip .btn:hover { background: var(--primary-50); }

.related { max-width: 760px; margin: 40px auto 0; }
.related .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }

/* ---------- list (categories) page ---------- */

.page-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin: 26px 0 34px;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
}
.page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.15), rgba(11, 18, 32, 0.78));
}
.page-hero__body { position: relative; z-index: 1; padding: 26px; color: #fff; }
.page-hero h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  margin: 0 0 6px;
}
.page-hero p { margin: 0; opacity: 0.9; font-size: 0.98rem; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.filter-chip {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- search page ---------- */

.search-panel { padding: 20px 0 60px; }
.search-panel h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  margin: 0 0 8px;
}
.search-panel .lead { color: var(--muted); margin: 0 0 24px; }

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.search-box input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
.search-box .icon-btn { width: 52px; height: 52px; border-radius: 12px; }

.search-meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 18px;
}

.result-list { display: grid; gap: 14px; }
.result {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: #fff;
}
.result h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result p { margin: 0 0 8px; font-size: 0.92rem; color: var(--muted); }
.result mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 2px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.popular { margin-top: 26px; }
.popular p {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

/* ---------- calculator ---------- */

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: start;
}

.calc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.calc-card h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 18px;
}

.field { margin-bottom: 18px; }
.field label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.field label output { color: var(--primary); font-weight: 700; }
.field input[type="number"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.field input[type="range"] { width: 100%; accent-color: var(--primary); }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.result-cards { display: grid; gap: 14px; margin-bottom: 22px; }
.result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
}
.result-card .k {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.result-card .v {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1.2;
}
.result-card--main { background: var(--primary-50); border-color: #cdd9fb; }
.result-card--main .v { color: var(--primary-600); }
.result-card--growth .v { color: var(--accent); }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 10px 0; }
.chart .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary), #60a5fa);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  position: relative;
}
.chart .bar:hover { background: var(--primary-600); }
.chart-note { font-size: 0.82rem; color: var(--muted); margin: 0; }

.formula-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 52px 0 26px;
  margin-top: 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 34px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(199, 210, 226, 0.16);
}

.footer-brand .brand-name { color: #fff; }
.footer-brand p {
  font-size: 0.92rem;
  color: var(--footer-muted);
  margin: 14px 0 0;
  max-width: 34ch;
}

.site-footer h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 14px;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: var(--footer-text); font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }

.footer-bottom {
  padding-top: 22px;
  display: grid;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--footer-muted);
}
.footer-bottom p { margin: 0; }
.footer-bottom .footer-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .main-nav a { padding: 8px 8px; font-size: 0.9rem; }
  .header-search input { width: 130px; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-media { order: -1; }
  .featured { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
}

@media (max-width: 768px) {
  .main-nav, .header-search { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-inner { height: 58px; gap: 10px; }
  .brand-name { font-size: 0.98rem; }
  .hero { padding: 34px 0 30px; }
  .section { padding: 28px 0; }
  .card-grid { grid-template-columns: 1fr; }
  .featured { padding: 14px; }
  .newsletter { padding: 24px 18px; }
  .newsletter form { flex-direction: column; }
  .article-wrap { padding: 20px 0 56px; }
  .related .card-grid { grid-template-columns: 1fr; }
  .cta-strip { flex-direction: column; align-items: flex-start; }
  .fab-stack { right: 12px; }
  .fab--home { right: 12px; }
  .fab--top { right: 12px; }
  /* footer: brand and company full width, Explore and Tools share one row */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-grid > div:nth-child(4) { grid-column: 1 / -1; }
  .prose table { min-width: 480px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
