/* Doverna - "drafting sheet" look, navy with a dot grid (12-04).
   Two themes from one set of colour tokens:
     dark navy  - the default, also what shows without JavaScript;
     light      - html[data-theme="light"], set by theme.js and kept in localStorage.
   DIN-style system type, mono annotations, teal from the logo and a red-line
   accent. No frameworks, no web fonts, no inline styles (the CSP allows
   style-src 'self' only). */

/* ---- colour tokens: dark navy (default). The second selector keeps the
   navy band, the footer and the drawing thumbnails dark inside the light theme. */
:root,
html[data-theme="light"] section.band,
html[data-theme="light"] footer,
html[data-theme="light"] .project .art {
  --bg: #0c1b42;            /* page ground */
  --bg-head: #0a1738;
  --bg-hero: #091534;
  --bg-band: #12285a;       /* logo navy */
  --bg-inset: #0a1738;
  --surface: #112350;       /* cards, form sheet */
  --field: #0a1738;
  --field-line: #6f84bd;
  --field-hover: #b7c7f0;
  --field-focus: #0c1b42;
  --field-ring: rgba(143, 166, 224, 0.4);
  --field-on: #1b3678;
  --field-off: #18264b;
  --field-off-ink: #8493bb;
  --text: #dbe3f7;
  --text-soft: #aebbe2;
  --heading: #ffffff;
  --line: rgba(143, 166, 224, 0.28);
  --line-strong: rgba(143, 166, 224, 0.42);
  --rule: #8fa6e0;          /* drafting lines and mono annotations */
  --mark: #ff5c39;          /* red-line text */
  --link: #ffffff;
  --link-hover: #ffb199;
  --dot: rgba(170, 188, 236, 0.26);
  --dot-soft: rgba(170, 188, 236, 0.13);
  --dot-major: rgba(255, 92, 57, 0.55);
  --veil: 9, 21, 52;
  --ghost-line: rgba(255, 255, 255, 0.45);
  --ghost-fill: rgba(255, 255, 255, 0.08);
  --invert-bg: #ffffff;
  --invert-ink: #0a1738;
  --card-top: #8fa6e0;
  --lift: #050b1d;          /* the one near-black accent: hover shadow */
  --dash: #6f84bd;
  --live-bg: rgba(20, 184, 166, 0.14);
  --live-ink: #6fe3d4;
  --live-line: rgba(20, 184, 166, 0.5);
  --err: #ffa594;
  --err-line: #ff7a66;
  --err-bg: #3a1622;
  --err-ink: #ffd6ce;
  --ok-bg: rgba(20, 184, 166, 0.12);
  --ok-line: #14b8a6;
  --art-strong: #ffffff;
  --art-bar: rgba(143, 166, 224, 0.3);
  --art-bar-strong: rgba(255, 255, 255, 0.82);
  --focus: #ffffff;
}

/* ---- colour tokens: light ---- */
html[data-theme="light"] {
  --bg: #edf1f8;
  --bg-head: #ffffff;
  --bg-hero: #f6f8fc;
  --bg-inset: #ffffff;
  --surface: #ffffff;
  --field: #fbfcfe;
  --field-line: #7482a8;
  --field-hover: #12285a;
  --field-focus: #ffffff;
  --field-ring: rgba(18, 40, 90, 0.28);
  --field-on: #e9eefb;
  --field-off: #e6eaf3;
  --field-off-ink: #7c86a3;
  --text: #0f1d40;
  --text-soft: #46527a;
  --heading: #0f1d40;
  --line: #cdd5e6;
  --line-strong: #a9b5d2;
  --rule: #4a5d96;
  --mark: #b93216;
  --link: #12285a;
  --link-hover: #b93216;
  --dot: rgba(18, 40, 90, 0.24);
  --dot-soft: rgba(18, 40, 90, 0.11);
  --dot-major: rgba(255, 92, 57, 0.7);
  --veil: 246, 248, 252;
  --ghost-line: rgba(18, 40, 90, 0.5);
  --ghost-fill: rgba(18, 40, 90, 0.06);
  --invert-bg: #12285a;
  --invert-ink: #ffffff;
  --card-top: #12285a;
  --lift: #12285a;
  --dash: #8d99b8;
  --live-bg: #dff5f1;
  --live-ink: #0a6b62;
  --live-line: #9fdcd3;
  --err: #a12020;
  --err-line: #a12020;
  --err-bg: #fdf0ef;
  --err-ink: #7a1717;
  --ok-bg: #e4f6f3;
  --ok-line: #0a6b62;
  --art-strong: #12285a;
  --art-bar: rgba(18, 40, 90, 0.2);
  --art-bar-strong: rgba(18, 40, 90, 0.78);
  --focus: #12285a;
  color-scheme: light;
}

