/* The Bottom Line Bookkeeping — single stylesheet, no build step.
   Brand slate (#49587B) is sampled from the cat-on-the-line logo. */

:root {
  color-scheme: light dark;

  --brand: #49587b;
  --brand-strong: #36425e;
  --brand-soft: #e8ebf3;
  --accent: #b7791f;         /* warm ledger gold, used for small marks only */

  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-alt: #f2f0ea;
  --ink: #1d2433;
  --ink-muted: #4b5468;      /* 7.4:1 on --bg */
  --line: #dcd9d0;
  --on-brand: #ffffff;
  --focus: #b7791f;
  --field-border: #7c8396;   /* 3.8:1 on white (WCAG 1.4.11) */
  --danger: #b42318;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --radius: 14px;
  --shadow: 0 1px 2px rgb(29 36 51 / .06), 0 8px 24px rgb(29 36 51 / .07);
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #9fb0d6;
    --brand-strong: #c3cfea;
    --brand-soft: #232b3d;
    --accent: #e0a94a;
    --bg: #12161f;
    --surface: #1a202c;
    --surface-alt: #161b26;
    --ink: #e9ecf2;
    --ink-muted: #b4bccb;
    --line: #2e3647;
    --on-brand: #12161f;
    --focus: #e0a94a;
    --field-border: #7a849c;
    --danger: #f97066;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  }
  /* The logo is drawn in slate; lighten it so it reads on dark backgrounds. */
  .logo { filter: brightness(0) invert(.88); }
  .illus { filter: brightness(.92); }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.18;
  color: var(--ink);
  text-wrap: balance;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p, ul, ol { margin: 0 0 1.1em; }
p { text-wrap: pretty; max-width: 68ch; }

a { color: var(--brand); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-strong); text-decoration-thickness: 2px; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--brand); color: var(--on-brand);
  padding: .6rem 1rem; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem; padding-block: .7rem;
}
.brand { display: inline-flex; border-radius: 6px; }
.brand .logo { width: clamp(150px, 14vw, 200px); }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.nav a {
  display: inline-block; padding: .5rem .75rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.nav a:hover { background: var(--brand-soft); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 650; }
.nav a.nav-cta { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.nav a.nav-cta:hover { background: var(--brand-strong); }

@media (max-width: 760px) {
  .site-header { position: static; }
  .site-header .wrap { justify-content: center; }
  .nav ul { justify-content: center; }
  .nav a { padding: .45rem .65rem; font-size: .92rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.35rem;
  border-radius: 999px; border: 2px solid transparent;
  font-weight: 650; text-decoration: none; line-height: 1.2;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); color: var(--on-brand); }
.btn-ghost { border-color: var(--brand); color: var(--brand-strong); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-strong); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.section-alt { background: var(--surface-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: 2.25rem; }
.eyebrow {
  font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand); margin-bottom: .6rem;
}
.lede { font-size: clamp(1.1rem, 1rem + .45vw, 1.3rem); color: var(--ink-muted); }

/* Hero */
.hero { padding-block: clamp(2.5rem, 1.5rem + 5vw, 5.5rem); }
.hero .wrap, .split {
  display: grid; gap: clamp(2rem, 4vw, 4rem); align-items: center;
  grid-template-columns: 1.1fr .9fr;
}
.split.reverse > :first-child { order: 2; }
@media (max-width: 860px) {
  .hero .wrap, .split { grid-template-columns: 1fr; }
  .split.reverse > :first-child { order: 0; }
}
.hero-art, .media {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow); overflow: hidden;
}
.hero-art img, .media img { width: 100%; }

/* Page hero (inner pages) */
.page-hero { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }

/* Trust strip */
.trust { border-block: 1px solid var(--line); background: var(--surface); }
.trust ul {
  list-style: none; margin: 0; padding: 1.1rem 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem 2rem;
}
.trust li { display: flex; gap: .65rem; align-items: center; font-weight: 600; font-size: .97rem; }
.trust svg { flex: none; color: var(--accent); }

/* Cards */
.cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); list-style: none; padding: 0; margin: 0; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.card img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--brand-soft); }
.card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable, one link in the a11y tree */
.card:hover { box-shadow: 0 2px 4px rgb(29 36 51 / .08), 0 14px 32px rgb(29 36 51 / .12); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.card h3 a:focus-visible { outline: none; }
.card .more { margin-top: auto; font-weight: 650; color: var(--brand); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-3px); } }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.steps li { counter-increment: step; padding: 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.steps li::before {
  content: counter(step); display: grid; place-items: center;
  width: 2.4rem; height: 2.4rem; margin-bottom: .9rem; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); font-weight: 700; font-family: var(--font-head); font-size: 1.15rem;
}
.steps h3 { margin-bottom: .35rem; }
.steps p { margin: 0; color: var(--ink-muted); }

