/* ==========================================================================
   Abacus Accounting Oy — site stylesheet
   Design language: "counting house" — parchment, ink, ruled ledger lines,
   an oxblood margin rule and a verdigris reserved exclusively for facts that
   have been verified against a public register.

   No webfonts, no CDN, no third-party request of any kind: the privacy policy
   claims zero external requests and this file is part of why that is true.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --paper:        #f7f3ea;
  --paper-raised: #fffdf8;
  --paper-sunk:   #efe9dc;
  --ink:          #16191c;
  --ink-soft:     #4c545b;
  --ink-faint:    #757e86;
  --rule:         #ded5c4;
  --rule-strong:  #c8bda6;
  --accent:       #9b3a2c;   /* oxblood — bead lacquer, margin rule */
  --accent-soft:  #f0e0da;
  --verified:     #2e6b5e;   /* verdigris — verified register facts only */
  --verified-soft:#dcebe6;
  --brass:        #a97f36;
  --focus:        #1f5fa8;

  --font-display: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --font-body:    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --wrap:      74rem;
  --wrap-text: 46rem;
  --radius:    3px;
  --shadow:    0 1px 2px rgba(22, 25, 28, .05), 0 12px 28px -20px rgba(22, 25, 28, .35);

  --step--1: clamp(.82rem, .8rem + .1vw, .88rem);
  --step-0:  clamp(1rem, .97rem + .16vw, 1.075rem);
  --step-1:  clamp(1.16rem, 1.1rem + .3vw, 1.35rem);
  --step-2:  clamp(1.4rem, 1.28rem + .6vw, 1.8rem);
  --step-3:  clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
  --step-4:  clamp(2.1rem, 1.65rem + 2.2vw, 3.4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #14171a;
    --paper-raised: #1b1f23;
    --paper-sunk:   #101316;
    --ink:          #eee8dc;
    --ink-soft:     #b3aca1;
    --ink-faint:    #8d867c;
    --rule:         #2f353b;
    --rule-strong:  #414951;
    --accent:       #e0836f;
    --accent-soft:  #3a2320;
    --verified:     #6fc0ac;
    --verified-soft:#17302b;
    --brass:        #d3a85c;
    --focus:        #77b0ee;
    --shadow:       0 1px 2px rgba(0, 0, 0, .4), 0 14px 30px -22px rgba(0, 0, 0, .9);
  }
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  overflow-wrap: break-word;
  /* faint ledger ruling, drawn not downloaded */
  background-image: linear-gradient(to bottom, transparent calc(2.2rem - 1px), color-mix(in srgb, var(--rule) 28%, transparent) 2.2rem);
  background-size: 100% 2.2rem;
  background-attachment: fixed;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  body { background-image: none; }
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.012em;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p  { margin: 0 0 1.1em; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

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

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--paper);
  padding: .7rem 1.1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
@media (max-width: 30rem) { .wrap { width: min(100% - 1.75rem, var(--wrap)); } }

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--sunk { background: var(--paper-sunk); border-block: 1px solid var(--rule); }

.prose { max-width: var(--wrap-text); }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.15rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent); }

.grid { display: grid; gap: clamp(1.1rem, 2.4vw, 2rem); }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(16.5rem, 100%), 1fr)); }

.stack > * + * { margin-top: 1rem; }
.text-center { text-align: center; }

