:root {
  --paper: #faf8f4;
  --card: #ffffff;
  --ink-950: #17130f;
  --ink-800: #2c2620;
  --ink-600: #564d43;
  --ink-400: #8a8075;
  --border: rgba(23, 19, 15, 0.1);
  --border-strong: rgba(23, 19, 15, 0.16);
  --accent: #1f5c46;
  --accent-dark: #163f32;
  --accent-tint: #e8f1ec;
  --radius-control: 10px;
  --radius-card: 14px;
  --radius-panel: 18px;
  --max-width: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink-800);
  background: var(--paper);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, .serif {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  color: var(--ink-950);
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.label {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 12px;
}
.label.center { text-align: center; }

.section-title {
  font-size: clamp(24px, 2.6vw, 30px);
  margin: 0 0 16px;
  letter-spacing: -0.005em;
}
.section-title.center { text-align: center; }

/* Signature mark: a checked ledger entry, reused as the brand's one recurring detail */
.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid currentColor;
  flex: none;
}
.mark svg { width: 10px; height: 10px; display: block; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 19px;
  color: var(--ink-950);
  text-decoration: none;
}
.logo .mark { color: var(--accent); }
.main-nav { display: flex; gap: 28px; }
.main-nav a {
  color: var(--ink-600);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}
.main-nav a:hover { color: var(--ink-950); }
.nav-cta { font-size: 14px; padding: 10px 18px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-control);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--ink-950); color: var(--paper); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink-950); border: 1.5px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--ink-950); }

/* Hero */
.hero { padding: 72px 0 80px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.hero h1 .underline {
  position: relative;
  white-space: nowrap;
}
.hero h1 .underline svg {
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 10px;
  color: var(--accent);
}
.hero-sub { font-size: 17px; color: var(--ink-600); margin: 0 0 28px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero moment: a small rendered dashboard card, the one bright element on the page */
.moment-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 24px;
  box-shadow: 0 1px 2px rgba(23,19,15,0.04);
}
.moment-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.moment-head .title { font-size: 13px; font-weight: 500; color: var(--ink-600); }
.moment-head .period { font-size: 13px; color: var(--ink-400); font-family: 'IBM Plex Mono', 'SFMono-Regular', monospace; }
.moment-chart { width: 100%; height: auto; display: block; margin-bottom: 16px; }
.moment-stats { display: flex; gap: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.moment-stat { flex: 1; }
.moment-stat .k { font-size: 12px; color: var(--ink-400); margin-bottom: 4px; }
.moment-stat .v { font-size: 18px; font-weight: 600; color: var(--ink-950); font-family: 'Source Serif 4', serif; }
.moment-stat .v.positive { color: var(--accent); }
.moment-stat .delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent); margin-left: 6px; font-family: 'Inter', sans-serif; font-weight: 500; }

/* Trust bar */
.trust-bar { background: var(--ink-950); padding: 24px 0; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.trust-item {
  display: flex; flex-direction: column; gap: 4px;
  color: var(--paper); text-align: center;
  border-left: 1px solid rgba(250,248,244,0.14);
  padding-left: 20px;
}
.trust-item:first-child { border-left: none; padding-left: 0; }
.trust-item strong { font-size: 16px; font-weight: 500; }
.trust-item span { font-size: 13px; color: rgba(250,248,244,0.55); }

/* Services */
.services { padding: 88px 0; }
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 36px; }
.service-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 28px; }
.service-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-600);
  margin-bottom: 16px;
}
.service-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.service-card h3 { margin: 0 0 8px; font-size: 18px; }
.service-card p { margin: 0; color: var(--ink-600); font-size: 15px; }

/* About */
.about { padding: 88px 0; background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.about-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about-text p { color: var(--ink-600); font-size: 16px; }
.about-card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; }
.about-card h3 { margin: 0 0 14px; font-size: 16px; }
.about-card ul { margin: 0; padding: 0; list-style: none; color: var(--ink-600); font-size: 15px; }
.about-card li { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.about-card li .mark { color: var(--accent); }

/* Contact */
.contact { padding: 88px 0; }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.contact-lead { color: var(--ink-600); font-size: 16px; }
.contact-card { background: var(--ink-950); color: var(--paper); border-radius: var(--radius-panel); padding: 32px; }
.contact-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.contact-label { font-size: 12px; color: rgba(250,248,244,0.55); }
.contact-row a, .contact-row span { color: var(--paper); text-decoration: none; font-size: 16px; font-weight: 500; }
.contact-btn { margin-top: 6px; background: var(--paper); color: var(--ink-950); }
.contact-btn:hover { background: #fff; }

/* Footer */
.site-footer { padding: 24px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--ink-400); }
.footer-inner a { color: var(--ink-400); }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: 1fr; }
  .about-inner, .contact-inner { grid-template-columns: 1fr; }
}