:root {
  --navy: #12285a;        /* logo tile */
  --deep: #0a1738;
  --teal: #14b8a6;        /* logo bracket */
  --red: #ff5c39;         /* red-line markup */
  --radius: 5px;
  --display: "Bahnschrift", "DIN Alternate", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* --head-h is the height of the fixed header: a fallback here, the measured
   value from theme.js. Anchors and focused fields stop below the header. */
html { scroll-behavior: smooth; background: var(--bg); --head-h: 68px; scroll-padding-top: calc(var(--head-h) + 14px); }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot-soft) 1px, transparent 1.6px);
  background-size: 28px 28px;
  background-position: 13px 13px;
  line-height: 1.6;
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--red); }
a:hover { color: var(--link-hover); }
a:focus-visible, .btn:focus-visible, .theme-switch:focus-visible, .menu-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: 10px 14px;
}
.skip:focus { left: 8px; top: 8px; z-index: 10; }
/* Read by screen readers, not shown: e.g. "(opens in a new tab)". */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
h1, h2, h3, p, li, dd { overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--display); font-stretch: 88%; letter-spacing: -0.01em; color: var(--heading); }

.wrap { width: min(1120px, 90%); margin: 0 auto; }

/* ---- header ---- */
/* stays at the top while the page scrolls under it; solid ground, so nothing shows through */
header.site {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg-head);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 6px 18px rgba(4, 9, 24, 0.28);
}
html[data-theme="light"] header.site { box-shadow: 0 6px 18px rgba(18, 40, 90, 0.1); }
header.site .wrap {
  display: flex; align-items: center;
  padding: 12px 0; gap: 8px 20px; flex-wrap: wrap;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 1.55rem; font-weight: 700;
  color: var(--heading); text-decoration: none; letter-spacing: 0;
}
.logo:hover { color: var(--heading); }
.logo img { display: block; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; margin-left: auto; }
nav a {
  display: inline-block; padding: 10px 0;
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-soft); text-decoration: none;
  border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--heading); border-bottom-color: var(--red); }
/* scroll-spy (theme.js): the section in view */
nav a[aria-current] { color: var(--heading); border-bottom-color: var(--red); }
nav a:last-child {
  color: var(--heading); font-weight: 700;
  border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 7px 12px;
}
nav a:last-child:hover, nav a:last-child[aria-current] { background: var(--invert-bg); color: var(--invert-ink); border-color: var(--invert-bg); }

/* theme switch: two cells, the active one filled. Shown by theme.js. */
.theme-switch {
  display: inline-flex; align-items: stretch; padding: 0; margin: 0; overflow: hidden;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: transparent; color: var(--text-soft); cursor: pointer;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
}
.theme-switch[hidden] { display: none; }
.theme-switch span { display: flex; align-items: center; padding: 0 10px; min-height: 38px; }
.theme-switch span + span { border-left: 1.5px solid var(--line-strong); }
.theme-switch:hover { border-color: var(--rule); color: var(--heading); }
html:not([data-theme="light"]) .theme-switch .is-dark,
html[data-theme="light"] .theme-switch .is-light {
  background: var(--invert-bg); color: var(--invert-ink); font-weight: 700;
}

