:root {
  --ink: #0f2a3a;
  --ink-soft: #3a5566;
  --teal: #1a7a72;
  --teal-deep: #0f524c;
  --sand: #e8f0ee;
  --mist: #f4f8f7;
  --line: rgba(15, 42, 58, 0.12);
  --accent: #c47a2c;
  --white: #ffffff;
  --display: "Fraunces", Georgia, serif;
  --body: "Outfit", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--mist);
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--teal); }
img, svg { display: block; max-width: 100%; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(ellipse 70% 120% at 80% 0%, rgba(26, 122, 114, 0.35), transparent 55%),
    linear-gradient(165deg, #0a1c28 0%, #123848 55%, #0f524c 100%);
  color: var(--white);
}
.site-nav a { color: inherit; text-decoration: none; }
.site-brand {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.site-nav-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.88;
}
.site-nav-links a:hover { opacity: 1; }
.site-nav-links a[aria-current="page"] {
  opacity: 1;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
@media (max-width: 640px) {
  .site-nav-links { display: none; }
}

.page-hero {
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1.25rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2rem);
  background:
    radial-gradient(ellipse 60% 80% at 90% 20%, rgba(26, 122, 114, 0.12), transparent 50%),
    var(--sand);
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.55rem;
}
.page-hero h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  max-width: 18ch;
}
.page-hero .lede {
  font-size: clamp(1.02rem, 1.7vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 48ch;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2rem) 1rem;
}

.context {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.context h2 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  margin-bottom: 0.75rem;
}
.context p {
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
  max-width: 62ch;
}
.context ul {
  margin: 0.75rem 0 1rem 1.15rem;
  color: var(--ink-soft);
  max-width: 62ch;
}
.context li { margin-bottom: 0.35rem; }
.context .note {
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
  background: var(--sand);
  border-left: 3px solid var(--teal);
  border-radius: 0 4px 4px 0;
  max-width: 62ch;
}

.tool-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tool-tab {
  appearance: none;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tool-tab:hover { border-color: var(--teal); color: var(--ink); }
.tool-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.tool-panel { display: none; }
.tool-panel.active { display: block; }

.section-head {
  margin: 0.5rem 0 1.25rem;
}
.section-head h2 {
  font-family: var(--display);
  font-size: 1.55rem;
  margin-bottom: 0.45rem;
}
.section-head p {
  color: var(--ink-soft);
  max-width: 58ch;
  font-size: 0.98rem;
}

.model-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  background: var(--sand);
  border-radius: 6px;
}
.model-switch input { position: absolute; opacity: 0; pointer-events: none; }
.model-switch label {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.model-switch label:hover { color: var(--ink); }
.model-switch input:checked + label {
  background: var(--ink);
  color: var(--white);
}
.model-switch input:disabled + label {
  opacity: 0.4;
  cursor: not-allowed;
}

.panel-block {
  margin-bottom: 1.75rem;
}
.panel-block h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  margin-bottom: 0.65rem;
}
.panel-block h4 {
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 1rem 0 0.5rem;
}

.table-scroll {
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
}
.table th,
.table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--sand);
  position: sticky;
  top: 0;
}
.table tr:last-child td { border-bottom: none; }

.chart-frame {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 0.75rem 0.25rem;
}
.total-cost {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  background: var(--ink);
  color: var(--white);
  border-radius: 6px;
}
.total-cost h3,
.total-cost h4 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
  color: var(--white);
}
.total-cost h4:last-child { margin-bottom: 0; }
#ceaSummary {
  padding: 1rem 1.15rem;
  background: var(--sand);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
#ceaSummary h4 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 0.45rem;
  color: var(--ink);
}
#ceaSummary h4:last-child { margin-bottom: 0; }

.ghost-btn {
  appearance: none;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.ghost-btn:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
}

.loading {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--ink-soft);
}

.site-footer {
  margin-top: 2.5rem;
  padding: 1.5rem clamp(1.25rem, 4vw, 3.5rem) 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  background: var(--mist);
}
.site-footer a {
  color: inherit;
  text-decoration: none;
}
.site-footer a:hover { color: var(--ink); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