/* ---------- Multi-page additions ---------- */
a { color: inherit; }
.main-nav a[aria-current="page"] { color: var(--ink-950); }
.nav-toggle {
  display: none;
  background: none; border: 1.5px solid var(--border-strong); border-radius: var(--radius-control);
  width: 42px; height: 42px; padding: 0; cursor: pointer; color: var(--ink-950);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 500; font-size: 15px; text-decoration: none;
}
.text-link:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

a.service-card { display: block; text-decoration: none; color: inherit; transition: border-color .15s ease; }
a.service-card:hover { border-color: var(--ink-400); }
.service-card .text-link { margin-top: 14px; }

/* Page hero (inner pages) */
.page-hero { padding: 56px 0 56px; border-bottom: 1px solid var(--border); }
.breadcrumb { font-size: 13px; color: var(--ink-400); margin: 0 0 24px; }
.breadcrumb a { color: var(--ink-600); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink-950); text-decoration: underline; }
.breadcrumb span[aria-hidden] { margin: 0 8px; }
.page-hero h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.16; letter-spacing: -0.01em; margin: 0 0 16px; max-width: 760px; }
.page-hero .lead { font-size: 18px; color: var(--ink-600); max-width: 640px; margin: 0 0 28px; }

.section { padding: 72px 0; }
.section.alt { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-intro { color: var(--ink-600); font-size: 16px; max-width: 640px; margin: 0 0 32px; }

/* Checklist of what a mission includes */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; color: var(--ink-800); }
.checklist .mark { color: var(--accent); margin-top: 3px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.prose p { color: var(--ink-600); font-size: 16px; margin: 0 0 14px; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.steps.four { grid-template-columns: repeat(4, 1fr); }
.steps li { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; counter-increment: step; }
.section:not(.alt) .steps li { background: var(--card); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-family: 'IBM Plex Mono', 'SFMono-Regular', monospace; font-size: 13px; color: var(--accent); margin-bottom: 10px;
}
.steps h3 { font-size: 17px; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--ink-600); font-size: 15px; }

/* Values */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.value { border-top: 2px solid var(--ink-950); padding-top: 16px; }
.value h3 { font-size: 18px; margin: 0 0 8px; }
.value p { margin: 0; color: var(--ink-600); font-size: 15px; }

/* FAQ */
.faq { max-width: 760px; border-top: 1px solid var(--border-strong); }
.faq details { border-bottom: 1px solid var(--border-strong); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 36px 20px 0; position: relative;
  font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; font-size: 17px; color: var(--ink-950);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 1.5px solid var(--ink-600); border-bottom: 1.5px solid var(--ink-600); transform: rotate(45deg); transition: transform .15s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { margin: 0 0 20px; color: var(--ink-600); font-size: 15px; max-width: 680px; }
.faq details p a { color: var(--accent-dark); }

/* CTA band */
.cta-band { background: var(--ink-950); color: var(--paper); border-radius: var(--radius-panel); padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: var(--paper); font-size: clamp(22px, 2.4vw, 28px); margin: 0 0 6px; }
.cta-band p { margin: 0; color: rgba(250,248,244,0.65); font-size: 15px; }
.cta-band .btn { background: var(--paper); color: var(--ink-950); }
.cta-band .btn:hover { background: #fff; }

/* Related services */
.related { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.related a { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 20px; text-decoration: none; transition: border-color .15s ease; }
.related a:hover { border-color: var(--ink-400); }
.related strong { display: block; font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; color: var(--ink-950); font-size: 16px; margin-bottom: 4px; }
.related span { color: var(--ink-600); font-size: 14px; }

.facts { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; }
.facts h3 { margin: 0 0 14px; font-size: 16px; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 15px; }
.facts dt { color: var(--ink-400); }
.facts dd { margin: 0; color: var(--ink-800); }

/* Contact form */
.contact-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-panel); padding: 32px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 500; color: var(--ink-800); }
.field .opt { color: var(--ink-400); font-weight: 400; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 15px; color: var(--ink-950);
  background: var(--paper); border: 1.5px solid var(--border-strong); border-radius: var(--radius-control);
  padding: 11px 13px; width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-600); }
.consent input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.form-actions .btn { border: none; cursor: pointer; font-family: inherit; }
.form-actions .btn[disabled] { opacity: .6; cursor: wait; }
.form-note { font-size: 13px; color: var(--ink-400); }
.form-status { display: none; border-radius: var(--radius-control); padding: 14px 16px; font-size: 15px; margin-bottom: 20px; }
.form-status.show { display: block; }
.form-status.ok { background: var(--accent-tint); color: var(--accent-dark); }
.form-status.err { background: #f8e9e6; color: #8a2a1b; }
.form-status a { color: inherit; font-weight: 600; }
.side-card { background: var(--ink-950); color: var(--paper); border-radius: var(--radius-panel); padding: 32px; }
.side-card h2 { color: var(--paper); font-size: 20px; margin: 0 0 18px; }
.side-card p { color: rgba(250,248,244,0.65); font-size: 14px; margin: 18px 0 0; }

/* Footer (expanded) */
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 48px 0 36px; }
.footer-grid h2 { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; color: var(--ink-950); margin: 0 0 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--ink-600); text-decoration: none; font-size: 14px; }
.footer-grid a:hover { color: var(--ink-950); text-decoration: underline; }
.footer-grid p { color: var(--ink-600); font-size: 14px; margin: 10px 0 0; max-width: 280px; }
.site-footer.full { padding: 0; }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; font-size: 13px; color: var(--ink-400); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-header.open .main-nav {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--border); padding: 8px 24px 16px;
  }
  .site-header.open .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 16px; }
  .site-header.open .main-nav a:last-child { border-bottom: none; }
  .checklist, .split, .steps, .steps.four, .values, .related, .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { padding: 32px 24px; }
  .section { padding: 56px 0; }
}
@media (max-width: 560px) {
  .nav-cta { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: 22px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Example dashboards ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dash-disclaimer { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-400); margin: -16px 0 28px; }
.chip { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--accent-dark); background: var(--accent-tint); border-radius: 999px; padding: 3px 10px; }
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; }
.dash-card { position: relative; margin: 0; background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px 24px 20px; min-width: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-title { display: block; font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; font-size: 17px; color: var(--ink-950); }
.dash-sub { display: block; font-size: 13px; color: var(--ink-400); margin-top: 2px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-600); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.lk { display: inline-block; }
.lk.line { width: 18px; height: 0; border-top: 2.5px solid #2a7a5a; }
.lk.line.dash { border-top: 2px dashed #a0948a; }
.lk.line.dash.ink { border-top-color: #17130f; }
.lk.box { width: 11px; height: 11px; border-radius: 3px; background: #2a7a5a; }
.chart-svg { width: 100%; }
.chart-svg svg { display: block; overflow: visible; }
.chart-svg svg [tabindex]:focus { outline: none; }
.chart-svg svg [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.kpi-stack { display: grid; gap: 20px; }
.kpi { display: flex; flex-direction: column; }
.kpi-title { font-size: 13px; font-weight: 500; color: var(--ink-600); }
.kpi-value { font-family: 'Source Serif 4', Georgia, serif; font-weight: 600; font-size: 40px; line-height: 1.1; color: var(--ink-950); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 18px; color: var(--ink-600); }
.kpi-delta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--accent-dark); margin: 6px 0 10px; }
.kpi-delta svg { width: 14px; height: 14px; }
.chart-svg.spark { margin-top: auto; }
.kpi-note { font-size: 13px; color: var(--ink-400); margin: 10px 0 0; }
.dash-hint { font-size: 13px; color: var(--ink-400); margin: 16px 0 0; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 150px;
  background: var(--ink-950); color: var(--paper); border-radius: 10px; padding: 10px 12px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(23,19,15,0.18); opacity: 0; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease;
}
.chart-tip.show { opacity: 1; transform: none; }
.tip-title { font-size: 12px; color: rgba(250,248,244,0.6); margin-bottom: 6px; }
.tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.tip-row strong { font-weight: 600; }
.tip-row span:last-child { color: rgba(250,248,244,0.6); }
.tip-key { width: 14px; height: 0; border-top: 2.5px solid; }
.tip-key.dash { border-top-style: dashed; border-top-width: 2px; }
.chart-tip .tip-key[style*="rgb(23, 19, 15)"] { border-color: #f2ede4 !important; }
@media (max-width: 900px) {
  .span-8, .span-6, .span-4 { grid-column: 1 / -1; }
  .kpi-stack { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .kpi-stack { grid-template-columns: 1fr; } .dash-card { padding: 20px 16px 16px; } }

/* ---------- Motion ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 60; pointer-events: none; }
.site-header { transition: box-shadow .25s ease, background-color .25s ease; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(23,19,15,0.06); }
.hero-pulse { opacity: 0; transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: no-preference) {
  :root { interpolate-size: allow-keywords; }

  /* Page-to-page transitions (browsers that support cross-document view transitions) */
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(root) { animation: vt-out .22s ease both; }
  ::view-transition-new(root) { animation: vt-in .5s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

  /* Scroll reveal: hidden only once JS has flagged the page (class "js" on <html>) */
  .js :is(.section-title, .section-intro, .label, .dash-disclaimer, .service-card, .steps li, .value, .checklist li,
          .faq details, .related a, .facts, .cta-band, .trust-item, .about-card, .about-text > *, .form-card, .side-card,
          .page-hero .container > *, .dash-card, .prose p, .legal > *, .dash-hint, .footer-grid > div, .flow):not(.in):not(.hero *) {
    opacity: 0; transform: translateY(12px);
  }
  .js .in {
    opacity: 1; transform: none;
    transition: opacity .7s ease, transform .8s cubic-bezier(.2,.7,.2,1), border-color .2s ease, box-shadow .25s ease;
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .js .in.settled { transition-delay: 0s; }

  /* Hero entrance */
  .hero-inner > div > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
  .hero-inner > div > :nth-child(2) { animation-delay: .08s; }
  .hero-inner > div > :nth-child(3) { animation-delay: .16s; }
  .hero-inner > div > :nth-child(4) { animation-delay: .24s; }
  .moment-card { animation: rise 1s .2s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); } }
  .hero h1 .underline svg path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.1s .7s ease-out forwards; }
  .hero-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2s .6s cubic-bezier(.4,0,.2,1) forwards; }
  .hero-area { opacity: 0; animation: fade 1s 1.6s ease forwards; }
  .hero-dot { opacity: 0; animation: fade .3s 2.5s ease forwards; }
  .hero-pulse { animation: pulse 1.2s 2.6s ease-out 1 both; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fade { to { opacity: 1; } }
  @keyframes pulse { 0% { opacity: .35; transform: scale(.5); } 80%, 100% { opacity: 0; transform: scale(2.2); } }
  .chart-svg .pulse { opacity: 0; }

  /* Hover micro-interactions */
  .btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
  .btn:active { transform: translateY(0) scale(.98); }
  a.service-card.in:hover, .related a.in:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23,19,15,0.06); transition-delay: 0s; }
  .service-icon { transition: color .2s ease; }
  a.service-card:hover .service-icon { color: var(--accent); }
  .text-link svg { transition: transform .2s ease; }
  a:hover > .text-link svg, .text-link:hover svg { transform: translateX(4px); }
  .main-nav a { position: relative; }
  .main-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
  .main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
  .steps li::before { transition: color .2s ease; }

  /* FAQ open/close (browsers supporting ::details-content) */
  .faq details::details-content { height: 0; overflow: clip; transition: height .35s ease, content-visibility .35s allow-discrete; }
  .faq details[open]::details-content { height: auto; }

  /* Mobile menu */
  .site-header.open .main-nav { animation: menu-in .25s ease both; }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
}
@media (max-width: 900px) { .main-nav a::after { display: none; } }

/* ---------- Service pages: Pourquoi / Comment graphics ---------- */
.lk.box.ref { background: #a0948a; }
.why-card { background: var(--card); padding: 28px 28px 24px; }
.section.alt .why-card { background: var(--paper); }
.chart-notes { list-style: none; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.chart-notes li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-600); }
.note-n { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-950); color: var(--paper); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.why-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-400); margin: 16px 0 0; }

