/* =============================================
   TheCalculatorWorld — Navy + Amber Design
   ============================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg:        #F8FAFC;
  --surface:   #FFFFFF;
  --surface2:  #F1F5F9;
  --border:    #E2E8F0;
  --border-soft: #EEF2F8;
  --amber:     #D97706;
  --amber-bg:  #FFFBEB;
  --amber-dark:#B45309;
  --navy:      #0F172A;
  --navy-mid:  #1E293B;
  --slate:     #334155;
  --slate-mid: #475569;
  --slate-soft:#64748B;
  --muted:     #94A3B8;
  --tag-bg:    #F1F5F9;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  line-height: 1.6;
}

/* ---- NAV ---- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 58px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .wrap {
  width: min(1100px, 94vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  margin-right: auto;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: var(--amber);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  object-fit: contain;
  padding: 4px;
}

.brand span {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
  letter-spacing: -0.2px;
}

.header-main { display: flex; align-items: center; gap: 0; }

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--navy);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 1.1rem;
  cursor: pointer;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-nav a {
  text-decoration: none;
  font-size: 18px;
  font-weight: 400;
  color: var(--slate-mid);
  padding: 6px 13px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.top-nav a:hover {
  background: var(--surface2);
  color: var(--navy);
}

/* Nav dropdown */

.all-calculators-nav { position: relative; }

.all-calculators-nav summary {
  list-style: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 400;
  color: var(--slate-mid);
  padding: 6px 13px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.all-calculators-nav summary::-webkit-details-marker { display: none; }

.all-calculators-nav summary:hover,
.all-calculators-nav[open] summary {
  background: var(--surface2);
  color: var(--navy);
}

.nav-mega {
  position: absolute;
  right: 0;
  top: 38px;
  width: min(800px, 94vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(15,23,42,0.1);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.nav-mega section {
  padding: 0 16px;
}

.nav-mega section:not(:last-child) {
  border-right: 1px solid var(--border-soft);
}

.nav-mega h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--slate-soft);
}

.nav-mega h3 a { color: inherit; text-decoration: none; font-size: 13px; padding: 0; }

.nav-mega h3 a:hover { color: var(--amber); background: none; }

.nav-mega ul { list-style: none; margin: 0; padding: 0; }

.nav-mega li + li { margin-top: 3px; }

.nav-mega a {
  display: block;
  padding: 5px 8px;
  font-size: 17px;
  color: var(--slate);
  text-decoration: none;
  border-radius: 5px;
  white-space: nowrap;
}

.nav-mega a:hover {
  background: var(--surface2);
  color: var(--navy);
}

/* ---- Breadcrumb ---- */

.breadcrumb-nav {
  padding: 9px 0;
  font-size: 16px;
  color: var(--muted);
  width: min(1100px, 94vw);
  margin: 0 auto;
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
}

.breadcrumb-list li { color: var(--muted); font-size: 16px; }

.breadcrumb-list li:not(:last-child)::after {
  content: "/";
  margin: 0 6px;
  color: var(--border);
}

.breadcrumb-list a { color: var(--muted); text-decoration: none; }

.breadcrumb-list a:hover { color: var(--amber); }

/* ---- Wrap ---- */

main.wrap {
  width: min(1100px, 94vw);
  margin: 0 auto;
  padding: 16px 0 48px;
}

/* ---- Hero (shared by home + calculator pages) ---- */

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 320px;
  overflow: hidden;
  animation: fadeUp 0.35s ease both;
}

.hero-left {
  padding: 3rem 3rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--amber);
}

.hero-title {
  font-family: 'Lora', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.45rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -0.5px;
}

.hero-desc {
  font-size: 16px;
  color: var(--slate-mid);
  line-height: 1.65;
  max-width: 440px;
  font-weight: 300;
}

.hero-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0;
}

.hero-bullets li {
  font-size: 16px;
  color: var(--slate);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.hero-bullets li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
  margin-top: 6px;
}

.hero-cta {
  display: flex;
  gap: 10px;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--amber);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.12s;
}
.btn-primary:hover { background: var(--amber-dark); }

