/* Data-Roo LLC — analytics you can audit.
   Palette, rules, and the callout block are lifted from the Data-Roo invoice
   stylesheet so the site, the invoices, and the status pages are one house style.
   Contrast ratios in comments are computed, not estimated. */

@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('/assets/fonts/publicsans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/plexmono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/plexmono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  /* surfaces */
  --paper:         #F7F6F3;
  --surface:       #FFFFFF;
  --surface-hover: #FBFAF7;
  --callout:       #FBF7F1;

  /* text (ratio vs --paper) */
  --ink:   #141D33;   /* 15.50:1 */
  --body:  #1E2A4A;   /* 13.08:1 */
  --muted: #5B6577;   /*  5.44:1 */

  /* brand */
  --orange:       #F18722;   /* fill only — 2.36:1 on paper, never text */
  --orange-ink:   #9A4C0C;   /* 5.69:1 on paper */
  --on-orange:    #141D33;   /* 6.57:1 on orange */

  /* rules */
  --rule:        #E7E4DD;
  --rule-strong: #C9C3B7;
  --field-border: #8C8677;  /* interactive boundary — 3.63:1 on white, 3.36:1 on paper (SC 1.4.11) */
  --error:        #A8410A;  /* 5.67:1 on paper, 6.13:1 on white */

  /* spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 72px; --sp-9: 112px; --sp-10: 160px;

  --r-sm: 2px; --r-md: 3px; --r-lg: 6px;

  --z-header: 200; --z-skip: 300;

  /* layout */
  --container: 1120px;
  --rail: 148px;
  --gutter: 40px;
  --measure: 68ch;
  --header-h: 64px;

  /* motion */
  --ease: cubic-bezier(.2,.7,.3,1);
  --dur-fast: 120ms; --dur-mid: 200ms; --dur-slow: 420ms;

  /* type */
  --ff-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ff-text: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --ff-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-mono:  11.5px;
  --t-micro: 12.5px;
  --t-small: 13.5px;
  --t-body:  16.5px;
  --t-lede:  clamp(18px, 0.55vw + 15.8px, 20.5px);
  --t-h3:    20px;
  --t-h2:    clamp(26px, 2.2vw + 12px, 36px);
  --t-h1:    clamp(38px, 5.4vw + 14px, 64px);

  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12151C; --surface: #171B23; --surface-hover: #1C212B; --callout: #1E1A16;
    --ink:   #E9E6E0;   /* 14.66:1 */
    --body:  #B4BBC8;   /*  9.47:1 */
    --muted: #8D95A4;   /*  6.06:1 */
    --orange: #F18722;
    --orange-ink:   #F5A65B;  /* 9.12:1 */
   
    --on-orange: #141D33;
    --rule: #262B34; --rule-strong: #39414E;
    --field-border: #616B7A;  /* 3.20:1 on surface */
    --error: #F5A65B;         /* 8.61:1 on surface */
  }
}
:root[data-theme="dark"] {
  --paper: #12151C; --surface: #171B23; --surface-hover: #1C212B; --callout: #1E1A16;
  --ink:   #E9E6E0;
  --body:  #B4BBC8;
  --muted: #8D95A4;
  --orange: #F18722;
  --orange-ink:   #F5A65B;
 
  --on-orange: #141D33;
  --rule: #262B34; --rule-strong: #39414E;
  --field-border: #616B7A;
  --error: #F5A65B;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--ff-text);
  font-size: var(--t-body);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

* { box-shadow: none; }

[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

h1, h2, h3 { color: var(--ink); margin: 0; }
h1 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--t-h1);
  line-height: 1.06;
  letter-spacing: -.025em;
  max-width: 16ch;
  font-variation-settings: 'opsz' 96;
}
h2 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: var(--t-h2);
  line-height: 1.14;
  letter-spacing: -.02em;
  font-variation-settings: 'opsz' 48;
}
h3 { font-size: var(--t-h3); font-weight: 600; line-height: 1.3; }