/* Flow diagrams (base) */
.flow { position: relative; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 16px; }
.flow-steps li { position: relative; min-width: 0; }
.flow-steps h3 { font-size: 16px; margin: 16px 0 4px; }
.flow-steps p { margin: 0; font-size: 14px; color: var(--ink-600); }
.flow-mark {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--accent); background: var(--paper); color: var(--accent);
}
.section.how .flow-mark { background: var(--paper); }
.flow-mark svg { width: 14px; height: 14px; }
.flow-mark path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.flow-steps li::before {
  content: ""; position: absolute; top: 13px; left: 28px; right: -16px; height: 1.5px; background: var(--border-strong);
  transform-origin: 0 50%;
}
.flow-steps li:last-child::before { display: none; }
.flow-caption { font-size: 14px; color: var(--ink-400); margin: 16px 0 0; }

/* Cycle: return arrow from last step back to first */
.flow-cycle .flow-return {
  position: relative; height: 28px; margin: 16px calc((100% - 48px) / 4 - 14px) 0 14px; color: var(--accent);
  border: 1.5px solid currentColor; border-top: 0; border-radius: 0 0 12px 12px;
}
.flow-return-head { position: absolute; left: -6px; top: -8px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 7px solid currentColor; }

/* Funnel: bands narrow from raw data to decisions */
.flow-funnel .flow-steps { gap: 0; }
.flow-funnel .flow-steps li { padding-right: 16px; }
.flow-funnel .flow-steps li::before {
  display: block; top: 0; left: 0; right: 0; height: 96px;
  background: var(--accent); opacity: calc(0.1 + var(--i) * 0.05); transform-origin: 0 50%;
  clip-path: polygon(0 var(--a), 100% var(--b), 100% calc(100% - var(--b)), 0 calc(100% - var(--a)));
}
.flow-funnel .flow-steps li:nth-child(1) { --a: 0%; --b: 9%; }
.flow-funnel .flow-steps li:nth-child(2) { --a: 9%; --b: 18%; }
.flow-funnel .flow-steps li:nth-child(3) { --a: 18%; --b: 27%; }
.flow-funnel .flow-steps li:nth-child(4) { --a: 27%; --b: 30%; }
.flow-funnel .flow-steps li:nth-child(5) { --a: 30%; --b: 30%; }
.flow-funnel .flow-mark { margin: 34px 0 34px 16px; }
.flow-funnel .flow-steps h3 { margin-top: 12px; }
.flow-funnel .flow-steps h3, .flow-funnel .flow-steps p { padding-left: 16px; }

