/* ==========================================================================
   Qista: "The Ledger" theme
   Every color and font lives here. Change these to restyle the whole site.
   ========================================================================== */
:root {
  /* Paper and ink */
  --paper: #f7f6ee;          /* page background, account-book cream */
  --paper-sheet: #fcfbf5;    /* raised sheets and cards */
  --paper-tint: #edf2e9;     /* alternating section band, pale green */
  --ink: #1d2a23;            /* body text */
  --ink-soft: #46564d;       /* secondary text */
  --ink-faint: #6b786f;      /* captions, axis labels */

  /* Ledger greens */
  --green-900: #15362a;      /* footer cover cloth */
  --green-700: #23573f;      /* headings, primary buttons */
  --green-600: #2a7d55;      /* links, "money in" series */
  --green-100: #dfeadf;

  /* Rules and accents */
  --rule: #cfdfd2;           /* ruled lines on the paper */
  --rule-strong: #9fbca8;    /* table and column rules */
  --margin-red: #c25b4f;     /* the double red margin line (decoration only) */
  --flag: #a8392f;           /* "jumped" flags and warnings (text-safe) */
  --brass: #a7843a;          /* the scale's metal (decoration only) */
  --brass-dark: #7a5f25;
  --blue-ink: #4a56a6;       /* "money out" series */
  --todo-bg: #fff3c4;        /* visible [TODO] placeholders */
  --todo-ink: #5c4300;
  --focus: #1b5fd1;          /* keyboard focus ring */
  --on-dark: #f3f1e4;        /* text on the green cover */

  /* Fonts */
  --font-serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  /* Rhythm */
  --rule-gap: 2rem;          /* spacing of the ruled lines */
  --radius: 4px;
  --container: 72rem;
  --gutter: 1rem;
  --shadow: 0 1px 2px rgba(21, 54, 42, 0.08), 0 6px 18px -8px rgba(21, 54, 42, 0.18);
}

@media (min-width: 48em) {
  :root { --gutter: 2rem; }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--green-700);
  line-height: 1.2;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.35rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

a { color: var(--green-600); text-underline-offset: 0.18em; }
a:hover { color: var(--green-700); }

strong { font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--green-700);
  color: var(--on-dark);
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--on-dark); }

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

.num { font-variant-numeric: tabular-nums; }

/* Visible placeholder for undecided content */
.todo {
  display: inline;
  background: var(--todo-bg);
  color: var(--todo-ink);
  border: 1px dashed #c9a227;
  border-radius: 3px;
  padding: 0.05em 0.35em;
  font-family: var(--font-sans);
  font-size: 0.92em;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Ledger paper textures
   -------------------------------------------------------------------------- */
.ruled {
  background-color: var(--paper-sheet);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--rule-gap) - 1px),
    var(--rule) calc(var(--rule-gap) - 1px),
    var(--rule) var(--rule-gap)
  );
}

/* Double red margin line down the left edge, as in an account book */
.margin-line { position: relative; }
.margin-line::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 1.25rem;
  width: 4px;
  border-left: 1px solid var(--margin-red);
  border-right: 1px solid var(--margin-red);
  opacity: 0.7;
  pointer-events: none;
}

.double-rule {
  border: 0;
  height: 4px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  margin: 2rem 0;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.35rem;
  border: 2px solid var(--green-700);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--green-700); color: var(--on-dark); }