/* --------------------------------------------------------------------------
   4. Small components
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .9rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--rule-strong);
}

.lead { font-size: var(--step-1); color: var(--ink-soft); max-width: 40ch; }
.muted { color: var(--ink-soft); }
.small { font-size: var(--step--1); }
.mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.break-anywhere { overflow-wrap: anywhere; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .78rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: .04em;
  padding: .25rem .6rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--ink-soft);
}
.tag--verified { color: var(--verified); border-color: var(--verified); background: var(--verified-soft); }
.tag--verified::before {
  content: "";
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--verified);
}

.panel {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2.4vw, 1.9rem);
  min-width: 0;
  box-shadow: var(--shadow);
}
.panel--flat { box-shadow: none; }
.panel--quiet { background: transparent; box-shadow: none; }

/* A note in the oxblood margin — used for standing legal disclosures. */
.disclosure {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: .95rem 1.15rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.disclosure strong { color: var(--ink); }

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

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.identity-bar {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .04em;
}
.identity-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.4rem;
  padding-block: .45rem;
}
.identity-bar span { white-space: nowrap; }
.identity-bar b { font-weight: 600; color: #fff; }
@media (prefers-color-scheme: dark) {
  .identity-bar { background: #0b0d0f; color: var(--ink-soft); }
  .identity-bar b { color: var(--ink); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
@supports not (backdrop-filter: blur(4px)) { .site-header { background: var(--paper); } }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .85rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: inherit;
}
.brand svg { flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* CSS-only navigation disclosure: works with JavaScript disabled. */
.nav-switch { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nav-switch-label {
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .55rem .85rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
}
.nav-switch:focus-visible + .nav-switch-label { outline: 2px solid var(--focus); outline-offset: 3px; }

.site-nav { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.8rem); }
.site-nav a {
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .01em;
  padding-block: .3rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover { border-bottom-color: var(--accent); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); }
.site-nav .btn { color: var(--paper); }
.site-nav .btn:hover { color: #fff; border-bottom-color: transparent; }

@media (max-width: 56rem) {
  .nav-switch-label { display: inline-flex; }
  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: .5rem;
    border-top: 1px solid var(--rule);
  }
  .nav-switch:checked ~ .site-nav { display: flex; }
  .site-nav a:not(.btn) {
    display: block;
    padding: .7rem .2rem;
    border-bottom: 1px solid var(--rule);
  }
  .site-nav a:not(.btn)[aria-current="page"] { border-bottom-color: var(--rule); }
  .site-nav .btn { margin-top: .8rem; justify-content: center; }
}

/* --------------------------------------------------------------------------
   6. Hero + ledger card (signature device)
   -------------------------------------------------------------------------- */
.hero { padding-block: clamp(2.75rem, 6vw, 5rem) clamp(3rem, 7vw, 5.5rem); }
.hero-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: start;
}
@media (max-width: 62rem) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

.hero h1 { margin-bottom: .5em; }
.hero .lead { max-width: 34ch; }

.hero-since {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.hero-since b {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--ink);
  font-weight: 600;
  line-height: 1;
}

/* The ledger card: a bound page with a red margin rule. */
.ledger {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.5rem 1.35rem 2.5rem;
  overflow: hidden;
}
.ledger::before {
  content: "";
  position: absolute;
  inset-block: 0;
  left: 1.5rem;
  width: 1px;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .ledger::before { background: var(--accent); }
}
.ledger-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  padding-bottom: .8rem;
  margin-bottom: .4rem;
  border-bottom: 1px solid var(--rule);
}
.ledger-title {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}
.ledger-rows { margin: 0; }
.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .35rem 1rem;
  align-items: baseline;
  padding-block: .62rem;
  border-bottom: 1px dotted var(--rule);
}
.ledger-row:last-of-type { border-bottom: 0; }
.ledger-row dt { color: var(--ink-soft); font-size: var(--step--1); }
.ledger-row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .93rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}
.ledger-foot {
  margin-top: .9rem;
  padding-top: .85rem;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: .85rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  justify-content: space-between;
}
.ledger-foot a { color: var(--verified); }

/* --------------------------------------------------------------------------
   7. Service cards
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  min-width: 0;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  transition: border-top-color .15s ease, transform .15s ease;
}
.card:hover { border-top-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0; font-size: var(--step-1); }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.card-index {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  letter-spacing: .1em;
}
.card-link {
  margin-top: auto;
  padding-top: .6rem;
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}
.card-link:hover { text-decoration: underline; }

/* Numbered process list */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1.4rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  flex: none;
}
.steps h3 { margin: 0 0 .25rem; font-size: var(--step-0); font-family: var(--font-body); font-weight: 700; }
.steps p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Service detail blocks on services.php */
.service-block { scroll-margin-top: 6rem; }
.service-block + .service-block { margin-top: clamp(2.5rem, 5vw, 4rem); }
.service-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .8rem; margin-bottom: .8rem; }
.service-head h2 { margin: 0; }
.service-list { columns: 2; column-gap: 2.2rem; padding-left: 1.1rem; margin: 1.2rem 0 0; }
@media (max-width: 44rem) { .service-list { columns: 1; } }
.service-list li { break-inside: avoid; margin-bottom: .5em; }
.service-list li::marker { color: var(--accent); }

/* Statutory figures table */
.figures { width: 100%; border-collapse: collapse; font-size: .95rem; }
.figures caption { text-align: left; color: var(--ink-faint); font-size: var(--step--1); padding-bottom: .7rem; }
.figures th, .figures td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.figures thead th { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.figures td.value { font-family: var(--font-mono); white-space: nowrap; color: var(--ink); }
.table-scroll { overflow-x: auto; }

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: var(--step--1); color: var(--ink-faint); }
.field .req { color: var(--accent); }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: .68rem .8rem;
  width: 100%;
  min-width: 0;
}
textarea { min-height: 9rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--accent); background: var(--accent-soft); }