/* Check lists */
.checks { list-style: none; padding: 0; display: grid; gap: .7rem; }
.checks li { position: relative; padding-left: 2rem; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2349587b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.5l3 3 6-7'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.checks.cols { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .7rem 2rem; }

/* Feature grid (benefits / values) */
.features { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.feature { padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-top: 4px solid var(--brand); }
.feature h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.feature p { margin: 0; color: var(--ink-muted); }

/* Testimonial */
.quote { margin: 0; padding: clamp(1.75rem, 4vw, 3rem); background: var(--surface); border-radius: calc(var(--radius) * 1.5); border: 1px solid var(--line); box-shadow: var(--shadow); }
.quote blockquote { margin: 0 0 1.25rem; font-family: var(--font-head); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); line-height: 1.4; }
.quote blockquote p { max-width: none; margin: 0; }
.quote blockquote p::before { content: "\201C"; color: var(--accent); }
.quote blockquote p::after { content: "\201D"; color: var(--accent); }
.quote figcaption { color: var(--ink-muted); }
.quote figcaption strong { color: var(--ink); }

/* CTA band */
.cta-band { background: var(--brand); color: var(--on-brand); border-radius: calc(var(--radius) * 1.5); padding: clamp(2rem, 5vw, 3.5rem); text-align: center; }
.cta-band h2, .cta-band p { color: inherit; margin-inline: auto; }
.cta-band .actions { justify-content: center; }
.cta-band .btn-primary { background: var(--on-brand); color: var(--brand-strong); }
.cta-band .btn-primary:hover { background: var(--brand-soft); }
.cta-band .btn-ghost { border-color: var(--on-brand); color: var(--on-brand); }
.cta-band .btn-ghost:hover { background: rgb(255 255 255 / .12); }
@media (prefers-color-scheme: dark) { .cta-band .btn-ghost:hover { background: rgb(0 0 0 / .12); } }

/* Profile (About) */
.profile { display: grid; grid-template-columns: minmax(0, 18rem) 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.profile img { border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow); aspect-ratio: 1; object-fit: cover; }
@media (max-width: 720px) { .profile { grid-template-columns: 1fr; } .profile img { max-width: 14rem; } }
.creds { list-style: none; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 1.25rem; }
.creds li { padding: .8rem 1rem; border-radius: 10px; background: var(--brand-soft); }
.creds strong { display: block; }
.creds span { font-size: .9rem; color: var(--ink-muted); }
figure { margin: 0; }
figure.media figcaption { padding: .8rem 1.1rem; font-size: .9rem; color: var(--ink-muted); border-top: 1px solid var(--line); }

.note { color: var(--ink-muted); font-size: .95rem; }

/* Prose (privacy) */
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.45rem; margin-top: 2.25rem; }
.prose h3 { font-size: 1.1rem; font-family: var(--font-body); margin-top: 1.25rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .3rem; }

/* ---------- Footer ---------- */

.site-footer { padding-block: 3rem 2rem; background: var(--surface-alt); border-top: 1px solid var(--line); font-size: .95rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-family: var(--font-body); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.site-footer address { font-style: normal; }
.site-footer .logo { width: 180px; margin-bottom: 1rem; }
.legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.legal p { margin: 0; max-width: none; }
.family-line { flex-basis: 100%; font-size: .9rem; }

@media print {
  .site-header, .site-footer, .cta-band, .skip { display: none; }
  body { background: #fff; color: #000; }
}
.flush-top { padding-top: 0; }
.split .features { grid-template-columns: 1fr; }

/* ---------- Contact ---------- */
/* One panel: form on the left, tinted "other ways" column on the right.
   Spacing scale: .5rem (label→input), 1.5rem (between fields), clamp(1.75–3rem) (panel padding). */
.contact-panel {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow); overflow: hidden;
}
.form, .contact-side { padding: clamp(1.75rem, 4vw, 3rem); }
.contact-side { background: var(--brand-soft); border-left: 1px solid var(--line); }
@media (max-width: 860px) {
  .contact-panel { grid-template-columns: 1fr; }
  .contact-side { border-left: 0; border-top: 1px solid var(--line); }
}

.panel-head { margin-bottom: 2rem; }
.panel-head h2 { font-size: clamp(1.4rem, 1.25rem + .6vw, 1.7rem); margin-bottom: .4rem; }
.panel-head p { margin: 0; color: var(--ink-muted); }

.form { display: flex; flex-direction: column; gap: 1.5rem; }
.form .panel-head { margin-bottom: .5rem; }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field label { font-weight: 650; line-height: 1.3; }
.field .hint { margin: -.15rem 0 0; }
.field label .opt { font-weight: 400; color: var(--ink-muted); }
.field input, .field textarea {
  width: 100%; font: inherit; line-height: 1.5; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--field-border); border-radius: 10px;
  padding: .75rem 1rem; min-height: 3.25rem;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 9.5rem; }
.field input:hover, .field textarea:hover { border-color: var(--ink-muted); }
.field input:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--focus);
}
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--danger); }
.form .btn { align-self: flex-start; border: 0; cursor: pointer; font: inherit; font-weight: 650; min-height: 3.25rem; padding-inline: 1.75rem; margin-top: .25rem; }
@media (max-width: 520px) { .form .btn { align-self: stretch; justify-content: center; } }
.hint { font-size: .9rem; line-height: 1.5; color: var(--ink-muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; gap: 1rem; align-items: flex-start; padding-block: 1.25rem; border-top: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.contact-list li:first-child { padding-top: 0; border-top: 0; }
.contact-list li:last-child { padding-bottom: 0; }
.contact-icon {
  flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgb(29 36 51 / .08);
}
.contact-icon svg { width: 1.25rem; height: 1.25rem; }
.contact-list h3 {
  font-family: var(--font-body); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted); margin: .1rem 0 .3rem;
}
.contact-list p { margin: 0; max-width: none; }
.contact-list a { font-weight: 600; overflow-wrap: anywhere; }
.contact-list .hint { margin-top: .4rem; }

.site-footer .label { font-size: .85rem; color: var(--ink-muted); }
address { font-style: normal; }
.page-hero:last-child { padding-bottom: clamp(3rem, 2rem + 4vw, 5.5rem); }