.btn-primary:hover { background: var(--green-900); border-color: var(--green-900); color: #fff; }
.btn-secondary { background: transparent; color: var(--green-700); }
.btn-secondary:hover { background: var(--green-100); color: var(--green-900); }
.btn-light { background: var(--on-dark); border-color: var(--on-dark); color: var(--green-900); }
.btn-light:hover { background: #fff; border-color: #fff; color: var(--green-900); }
.btn-sm { min-height: 2.5rem; padding: 0.45rem 0.95rem; font-size: 0.95rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.text-link {
  font-weight: 700;
  text-decoration-thickness: 1px;
}
.text-link::after { content: " \2192"; }

/* --------------------------------------------------------------------------
   Header and navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 4px double var(--rule-strong);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  min-height: 4.25rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--green-700);
  text-decoration: none;
}
.brand:hover { color: var(--green-900); }
.brand img { display: block; height: 36px; width: auto; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-sheet);
  color: var(--green-700);
  font: 700 0.95rem var(--font-sans);
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  content: "";
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  width: 100%;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a:not(.btn) {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:not(.btn):hover { color: var(--green-700); border-bottom-color: var(--rule-strong); }
.site-nav a[aria-current="page"] { color: var(--green-700); border-bottom-color: var(--green-600); }

/* With JavaScript, the mobile menu collapses behind the toggle */
@media (max-width: 59.99em) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; padding: 0.5rem 0 1rem; }
  .js .site-nav.is-open { display: flex; }
  .js .site-nav ul { flex-direction: column; width: 100%; gap: 0; }
  .js .site-nav ul a:not(.btn) { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
  .js .site-nav .btn { width: 100%; margin-top: 0.5rem; }
}

@media (min-width: 60em) {
  .header-inner { flex-wrap: nowrap; }
  .site-nav { width: auto; justify-content: flex-end; }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
main { display: block; }

.section { padding: 4rem 0; }
.section-tint { background: var(--paper-tint); }
.section + .section:not(.section-tint) { border-top: 1px solid var(--rule); }

.section-head { max-width: 46rem; margin-bottom: 2.25rem; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }

/* Ledger-style section label, e.g. "Folio 02 · How it works" */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 4px;
  border-top: 1px solid var(--margin-red);
  border-bottom: 1px solid var(--margin-red);
}

.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 40rem; }

.grid { display: grid; gap: 1.25rem; }
@media (min-width: 40em) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56em) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 40em) and (max-width: 55.99em) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--paper-sheet);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-bottom: 0.4rem; }

.card-core { border-top: 4px solid var(--green-700); }
.card-tag {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: 99px;
  color: var(--green-700);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ticks { margin: 0 0 1rem; padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: 0.45rem; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.15rem; top: 0.5em;
  width: 0.7rem; height: 0.38rem;
  border-left: 2px solid var(--green-600);
  border-bottom: 2px solid var(--green-600);
  transform: rotate(-45deg);
}
.ticks-cross li::before {
  width: 0.75rem; height: 0;
  top: 0.75em;
  border-left: 0;
  border-bottom: 2px solid var(--flag);
  transform: none;
}

/* --------------------------------------------------------------------------
   Hero (top banner) with the balancing scale
   -------------------------------------------------------------------------- */
.hero { padding: 3rem 0 3.5rem; border-bottom: 1px solid var(--rule); }
.hero-inner { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 56em) {
  .hero { padding: 5rem 0; }
  .hero-inner { grid-template-columns: 1.15fr 0.85fr; gap: 3rem; }
}
.hero h1 { margin-bottom: 0.5em; }
.hero .btn-row { margin: 1.75rem 0 1.25rem; }
.hero-note { color: var(--ink-soft); font-size: 0.98rem; margin: 0; }


.scale-sheet {
  position: relative;
  padding: 1.5rem 1rem 1rem 2.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 26rem;
  margin: 0 auto;
  width: 100%;
}
.scale-sheet figcaption {
  margin-top: 0.25rem;
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
}
.scale { display: block; width: 100%; height: auto; overflow: visible; }

/* Signature moment: the beam settles level on page load.
   Each pan counter-rotates by the same amount so it always hangs straight. */
.scale-beam, .scale-pan { transform-box: view-box; transform-origin: 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .scale-beam { animation: beam-settle 3s ease-in-out 0.35s both; }
  .scale-pan { animation: pan-settle 3s ease-in-out 0.35s both; }
}
@keyframes beam-settle {
  0%   { transform: rotate(-11deg); }
  22%  { transform: rotate(6.5deg); }
  41%  { transform: rotate(-3.4deg); }
  59%  { transform: rotate(1.7deg); }
  75%  { transform: rotate(-0.75deg); }
  89%  { transform: rotate(0.25deg); }
  100% { transform: rotate(0deg); }
}
@keyframes pan-settle {
  0%   { transform: rotate(11deg); }
  22%  { transform: rotate(-6.5deg); }
  41%  { transform: rotate(3.4deg); }
  59%  { transform: rotate(-1.7deg); }
  75%  { transform: rotate(0.75deg); }
  89%  { transform: rotate(-0.25deg); }
  100% { transform: rotate(0deg); }
}

/* Page header for inner pages */
.page-head { padding: 3rem 0 2.5rem; border-bottom: 1px solid var(--rule); }
.page-head h1 { max-width: 46rem; }
@media (min-width: 56em) { .page-head { padding: 4.5rem 0 3.5rem; } }

/* --------------------------------------------------------------------------
   How it works
   -------------------------------------------------------------------------- */
.steps { display: grid; gap: 1.25rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
@media (min-width: 56em) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { counter-increment: step; position: relative; padding-top: 3.75rem; }
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 1.1rem; left: 1.5rem;
  color: var(--margin-red);
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1;
}

/* Small print */
.fine-print { color: var(--ink-faint); font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Offer callout (no setup fee)
   -------------------------------------------------------------------------- */
.offer {
  display: grid;
  gap: 1rem 2rem;
  align-items: center;
  padding: 1.75rem 1.5rem;
  border: 2px solid var(--green-700);
}
@media (min-width: 48em) { .offer { grid-template-columns: 1fr auto; padding: 2rem 2.25rem 2rem 3rem; } }
.offer h3 { margin-bottom: 0.3rem; }

.plan { display: flex; flex-direction: column; align-items: flex-start; }
.plan .btn { margin-top: auto; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.field .hint { display: block; font-weight: 400; color: var(--ink-faint); font-size: 0.9rem; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--ink-faint);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--focus); }
.form-status { margin: 0; padding: 0.75rem 1rem; border-radius: var(--radius); }
.form-status:empty { display: none; }
.form-status.is-error { background: #fbe9e7; color: #7a2018; border: 1px solid #e3b4ae; }
.form-status.is-ok { background: var(--green-100); color: var(--green-900); border: 1px solid var(--rule-strong); }
.btn:disabled { opacity: 0.65; cursor: progress; }

/* Contact page: form card is the "Send us a message" target */
.contact-grid { align-items: start; }
#message { scroll-margin-top: 6rem; }
.form-after { margin: 1.25rem 0 0.5rem; }
.form-after + .fine-print, .fine-print + .fine-print { margin: 0 0 0.35rem; }
.email-plain { font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; user-select: all; }

/* --------------------------------------------------------------------------
   Privacy and "not" panels
   -------------------------------------------------------------------------- */
.privacy-list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 48em) { .privacy-list { grid-template-columns: repeat(2, 1fr); } }
.privacy-list li { display: grid; grid-template-columns: 2.25rem 1fr; gap: 0.75rem; align-items: start; }
.privacy-list svg { width: 2.25rem; height: 2.25rem; color: var(--green-700); }
.privacy-list h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.privacy-list p { margin: 0; color: var(--ink-soft); }

.not-panel { border-left: 4px solid var(--flag); }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq { max-width: 50rem; border-top: 4px double var(--rule-strong); }
.faq details { border-bottom: 1px solid var(--rule-strong); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0.25rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--green-700);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  width: 1.75rem; height: 1.75rem;
  display: grid; place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 1.2rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 0.25rem 1.25rem; color: var(--ink-soft); }