.btn-outline {
  background: transparent;
  color: var(--navy-mid);
  border: 1px solid var(--border);
  padding: 11px 22px;
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.12s, border-color 0.12s;
}
.btn-outline:hover { background: var(--surface2); border-color: #CBD5E1; }

/* Hero right panel */

.hero-right {
  background: var(--surface2);
  border-left: 1px solid var(--border);
  padding: 2.5rem 1.75rem;
}

.hero-right-heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--amber-dark);
  margin: 0 0 1.1rem;
}

.hero-right-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

.hero-right-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 16px;
  color: var(--slate);
  text-decoration: none;
  border-bottom: 1px solid var(--border-soft);
  transition: color 0.12s;
  font-weight: 400;
}

.hero-right-list li:last-child a { border-bottom: none; }

.hero-right-list li a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.12s;
}

.hero-right-list li a:hover { color: var(--amber); }
.hero-right-list li a:hover::before { background: var(--amber); }

/* ---- Features grid ---- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  animation: fadeUp 0.35s 0.08s ease both;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem 1.4rem;
  transition: box-shadow 0.15s, transform 0.15s;
}

.feature-card:hover {
  box-shadow: 0 4px 20px rgba(15,23,42,0.07);
  transform: translateY(-2px);
}

.feature-icon {
  width: 36px;
  height: 36px;
  background: var(--amber-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  font-size: 17px;
}

.feature-title {
  font-family: 'Lora', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 7px;
}

.feature-desc {
  font-size: 16px;
  color: var(--slate-mid);
  line-height: 1.6;
  font-weight: 300;
  margin: 0;
}

/* ---- Hub section ---- */

.hub-section { animation: fadeUp 0.35s 0.16s ease both; }

.hub-heading {
  font-family: 'Lora', serif;
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 3px;
}

.hub-sub {
  font-size: 16px;
  color: var(--slate-soft);
  margin: 0 0 1.1rem;
  font-weight: 300;
}

.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.hub-tabs {
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  background: var(--surface2);
}

.hub-tab {
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 400;
  color: var(--slate-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
  user-select: none;
  text-decoration: none;
}

.hub-tab.active {
  color: var(--amber-dark);
  border-bottom-color: var(--amber);
  font-weight: 500;
  background: var(--surface);
}

.hub-tab:hover:not(.active) { color: var(--slate); }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 1.4rem 1.5rem 1.6rem;
}

.hub-col {
  display: flex;
  flex-direction: column;
}

.hub-col:not(:last-child) {
  padding-right: 1.25rem;
  border-right: 1px solid var(--border-soft);
  margin-right: 1.25rem;
}

.hub-link {
  display: block;
  padding: 7px 8px;
  font-size: 16px;
  color: var(--slate);
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.1s, color 0.1s;
  font-weight: 400;
}

.hub-link:hover {
  background: var(--surface2);
  color: var(--navy);
}

/* ---- Calculator Hero (detail page) ---- */

.calc-hero {
  margin-bottom: 1.25rem;
}

.calc-hero .hero-eyebrow { margin-bottom: 4px; }

.calc-hero h1 {
  font-family: 'Lora', serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
}

.calc-hero .hero-desc {
  font-size: 16px;
  max-width: 600px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.hero-tags span {
  background: var(--tag-bg);
  color: var(--slate-mid);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 16px;
  font-weight: 500;
}

/* ---- Calculator layout ---- */

.calc-content {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  align-items: start;
}

.calc-primary { display: flex; flex-direction: column; gap: 1rem; }

.calc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: 78px;
}

/* Calculator shell */

.calc-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
}

.calc-shell h2 {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.formula-badge {
  display: inline-block;
  margin-top: 6px;
  background: var(--surface2);
  color: var(--slate-soft);
  font-size: 16px;
  padding: 5px 10px;
  border-radius: 5px;
  font-family: monospace;
  word-break: break-all;
}

/* Form */

.calc-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-top: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 16px;
  font-weight: 600;
  color: var(--slate-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--navy);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(217,119,6,0.1);
  background: var(--surface);
}

.calc-submit {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 11px 22px;
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 16px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.12s;
}
.calc-submit:hover { background: var(--amber-dark); }

.calc-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 8px;
  font-size: 16px;
  color: var(--slate-soft);
}

/* ---- Results ---- */

.results-container { display: flex; flex-direction: column; gap: 1rem; }

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
}

