/* Fonts: self-hosted Latin subsets from Google Fonts (SIL OFL; licenses/ in the repo). */
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/bricolage-grotesque-latin.woff2) format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(/fonts/instrument-sans-latin.woff2) format("woff2"); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-latin.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

/* Tokens: palette B, "Worksheet" (warm paper, navy ink, pencil orange) */
:root {
  color-scheme: light;
  --bg: #F7F4EE; --ink: #16202E; --muted: #5E6570; --line: #E2DCD0;
  --tile: #FFFFFF; --tile-edge: #E8E1D4;
  --accent: #C2410C; --accent-ink: #FFFFFF; --accent-2: #2F5D8A; --accent-3: #16202E;
  --danger: #B42318;
  --field-edge: #8C8577; /* 3:1 against --bg and --tile (WCAG 1.4.11) */
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #14161A; --ink: #EEE9E0; --muted: #A39D93; --line: #2A2C31;
    --tile: #1D2025; --tile-edge: #2C3036;
    --accent: #F08A5D; --accent-ink: #2A1004; --accent-2: #8DB3DA; --accent-3: #3A4A60;
    --danger: #F4A7A0;
    --field-edge: #6B7079;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
a { color: var(--accent); }
:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.narrow { max-width: 760px; }

/* Nav and lockup */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.lockup { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.lockup-mark { width: 32px; height: 32px; flex: none; }
.lockup-mark path { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: 0.45; }
.lockup-mark rect { fill: var(--accent); }
.lockup-text { display: flex; flex-direction: column; gap: 2px; }
.mark { font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; }
.mark b { font-weight: 700; }
.mark i { font-style: normal; color: var(--accent); }
.tagline { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }

/* Buttons: transform only, on kit tokens */
.btn { display: inline-block; font: 600 15px/1 var(--body); padding: 14px 20px; border-radius: 10px; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: transparent; cursor: pointer;
  transition: transform var(--motion-duration-hover) var(--motion-easing-standard); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: 24px; min-height: 620px; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; padding-block: 48px; position: relative; z-index: 1; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 6vw, 76px); line-height: 0.98; letter-spacing: -0.035em; margin: 0; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 18px; color: var(--muted); max-width: 32em; margin: 0 0 16px; }
.hero .lede { margin: 0; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.stage { position: relative; height: 620px; margin-right: -24px; }
.stage canvas, .hero-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage canvas { touch-action: pan-y;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 100%); }

/* Sections */
.section { padding-block: clamp(56px, 9vw, 112px); border-top: 1px solid var(--line); }
h2 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 16px; }
h3 { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 0 0 6px; }
.checks { padding-left: 1.2em; display: grid; gap: 10px; margin: 0 0 20px; }
.checks li::marker { font-family: var(--mono); color: var(--accent); }
.services { list-style: none; padding: 0; margin: 24px 0; counter-reset: svc; }
.services li { counter-increment: svc; display: grid; grid-template-columns: 3.5em 1fr; padding-block: 20px; border-top: 1px solid var(--line); }
.services li::before { content: "0" counter(svc); font-family: var(--mono); color: var(--accent); padding-top: 4px; grid-row: 1 / span 2; }
.services li > * { grid-column: 2; }
.services p { margin: 0; color: var(--muted); }
.aside { color: var(--muted); }

/* Form */
.audit-form { display: grid; gap: 18px; margin-block: 24px; }
.field { display: grid; gap: 6px; scroll-margin-top: 24px; }
label { font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
input, textarea { font: inherit; color: var(--ink); background: var(--tile); border: 1px solid var(--field-edge); border-radius: 10px; padding: 12px 14px; width: 100%; }
input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin: 0; color: var(--danger); font-size: 15px; font-weight: 500; }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.audit-fallback { margin: 0; color: var(--muted);
  animation: fallback-in var(--motion-duration-enter) var(--motion-easing-enter); }
@keyframes fallback-in { from { opacity: 0; transform: translateY(calc(-1 * var(--motion-distance-enter))); } }
@media (prefers-reduced-motion: reduce) { .audit-fallback { animation: none; } }

/* Footer */
.footer { display: flex; align-items: end; justify-content: space-between; padding-block: 32px; border-top: 1px solid var(--line); color: var(--muted); }

/* Narrow: the canvas stacks above the copy, capped so the headline stays above the fold */
@media (max-width: 820px) {
  .wrap { padding-inline: 16px; }
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 0; }
  .hero-copy { padding-block: 16px 32px; }
  .stage { height: min(42vh, 400px); margin-right: 0; order: -1; }
  .stage canvas { -webkit-mask-image: none; mask-image: none; }
  .nav .btn { padding: 12px 14px; font-size: 14px; }
}