/* phone menu: below 720 px theme.js (html.js) folds the menu and the theme
   switch into a panel under a one-row header. Without JavaScript the menu
   stays open in rows, as on a tablet. */
.menu { display: contents; }
.menu-btn {
  display: none; align-items: center; gap: 9px; min-height: 40px; padding: 0 12px; margin: 0;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: transparent; color: var(--heading); cursor: pointer;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
}
.menu-btn .bars {
  display: block; width: 16px; height: 2px; background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}
.menu-btn[aria-expanded="true"] { background: var(--invert-bg); color: var(--invert-ink); border-color: var(--invert-bg); }

/* ---- shared pieces ---- */
.tag {
  display: block; margin: 0 0 14px;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--rule);
}
.tag b { color: var(--mark); font-weight: 700; margin-right: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: var(--radius);
  font-family: var(--body); font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; border: 2px solid var(--red);
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn.primary { background: var(--red); color: var(--deep); }
.btn.primary:hover { background: #ff7a5c; border-color: #ff7a5c; color: var(--deep); }
.btn.primary::after { content: "\2192"; transition: transform 0.15s ease; }
.btn.primary:hover::after { transform: translateX(4px); }
.btn.ghost { background: transparent; color: var(--heading); border-color: var(--ghost-line); }
.btn.ghost:hover { border-color: var(--heading); color: var(--heading); background: var(--ghost-fill); }
.btn:active { transform: translateY(1px); }

section { padding: 76px 0; }
h2 {
  font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.05; font-weight: 700;
  margin: 0 0 18px;
}
h3 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.15; font-weight: 700; }
section p { max-width: 42em; }
.note { font-size: 0.92rem; color: var(--text-soft); }

/* ---- hero ---- */
.hero {
  position: relative; overflow: hidden;
  padding: 72px 0 0;
  color: var(--heading);
  background-color: var(--bg-hero);
  background-image:
    radial-gradient(circle, var(--dot-major) 1.4px, transparent 2px),
    radial-gradient(circle, var(--dot) 1px, transparent 1.6px);
  background-size: 140px 140px, 28px 28px;
  background-position: 13px 13px, 13px 13px;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 80% at 22% 40%, rgba(var(--veil), 0.96) 0%, rgba(var(--veil), 0.55) 55%, rgba(var(--veil), 0) 100%);
}
.hero .wrap { position: relative; }
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr; }
.eyebrow {
  margin: 0 0 22px; font-family: var(--mono); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--rule);
}
.eyebrow::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 12px;
  background: var(--teal); border-radius: 50%;
}
.hero h1 {
  font-size: clamp(2.7rem, 7.4vw, 5rem); font-weight: 700;
  line-height: 0.98; margin: 0 0 24px; max-width: 11em; letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal; white-space: nowrap;
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 96% / 100% 0.09em;
  padding-bottom: 0.04em;
}
.hero p.lead { font-size: 1.18rem; color: var(--text); max-width: 33em; margin: 0 0 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-art { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.art .ln { fill: none; stroke: var(--rule); stroke-width: 1.5; }
.art .ln-strong { fill: none; stroke: var(--art-strong); stroke-width: 2; }
.art .solid { fill: var(--bg-hero); }
.art .bar { fill: var(--art-bar); }
.art .bar-strong { fill: var(--art-bar-strong); }
.art .red-fill { fill: var(--red); }
.art .red { fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.art .teal { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.art .teal-thick { fill: none; stroke: var(--teal); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.art .teal-fill { fill: var(--teal); }
.art .dim { fill: none; stroke: var(--rule); stroke-width: 1; opacity: 0.75; }
.art text {
  font-family: var(--mono); font-size: 11px; fill: var(--rule); letter-spacing: 0.08em;
}
.art text.red-text { fill: var(--mark); }

/* title block, like the corner of a drawing sheet */
.titleblock {
  margin: 56px 0 0; padding: 0;
  display: grid; grid-template-columns: 1fr;
  border: 1px solid var(--line-strong); border-bottom: 0;
  background: rgba(var(--veil), 0.86);
}
.titleblock div {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px;
  padding: 11px 14px; border-bottom: 1px solid var(--line-strong);
}
.titleblock div:last-child { border-bottom: 0; }
.titleblock dt {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--rule);
}
.titleblock dd { margin: 0; font-family: var(--display); font-size: 1.12rem; font-weight: 600; color: var(--heading); }

/* ---- live work ---- */
.grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
}
.card > :last-child { margin-bottom: 0; }
.work { margin-top: 30px; }
.project {
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.project:hover { transform: translateY(-4px); border-color: var(--rule); box-shadow: 8px 8px 0 var(--lift); }
.project .art {
  display: block; width: 100%; height: auto; background-color: var(--bg-inset);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.6px);
  background-size: 20px 20px;
  border-bottom: 1px solid var(--line);
}
.project .body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.project .body > :last-child { margin: auto 0 0; padding-top: 8px; }
.project .kind { margin: 0 0 12px; font-weight: 600; color: var(--text-soft); }
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-soft);
}
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 3px 9px; border-radius: 3px;
}
.badge.live { background: var(--live-bg); color: var(--live-ink); border: 1px solid var(--live-line); }
.badge.live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  animation: pulse 2.4s ease-in-out infinite;
}
.badge.soon { background: transparent; color: var(--text-soft); border: 1px dashed var(--dash); }
.go {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; text-decoration: none; color: var(--link);
  border-bottom: 2px solid var(--red); padding-bottom: 2px;
}
.go::after { content: "\2197"; transition: transform 0.15s ease; }
.go:hover::after { transform: translate(3px, -3px); }

