:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #172923;
  background: #f8faf7;
  --primary: #165a4b;
  --primary-hover: #10483b;
  --primary-container: #dceee4;
  --muted: #4e6258;
  --outline: #cddbd2;
  --surface: #fff;
  --content-width: 76rem;
  line-height: 1.6;
}

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

body { margin: 0; }

a { color: var(--primary); text-underline-offset: .2em; }

:focus-visible { outline: 3px solid #197861; outline-offset: 4px; }

.wrap { width: min(var(--content-width), calc(100% - 4rem)); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 2;
  padding: .75rem 1rem;
  border-radius: .75rem;
  background: var(--surface);
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.topbar { background: #f9fcf9; border-bottom: 1px solid var(--outline); }

.topbar-inner {
  display: flex;
  min-height: 5.15rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: #19392f;
  text-decoration: none;
}

.brand strong { display: block; font-size: 1.25rem; letter-spacing: -.04em; line-height: 1.25; }
.brand small { display: block; color: var(--muted); font-size: .8125rem; }

.brand-mark {
  display: inline-flex;
  flex: none;
  width: 2.65rem;
  height: 2.65rem;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding-bottom: .7rem;
  border-radius: .9rem;
  background: #175347;
}

.brand-mark i { width: 4px; height: 8px; border-radius: 2px; background: #d9f4e7; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 19px; }

.header-links { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }

.header-links a {
  padding: .55rem .9rem;
  border-radius: 99rem;
  color: #344e43;
  font-size: .9375rem;
  font-weight: 630;
  text-decoration: none;
}

.header-links a:hover,
.header-links [aria-current="page"] { color: #164b3f; background: var(--primary-container); }

.hero-surface {
  background: radial-gradient(ellipse at 87% 63%, #dbece0 0, transparent 56%),
              linear-gradient(115deg, #f1f7ee, #eaf3ec);
  border-bottom: 1px solid #dbe7dd;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(3rem, 6.5vw, 7rem);
}

.eyebrow {
  margin: 0 0 .9rem;
  color: var(--primary);
  font-size: .875rem;
  font-weight: 750;
  letter-spacing: .045em;
}

.hero h1 {
  margin: 0 0 1.3rem;
  font-size: clamp(2.65rem, 4.75vw, 4.65rem);
  font-weight: 760;
  letter-spacing: -.073em;
  line-height: 1.04;
}

.hero h1 span { color: var(--primary); }
.hero-copy > p:not(.eyebrow) { max-width: 30rem; margin: 0; color: var(--muted); font-size: 1.125rem; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.85rem; }

.button {
  display: inline-flex;
  min-height: 3.1rem;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 99rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-hover); }
.button-outline { border-color: #8ba89a; }
.button-outline:hover { background: #e1eee5; }

.ledger-preview {
  min-width: 0;
  margin: 0;
  padding: clamp(1.05rem, 2.35vw, 2rem);
  border: 1px solid #d2e2d8;
  border-radius: 1.85rem;
  background: #fcfffc;
  box-shadow: 0 2px 4px #2144360d, 0 22px 48px -26px #234d3c61;
}

.preview-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.preview-header p { display: flex; align-items: center; gap: .55rem; margin: 0; font-weight: 730; }
.brand-mark-small { width: 1.75rem; height: 1.75rem; gap: 2px; padding-bottom: .45rem; border-radius: .55rem; }
.brand-mark-small i { width: 3px; height: 5px; }
.brand-mark-small i:nth-child(2) { height: 9px; }
.brand-mark-small i:nth-child(3) { height: 12px; }

.demo-label { padding: .18rem .63rem; border-radius: 99rem; background: #edf4ed; color: #4a5d52; font-size: .8125rem; }
.preview-balance { display: grid; gap: .05rem; margin-block: 1.2rem .9rem; }
.preview-balance span { color: var(--muted); font-size: .875rem; }
.preview-balance strong { font-size: clamp(1.95rem, 3.4vw, 2.8rem); line-height: 1.15; letter-spacing: -.055em; }

.balance-history { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .4rem .65rem; }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; }
.chart-scale, .chart-dates { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.chart-dates { display: flex; grid-column: 2; justify-content: space-between; padding-right: .1rem; }

.chart-plot {
  position: relative;
  height: 7.5rem;
  margin-block: .3rem;
  border-block: 1px solid #e1ebe4;
  background: linear-gradient(#e1ebe4, #e1ebe4) center / 100% 1px no-repeat;
}

.chart-area, .chart-line { position: absolute; inset: 0; }

.chart-area {
  background: linear-gradient(#add8c4, #edf6ef);
  clip-path: polygon(0 86%, 6% 82%, 12% 73%, 18% 75%, 24% 77%, 30% 67%, 36% 58%, 42% 60%, 48% 64%, 54% 52%, 60% 40%, 66% 43%, 72% 47%, 78% 32%, 84% 24%, 90% 27%, 96% 17%, 100% 11%, 100% 100%, 0 100%);
}

.chart-line {
  background: #2e8268;
  clip-path: polygon(0 84%, 6% 80%, 12% 71%, 18% 73%, 24% 75%, 30% 65%, 36% 56%, 42% 58%, 48% 62%, 54% 50%, 60% 38%, 66% 41%, 72% 45%, 78% 30%, 84% 22%, 90% 25%, 96% 15%, 100% 9%, 100% 12%, 96% 18%, 90% 28%, 84% 25%, 78% 33%, 72% 48%, 66% 44%, 60% 41%, 54% 53%, 48% 65%, 42% 61%, 36% 59%, 30% 68%, 24% 78%, 18% 76%, 12% 74%, 6% 83%, 0 87%);
}

.chart-end { position: absolute; top: 11%; right: 0; width: .7rem; height: .7rem; border: 2px solid #fff; border-radius: 50%; background: #247158; transform: translate(25%, -50%); }

.preview-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: 1.05rem; }
.preview-totals > div { display: grid; gap: .12rem; padding: .65rem .78rem; border-radius: .75rem; background: #edf4ef; }
.preview-totals strong { font-size: 1.015rem; line-height: 1.3; }
.metric-label { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .8125rem; }
.metric-label i { width: .43rem; height: .43rem; border-radius: 50%; background: #297d61; }
.expense i { background: #9b5947; }

.site-content { padding-block: 3.2rem 4rem; }
.site-content h2, .article-page h1 { margin: 0 0 .75rem; font-size: clamp(1.7rem, 2.9vw, 2.55rem); letter-spacing: -.055em; line-height: 1.15; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }

.feature, .info-panel {
  min-width: 0;
  padding: 1.4rem;
  border: 1px solid #dce6dd;
  border-radius: 1.25rem;
  background: var(--surface);
}

.feature h3 { margin: .85rem 0 .35rem; font-size: 1.13rem; letter-spacing: -.025em; }
.feature p, .section-intro > p:not(.eyebrow), .info-panel p { margin: 0; color: var(--muted); }

.feature-icon {
  position: relative;
  display: block;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: .85rem;
  background: #e3f1e6;
  color: var(--primary);
}

.feature-icon::before, .feature-icon::after { position: absolute; content: ""; }
.icon-wallet::before { inset: 12px 10px; border: 2px solid; border-radius: 4px; }
.icon-wallet::after { top: 18px; right: 10px; width: 8px; height: 6px; border: 2px solid; border-radius: 3px; background: #e3f1e6; }
.icon-chart::before { inset: 10px 11px 11px; border: solid; border-width: 0 0 2px 2px; }
.icon-chart::after { bottom: 15px; left: 16px; width: 3px; height: 6px; background: currentColor; box-shadow: 5px -3px currentColor, 10px -6px currentColor; }
.icon-data::before { inset: 10px 11px; border: 2px solid; border-radius: 3px; }
.icon-data::after { top: 16px; left: 15px; width: 11px; height: 2px; background: currentColor; box-shadow: 0 5px currentColor; }

.download-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 1.5rem 2.5rem;
  margin-block: 3rem 1.25rem;
  padding: clamp(1.25rem, 4vw, 2.75rem);
  border: 1px solid #d5e5da;
  border-radius: 1.6rem;
  background: #eaf3eb;
}

.section-intro .eyebrow { margin-bottom: .6rem; }
.downloads { display: grid; gap: .55rem; }

.download-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .65rem .8rem;
  border: 1px solid #d6e3da;
  border-radius: .9rem;
  background: #fafffa;
  color: #20362d;
  text-decoration: none;
}

.download-link:hover { background: #fff; border-color: #739987; }
.package-type { min-width: 3rem; padding: .24rem .4rem; border-radius: .45rem; background: #e0eee3; color: #214d3e; font-size: .8125rem; font-weight: 750; text-align: center; }
.download-text { color: var(--primary); font-size: .875rem; font-weight: 720; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.info-panel h2 { font-size: 1.55rem; }
.info-panel code { font-size: .9em; overflow-wrap: anywhere; }
.info-links { display: flex; flex-wrap: wrap; column-gap: 1rem; }
.text-link { display: inline-block; margin-top: .75rem; font-weight: 700; overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--outline); background: #edf4ed; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-block: 1.25rem; }
.copyright { margin: 0; color: var(--muted); font-size: .9375rem; white-space: pre-wrap; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { display: inline-flex; min-height: 2.75rem; align-items: center; gap: .4rem; font-weight: 680; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

.article-page { min-height: 60vh; padding-block: 3rem; }
.page-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.pagination { display: flex; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 55rem) {
  .wrap { width: min(var(--content-width), calc(100% - 2.5rem)); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .ledger-preview { width: min(100%, 35rem); }
  .hero h1 { font-size: clamp(2.6rem, 7.5vw, 4.4rem); }
}

@media (max-width: 42rem) {
  .topbar-inner { align-items: flex-start; flex-direction: column; gap: .7rem; padding-block: .85rem; }
  .header-links { margin-left: -.55rem; }
  .header-links a { padding-inline: .55rem; font-size: .875rem; }
  .feature-grid, .download-section, .info-grid { grid-template-columns: minmax(0, 1fr); }
  .site-content { padding-block: 2rem 2.75rem; }
}

@media (max-width: 25rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .hero h1 { font-size: 2.35rem; }
  .download-link { grid-template-columns: auto minmax(0, 1fr); }
  .download-text { grid-column: 2; }
}