.result-card h2 {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 14px;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.result-metric {
  background: var(--amber-bg);
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 14px 16px;
}

.result-metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--slate-soft);
  font-weight: 600;
}

.result-metric-value {
  font-size: 1.2rem;
  font-family: 'Lora', serif;
  font-weight: 700;
  color: var(--navy);
  margin-top: 4px;
}

.result-metric.highlight {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.result-metric.highlight .result-metric-value { color: #166534; }

/* Schedule table */

.schedule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
}

.schedule-card h2 {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 14px;
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 16px;
}

.table-scroll th {
  text-align: left;
  padding: 9px 12px;
  background: var(--surface2);
  color: var(--navy);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  font-family: 'DM Sans', sans-serif;
}

.table-scroll td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--slate);
  white-space: nowrap;
}

.table-scroll tr:last-child td { border-bottom: none; }

.table-scroll tbody tr:hover { background: #FAFAF8; }

/* ---- Sidebar ---- */

.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
}

.side-card h3 {
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.side-card p {
  font-size: 16px;
  color: var(--slate-soft);
  margin: 6px 0 0;
  line-height: 1.55;
}

.side-card ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.side-card li {
  font-size: 16px;
  color: var(--slate);
  padding: 3px 0;
}

.side-card li + li { margin-top: 3px; }

.side-card a {
  color: var(--amber);
  text-decoration: none;
  font-weight: 400;
}

.side-card a:hover { text-decoration: underline; }

/* ---- SEO content ---- */

.seo-section {
  margin-top: 2rem;
}

.seo-section h2 {
  font-family: 'Lora', serif;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
}

.seo-section p {
  font-size: 16px;
  color: var(--slate-mid);
  line-height: 1.7;
  margin: 10px 0;
  max-width: 72ch;
  font-weight: 300;
}

.seo-section a { color: var(--amber); text-decoration: none; }
.seo-section a:hover { text-decoration: underline; }

/* ---- FAQ ---- */

.faq-section {
  margin-top: 2rem;
}

.faq-section h2 {
  font-family: 'Lora', serif;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 14px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.faq-item + .faq-item { margin-top: 6px; }

.faq-item summary {
  padding: 14px 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: var(--navy);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-size: 1.1rem;
  color: var(--muted);
  transition: transform 0.2s;
}

.faq-item[open] summary {
  background: var(--amber-bg);
  color: var(--amber-dark);
}

.faq-item[open] summary::after { content: "−"; }

.faq-item .faq-answer {
  padding: 0 16px 14px;
  font-size: 16px;
  color: var(--slate-mid);
  line-height: 1.65;
}

/* ---- Blog pages ---- */

.blog-hero {
  margin-bottom: 1.25rem;
}

.blog-hero .hero-eyebrow { margin-bottom: 2px; }

.blog-hero h1 {
  font-family: 'Lora', serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  margin: 0;
}

.blog-hero .hero-desc {
  font-size: 16px;
  margin-top: 4px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}

.blog-card:hover {
  box-shadow: 0 4px 20px rgba(15,23,42,0.07);
  transform: translateY(-2px);
}

.blog-card h2 {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.blog-card h2 a { color: var(--navy); text-decoration: none; transition: color 0.12s; }
.blog-card h2 a:hover { color: var(--amber); }

.blog-meta {
  font-size: 16px;
  color: var(--muted);
  margin-top: 8px;
}

.blog-excerpt {
  font-size: 16px;
  color: var(--slate-mid);
  line-height: 1.6;
  margin-top: 10px;
  flex: 1;
  font-weight: 300;
}

.blog-link {
  margin-top: 14px;
  font-size: 16px;
  font-weight: 500;
}

.blog-link a {
  color: var(--amber);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.blog-link a:hover { gap: 6px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  font-size: 16px;
  color: var(--slate-soft);
}

/* ---- Blog detail ---- */

.article-page { max-width: 720px; }

.article-header {
  margin-bottom: 1.25rem;
}

.article-header .hero-eyebrow { margin-bottom: 2px; }

.article-header h1 {
  font-family: 'Lora', serif;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  margin: 0;
}

.article-meta {
  font-size: 16px;
  color: var(--muted);
  margin-top: 8px;
}

.article-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.2rem;
  font-size: 16px;
  color: var(--slate-mid);
  line-height: 1.75;
}

.article-body h2 {
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin: 2rem 0 0.6rem;
}

.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1.5rem 0 0.5rem;
}

.article-body p {
  margin: 0.75rem 0;
  font-weight: 300;
}

.article-body ul, .article-body ol {
  margin: 0.75rem 0;
  padding-left: 22px;
  font-weight: 300;
}

.article-body li + li { margin-top: 4px; }

.article-body strong { color: var(--navy); font-weight: 600; }

.article-related {
  margin-top: 2rem;
}

.article-related h3 {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 12px;
}

.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.related-tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: box-shadow 0.15s;
}

.related-tool:hover { box-shadow: 0 4px 20px rgba(15,23,42,0.07); }

.related-tool h4 {
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
}

.related-tool h4 a { color: var(--navy); text-decoration: none; }
.related-tool h4 a:hover { color: var(--amber); }

.related-tool p {
  font-size: 16px;
  color: var(--slate-soft);
  margin: 4px 0 0;
  line-height: 1.5;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--amber);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  margin-top: 1.5rem;
}
.back-link:hover { text-decoration: underline; }

