/* File to Form. Mobile first, system fonts, no external requests. */
:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #17191c;
  --muted: #4a4f57;
  --line: #dcd7cd;
  --accent: #b23f0b;        /* 5.6:1 on --bg */
  --accent-ink: #ffffff;
  --dark: #17191c;
  --dark-ink: #f3efe8;
  --dark-muted: #c4bfb6;
  --dark-accent: #f08a52;   /* 7.4:1 on --dark */
  --radius: 10px;
  --wrap: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 7vw, 3.75rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); font-weight: 750; }
h3, .h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow > * { max-width: 46rem; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 6px;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-top: .8rem; padding-bottom: .8rem; }
.wordmark { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.wordmark-lockup { height: 1.75rem; width: auto; aspect-ratio: 6.060; color: var(--ink); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: .5rem .1rem; display: inline-block; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current]:not(.btn) { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: .7rem 1.3rem;
  background: var(--accent); color: var(--accent-ink);
  border: 2px solid var(--accent); border-radius: 999px;
  font-weight: 700; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: #8f3209; border-color: #8f3209; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-small { min-height: 2.5rem; padding: .45rem 1rem; font-size: .95rem; }
.btn-block { display: flex; width: 100%; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Hero */
.hero {
  border-bottom: 1px solid var(--line);
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(23,25,28,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(23,25,28,.06) 1px, transparent 1px);
  background-size: 28px 28px;
}
.hero-inner { padding-top: 3rem; padding-bottom: 3.5rem; }
.eyebrow, .kicker {
  font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); font-weight: 700; margin-bottom: 1rem;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.hero .lead { color: var(--ink); }
/* Animated 7B mark (decorative). Keyframes live in the generated brand:anim block at the end. */
.hero-mark { width: 8.5rem; margin-bottom: 1.5rem; }
.hero-mark svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (min-width: 64rem) {
  .hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 4rem; align-items: center; }
  .hero-inner > * { grid-column: 1; }
  .hero-inner > .hero-mark { grid-column: 2; grid-row: 1 / span 4; width: 19rem; margin: 0; }
}

/* Sections */
.section { padding: 3.5rem 0; }
.section-tight { padding: 2.5rem 0; }
.section-dark { background: var(--dark); color: var(--dark-ink); }
.section-dark .kicker { color: var(--dark-accent); }
.section-dark p { color: var(--dark-muted); }
.page-head { padding: 3rem 0 1rem; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2rem, 6vw, 3rem); }

/* Cards */
.cards { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card p { color: var(--muted); margin: 0; }
.icon { width: 3rem; height: 3rem; margin-bottom: 1rem; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-small { width: 2.5rem; height: 2.5rem; flex: none; margin: 0; }
.callout { display: flex; gap: 1rem; align-items: flex-start; margin-top: 1rem; padding: 1.5rem; border: 2px dashed var(--line); border-radius: var(--radius); }
.callout p { margin: 0; color: var(--muted); }
.callout h3 { margin-bottom: .3em; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid #3a3e45; padding-top: 1rem; }
.steps li::before {
  content: "0" counter(step);
  display: block; font-family: var(--mono); font-weight: 700; color: var(--dark-accent); margin-bottom: .5rem;
}
.steps p { margin: 0; }

/* Two column + lists */
.two-col { display: grid; gap: 2rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.checklist li { position: relative; padding: .8rem 1rem .8rem 2.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.checklist li::before {
  content: ""; position: absolute; left: 1rem; top: 1.2rem; width: .8rem; height: .45rem;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.numbered { padding-left: 1.4rem; margin: 0 0 1.5rem; }
.numbered li { margin-bottom: .6rem; padding-left: .3rem; }
.numbered li::marker { font-family: var(--mono); color: var(--accent); font-weight: 700; }
.note { font-size: .95rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 1rem; }
.small { font-size: .95rem; color: var(--muted); margin-top: 1.25rem; }

/* Quote box */
.quote-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; align-self: start; }
.template {
  font-family: var(--mono); font-size: .85rem; line-height: 1.55;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  padding: 1.1rem 2.5rem 1.1rem 0; font-weight: 700; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 1.4rem; color: var(--accent);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); }

/* Prose */
.prose h2 { font-size: 1.4rem; margin-top: 2rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

/* CTA band */
.cta-band { background: var(--accent); color: #fff; }
.cta-band-inner { padding-top: 3rem; padding-bottom: 3rem; }
.cta-band a:not(.btn) { color: #fff; }
.cta-band .btn { background: var(--ink); border-color: var(--ink); color: #fff; }
.cta-band .btn:hover { background: #000; border-color: #000; }
.cta-band :focus-visible { outline-color: #fff; }

/* Footer */
.site-footer { background: var(--dark); color: var(--dark-ink); padding: 3rem 0 1.5rem; }
.site-footer a { color: var(--dark-ink); }
.site-footer a:hover { color: var(--dark-accent); }
.site-footer :focus-visible { outline-color: var(--dark-accent); }
.footer-inner { display: grid; gap: 2rem; }
.footer-name { font-weight: 800; font-size: 1.2rem; margin-bottom: .4rem; }
.footer-brand p:not(.footer-name) { color: var(--dark-muted); max-width: 26rem; }
.footer-heading { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dark-accent); margin-bottom: .75rem; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.footer-nav a { display: inline-block; padding: .35rem 0; }
.footer-base { border-top: 1px solid #3a3e45; margin-top: 2rem; padding-top: 1.25rem; font-size: .9rem; color: var(--dark-muted); }
.footer-base p { margin: 0; }

.page-404 { border-bottom: 0; padding-bottom: 4rem; }

@media (min-width: 48rem) {
  .hero-inner { padding-top: 5rem; padding-bottom: 5.5rem; }
  .section { padding: 5rem 0; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .two-col { grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
  .footer-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .cta-band-inner { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 2rem; }
  .cta-band-inner h2 { grid-column: 1; margin-bottom: .25em; }
  .cta-band-inner p { grid-column: 1; margin: 0; }
  .cta-band-inner .btn { grid-column: 2; grid-row: 1 / span 2; }
}
@media (min-width: 48rem) {
  /* Keep tight sections tight on wide screens (the .section rule above would otherwise win). */
  .section.section-tight { padding: 3rem 0; }
}
@media (min-width: 64rem) {
  .steps { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { grid-template-columns: 2fr 1.3fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}

/* Small phones: keep all nav items, including the quote button, on one row under the wordmark. */
@media (max-width: 47.99rem) {
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: space-between; gap: .25rem .5rem; flex-wrap: nowrap; }
  .site-nav a:not(.btn) { font-size: .875rem; }
  .site-nav .btn-small { font-size: .875rem; padding: .4rem .8rem; white-space: nowrap; }
  .site-nav a:not(.btn) { white-space: nowrap; }
}
/* Five nav items do not fit one row below ~430px: let them wrap onto a second row instead of overflowing. */
@media (max-width: 29rem) {
  .site-nav ul { flex-wrap: wrap; justify-content: flex-start; column-gap: 1.1rem; }
}

/* Utilities */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Linked service cards: heading link covers the whole card */
.cards-linked .card { position: relative; transition: border-color .15s; }
.cards-linked .card:hover { border-color: var(--accent); }
.cards-linked h3 a { color: var(--ink); text-decoration: none; }
.cards-linked h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.cards-linked h3 a::before { content: "\2192"; content: "\2192" / ""; float: right; margin-left: .5rem; color: var(--accent); font-family: var(--mono); }
.cards-linked .card:hover h3 a { text-decoration: underline; text-decoration-color: var(--accent); }
.cards-linked h3 a:focus-visible { outline: none; }
.cards-linked .card:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Page heads with a decorative secondary brand mark */
.page-mark { width: 4.5rem; height: auto; margin-bottom: 1.25rem; }
.kicker a { color: inherit; }
@media (min-width: 48rem) {
  .page-head-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 3rem; align-items: center; }
  .page-head-inner > * { grid-column: 1; }
  .page-head-inner > .page-mark { grid-column: 2; grid-row: 1 / span 3; width: 8rem; margin: 0 0 1rem; }
}

/* Callout with a mark on top (services overview) */
.callout-stack { flex-direction: column; margin-top: 0; }
.callout-stack .page-mark { width: 4rem; margin: 0; }

/* Dark sections: links and the detailed steps list */
.section-dark a { color: var(--dark-accent); }
.section-dark :focus-visible { outline-color: var(--dark-accent); }
.steps-detailed { margin-top: 0; }
.section-more { margin: 2rem 0 0; font-weight: 700; }

/* File guide */
.toc { padding-bottom: 0; }
.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.toc-list a { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .95rem; text-decoration: none; }
.toc-list a:hover { border-color: var(--accent); }
.guide h2 { scroll-margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.guide h2:first-child { border-top: 0; padding-top: 0; }
.guide h3 { font-size: 1.1rem; margin: 1.5rem 0 .4rem; }
.guide p, .guide li { color: var(--muted); }
.guide strong { color: var(--ink); }

/* Recent work grid (unused until real photos exist; see OWNER TODO in src/pages/index.html) */
.work-grid { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.work-grid figure { margin: 0; }
.work-grid img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.work-grid figcaption { font-size: .95rem; color: var(--muted); margin-top: .4rem; }

/* Machines and materials */
.anchor-target { scroll-margin-top: 1rem; }
.section-intro { color: var(--muted); max-width: 46rem; }
.spec-grid { display: grid; gap: 1rem; margin: 1.5rem 0; }
.spec-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; min-width: 0; }
.spec-card h3 { margin: 0 0 .75rem; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.spec-table th, .spec-table td { text-align: left; vertical-align: top; padding: .55rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.spec-table tr:first-child th, .spec-table tr:first-child td { border-top: 0; }
.spec-table th { width: 42%; padding-right: .75rem; font-weight: 600; color: var(--muted); }
.source-list { padding-left: 1.2rem; margin: .5rem 0 0; }
.source-list li { margin-bottom: .35rem; overflow-wrap: anywhere; }
.sources { border-top: 1px solid var(--line); }
@media (min-width: 48rem) {
  .spec-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .spec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spec-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* brand:anim (generated by brand/build_brand.py: animated 7B hero mark) */
@keyframes ffa0{0%,2.00%{opacity:0}4.10%,86%{opacity:1}95%,100%{opacity:0}}
.ffa0{animation:ffa0 5.0s cubic-bezier(.3,.7,.3,1) infinite;transform-box:fill-box;transform-origin:50% 50%}
@keyframes ffa1{0%,5.50%{opacity:0}7.60%,86%{opacity:1}95%,100%{opacity:0}}
.ffa1{animation:ffa1 5.0s cubic-bezier(.3,.7,.3,1) infinite;transform-box:fill-box;transform-origin:50% 50%}
@keyframes ffa2{0%,9.00%{opacity:0}11.10%,86%{opacity:1}95%,100%{opacity:0}}
.ffa2{animation:ffa2 5.0s cubic-bezier(.3,.7,.3,1) infinite;transform-box:fill-box;transform-origin:50% 50%}
@keyframes ffa3{0%,12.50%{opacity:0}14.60%,86%{opacity:1}95%,100%{opacity:0}}
.ffa3{animation:ffa3 5.0s cubic-bezier(.3,.7,.3,1) infinite;transform-box:fill-box;transform-origin:50% 50%}
@keyframes ffa4{0%,17.00%{opacity:0;transform:translateX(-5px)}24.00%,86%{opacity:1;transform:translateX(0)}95%,100%{opacity:0;transform:translateX(0)}}
.ffa4{animation:ffa4 5.0s cubic-bezier(.3,.7,.3,1) infinite;transform-box:fill-box;transform-origin:50% 50%}
@keyframes ffa5{0%,25.00%{opacity:1;clip-path:inset(100% 0 0 0)}46.00%,86%{opacity:1;clip-path:inset(0 0 0 0)}95%,100%{opacity:0;clip-path:inset(0 0 0 0)}}
.ffa5{animation:ffa5 5.0s cubic-bezier(.3,.7,.3,1) infinite;transform-box:fill-box;transform-origin:50% 100%}
@media (prefers-reduced-motion: reduce) { .hero-mark * { animation: none !important; } }
/* /brand:anim */