p { margin: 0 0 var(--sp-4); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a { color: var(--orange-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--orange-ink);
  outline-offset: 2px;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.skip {
  position: absolute;
  left: -9999px;
  z-index: var(--z-skip);
  background: var(--surface);
  color: var(--ink);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
}
.skip:focus { left: var(--sp-4); top: var(--sp-4); }

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.masthead-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}
/* Both lockups are the same geometry, recoloured — a theme swap cannot shift
   the masthead. CSS toggles them rather than <picture>, so the [data-theme]
   override works the same way the colour tokens do. */
.wordmark {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex: none;
}
.lockup {
  display: block;
  height: 30px;
  width: auto;
}
.lockup.dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lockup.light { display: none; }
  :root:not([data-theme="light"]) .lockup.dark { display: block; }
}
:root[data-theme="dark"] .lockup.light { display: none; }
:root[data-theme="dark"] .lockup.dark { display: block; }
.nav { display: flex; gap: var(--sp-5); }
.nav a {
  font-family: var(--ff-mono);
  font-weight: 500;
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--orange-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.nav-menu { display: none; }
.nav-menu summary {
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .09em;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  padding: var(--sp-2);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}
.nav-panel a {
  padding: 0 clamp(20px, 4vw, 40px);
  min-height: 44px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--rule);
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--body);
  text-decoration: none;
}

/* ---------- shared section frame ---------- */

.eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-4);
  max-width: none;
}

.section { padding-block: var(--sp-9); position: relative; }
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--rule);
}
.section > .container { position: relative; }
.section > .container::before {
  content: "";
  position: absolute;
  top: calc(var(--sp-9) * -1);
  left: clamp(20px, 4vw, 40px);
  width: var(--rail);
  height: 2px;
  background: var(--orange);
}

.section-grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: var(--gutter);
  align-items: start;
}

.rail {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.rail-num { color: var(--orange-ink); font-weight: 500; }
.rail-label { color: var(--ink); }
.rail-state { color: var(--muted); }

.content > h2 { margin-bottom: var(--sp-3); }
.sub { color: var(--muted); margin-bottom: var(--sp-6); }

/* ---------- hero ---------- */

.hero { padding-block: var(--sp-9) var(--sp-8); }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--sp-7);
  align-items: center;
}
.hero-copy { grid-column: 1; }
.hero-mark {
  grid-column: 2;
  width: clamp(140px, 17vw, 208px);
  height: auto;
  align-self: center;
}
.hero-inner .meta-rule { grid-column: 1 / -1; }
.lede { font-size: var(--t-lede); line-height: 1.5; color: var(--body); }
.hero h1 { margin-bottom: var(--sp-5); }
.hero .lede { margin-bottom: var(--sp-6); }