/* ---- in development: dashed outlines, the drafting sign for "not built yet" ---- */
#soon { padding-top: 0; }
.planned {
  background: transparent; border: 1.5px dashed var(--dash);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.planned h3 { margin: 0; }
.planned .badge { margin: 0; }

/* ---- work with us: the navy band (stays navy in the light theme) ---- */
section.band {
  color: var(--text); background-color: var(--bg-band);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.6px);
  background-size: 28px 28px;
  background-position: 13px 13px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
section.band > .wrap > p:not(.note) { font-size: 1.1rem; }
.steps-title { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rule); font-weight: 400; font-stretch: 100%; margin: 40px 0 0; }
.steps {
  counter-reset: step; list-style: none; padding: 0; margin: 16px 0 0;
  display: grid; gap: 0; border: 1px solid var(--line-strong);
  background: var(--bg-inset);
}
.steps li {
  counter-increment: step; position: relative;
  padding: 24px 24px 26px; color: var(--text);
  border-bottom: 1px solid var(--line-strong);
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: "0" counter(step);
  display: block; margin-bottom: 14px;
  font-family: var(--display); font-stretch: 80%; font-weight: 700; font-size: 3.4rem; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--red);
}
.steps li strong { display: block; font-family: var(--display); font-size: 1.35rem; color: var(--heading); margin-bottom: 6px; }
.steps + .note { margin-top: 22px; }

/* ---- contact / estimate form ---- */
#contact .intro { display: grid; gap: 8px 48px; grid-template-columns: 1fr; margin-bottom: 30px; }
#estimate-card { padding: 30px 26px; border-top: 4px solid var(--card-top); }
form.estimate { counter-reset: fs; }
form.estimate fieldset {
  border: 0; margin: 0 0 30px; padding: 0 0 4px; min-width: 0;
  counter-increment: fs;
}
form.estimate legend {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; width: 100%;
  font-family: var(--display); font-stretch: 88%; font-weight: 700; font-size: 1.3rem;
  color: var(--heading);
  padding: 0 0 8px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
form.estimate legend::before {
  content: counter(fs, decimal-leading-zero);
  font-family: var(--mono); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--mark);
}
form.estimate .opt { font-family: var(--body); font-stretch: 100%; font-weight: 400; color: var(--text-soft); font-size: 0.9rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; }
.hint { margin: 0 0 6px; font-size: 0.92rem; color: var(--text-soft); }
form.estimate input[type=text], form.estimate input[type=email], form.estimate input[type=tel],
form.estimate input[type=date], form.estimate select, form.estimate textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--field);
  border: 1.5px solid var(--field-line); border-radius: var(--radius); padding: 11px 12px; min-height: 48px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
