/* ==========================================================================
   Mach Lilies — design system
   Brief: docs/machlilies-rebuild-brief.md §13
   A calm, capable British studio. Paper, ink, lily-stem green, pale leaf,
   stamen gold (founding offers only). Bricolage Grotesque display,
   Instrument Sans body, Caveat for the plain-English correction only.
   ========================================================================== */

/* ---- Fonts (self-hosted, variable, latin subset) ------------------------ */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-400-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("/assets/fonts/caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens -------------------------------------------------------------- */
:root {
  /* Palette — drawn from the lily, not from tech (all pairs checked AA) */
  --paper: #FBFBF8;        /* background */
  --ink: #20303C;          /* text · 12.5:1 on paper */
  --ink-soft: #46586A;     /* muted text · 7:1 on paper */
  --stem: #2E6B4F;         /* primary accent: buttons, links · 6.3:1 on paper */
  --stem-deep: #245640;    /* hover state */
  --leaf: #E7EFE9;         /* section tint */
  --gold: #D9A441;         /* founding-offer highlights only — never body text */
  --gold-deep: #8A6118;    /* accessible gold for offer eyebrow text · 5.3:1 */
  --gold-tint: #FBF3E3;    /* founding-offer card background */
  --hairline: rgba(32, 48, 60, 0.14);
  --shadow: 0 1px 2px rgba(32, 48, 60, 0.05), 0 6px 24px -12px rgba(32, 48, 60, 0.12);

  /* Type */
  --font-display: "Bricolage Grotesque", "Trebuchet MS", Verdana, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Comic Sans MS", cursive;

  /* Fluid scale — body never below 18px (audience skews 45+, reads on phones) */
  --step--1: 0.9375rem;
  --step-0: clamp(1.125rem, 1.08rem + 0.2vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.17rem + 0.4vw, 1.375rem);
  --step-2: clamp(1.5rem, 1.36rem + 0.7vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.25vw, 2.25rem);
  --step-4: clamp(2.125rem, 1.65rem + 2.4vw, 3.125rem);

  /* Layout */
  --measure: 68ch;         /* prose max-width */
  --container: 66rem;
  --radius: 12px;
  --gap: clamp(1rem, 2.5vw, 1.5rem);
  --section: clamp(3.5rem, 8vw, 6.5rem);

  color-scheme: light;
}

/* ---- Reset + 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: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-weight: 700; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.3; }
p, ul, ol { margin: 0 0 1.1em; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
a { color: var(--stem); text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: var(--stem-deep); }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--section) 0; }
::selection { background: var(--leaf); color: var(--ink); }

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

.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;
}
.skip-link {
  position: absolute; left: 1rem; top: -3.5rem; z-index: 100;
  background: var(--stem); color: #fff; padding: 0.6rem 1rem;
  border-radius: var(--radius); transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---- Layout helpers ------------------------------------------------------ */
.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2rem); }
.prose { max-width: var(--measure); }
.section { padding-block: var(--section); }
.section-tint { background: var(--leaf); }
.section-head { max-width: var(--measure); margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.center { text-align: center; }
.center .prose, .center.section-head { margin-inline: auto; }

.eyebrow {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stem);
  margin-bottom: 0.9rem;
}
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.small { font-size: var(--step--1); }

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 251, 248, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .container {
  display: flex; align-items: center; gap: 1rem;
  min-height: 4.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  margin-right: auto;
}
.brand img { width: 2rem; height: 2rem; }
.site-nav { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.5rem); }
.site-nav a:not(.btn) {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1rem;
  padding: 0.25rem 0;
}
.site-nav a:not(.btn):hover { color: var(--stem); }
.site-nav a[aria-current="page"] { color: var(--stem); box-shadow: 0 2px 0 var(--stem); }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--hairline); border-radius: 8px;
  padding: 0.5rem 0.65rem; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 1.25rem; height: 1.25rem; display: block; }