.faq .answer > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Call to action band and footer (the green ledger cover)
   -------------------------------------------------------------------------- */
.cta-band {
  background: var(--green-700);
  color: var(--on-dark);
  padding: 3.5rem 0;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--on-dark); max-width: 40rem; }
.cta-band a:not(.btn) { color: #fff; }
.cta-band .btn-secondary { color: #fff; border-color: var(--on-dark); }
.cta-band .btn-secondary:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.cta-band :focus-visible { outline-color: #fff; }
.cta-band .todo { color: var(--todo-ink); }

.site-footer {
  background: var(--green-900);
  color: var(--on-dark);
  padding: 3rem 0 2rem;
  font-size: 0.97rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--on-dark); }
.site-footer :focus-visible { outline-color: #fff; }
.site-footer h2 {
  color: #fff;
  font-size: 1.05rem;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 48em) { .footer-grid { grid-template-columns: 1.3fr 0.7fr 1fr; } }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer .brand { color: #fff; margin-bottom: 0.75rem; }
.footer-not {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 4px double rgba(243, 241, 228, 0.35);
  color: #d9dccd;
  font-size: 0.92rem;
}
.footer-not strong { color: #fff; }
.footer-base { margin-top: 1rem; color: #c9cebd; font-size: 0.88rem; }

/* --------------------------------------------------------------------------
   Gentle fade-in of sections on scroll
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* --------------------------------------------------------------------------
   Print: the report should print cleanly
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .cta-band, .nav-toggle, .btn { display: none !important; }
  body { background: #fff; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* --------------------------------------------------------------------------
   Narrow-screen adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 39.99em) {
  .offer { padding-left: 2.75rem; }
}