form.estimate select option { background: var(--field); color: var(--text); }
form.estimate input:hover, form.estimate select:hover, form.estimate textarea:hover { border-color: var(--field-hover); }
form.estimate textarea { resize: vertical; }
form.estimate input:focus-visible, form.estimate select:focus-visible,
form.estimate textarea:focus-visible {
  outline: none; border-color: var(--field-hover); background: var(--field-focus);
  box-shadow: 0 0 0 3px var(--field-ring);
}
form.estimate button:focus-visible, label.choice input:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
form.estimate input:disabled { background: var(--field-off); color: var(--field-off-ink); border-color: var(--line); }
.row2 { display: grid; gap: 0 20px; grid-template-columns: 1fr; }
.choices { display: grid; gap: 8px; grid-template-columns: 1fr; }
label.choice {
  display: flex; align-items: center; gap: 10px; font-weight: 400;
  padding: 10px 12px; border: 1.5px solid var(--field-line); border-radius: var(--radius);
  background: var(--field); cursor: pointer; min-height: 48px; margin: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
label.choice:hover { border-color: var(--field-hover); }
label.choice:has(input:checked) { border-color: var(--field-hover); background: var(--field-on); box-shadow: inset 4px 0 0 var(--teal); font-weight: 600; }
label.choice input { width: 20px; height: 20px; accent-color: var(--teal); flex: none; margin: 0; }
html[data-theme="light"] label.choice input { accent-color: var(--navy); }
label.choice.inline { margin-top: 8px; }
.field.other { margin-top: 12px; }
.err { margin: 6px 0 0; color: var(--err); font-size: 0.92rem; font-weight: 600; }
.err[hidden], .field.other[hidden] { display: none; }
.invalid { border-color: var(--err-line) !important; }
.form-summary { border: 2px solid var(--err-line); background: var(--err-bg); color: var(--err-ink); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 20px; font-weight: 600; }
.form-summary[hidden], .thanks[hidden], form.estimate[hidden] { display: none; }
.thanks { border: 2px solid var(--ok-line); background: var(--ok-bg); border-radius: var(--radius); padding: 22px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { font-size: 0.95rem; }
form.estimate button.btn { cursor: pointer; }
form.estimate button.btn:disabled { opacity: 0.6; cursor: wait; }

/* ---- footer: the darkest strip on the page, in both themes ---- */
footer {
  background: #060d22; color: var(--text-soft); padding: 30px 0; font-size: 0.92rem;
  border-top: 4px solid var(--teal);
}
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
footer .links { display: flex; flex-wrap: wrap; gap: 0 20px; font-family: var(--mono); font-size: 0.82rem; }
footer a { display: inline-block; padding: 6px 0; color: #fff; }
footer a:hover { color: #ffb199; }
footer a:focus-visible { outline-color: #fff; }

/* ---- privacy / terms ---- */
main.doc {
  margin: 44px 0 64px; padding: 34px 26px 38px; max-width: 50em;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--card-top);
  border-radius: var(--radius);
}
main.doc h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); line-height: 1; margin: 0 0 10px; }
main.doc h1 + p { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); margin-top: 0; }
main.doc h2 { font-size: 1.5rem; margin: 34px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---- motion ---- */
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: no-preference) {
  .hero-art .draw { stroke-dasharray: 1; animation: draw 1.3s cubic-bezier(0.6, 0, 0.2, 1) backwards; }
  .hero-art .d2 { animation-delay: 0.35s; }
  .hero-art .d3 { animation-delay: 0.8s; }
  .hero-art .d4 { animation-delay: 1.3s; }
  .hero-art .pop { animation: fade 0.5s ease 1.5s backwards; }
  .hero-art .pop.d2 { animation-delay: 0.9s; }
  .hero-copy > * { animation: rise 0.6s ease backwards; }
  .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.16s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.24s; }
  @supports (animation-timeline: view()) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- wider screens ---- */
@media (min-width: 720px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .choices { grid-template-columns: 1fr 1fr; }
  .titleblock { grid-template-columns: repeat(3, 1fr); }
  .titleblock div { display: block; padding: 14px 18px; border-bottom: 0; border-right: 1px solid var(--line-strong); }
  .titleblock div:last-child { border-right: 0; }
  .titleblock dt { margin-bottom: 2px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { border-bottom: 0; border-right: 1px solid var(--line-strong); }
  .steps li:last-child { border-right: 0; }
  #estimate-card { padding: 40px 44px; }
  main.doc { padding: 48px 56px 52px; }
}
@media (min-width: 960px) {
  .hero { padding-top: 88px; }
  .hero-grid { grid-template-columns: 1.08fr 0.92fr; gap: 48px; }
  #contact .intro { grid-template-columns: 1fr 1fr; align-items: end; }
  #contact .intro p { margin: 0 0 18px; }
  .choices.three { grid-template-columns: 1fr 1fr 1fr; }
}
/* narrow header: logo and theme switch on the first row, the menu under them */
@media (max-width: 940px) {
  html { --head-h: 112px; }
  header.site .theme-switch { margin-left: auto; }
  header.site nav { order: 3; flex-basis: 100%; margin-left: 0; }
}
@media (max-width: 719.98px) {
  html.js { --head-h: 58px; }
  html.js header.site .wrap { flex-wrap: nowrap; padding: 8px 0; }
  html.js .menu-btn { display: inline-flex; margin-left: auto; }
  html.js .menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    padding: 6px 5% 20px; max-height: calc(100vh - var(--head-h)); overflow-y: auto;
    background: var(--bg-head); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 14px 24px rgba(4, 9, 24, 0.35);
  }
  html.js .menu.open { display: block; }
  html.js .menu nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0; }
  html.js .menu nav a {
    padding: 15px 0 15px 14px; font-size: 0.86rem;
    border-bottom: 1px solid var(--line); box-shadow: inset 3px 0 0 transparent;
  }
  html.js .menu nav a:hover { border-bottom-color: var(--line); }
  html.js .menu nav a[aria-current] { border-bottom-color: var(--line); box-shadow: inset 3px 0 0 var(--red); }
  html.js .menu nav a:last-child {
    margin-top: 16px; padding: 13px 14px; text-align: center;
    border: 1.5px solid var(--rule); box-shadow: none;
  }
  html.js .menu nav a:last-child[aria-current] { border-color: var(--invert-bg); }
  html.js .menu .theme-switch { margin: 16px 0 0; }
  html.js .menu .theme-switch span { min-height: 40px; padding: 0 14px; }
}
@media (max-width: 520px) {
  html { --head-h: 124px; }
  header.site .wrap { padding: 8px 0 6px; gap: 2px 16px; }
  .logo { font-size: 1.35rem; }
  .logo img { width: 32px; height: 32px; }
  .theme-switch span { min-height: 34px; }
  nav a { padding: 6px 0; }
  body { font-size: 16px; }
  section { padding: 52px 0; }
  .hero { padding-top: 44px; }
  .hero p.lead { font-size: 1.06rem; }
  .actions { flex-direction: column; }
  .actions .btn { justify-content: center; }
  nav { gap: 0 16px; }
  nav a { font-size: 0.72rem; }
  nav a:last-child { padding: 4px 9px; }
  .titleblock { margin-top: 40px; }
  .titleblock dd { font-size: 1rem; }
  .project .body, .card { padding: 20px; }
  .card.project { padding: 0; }
  #estimate-card { padding: 22px 16px; }
  form.estimate button.btn { display: flex; width: 100%; justify-content: center; }
}