@media (max-width: 47.9em) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--hairline);
    padding: 0.5rem clamp(1.25rem, 4vw, 2rem) 1.25rem;
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 0.8rem 0; border-bottom: 1px solid var(--hairline); }
  .site-nav .btn { margin-top: 1rem; text-align: center; justify-content: center; }
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--stem); color: #fff;
  font-family: var(--font-body); font-weight: 500; font-size: 1.0625rem;
  padding: 0.8rem 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--stem);
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--stem-deep); border-color: var(--stem-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--stem); }
.btn-ghost:hover { background: var(--leaf); color: var(--stem-deep); }
.btn-on-dark { background: var(--paper); color: var(--stem); border-color: var(--paper); }
.btn-on-dark:hover { background: #fff; border-color: #fff; color: var(--stem-deep); }
.btn-gold { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn-gold:hover { background: #745112; border-color: #745112; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { padding-block: clamp(3rem, 8vw, 6rem) var(--section); }
.hero p.sub { max-width: 54ch; font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); }
.hero h1 { margin-bottom: 0.5em; max-width: 26ch; }
.hero .pec-line { margin-top: 2.25rem; font-size: 1.0625rem; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.75rem; }
.hero-cta .alt { font-weight: 500; }
.trust-line {
  margin-top: 1.5rem; font-size: var(--step--1); color: var(--ink-soft);
}
.trust-line span + span::before { content: "·"; margin: 0 0.5em; color: var(--hairline); }

/* ---- The plain-English correction (signature element — 3 uses sitewide) --- */
.pec { display: inline-block; }
.pec s {
  text-decoration: none; position: relative; color: var(--ink-soft);
  font-style: normal;
}
.pec s::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 53%;
  height: 0.09em; min-height: 2px; background: var(--stem);
  border-radius: 2px; transform: rotate(-1.3deg) scaleX(1);
  transform-origin: left center;
}
.pec .fix {
  font-family: var(--font-hand); font-weight: 600; color: var(--stem);
  font-size: 1.28em; line-height: 1; white-space: nowrap;
  display: inline-block; padding-left: 0.15em; transform: rotate(-1.5deg);
}
@media (prefers-reduced-motion: no-preference) {
  .pec[data-reveal] s::after { transform: rotate(-1.3deg) scaleX(0); transition: transform 0.5s ease 0.2s; }
  .pec[data-reveal] .fix { opacity: 0; transform: rotate(-1.5deg) translateY(0.3em); transition: opacity 0.45s ease 0.55s, transform 0.45s ease 0.55s; }
  .pec[data-reveal].in s::after { transform: rotate(-1.3deg) scaleX(1); }
  .pec[data-reveal].in .fix { opacity: 1; transform: rotate(-1.5deg) translateY(0); }
}

/* ---- Cards --------------------------------------------------------------- */
.cards { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 40em) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64em) { .cards.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--paper); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 1.75rem);
}
.section-tint .card { border-color: transparent; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--ink-soft); font-size: 1.0625rem; }
.card .card-link { font-weight: 500; }

/* ---- Numbered steps ------------------------------------------------------ */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); counter-reset: step; }
@media (min-width: 48em) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps > li {
  counter-increment: step;
  border-top: 2px solid var(--stem); padding-top: 1.1rem;
}
.steps > li::before {
  content: counter(step);
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-3);
  color: var(--stem); display: block; line-height: 1; margin-bottom: 0.35rem;
}
.steps h3 { margin-bottom: 0.35em; }
.steps p { color: var(--ink-soft); font-size: 1.0625rem; }

/* Ordered walk-through (accountants "working week") */
.walk { list-style: none; margin: 0; padding: 0; max-width: var(--measure); counter-reset: walk; }
.walk > li {
  counter-increment: walk;
  position: relative; padding: 0.9rem 0 0.9rem 3.25rem;
  border-bottom: 1px solid var(--hairline);
}
.walk > li:last-child { border-bottom: 0; }
.walk > li::before {
  content: counter(walk);
  position: absolute; left: 0; top: 0.85rem;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--leaf); color: var(--stem);
  font-family: var(--font-display); font-weight: 600;
  display: grid; place-items: center; font-size: 1.05rem;
}
.section-tint .walk > li::before { background: var(--paper); }

/* ---- Tick / cross lists --------------------------------------------------- */
.list-plain { list-style: none; margin: 0 0 1.1em; padding: 0; }
.list-plain > li { position: relative; padding-left: 2rem; margin-bottom: 0.75em; }
.list-plain > li::before {
  content: ""; position: absolute; left: 0; top: 0.42em;
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background-color: var(--stem);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>') center / contain no-repeat;
}
.list-dash > li::before {
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round"><path d="M5 12h14"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3" stroke-linecap="round"><path d="M5 12h14"/></svg>') center / contain no-repeat;
  background-color: var(--ink-soft);
}