.btn {
  display: inline-block;
  background: var(--orange);
  color: var(--on-orange);
  font-family: var(--ff-text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 13px 22px;
  border: 0;
  border-radius: var(--r-md);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: color-mix(in srgb, var(--orange) 88%, #000); }

.cta-row {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-bottom: var(--sp-7);
  max-width: none;
}
.link-alt { font-size: var(--t-small); }

.meta-rule {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  border-top: 1px solid var(--rule);
  padding-top: var(--sp-4);
  margin: 0;
}
.meta-cell dt {
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.meta-cell dd { margin: 0; font-size: var(--t-small); color: var(--body); }

/* ---------- four shapes ---------- */

.shapes {
  list-style: none;
  margin: 0 0 var(--sp-5);
  padding: 0;
}
.shapes li {
  padding-block: var(--sp-5);
  border-bottom: 1px solid var(--rule);
}
.shapes li:first-child { border-top: 1px solid var(--rule); }
.shapes h3 { margin-bottom: var(--sp-2); }
.idx {
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  color: var(--orange-ink);
  letter-spacing: .09em;
  margin-right: var(--sp-3);
}
.closing { color: var(--muted); font-size: var(--t-small); }

/* ---------- terms ---------- */

.terms { margin: 0 0 var(--sp-6); }
.terms > div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: var(--sp-3) var(--sp-5);
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--rule);
}
.terms > div:first-child { border-top: 1px solid var(--rule); }
.terms dt {
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.terms dd { margin: 0; }

.callout {
  background: var(--callout);
  border-left: 3px solid var(--orange);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--t-small);
  color: var(--body);
  max-width: var(--measure);
}

/* ---------- audit offer ---------- */

/* The one card that carries an offer gets the invoice's orange edge, so it
   reads as the page's single call to action rather than another panel. */
.offer {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--orange);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
}
.offer h2 { margin-bottom: var(--sp-3); }
.offer .lede { margin-bottom: var(--sp-5); }
.deliverables { list-style: none; margin: 0 0 var(--sp-5); padding: 0; }
.deliverables li {
  position: relative;
  padding-left: var(--sp-5);
  margin-bottom: var(--sp-3);
  max-width: var(--measure);
}
.deliverables li::before {
  content: "—";
  position: absolute;
  left: 0;
  font-family: var(--ff-mono);
  color: var(--orange-ink);
}
.price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-3);
  font-weight: 600;
  font-size: var(--t-h3);
  color: var(--ink);
  margin-bottom: var(--sp-3);
}
.price span {
  font-family: var(--ff-mono);
  font-weight: 400;
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.rationale {
  font-size: var(--t-small);
  color: var(--body);
  border-left: 3px solid var(--rule-strong);
  padding-left: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.qualifier { font-size: var(--t-small); color: var(--muted); margin-top: var(--sp-4); }

/* ---------- ren ---------- */

.creds { margin: var(--sp-6) 0 var(--sp-5); }
.creds > div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: var(--sp-3) var(--sp-5);
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--rule);
}
.creds > div:first-child { border-top: 1px solid var(--rule); }
.creds dt {
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.creds dd { margin: 0; font-size: var(--t-small); }
.stack {
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: none;
}

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: var(--sp-7);
  align-items: start;
}
#contact-form {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
}
.field { margin-bottom: var(--sp-4); }
.field label {
  display: block;
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.opt { text-transform: none; letter-spacing: 0; }
.field input, .field textarea {
  width: 100%;
  font-family: var(--ff-text);
  font-size: var(--t-body);
  color: var(--body);
  background: var(--paper);
  border: 1px solid var(--field-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.field textarea { resize: vertical; }

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

.privacy { font-size: var(--t-small); color: var(--muted); margin-bottom: var(--sp-5); }
#form-status { font-size: var(--t-small); margin: var(--sp-4) 0 0; min-height: 1.5em; }
#form-status.err { color: var(--error); }

.contact-meta > div {
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--rule);
}
.contact-meta > div:first-child { border-top: 1px solid var(--rule); }
.contact-meta dt {
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}
.contact-meta dd { margin: 0; font-size: var(--t-small); }

/* ---------- colophon ---------- */

.colophon {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding-block: var(--sp-8);
  position: relative;
}
.colophon::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(20px, 4vw, 40px);
  width: var(--rail);
  height: 2px;
  background: var(--orange);
}
.colophon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--sp-7);
  align-items: start;
}
.colophon-mark {
  display: block;
  width: 34px;
  height: auto;
  margin-bottom: var(--sp-4);
}
.colophon p {
  font-family: var(--ff-mono);
  font-size: var(--t-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--sp-2);
}
.colophon .verifiable {
  font-family: var(--ff-text);
  font-size: var(--t-small);
  letter-spacing: 0;
  text-transform: none;
  color: var(--body);
}

/* ---------- motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
/* Runs off CSS alone. If script.js never loads the hero still resolves —
   the old JS-triggered class left it stranded at opacity 0. */
.js .intro-anim {
  animation: rise var(--dur-slow) var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .hero-inner { display: block; }
  .hero-mark { display: none; }
  .section-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .rail {
    position: static;
    flex-direction: row;
    gap: var(--sp-3);
  }
  .rail-num::after, .rail-label::after { content: " ·"; }
  .contact-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .colophon-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
}

@media (max-width: 720px) {
  .section { padding-block: var(--sp-8); }
  .section > .container::before { top: calc(var(--sp-8) * -1); }
  .meta-rule { grid-template-columns: repeat(2, 1fr); }
  .terms > div, .creds > div { grid-template-columns: 1fr; gap: var(--sp-1); }
}

@media (max-width: 560px) {
  .nav { display: none; }
  .nav-menu { display: block; }
  .meta-rule { grid-template-columns: 1fr; }
  .offer, #contact-form { padding: var(--sp-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js .intro-anim { animation: none; opacity: 1; transform: none; }
}