.error-text { color: var(--accent); font-size: var(--step--1); font-weight: 600; }

.checkbox {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .7rem;
  align-items: start;
  font-size: .95rem;
  color: var(--ink-soft);
}
.checkbox input { margin-top: .3rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert {
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  background: var(--paper-raised);
}
.alert--ok { border-left-color: var(--verified); background: var(--verified-soft); }
.alert h2, .alert h3 { margin-top: 0; }

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--paper-sunk);
  border-top: 1px solid var(--rule-strong);
  padding-block: clamp(2.5rem, 5vw, 3.75rem) 1.75rem;
  margin-top: clamp(3rem, 7vw, 5rem);
  font-size: .95rem;
}
.footer-grid {
  display: grid;
  gap: clamp(1.6rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
}
.footer-grid > * { min-width: 0; }
.footer-grid h2 {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 .9rem;
}
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer-list a { text-decoration: none; }
.footer-list a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

.legal-block {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-strong);
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.legal-block > * { min-width: 0; }
.legal-block dt { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.legal-block dd { margin: 0 0 .6rem; font-family: var(--font-mono); overflow-wrap: anywhere; }
.legal-block dd:last-child { margin-bottom: 0; }

.footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.5rem;
  justify-content: space-between;
  font-size: var(--step--1);
  color: var(--ink-faint);
}

/* Site notice (no cookie: dismissal is stored in localStorage) */
.notice {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step--1);
}
.notice .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; padding-block: .7rem; }
.notice p { margin: 0; flex: 1 1 22rem; }
.notice a { color: #fff; }
.notice button {
  font: inherit;
  font-weight: 600;
  background: transparent;
  color: var(--paper);
  border: 1px solid color-mix(in srgb, var(--paper) 45%, transparent);
  border-radius: var(--radius);
  padding: .35rem .9rem;
  cursor: pointer;
}
.notice button:hover { background: var(--paper); color: var(--ink); }
@media (prefers-color-scheme: dark) { .notice { background: #0b0d0f; } }

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

@media print {
  .site-header, .site-nav, .notice, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .ledger, .card { box-shadow: none; border-color: #999; }
}

/* Brand mark: beads take the oxblood accent, frame and rails inherit text colour. */
.brand svg .bead { fill: var(--accent); }

/* Type-scale utilities for headings that must stay semantic but read smaller. */
.h3 { font-size: var(--step-1); }
.text-center .lead { margin-inline: auto; }
.text-center .btn-row { justify-content: center; }

/* ==========================================================================
   11. Motion
   --------------------------------------------------------------------------
   Rules this section obeys, in order of importance:

   1. No animation may be load-bearing for content. Everything below is scoped
      to `.js-reveal`, a class added by a hashed inline script before first
      paint and removed again by a failsafe if site.js never runs. With
      JavaScript off nothing here applies and every element is simply visible.
   2. `prefers-reduced-motion: reduce` switches this section off rather than
      merely shortening it — and leaves nothing hidden or displaced.
   3. Motion is short (180-520ms), moves things a few pixels, and never loops
      in the reader's peripheral vision while they are reading a number.
   ========================================================================== */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rule-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes bead-slide {
  from { transform: translateX(-7px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes margin-draw {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes notice-in {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

/* The abacus beads settle into place once, on load. */
.js-reveal .brand svg .bead rect {
  animation: bead-slide .5s cubic-bezier(.22, .61, .36, 1) both;
}
.js-reveal .brand svg .bead rect:nth-child(2) { animation-delay: .06s; }
.js-reveal .brand svg .bead rect:nth-child(3) { animation-delay: .12s; }
.js-reveal .brand svg .bead rect:nth-child(4) { animation-delay: .18s; }
.js-reveal .brand svg .bead rect:nth-child(5) { animation-delay: .24s; }
.js-reveal .brand svg .bead rect:nth-child(6) { animation-delay: .30s; }

/* Above-the-fold content animates on load; the rest waits for the observer. */
.js-reveal .hero .eyebrow,
.js-reveal .hero h1,
.js-reveal .hero .lead,
.js-reveal .hero .btn-row,
.js-reveal .hero-since,
.js-reveal .hero .ledger {
  animation: rise-in .52s cubic-bezier(.22, .61, .36, 1) both;
}
.js-reveal .hero h1        { animation-delay: .05s; }
.js-reveal .hero .lead     { animation-delay: .12s; }
.js-reveal .hero .btn-row  { animation-delay: .19s; }
.js-reveal .hero-since     { animation-delay: .26s; }
.js-reveal .hero .ledger   { animation-delay: .16s; }

/* The ledger's oxblood margin rule draws itself down the card. */
.js-reveal .ledger::before {
  transform-origin: top;
  animation: margin-draw .7s cubic-bezier(.22, .61, .36, 1) .35s both;
}

/* --- scroll reveal -------------------------------------------------------- */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s cubic-bezier(.22, .61, .36, 1),
              transform .5s cubic-bezier(.22, .61, .36, 1);
}
.js-reveal [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}
/* Cards and steps arrive in sequence rather than as a block. */
.js-reveal [data-reveal][data-reveal-index="1"] { transition-delay: .07s; }
.js-reveal [data-reveal][data-reveal-index="2"] { transition-delay: .14s; }
.js-reveal [data-reveal][data-reveal-index="3"] { transition-delay: .21s; }
.js-reveal [data-reveal][data-reveal-index="4"] { transition-delay: .28s; }
.js-reveal [data-reveal][data-reveal-index="5"] { transition-delay: .35s; }

/* A section's eyebrow rule extends as the section comes into view. */
.js-reveal .eyebrow::after {
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .6s cubic-bezier(.22, .61, .36, 1) .1s;
}
.js-reveal .eyebrow.is-revealed::after { transform: scaleX(1); }
.js-reveal .hero .eyebrow::after { animation: rule-draw .8s cubic-bezier(.22, .61, .36, 1) .2s both; }

/* --- interaction ---------------------------------------------------------- */
.btn:active { transform: translateY(1px); }

.site-nav a:not(.btn) { position: relative; }
.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s cubic-bezier(.22, .61, .36, 1);
}
.site-nav a:not(.btn):hover::after,
.site-nav a:not(.btn):focus-visible::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (max-width: 56rem) {
  .site-nav a:not(.btn)::after { display: none; }
}

.card-link { transition: transform .18s cubic-bezier(.22, .61, .36, 1); }
.card-link:hover, .card-link:focus-visible { transform: translateX(3px); }
.ledger-foot a { display: inline-block; transition: transform .18s cubic-bezier(.22, .61, .36, 1); }
.ledger-foot a:hover, .ledger-foot a:focus-visible { transform: translateX(3px); }

.card { transition: border-top-color .18s ease, transform .18s cubic-bezier(.22, .61, .36, 1), box-shadow .18s ease; }
.card:hover { box-shadow: var(--shadow); }

.panel { transition: border-color .2s ease; }
.panel:hover { border-color: var(--rule-strong); }

.steps li::before { transition: border-color .2s ease, color .2s ease, transform .2s cubic-bezier(.22, .61, .36, 1); }
.steps li:hover::before { border-color: var(--accent); transform: scale(1.06); }

.figures tbody tr { transition: background-color .18s ease; }
.figures tbody tr:hover { background: var(--paper-sunk); }

input, select, textarea { transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}

/* The header settles onto the page once it is no longer at the top. */
.site-header { transition: box-shadow .2s ease, border-color .2s ease; }
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--rule-strong), 0 10px 24px -22px rgba(0, 0, 0, .6); }

/* The verified dot breathes very slowly - a state, not a distraction. */
@keyframes verified-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}
.js-reveal .tag--verified::before { animation: verified-pulse 4.5s ease-in-out infinite; }

.notice:not([hidden]) { animation: notice-in .3s cubic-bezier(.22, .61, .36, 1) both; }
.alert { animation: rise-in .35s cubic-bezier(.22, .61, .36, 1) both; }

/* --- reduced motion: off, with nothing left hidden ------------------------- */
@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal],
  .js-reveal [data-reveal].is-revealed {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .js-reveal .brand svg .bead rect,
  .js-reveal .hero .eyebrow,
  .js-reveal .hero h1,
  .js-reveal .hero .lead,
  .js-reveal .hero .btn-row,
  .js-reveal .hero-since,
  .js-reveal .hero .ledger,
  .js-reveal .ledger::before,
  .js-reveal .tag--verified::before,
  .notice:not([hidden]),
  .alert {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .js-reveal .eyebrow::after { transform: scaleX(1) !important; transition: none !important; }
  .card:hover, .steps li:hover::before, .card-link:hover, .ledger-foot a:hover { transform: none !important; }
}