/* ---- Hub page ---- */

.hub-hero {
  margin-bottom: 1.25rem;
}

.hub-hero .hero-eyebrow { margin-bottom: 2px; }

.hub-hero h1 {
  font-family: 'Lora', serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
}

.hub-hero p {
  font-size: 16px;
  color: var(--slate-mid);
  max-width: 600px;
  font-weight: 300;
}

.hub-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.hub-tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  transition: box-shadow 0.15s, transform 0.15s;
}

.hub-tool-card:hover {
  box-shadow: 0 4px 20px rgba(15,23,42,0.07);
  transform: translateY(-2px);
}

.hub-tool-card h3 {
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
}

.hub-tool-card h3 a { color: var(--navy); text-decoration: none; }
.hub-tool-card h3 a:hover { color: var(--amber); }

.hub-tool-card p {
  font-size: 16px;
  color: var(--slate-soft);
  margin: 6px 0 0;
  line-height: 1.5;
  font-weight: 300;
}

/* Use cases */

.hub-use-cases {
  display: grid;
  gap: 0.75rem;
}

.hub-use-case {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
}

.hub-use-case h3 {
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.hub-use-case p {
  font-size: 16px;
  color: var(--slate-mid);
  margin: 6px 0 0;
  line-height: 1.6;
  font-weight: 300;
}

/* ---- Scenario page extras ---- */

.scenario-intro {
  background: var(--amber-bg);
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 16px;
  color: var(--amber-dark);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.scenario-intro a { color: var(--amber); font-weight: 500; }

.scenario-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.scenario-meta span {
  background: var(--tag-bg);
  color: var(--slate-mid);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 16px;
  font-weight: 500;
}

.cta-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--amber);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  margin-top: 1.5rem;
}
.cta-back-link:hover { text-decoration: underline; }

/* ---- Page footer nav ---- */

.page-footer-nav {
  margin-top: 2rem;
}

.page-footer-nav h2 {
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 2px;
}

.page-footer-nav .hub-sub { margin-top: 4px; }

/* ---- Home footnote ---- */

.home-footnote {
  background: var(--amber-bg);
  border: 1px solid #FDE68A;
  border-radius: 12px;
  padding: 1.6rem 2rem;
}

.home-footnote h2 {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.home-footnote p {
  font-size: 16px;
  color: var(--slate-mid);
  margin: 8px 0 0;
  line-height: 1.65;
  max-width: 64ch;
  font-weight: 300;
}

/* ---- HTMX ---- */

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.6rem;
  height: 360px;
  position: relative;
}

.chart-card canvas { width: 100% !important; height: 100% !important; }

/* ---- Result Insights ---- */

.result-insight { margin-bottom: 1rem; }

.result-narrative {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--navy);
  margin: 0 0 12px;
  font-weight: 400;
}

.result-key-insight {
  background: var(--amber-bg);
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 14px 18px;
}

.result-key-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--amber-dark);
  font-weight: 700;
}

.result-key-insight p {
  margin: 6px 0 0;
  font-size: 0.93rem;
  color: var(--navy-mid);
  line-height: 1.6;
}