/* ---- Founder note --------------------------------------------------------- */
.founder-note {
  display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); align-items: start;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
@media (min-width: 48em) { .founder-note { grid-template-columns: 11rem 1fr; } }
.founder-note img, .founder-photo {
  border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; width: 100%;
}
.founder-photo-placeholder {
  border-radius: var(--radius); aspect-ratio: 1; width: 100%;
  background: var(--leaf); display: grid; place-items: center;
  color: var(--stem); font-family: var(--font-display); font-weight: 600;
}
.founder-note blockquote { margin: 0; font-size: var(--step-1); line-height: 1.55; }
.founder-note .who { margin-top: 1rem; color: var(--ink-soft); font-weight: 500; }

/* ---- Pricing -------------------------------------------------------------- */
.price-cards { display: grid; gap: var(--gap); }
@media (min-width: 48em) { .price-cards { grid-template-columns: repeat(3, 1fr); } }
.price-card {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.price-card .amount {
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-3);
  color: var(--ink); line-height: 1.1;
}
.price-card .amount small { font-size: 0.45em; font-weight: 600; color: var(--ink-soft); letter-spacing: 0; }
.price-card p { color: var(--ink-soft); font-size: 1.0625rem; }

/* ---- Founding offer (stamen gold — only here) ------------------------------ */
.offer {
  background: var(--gold-tint);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.offer .eyebrow { color: var(--gold-deep); }
.offer h2, .offer h3 { margin-bottom: 0.4em; }

/* ---- FAQ ------------------------------------------------------------------ */
.faq { max-width: var(--measure); }
.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-item summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.1rem 0;
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-1);
  line-height: 1.3;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex: 0 0 auto; width: 1rem; height: 1rem;
  background-color: var(--stem);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>') center / contain no-repeat;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 0 1.25rem; color: var(--ink-soft); max-width: var(--measure); }

/* ---- CTA band -------------------------------------------------------------- */
.cta-band { background: var(--stem); color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, 0.85); }
.cta-band a:not(.btn) { color: #fff; }

/* ---- Tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 1.0625rem; }
th, td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
thead th { font-family: var(--font-display); font-weight: 600; background: var(--leaf); }
tbody tr:last-child td { border-bottom: 0; }

/* ---- Article (guides) -------------------------------------------------------- */
.breadcrumbs { font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 1.5rem; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4em; }
.breadcrumbs li + li::before { content: "→"; margin-right: 0.4em; color: var(--hairline); }
.breadcrumbs a { color: var(--ink-soft); }

article.guide { max-width: var(--measure); }
article.guide h2 { margin-top: 2em; }
article.guide h3 { margin-top: 1.6em; }
.byline {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: var(--step--1); color: var(--ink-soft);
  padding-block: 1rem; border-block: 1px solid var(--hairline);
  margin-block: 1.5rem 2rem;
}
.byline a { color: var(--ink); font-weight: 500; }

/* Quotable definition / checklist block (GEO excerpt target) */
.quotable {
  background: var(--leaf); border-left: 3px solid var(--stem);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem; margin-block: 1.75rem;
}
.quotable p:first-child { margin-top: 0; }

/* ---- Forms -------------------------------------------------------------------- */
label { display: block; font-weight: 500; margin-bottom: 0.4rem; }
input[type="text"], input[type="email"], textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 0.8rem 1rem;
}
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--stem); outline-offset: 1px; border-color: var(--stem); }
textarea { min-height: 8.5rem; resize: vertical; }
.form-note { font-size: var(--step--1); color: var(--ink-soft); }

/* ---- Footer --------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  font-size: var(--step--1); color: var(--ink-soft);
}
.site-footer .cols {
  display: grid; gap: 2rem; margin-bottom: 2.5rem;
}
@media (min-width: 48em) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; color: var(--ink); margin-bottom: 0.75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5em; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--stem); }
.site-footer .legal {
  border-top: 1px solid var(--hairline); padding-top: 1.5rem;
  display: grid; gap: 0.5rem;
}

/* ---- Scroll reveal (subtle; corrections only per brief) -------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(0.75rem); transition: opacity 0.5s ease, transform 0.5s ease; }
  .reveal.in { opacity: 1; transform: none; }
}

/* ---- Print ------------------------------------------------------------------------ */
@media print {
  .site-header, .site-footer, .cta-band, .skip-link { display: none; }
}
