/* Northfold demo — mobile-first. Tokens first, then layout, then sections. */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-regular-latin.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-italic-latin.woff2") format("woff2"); }
:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --ink: #16140f;
  --ink-2: #4a463d;
  --line: #d8d1c2;
  --signal: #d9480f;         /* accent: marks and highlights, not body text */
  --signal-soft: #f6d8c6;
  --night: #1b1a16;
  --night-2: #2a2822;
  --on-night: #efeae0;
  --on-night-2: #b9b2a3;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;
  --gutter: 20px;
  --max: 1120px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }

/* ---------- type ---------- */
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; font-weight: 600; }
.section-title { font-family: var(--serif); font-size: clamp(34px, 7vw, 56px); line-height: 1.02; letter-spacing: -.01em; margin-bottom: 28px; text-wrap: balance; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; line-height: 1.5; color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px;
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--ink); border-radius: 999px;
  font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: #000; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-block { width: 100%; }
.link-arrow { font-weight: 600; text-decoration: none; padding: 12px 0; border-bottom: 2px solid var(--line); }
.link-arrow::after { content: " →"; }
.link-arrow:hover { border-color: var(--ink); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 400 26px/1 var(--serif); text-decoration: none; }
.wordmark svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.header-nav { display: none; gap: 28px; font-size: 15px; }
.header-nav a { text-decoration: none; color: var(--ink-2); }
.header-nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 36px 0 64px; }
.hero-grid { display: grid; gap: 44px; }
.hero h1 { font-family: var(--serif); font-size: clamp(44px, 11vw, 84px); line-height: .98; letter-spacing: -.02em; margin-bottom: 22px; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--signal); }
.lede { font-size: 19px; color: var(--ink-2); max-width: 34em; margin-bottom: 30px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-bottom: 34px; }
.cta-row .btn { width: 100%; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.facts li { padding: 14px 10px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.facts strong { display: block; font: 400 26px/1.1 var(--serif); color: var(--ink); }

.statement-card {
  margin: 0; background: #fffdf8; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: 0 1px 0 var(--line), 0 24px 48px -28px rgba(22,20,15,.35);
  transform: rotate(-1deg);
}
.statement-card figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; font-size: 13px; color: var(--ink-2); }
.tag { background: var(--ink); color: var(--paper); padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 12px; letter-spacing: .02em; }
.statement { font: 400 25px/1.32 var(--serif); margin-bottom: 22px; }
.statement mark { background: linear-gradient(transparent 58%, var(--signal-soft) 58%); color: inherit; padding: 0 .06em; }
.card-notes { border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.card-notes li { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: baseline; }
.card-notes span { font-weight: 700; color: var(--signal); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- generic section ---------- */
.section { padding: 72px 0; border-top: 1px solid var(--line); }

/* problems */
.problem-grid { display: grid; gap: 14px; }
.problem { background: var(--paper-2); border-radius: var(--radius); padding: 24px; }
.problem .num { font: italic 400 22px/1 var(--serif); color: var(--signal); }
.problem h3 { font: 600 20px/1.25 var(--sans); margin: 14px 0 8px; letter-spacing: -.01em; }
.problem p { color: var(--ink-2); }

/* timeline */
.timeline { display: grid; gap: 0; counter-reset: step; }
.timeline li { position: relative; padding: 0 0 34px 34px; border-left: 2px solid var(--line); margin-left: 7px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.timeline .days { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--signal); margin-bottom: 4px; }
.timeline h3 { font: 400 32px/1.1 var(--serif); margin-bottom: 8px; }
.timeline p { color: var(--ink-2); }
.timeline .out { margin-top: 12px; color: var(--ink); font-size: 15px; font-weight: 600; padding-left: 14px; border-left: 3px solid var(--signal); }
.inline-cta { margin-top: 44px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); }
.inline-cta p { font-weight: 600; }

/* fit */
.fit-grid { display: grid; gap: 14px; }
.fit-col { border-radius: var(--radius); padding: 24px; }
.fit-col h3 { font: 600 15px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.fit-col li { position: relative; padding: 10px 0 10px 30px; border-top: 1px solid var(--line); }
.fit-col li::before { position: absolute; left: 0; top: 9px; font-weight: 700; }
.fit-col.yes { background: #fffdf8; border: 1px solid var(--line); }
.fit-col.yes li::before { content: "✓"; color: #2f6b3c; }
.fit-col.no { background: var(--paper-2); }
.fit-col.no li::before { content: "✕"; color: var(--signal); }

/* pricing */
.pricing-grid { display: grid; gap: 28px; }
.price-card { background: #fffdf8; border: 2px solid var(--ink); border-radius: calc(var(--radius) + 4px); padding: 26px; }
.price { font: 400 64px/1 var(--serif); margin-bottom: 20px; letter-spacing: -.02em; }
.currency { font-size: 30px; vertical-align: 22px; margin-right: 2px; }
.gst { font: 500 15px/1 var(--sans); color: var(--ink-2); letter-spacing: 0; }
.ticks { margin-bottom: 18px; }
.ticks li { padding: 10px 0 10px 28px; border-top: 1px solid var(--line); position: relative; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 12px; height: 7px; border-left: 2.5px solid var(--signal); border-bottom: 2.5px solid var(--signal); transform: rotate(-45deg); }
.price-card .small { margin-bottom: 20px; }

/* faq */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative; font: 600 18px/1.35 var(--sans); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font: 400 30px/1 var(--serif); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--ink-2); max-width: 40em; }

/* book */
.book { background: var(--night); color: var(--on-night); border-top: 0; }
.book .section-title { color: var(--on-night); }
.book-grid { display: grid; gap: 36px; }
.book-copy > p { color: var(--on-night-2); font-size: 18px; margin-bottom: 28px; max-width: 30em; }
.facts-inverse { border-top-color: var(--night-2); }
.facts-inverse li { color: var(--on-night-2); }
.facts-inverse strong { color: var(--on-night); }

.lead-form, .form-success { background: var(--paper); color: var(--ink); border-radius: calc(var(--radius) + 4px); padding: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--ink-2); font-size: 13px; margin-left: 4px; }
.field input, .field select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: 400 16px/1.3 var(--sans); color: var(--ink);
  background: #fffdf8; border: 1.5px solid var(--line); border-radius: 10px;
  appearance: none; -webkit-appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus, .field select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--signal-soft); }
.field [aria-invalid="true"] { border-color: var(--signal); }
.error { color: #b23a0b; font-size: 14px; margin-top: 6px; font-weight: 600; }
.form-note { margin-top: 12px; text-align: center; }
.form-success:focus { outline: none; } /* focus is moved here for screen readers only */
.form-success h3 { font: 400 36px/1.1 var(--serif); margin-bottom: 12px; }
.form-success p { margin-bottom: 10px; color: var(--ink-2); }
.form-success code { background: var(--paper-2); padding: 1px 6px; border-radius: 4px; font-size: 14px; color: var(--ink); }

/* footer */
.site-footer { background: var(--night); color: var(--on-night-2); border-top: 1px solid var(--night-2); padding: 28px 0 110px; font-size: 14px; }
.footer-inner { display: grid; gap: 10px; }
.site-footer strong { color: var(--on-night); }
.site-footer a { color: var(--on-night); font-weight: 600; text-decoration-color: var(--signal); text-underline-offset: 3px; }

/* sticky mobile CTA */
.sticky-cta {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 18px; background: var(--ink); color: var(--paper);
  border-radius: 999px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  font-size: 14px; font-weight: 600;
  transform: translateY(140%); transition: transform .25s ease;
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ---------- tablet+ ---------- */
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .cta-row .btn { width: auto; }
  .problem-grid { grid-template-columns: repeat(3, 1fr); }
  .fit-grid { grid-template-columns: 1fr 1fr; }
  .inline-cta { flex-direction: row; justify-content: space-between; align-items: center; }
  .section { padding: 96px 0; }
}

/* ---------- desktop ---------- */
@media (min-width: 1000px) {
  .header-nav { display: flex; }
  .hero { padding: 64px 0 96px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; align-items: center; gap: 64px; }
  .timeline { grid-template-columns: repeat(4, 1fr); gap: 28px; }
  .timeline li { border-left: 0; border-top: 2px solid var(--line); margin: 0; padding: 30px 0 0; }
  .timeline li:last-child { border-top-color: var(--line); }
  .timeline li::before { left: 0; top: -9px; }
  .pricing-grid { grid-template-columns: 1fr 1fr; align-items: start; gap: 64px; }
  .book-grid { grid-template-columns: 1fr 1fr; align-items: start; gap: 64px; }
  .sticky-cta { display: none; }
  .site-footer { padding-bottom: 28px; }
  .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
}

/* ---------- case study page ---------- */
.case-hero { padding: 48px 0 56px; }
.case-hero h1 { font-family: var(--serif); font-size: clamp(40px, 9vw, 72px); line-height: 1; letter-spacing: -.02em; margin-bottom: 20px; text-wrap: balance; }
.case-hero h1 em { color: var(--signal); }
.case-meta { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: 8px; }
.case-meta li { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.case-meta li > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--signal); padding-top: 2px; }
.case code, .callout code { font: 500 .88em/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--paper-2); padding: 2px 5px; border-radius: 4px; }
.prose p { margin-bottom: 16px; color: var(--ink-2); max-width: 40em; }
.prose p strong { color: var(--ink); }
.case-intro { margin: -12px 0 24px; max-width: 40em; }
.decision-list li { padding: 14px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.decision-list li strong { color: var(--ink); }
.decision-list.compact li { padding: 8px 0 8px 18px; position: relative; }
.decision-list.compact li::before { content: ""; position: absolute; left: 0; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fffdf8; }
.case-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
.case-table th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.case-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.case-table tr:last-child td { border-bottom: 0; }
.case-table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.callout { margin-top: 28px; background: var(--night); color: var(--on-night); border-radius: var(--radius); padding: 24px; }
.callout h3 { font: 400 28px/1.1 var(--serif); margin-bottom: 12px; }
.callout ol { list-style: decimal; padding-left: 20px; color: var(--on-night-2); }
.callout li { margin: 8px 0; }
.callout a { color: var(--on-night); text-decoration-color: var(--signal); text-underline-offset: 3px; }
.callout code { background: var(--night-2); color: var(--on-night); }
.perf-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.perf-row li { background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 13px; color: var(--ink-2); }
.perf-row strong { display: block; font: 400 30px/1.1 var(--serif); color: var(--ink); }
.case .site-footer { padding-bottom: 28px; }
@media (min-width: 720px) { .perf-row { grid-template-columns: repeat(4, 1fr); } }
.wordmark { white-space: nowrap; }
.show-sm { display: inline; } .hide-sm { display: none; }
@media (min-width: 720px) { .show-sm { display: none; } .hide-sm { display: inline; } }
/* tables become stacked cards on phones */
@media (max-width: 719px) {
  .table-wrap { overflow: visible; border: 0; background: none; }
  .case-table { min-width: 0; }
  .case-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .case-table, .case-table tbody, .case-table tr, .case-table td { display: block; }
  .case-table tr { background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; padding: 6px 0; margin-bottom: 10px; }
  .case-table td { border: 0; padding: 6px 16px; }
  .case-table td:first-child { white-space: normal; font-size: 17px; padding-top: 10px; }
  .case-table td:not(:first-child)::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--signal); margin-bottom: 2px; }
}