.result-so-what {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 1rem;
}

.result-so-what h3 {
  margin: 0;
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.result-so-what p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--slate-mid);
  line-height: 1.6;
}

.result-suggestions {
  margin-top: 1rem;
}

.result-suggestions h3 {
  margin: 0;
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.suggestion-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 8px;
}

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

.suggestion-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suggestion-btn:hover {
  border-color: var(--amber);
  box-shadow: 0 2px 8px rgba(217,119,6,0.12);
  transform: translateY(-1px);
}

.suggestion-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

.suggestion-detail {
  font-size: 0.82rem;
  color: var(--slate-soft);
}

/* ---- Beginner / Advanced Toggle ---- */

.advanced-fields {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.advanced-fields.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

.advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--slate-soft);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  padding: 4px 0;
  margin-bottom: 8px;
  grid-column: 1 / -1;
}

.advanced-toggle:hover { color: var(--amber); }

.advanced-toggle::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  transition: background 0.15s;
}

.advanced-toggle.expanded::before {
  background: var(--amber);
  border-color: var(--amber);
}

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator { display: block; }

/* ---- Animations ---- */

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

/* ---- Margin helpers ---- */

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { border-left: none; border-top: 1px solid var(--border); }
  .hero-left { padding: 2rem 1.5rem; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .calc-content { grid-template-columns: 1fr; }
  .calc-sidebar { position: static; }
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-col:nth-child(2) { border-right: none; }
  .nav-mega { grid-template-columns: repeat(2, 1fr); }
  .nav-mega section:nth-child(2) { border-right: none; }
}

@media (max-width: 640px) {
  .hero-left { padding: 1.5rem 1.2rem; }
  .hero-right { padding: 1.5rem 1.2rem; }
  .features { grid-template-columns: 1fr; }
  .calc-form { grid-template-columns: 1fr; }
  .hub-grid { grid-template-columns: 1fr; }
  .hub-col { border-right: none !important; padding-right: 0 !important; margin-right: 0 !important; }
  .hub-col:not(:last-child) { padding-bottom: 1rem; border-bottom: 1px solid var(--border-soft); margin-bottom: 1rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .hub-tools-grid { grid-template-columns: 1fr; }
  .result-metrics { grid-template-columns: 1fr 1fr; }
  .article-body { padding: 1.4rem; }
  .nav-mega { grid-template-columns: 1fr; position: static; margin-top: 6px; }
  .nav-mega section { border-right: none !important; padding: 0; }
  .nav-mega section:not(:last-child) { padding-bottom: 1rem; border-bottom: 1px solid var(--border-soft); margin-bottom: 0.5rem; }

  .site-header .wrap { position: relative; }

  .nav-toggle { display: inline-block; }

  .top-nav {
    display: none;
    position: absolute;
    right: 0;
    top: 52px;
    width: min(300px, 90vw);
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(15,23,42,0.1);
    padding: 10px;
    z-index: 60;
  }

  .top-nav.is-open { display: flex; }
  .top-nav a { width: 100%; text-align: left; }
  .all-calculators-nav { width: 100%; }
  .all-calculators-nav summary { width: 100%; text-align: center; }

  .hero-title { font-size: clamp(1.5rem, 5vw, 1.8rem) !important; }
  .hero-desc { font-size: 16px !important; }
  .hero-bullets li { font-size: 15px !important; }
  .hero-eyebrow { font-size: 11px !important; }
  .top-nav a { font-size: 17px !important; }
  .btn-primary, .btn-outline { font-size: 15px !important; padding: 12px 20px; }
  .hub-link { font-size: 15px !important; }
  .form-group input, .form-group select { font-size: 16px !important; }
  .form-group label { font-size: 12px !important; }
  .calc-submit { font-size: 15px !important; }
  .blog-excerpt { font-size: 14px !important; }
  .blog-meta { font-size: 12px !important; }
  .article-body { font-size: 15px !important; }
  .faq-item summary { font-size: 15px !important; }
  .faq-item .faq-answer { font-size: 14px !important; }
  .result-metric-value { font-size: 1.15rem !important; }
  .result-metric-label { font-size: 11px !important; }
}
