:root {
  --bg: #f6f1e7;
  --bg-deep: #ebe4d6;
  --surface: #fffdf8;
  --surface-2: #f1eadc;
  --text: #1c2a22;
  --muted: #5e6b61;
  --accent: #0c7a62;
  --accent-soft: #d7f3ea;
  --accent-2: #c9642f;
  --line: #d8cfbf;
  --shadow: 0 10px 24px rgba(28, 42, 34, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, #fdf6d9 0%, transparent 32%),
    radial-gradient(circle at 90% 10%, #d9f0e8 0%, transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(12, 122, 98, 0.05) 1px, transparent 1px), linear-gradient(to bottom, rgba(12, 122, 98, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.3;
  z-index: -1;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

p {
  margin-top: 0;
}

.shell {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #ffffff;
  color: #000000;
  padding: 8px 10px;
  border: 1px solid #000000;
}

.skip-link:focus {
  left: 8px;
  z-index: 1000;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(246, 241, 231, 0.88);
  border-bottom: 1px solid rgba(216, 207, 191, 0.8);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
}

.nav-link:hover {
  text-decoration: none;
  background: var(--surface-2);
}

.nav-link.is-active {
  background: var(--accent-soft);
  color: #054b3b;
}

.hero {
  padding: 64px 0 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--surface);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin-bottom: 14px;
}

.lede {
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.1rem;
}

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

.hero-note {
  background: linear-gradient(160deg, #e8f5ef 0%, #f6efe4 100%);
  border: 1px solid #c7d5c8;
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.hero-note h2 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.hero-note ul {
  margin: 0;
  padding-left: 18px;
}

.hero-note li {
  margin: 8px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid #003f31;
  outline-offset: 2px;
}

.btn-solid {
  background: linear-gradient(135deg, var(--accent) 0%, #0a6552 100%);
  border-color: #0a6552;
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(12, 122, 98, 0.26);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.calculator-section,
.results-section,
.schedule-section,
.content-strip,
.page-main {
  padding: 20px 0 36px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.calculator-form,
.table-wrap,
.result-cards,
.page-card,
.faq-grid {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.calculator-form {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-weight: 700;
  font-size: 0.95rem;
}

.field input,
.field select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 10px;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.error-box {
  margin-top: 10px;
  color: #9b2d0a;
  font-weight: 700;
  min-height: 1.4em;
}

.result-cards {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #fffcf4 0%, #f6f1e8 100%);
}

.result-card h3 {
  font-size: 0.97rem;
  margin-bottom: 8px;
}

.result-card p {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-weight: 700;
}

.result-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.02rem;
}

.chart-wrap {
  margin: 16px 0 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
}

.chart-wrap h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--muted);
}

#balanceChart {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #ffffff;
}

.inline-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 670px;
}

thead th {
  position: sticky;
  top: 0;
  background: #f5efe4;
  text-align: left;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #ebe1cf;
}

tbody tr:nth-child(even) {
  background: #fefcf8;
}

.content-strip {
  margin-bottom: 18px;
}

.strip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.strip-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.text-link {
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #f3ebdd;
  padding: 18px 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-grid p {
  margin: 0;
}

.page-main {
  padding-top: 44px;
}

.page-head {
  margin-bottom: 18px;
}

.page-head h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin-bottom: 10px;
}

.page-head p {
  color: var(--muted);
  max-width: 70ch;
  margin: 0;
}

.page-card {
  padding: 20px;
  margin-bottom: 14px;
}

.page-card h2 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.page-card ul {
  margin: 0;
  padding-left: 20px;
}

.page-card li {
  margin: 8px 0;
}

.faq-grid {
  padding: 18px;
}

.faq-grid details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fffefb;
}

.faq-grid details + details {
  margin-top: 10px;
}

.faq-grid summary {
  cursor: pointer;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.delay-1 {
  transition-delay: 0.08s;
}

.delay-2 {
  transition-delay: 0.16s;
}

.delay-3 {
  transition-delay: 0.24s;
}

.delay-4 {
  transition-delay: 0.3s;
}

@media (max-width: 1024px) {
  .hero-grid,
  .strip-grid {
    grid-template-columns: 1fr;
  }

  .result-cards,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .nav-shell {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid,
  .result-cards {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .btn {
    transition: none;
  }
}