/* Roadmap: three phases over six steps */
.road-phases { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 16px; margin-bottom: 20px; }
.road-phases span { font-size: 13px; font-weight: 500; color: var(--accent-dark); padding-top: 8px; border-top: 2px solid var(--accent); }

/* Calendar: true-date track, then the steps */
.cal-track { position: relative; height: 56px; margin: 0 0 24px; }
.cal-track::before, .cal-fill { content: ""; position: absolute; left: 0; right: 0; top: 27px; height: 2px; background: var(--border-strong); border-radius: 2px; }
.cal-fill { background: var(--accent); transform-origin: 0 50%; }
.cal-dot {
  position: absolute; left: var(--x); top: 16px; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--paper);
}
.cal-month { position: absolute; left: var(--x); top: 40px; transform: translateX(-50%); font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-400); white-space: nowrap; }
.cal-month[style*="--x:0%"] { transform: none; }
.cal-month.end { transform: translateX(-100%); }
.cal-month::before { content: ""; position: absolute; left: 50%; top: -15px; width: 1.5px; height: 8px; background: var(--ink-400); }
.cal-month[style*="--x:0%"]::before { left: 0; } .cal-month.end::before { left: auto; right: 0; }
.flow-calendar .flow-steps li::before { display: none; }
.cal-day { display: flex; align-items: center; gap: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink-600); margin-bottom: 12px; }
.cal-day b { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-family: 'Inter', sans-serif; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.flow-calendar .flow-mark { display: none; }
.flow-calendar .flow-steps h3 { margin-top: 0; }

@media (max-width: 900px) {
  .flow-steps { grid-auto-flow: row; grid-auto-columns: auto; gap: 24px; }
  .flow-steps li { display: grid; grid-template-columns: 28px 1fr; column-gap: 16px; }
  .flow-steps li > :not(.flow-mark) { grid-column: 2; }
  .flow-steps li .flow-mark { grid-row: 1 / span 2; }
  .flow-steps h3 { margin-top: 2px; }
  .flow-steps li::before { top: 28px; bottom: -24px; left: 13px; right: auto; width: 1.5px; height: auto; transform-origin: 50% 0; }
  .flow-cycle .flow-return { display: none; }
  .flow-funnel .flow-steps { gap: 8px; }
  .flow-funnel .flow-steps li { padding-right: 0; grid-template-columns: 1fr; }
  .flow-funnel .flow-steps li::before { top: 0; bottom: auto; left: 0; right: auto; height: 44px; width: calc(100% - 2 * var(--a)); border-radius: 8px; clip-path: none; transform-origin: 0 50%; }
  .flow-funnel .flow-mark { margin: 8px 0 0 8px; grid-row: auto; }
  .flow-funnel .flow-steps li > * { grid-column: 1; }
  .flow-funnel .flow-steps h3, .flow-funnel .flow-steps p { padding-left: 0; }
  .road-phases { display: none; }
  .cal-track { display: none; }
  .flow-calendar .flow-steps li { grid-template-columns: 1fr; }
  .flow-calendar .flow-steps li > * { grid-column: 1; }
  .why-card { padding: 20px 16px 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .js .flow:not(.in) :is(.flow-steps h3, .flow-steps p, .cal-day, .road-phases span, .flow-caption) { opacity: 0; transform: translateY(8px); }
  .js .flow.in :is(.flow-steps h3, .flow-steps p, .cal-day, .road-phases span, .flow-caption) { transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 180ms + 250ms); }
  .js .flow .road-phases span:first-child { --i: 0; }
  .js .flow.in .road-phases span:nth-child(2) { --i: 2; } .js .flow.in .road-phases span:nth-child(3) { --i: 4; }
  .js .flow.in .flow-caption { transition-delay: 1.3s; }
  .js .flow:not(.in) .flow-mark { border-color: var(--border-strong); }
  .js .flow .flow-mark { transition: border-color .3s ease; transition-delay: calc(var(--i, 0) * 180ms + 100ms); }
  .js .flow:not(.in) .flow-mark path { stroke-dashoffset: 1; }
  .js .flow.in .flow-mark path { transition: stroke-dashoffset .4s ease-out; transition-delay: calc(var(--i, 0) * 180ms + 200ms); }
  .js .flow:not(.in) .flow-steps li::before { transform: scaleX(0); }
  .js .flow.in .flow-steps li::before { transition: transform .5s ease-out; transition-delay: calc(var(--i, 0) * 180ms + 350ms); }
  .js .flow-funnel:not(.in) .flow-steps li::before { transform: scaleX(0); }
  .js .flow:not(.in) .flow-return { clip-path: inset(0 0 0 100%); }
  .js .flow.in .flow-return { clip-path: inset(-10px -10px -10px -10px); transition: clip-path 1s ease-in-out .95s; }
  .js .flow:not(.in) .cal-fill { transform: scaleX(0); }
  .js .flow.in .cal-fill { transition: transform 1.4s cubic-bezier(.4,0,.2,1) .2s; }
  .js .flow:not(.in) .cal-dot { opacity: 0; transform: translateX(-50%) scale(.6); }
  .js .flow.in .cal-dot { transition: opacity .3s ease, transform .3s ease; transition-delay: calc(var(--i) * 250ms + 300ms); }
  @media (max-width: 900px) {
    .js .flow:not(.in) .flow-steps li::before { transform: scaleY(0); }
    .js .flow-funnel:not(.in) .flow-steps li::before { transform: scaleX(0); }
  }
}

/* Featured service (accounting) on the homepage */
a.service-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 34px 1fr; column-gap: 20px; align-items: start; background: var(--card); border-color: var(--border-strong); }
a.service-card.featured .service-icon { color: var(--accent); margin: 2px 0 0; }
a.service-card.featured h3 { font-size: 20px; }
a.service-card.featured p { max-width: 640px; }
@media (max-width: 1100px) { .related { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { a.service-card.featured { grid-template-columns: 1fr; } a.service-card.featured .service-icon { margin-bottom: 16px; } }
@media (max-width: 560px) { .related { grid-template-columns: 1fr; } }
