/* Toffee AI — shared styles
   Layout: left-aligned editorial column; one memorable element (the hero "evidence slip"); everything else quiet. */
:root {
  --paper: #f4f6f3;      /* cool sage-grey page ground */
  --surface: #ffffff;    /* slips, panels */
  --ink: #2a1d15;        /* treacle: text */
  --muted: #59605b;      /* secondary text */
  --toffee: #9a5d10;     /* links, buttons */
  --on-toffee: #ffffff;
  --butter: #f3c567;     /* highlight */
  --on-butter: #2a1d15;
  --sage: #dfe7df;       /* quiet section band */
  --line: #ccd5ce;
  --good: #2f6b45;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
  --measure: 64ch;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1713; --surface: #25201a; --ink: #f2ede5; --muted: #b8b1a6;
    --toffee: #e5a94b; --on-toffee: #1b1713; --butter: #f3c567; --on-butter: #2a1d15;
    --sage: #262c26; --line: #3c3730; --good: #7fc79a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1713; --surface: #25201a; --ink: #f2ede5; --muted: #b8b1a6;
  --toffee: #e5a94b; --on-toffee: #1b1713; --butter: #f3c567; --on-butter: #2a1d15;
  --sage: #262c26; --line: #3c3730; --good: #7fc79a; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { max-width: 100%; }
a { color: var(--toffee); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

h1, h2, h3 { font-family: var(--display); line-height: 1.08; text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 750; font-variation-settings: "opsz" 96; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 650; letter-spacing: -0.005em; }
p { margin: 0; max-width: var(--measure); }
.lede { font-size: clamp(1.15rem, 2vw, 1.3rem); color: var(--muted); line-height: 1.55; }
.flow > * + * { margin-top: 1rem; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 0.5rem; }
.brand-mark { width: 1.6rem; height: 1.6rem; border-radius: 0.45rem 0.45rem 0.45rem 0.15rem; background: var(--butter); display: inline-grid; place-items: center; color: var(--on-butter); font-size: 0.95rem; }
.nav { display: flex; align-items: center; gap: 0.25rem 1.25rem; flex-wrap: wrap; font-family: var(--display); font-size: 0.98rem; }
.nav a { color: var(--ink); text-decoration: none; padding-block: 0.25rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--toffee); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.35em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 650; font-size: 1rem; padding: 0.8rem 1.25rem; border-radius: 0.6rem; text-decoration: none; border: 2px solid var(--toffee); line-height: 1.2; }
.btn-primary { background: var(--toffee); color: var(--on-toffee); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--toffee); }
.nav .btn { padding: 0.5rem 0.9rem; color: var(--on-toffee); }
.nav .btn:hover { color: var(--on-toffee); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.band { background: var(--sage); }
.section-head { display: grid; gap: 0.9rem; margin-bottom: 2.25rem; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 6vw, 4.5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-copy { display: grid; gap: 1.4rem; min-width: 0; }
.hero-note { font-size: 0.95rem; color: var(--muted); }

/* The evidence slip: the page's one memorable element */
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: 0.9rem 0.9rem 0.3rem 0.9rem; padding: 1.4rem 1.4rem 1.2rem; box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(42, 29, 21, 0.45); min-width: 0; transform: rotate(-0.6deg); }
.slip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 0.6rem; }
.slip-title { font-family: var(--display); font-weight: 750; font-size: 1.15rem; }
.slip-sub { font-size: 0.85rem; color: var(--muted); }
.slip-table-wrap { overflow-x: auto; }
.slip table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; margin-top: 0.4rem; }
.slip th { text-align: left; font-family: var(--display); font-weight: 600; font-size: 0.8rem; color: var(--muted); padding: 0.45rem 0.4rem 0.35rem 0; border-bottom: 1px solid var(--line); }
.slip td { padding: 0.55rem 0.4rem 0.55rem 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.slip td.num, .slip th.num { text-align: right; white-space: nowrap; }
.slip .supplier { font-family: var(--display); font-weight: 600; }
.slip .src { display: block; font-size: 0.78rem; color: var(--muted); }
.status { display: inline-block; font-family: var(--display); font-size: 0.75rem; font-weight: 650; padding: 0.12rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.status[data-state="filed"] { background: var(--butter); color: var(--on-butter); }
.status[data-state="inbox"] { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.slip tfoot td { border-bottom: 0; padding-top: 0.75rem; font-family: var(--display); font-weight: 700; }
.slip-foot { margin-top: 0.9rem; font-size: 0.85rem; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .status { transition: background-color 280ms ease, color 280ms ease, box-shadow 280ms ease; }
}

/* Help list */
.help-list { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.help-item { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: 0.5rem 2.5rem; padding-block: 1.5rem; border-bottom: 1px solid var(--line); }
.help-item p { color: var(--muted); }

/* Steps (a real sequence) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: 0.5rem; align-content: start; padding-top: 1rem; border-top: 2px solid var(--ink); }
.steps li::before { content: counter(step); font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; color: var(--toffee); }
.steps p { font-size: 0.98rem; color: var(--muted); }

/* Two-column prose with aside */
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.split > * { min-width: 0; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.checks li { padding-left: 1.6rem; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.7rem; height: 0.7rem; border-radius: 0.2rem; background: var(--butter); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 0.8rem; padding: 1.5rem; }

/* Offers table */
.table-wrap { overflow-x: auto; }
.offers { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 40rem; }
.offers th, .offers td { text-align: left; padding: 1.1rem 1.25rem 1.1rem 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.offers thead th { font-family: var(--display); font-weight: 600; font-size: 0.9rem; color: var(--muted); border-bottom: 2px solid var(--ink); }
.offers td:first-child { font-family: var(--display); font-weight: 700; font-size: 1.1rem; width: 14rem; }
.offers .price { font-family: var(--display); font-weight: 700; white-space: nowrap; }
.small { font-size: 0.9rem; color: var(--muted); }

/* FAQ */
.faq { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); padding-block: 1rem; }
.faq summary { cursor: pointer; font-family: var(--display); font-weight: 650; font-size: 1.12rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--toffee); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details > p { margin-top: 0.75rem; color: var(--muted); }

/* Case studies */
.case { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1rem 2.5rem; padding-block: 2rem; border-top: 2px solid var(--ink); }
.case-meta { display: grid; gap: 0.4rem; align-content: start; font-size: 0.95rem; color: var(--muted); }
.tag { display: inline-block; justify-self: start; font-family: var(--display); font-size: 0.8rem; font-weight: 650; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--butter); color: var(--on-butter); }
.tag-quiet { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.figures { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-block: 0.5rem; }
.figures div { display: grid; }
.figures strong { font-family: var(--display); font-size: 1.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figures span { font-size: 0.9rem; color: var(--muted); }

/* Copy field */
.copy-field { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.copy-field code { font-family: var(--display); font-size: 1.25rem; font-weight: 650; background: var(--surface); border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.5rem 0.8rem; user-select: all; }
.copy-field button { font: inherit; font-family: var(--display); font-weight: 650; cursor: pointer; padding: 0.55rem 0.9rem; border-radius: 0.5rem; border: 2px solid var(--toffee); background: transparent; color: var(--toffee); }
.copy-status { font-size: 0.9rem; color: var(--good); min-height: 1.4em; }

/* CTA band */
.cta { background: var(--ink); color: var(--paper); }
.cta .wrap { display: grid; gap: 1.25rem; padding-block: clamp(3rem, 6vw, 4.5rem); }
.cta p { color: var(--paper); opacity: 0.85; }
.cta .btn-primary { background: var(--butter); border-color: var(--butter); color: var(--on-butter); justify-self: start; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; padding-block: 2.5rem; }
.site-footer p { max-width: 48ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-content: start; }

/* Prose pages */
.prose { max-width: 46rem; }
.prose h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.35rem; }

@media (max-width: 860px) {
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .slip { transform: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-item, .case { grid-template-columns: minmax(0, 1fr); }
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .site-header { position: static; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .slip { padding: 1.1rem 1rem; }
  .slip .src { display: none; }
}
