/* Layout concept: a dragon's forge. Work-order tickets, a posted rate board and a component datasheet,
   set on black with ember-red heat and dragon-scale texture. Dark-only.
   Contrast notes (WCAG 2.2 AA): --muted ≥ 5.6:1 and --copper ≥ 4.7:1 on every light surface; dark theme
   values are all ≥ 6.7:1. --field-line is the 3:1 non-text border for form controls. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-600.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
/* Metric-matched fallback keeps layout from jumping while Archivo loads. */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial");
  size-adjust: 104%;
  ascent-override: 88%;
  descent-override: 21%;
}

/* Ember palette: the forge at night. Dark-only by design (a dragon brand in light mode loses its point).
   Contrast on --paper: --ink 16.8:1, --muted 8.5:1, --copper (ember text) 7.2:1, --ok (amber) 9.6:1,
   --field-line 3.2:1 (non-text), white on --fire 6.7:1, --fire on --paper 3.0:1 (button edge). */
:root {
  --paper: #0A0607;
  --surface: #140C0D;
  --sunk: #0F0909;
  --ink: #F1E9E6;
  --muted: #B3A5A1;
  --line: #2A1719;
  --field-line: #7A5658;
  --board: #120A0B;
  --board-ink: #F1E9E6;
  --board-muted: #B3A5A1;
  --board-copper: #FF7A3D;
  --copper: #FF6B4A;
  --ember: #E5392C;
  --fire: #B3201A;
  --molten: #FF7A3D;
  --ok: #FF9A5C;
  --bad: #FF8A80;
  --scale: rgba(229, 57, 44, 0.10);
  --display: "Archivo", "Archivo Fallback", "Arial Narrow", system-ui, sans-serif;
  --body: "Archivo", "Archivo Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --max: 1120px;
  --bar-h: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--bar-h);
}
a { color: inherit; text-decoration-color: var(--copper); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--copper); }
.board a:hover { color: var(--board-copper); }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.board :focus-visible { outline-color: var(--board-copper); }
img, svg { display: block; max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); }
.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
p { margin: 0; }

h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(36px, 4.7vw, 60px); line-height: 1; font-weight: 800; font-variation-settings: "wdth" 125; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.05; font-weight: 800; font-variation-settings: "wdth" 118; letter-spacing: -0.01em; }
h3 { font-size: 19px; line-height: 1.25; font-weight: 700; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Skip link */
.skip {
  position: absolute; left: 12px; top: -100px; z-index: 50;
  background: var(--fire); color: #fff; padding: 12px 16px; border-radius: 4px;
  font: 600 15px/1 var(--body); text-decoration: none;
}
.skip:focus { top: 12px; color: #fff; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); }
@supports (backdrop-filter: blur(8px)) { .top { backdrop-filter: blur(8px); } }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; min-height: 64px; }
.mark { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 125; font-size: 18px; letter-spacing: 0.01em; white-space: nowrap; }
.mark img { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 4px; }
.menu { display: flex; align-items: center; gap: 2px; font-size: 15px; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 10px; text-decoration: none; color: var(--muted); border-radius: 4px; }
.menu a:hover, .menu a[aria-current] { color: var(--ink); }
.menu a[aria-current] { box-shadow: inset 0 -2px 0 var(--copper); border-radius: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 6px;
  font: 600 16px/1 var(--body); text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
}
.btn:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn.solid { background: var(--fire); border-color: var(--fire); color: #fff; }
.btn.solid:hover { background: #C8261E; border-color: #C8261E; color: #fff; box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--ember) 80%, transparent); }
.btn.on-board { border-color: var(--board-ink); color: var(--board-ink); }
.btn.on-board:hover { background: color-mix(in srgb, var(--board-ink) 12%, transparent); color: var(--board-ink); }
.btn.on-board.solid { background: var(--fire); border-color: var(--fire); color: #fff; }
.btn.on-board.solid:hover { background: #C8261E; border-color: #C8261E; color: #fff; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.textlink { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Hero (home) */
.hero { padding-block: 64px 64px; }
.hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.hero .copy { min-width: 0; display: grid; gap: 22px; }
.hero p.lede { font-size: 19px; color: var(--muted); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fineprint { font-size: 14px; color: var(--muted); }
.fineprint strong { color: var(--ink); font-weight: 600; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; font: 13px/1.4 var(--mono); color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 6px; height: 6px; background: var(--ember); transform: rotate(45deg); }

/* Work-order ticket (shared by the hero intake card and the job log) */
.ticket {
  position: relative; min-width: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; padding: 26px 26px 22px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px color-mix(in srgb, var(--ink) 40%, transparent);
}
.ticket.tilt { transform: rotate(1.2deg); }
.ticket::after {
  content: ""; position: absolute; left: 50%; top: -9px; width: 18px; height: 18px; margin-left: -9px;
  border-radius: 50%; background: var(--paper); border: 1px solid var(--line);
}
.ticket-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 18px; border-bottom: 2px dashed var(--line); flex-wrap: wrap; }
.ticket-head b, .ticket-head h2, .ticket-head h3 { font-family: var(--display); font-variation-settings: "wdth" 125; font-size: 20px; font-weight: 800; letter-spacing: 0; line-height: 1.2; }
.ticket-head .num { font-size: 13px; color: var(--muted); }
.ticket dl { display: grid; grid-template-columns: 112px 1fr; gap: 10px 14px; margin: 18px 0 0; font-size: 15px; }
.ticket dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.ticket dd { margin: 0; min-width: 0; }
.before-after { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.before-after s { color: var(--muted); }
.stamp {
  display: inline-block; margin-top: 18px;
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ok); border: 2px solid var(--ok); border-radius: 4px; padding: 5px 10px; transform: rotate(-3deg);
}
.stamp.copper { color: var(--copper); border-color: var(--copper); }
.ticket-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* Hero intake: pick a device, jump to the form with it preselected */
.intake p { margin-top: 16px; color: var(--muted); font-size: 15px; }
.devices { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.devices a {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--field-line); border-radius: 4px; background: var(--paper);
  text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.2;
}
.devices a:hover { border-color: var(--copper); color: var(--ink); background: var(--surface); }
.devices svg { width: 22px; height: 22px; flex: none; color: var(--copper); }
.devices a:hover svg { color: var(--copper); }

/* Sections */
.band { padding-block: 72px; border-top: 1px solid var(--line); }
.band-head { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; align-items: end; margin-bottom: 36px; }
.band-head p { color: var(--muted); max-width: 36em; }
.band-head .eyebrow { display: block; margin-bottom: 10px; }
.todo-note { font: 13px/1.5 var(--mono); color: var(--muted); }

/* Rate board */
.rates { border-top: 2px solid var(--ink); }
.rate { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; gap: 24px; padding-block: 20px; border-bottom: 1px solid var(--line); align-items: baseline; }
.rate h3 { font-size: 20px; }
.rate h3 a { text-decoration-thickness: 1px; }
.rate p { color: var(--muted); font-size: 16px; }
.rate .price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; white-space: nowrap; text-align: right; }
.rate .price small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.rates-foot { margin: 16px 0 0; font-size: 14px; color: var(--muted); }

/* Status flow */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; list-style: none; padding: 0; margin: 0; }
.flow li { padding: 0 22px 0 0; display: grid; gap: 10px; align-content: start; }
.flow .pill {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
}
.flow .pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--copper); }
.flow li:last-child .pill i { background: var(--ok); }
.flow .track { height: 2px; background: var(--line); position: relative; margin-right: -22px; }
.flow li:last-child .track { margin-right: 0; }
.flow p { color: var(--muted); font-size: 16px; }

/* Board panel (green PCB section) */
.board {
  background: var(--board); color: var(--board-ink);
  background-image:
    radial-gradient(circle at 50% 0, transparent 13px, var(--scale) 14px, transparent 15.5px),
    radial-gradient(circle at 50% 0, transparent 13px, var(--scale) 14px, transparent 15.5px);
  background-size: 30px 16px;
  background-position: 0 0, 15px 8px;
  border-top-color: transparent;
}
.board .band-head p, .board .muted, .board p { color: var(--board-muted); }
.board .label { color: var(--board-muted); }
.board h2, .board h3, .board b { color: var(--board-ink); }
.board a { text-decoration-color: var(--board-copper); }
.creds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.creds > div { display: grid; gap: 6px; align-content: start; }
.creds b { font-family: var(--display); font-variation-settings: "wdth" 115; font-size: 20px; }
.creds p { font-size: 16px; }

/* Job log (before/after gallery) */
.jobs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.job .ba { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 18px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.job .ba > div { padding: 14px 16px; display: grid; gap: 4px; }
.job .ba > div + div { border-left: 1px solid var(--line); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.job .ba b { font: 600 22px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.job .ba .after b { color: var(--ok); }
.job .ba figure { margin: 0; }
.job .ba img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }
.slot {
  display: grid; gap: 10px; align-content: center; justify-items: start; min-height: 100%;
  padding: 26px; border: 2px dashed var(--field-line); border-radius: 4px; color: var(--muted);
}
.slot b { color: var(--ink); font-family: var(--display); font-variation-settings: "wdth" 118; font-size: 20px; }

/* Reviews empty state */
.reviews { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.review-slot {
  position: relative; padding: 30px 28px; border: 2px dashed var(--field-line); border-radius: 4px; background: var(--surface);
  display: grid; gap: 12px;
}
.review-slot .stars { display: flex; gap: 6px; }
.review-slot .stars svg { width: 22px; height: 22px; color: var(--field-line); }
.review-slot p { color: var(--muted); }
.review-slot .who { font: 13px/1.4 var(--mono); color: var(--muted); }
.review-copy { display: grid; gap: 16px; }
.review-copy p { color: var(--muted); }

/* FAQ */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  min-height: 56px; padding-block: 14px; font-family: var(--display); font-variation-settings: "wdth" 108; font-weight: 700; font-size: 19px; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font: 500 22px/1 var(--mono); color: var(--copper); width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 4px;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--copper); }
.faq .answer { padding: 0 48px 22px 0; color: var(--muted); display: grid; gap: 10px; max-width: 46em; }
.faq-cols { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; }
.faq-cols .band-head { display: block; margin: 0; }
.faq-cols .band-head p { margin-top: 14px; }

/* Area + quote */
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.towns { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.towns li { display: flex; justify-content: space-between; gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.towns span { font-family: var(--mono); color: var(--muted); font-size: 14px; }

form.quote { display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 26px; scroll-margin-top: 90px; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field label .req { color: var(--copper); }
.field input, .field select, .field textarea {
  font: 16px/1.4 var(--body); color: var(--ink); background: var(--paper);
  border: 1px solid var(--field-line); border-radius: 4px; padding: 11px 12px; width: 100%; min-height: 48px;
}
.field select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--copper); outline-offset: 0; border-color: var(--copper); }
.field [aria-invalid="true"] { border-color: var(--bad); border-width: 2px; padding: 10px 11px; }
.field .err { font-size: 14px; color: var(--bad); font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.form-foot p { font-size: 14px; color: var(--muted); }
.form-status { font-size: 15px; border-radius: 4px; }
.form-status:not(:empty) { padding: 12px 14px; border: 1px solid var(--line); background: var(--paper); }
.form-status.is-error { border-color: var(--bad); color: var(--ink); }
.form-status.is-error b { color: var(--bad); }
.sent { display: grid; gap: 14px; justify-items: start; }
.sent h3 { font-size: 24px; font-variation-settings: "wdth" 118; }
.sent p { color: var(--muted); }

.email-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }
.email-line code, .email-line a.addr { font-family: var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; justify-content: center;
  font: 600 13px/1 var(--mono); background: none; border: 1px solid var(--field-line); border-radius: 4px; padding: 0 12px; color: inherit; cursor: pointer;
}
.copy-btn:hover { border-color: var(--copper); }
.copy-btn svg { width: 16px; height: 16px; }
.board .copy-btn { border-color: color-mix(in srgb, var(--board-ink) 45%, transparent); }
.board .copy-btn:hover { border-color: var(--board-copper); }

/* Sticky mobile quote bar */
.quickbar { display: none; }
@media (max-width: 760px) {
  .quickbar {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--paper) 94%, transparent); border-top: 1px solid var(--line);
    transform: translateY(0); transition: transform 0.2s ease;
  }
  @supports (backdrop-filter: blur(8px)) { .quickbar { backdrop-filter: blur(8px); } }
  .quickbar .btn { flex: 1; min-height: 48px; padding: 0 12px; }
  .quickbar .btn:not(.solid) { flex: 0 0 auto; }
  .quickbar.is-hidden { transform: translateY(110%); visibility: hidden; }
  body.has-bar { --bar-h: calc(70px + env(safe-area-inset-bottom)); }
}

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 36px; font-size: 14px; color: var(--muted); }
.foot .wrap { display: grid; grid-template-columns: 1.4fr repeat(2, minmax(0, 1fr)); gap: 28px; }
.foot ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }
.foot p { max-width: 30em; margin-top: 8px; }
.foot .legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; }

/* Sub-page header (business, privacy, case studies) */
.page-head { padding-block: 56px 40px; }
.page-head .wrap { display: grid; gap: 22px; }
.page-head p.lede { font-size: 19px; color: var(--muted); max-width: 38em; }
.crumbs { font: 13px/1.4 var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line); }
.crumbs a { display: inline-flex; min-height: 24px; align-items: center; }

/* Business plan sheet */
.plan { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.checklist { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.checklist li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.checklist li svg { width: 20px; height: 20px; color: var(--ok); margin-top: 3px; }
.checklist b { display: block; font-family: var(--display); font-variation-settings: "wdth" 110; font-size: 18px; }
.checklist p { color: var(--muted); font-size: 16px; margin-top: 2px; }
.plan .ticket dl { grid-template-columns: 130px 1fr; }

/* Prose (privacy) */
.prose { max-width: 44em; display: grid; gap: 16px; }
.prose h2 { font-size: clamp(22px, 2.6vw, 28px); margin-top: 22px; }
.prose p, .prose li { color: var(--muted); }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.prose li::marker { color: var(--copper); }
.prose strong { color: var(--ink); }

/* ===== Portfolio: datasheet ===== */
.sheet-head { padding-block: 64px 48px; }
.sheet-head .wrap { display: grid; gap: 28px; }
.part { display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--mono); font-size: 13px; color: var(--muted); border-block: 1px solid var(--line); padding-block: 12px; }
.part b { color: var(--ink); font-weight: 600; }
.part .ok { color: var(--ok); }
.sheet-intro { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: end; }
.sheet-intro p { font-size: 19px; color: var(--muted); max-width: 32em; }
.sheet-intro .actions { justify-content: flex-end; }

.learning { border-block: 1px solid var(--line); background: var(--sunk); }
.learning .wrap { display: grid; grid-template-columns: auto repeat(2, minmax(0, 1fr)); gap: 12px 40px; align-items: center; padding-block: 18px; }
.learning .item { display: grid; gap: 8px; }
.learning .item b { font-family: var(--display); font-variation-settings: "wdth" 112; font-size: 17px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.learning .item span { font: 12px/1.3 var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(90deg, var(--copper) 0 8px, transparent 8px 12px); opacity: 0.85; }

.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.features li { padding: 12px 0 12px 22px; border-bottom: 1px solid var(--line); position: relative; }
.features li::before { content: ""; position: absolute; left: 0; top: 21px; width: 8px; height: 8px; background: var(--copper); }
.board .features li { border-color: color-mix(in srgb, var(--board-ink) 18%, transparent); color: var(--board-ink); }
.board .features li::before { background: var(--board-copper); }

.projects { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.proj { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; padding-block: 30px; border-bottom: 1px solid var(--line); }
.proj aside { display: grid; gap: 8px; align-content: start; }
.proj .state { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.proj .state i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.proj .state.wip i { background: var(--copper); }
.proj .stack { font-family: var(--mono); font-size: 13px; color: var(--muted); line-height: 1.7; }
.proj h3 { font-size: 24px; font-variation-settings: "wdth" 112; margin-bottom: 10px; }
.proj ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--muted); }
.proj ul li::marker { color: var(--copper); }
.proj .links { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 10px; font-weight: 600; font-size: 15px; }
.proj .links a { display: inline-flex; align-items: center; min-height: 44px; }
.proj .links a.case { color: var(--ink); }
.proj .links a.case::after { content: "\2192"; margin-left: 6px; color: var(--copper); }

.spec { width: 100%; border-collapse: collapse; font-size: 16px; }
.spec-wrap { overflow-x: auto; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); }
.spec th { width: 200px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 400; padding-top: 17px; }
.spec tr:first-child th, .spec tr:first-child td { border-top: 2px solid var(--ink); }

.history { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.history > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding-block: 22px; border-bottom: 1px solid var(--line); }
.history .when { font-family: var(--mono); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history p { margin: 6px 0 0; color: var(--muted); }
.history ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }
.history ul li::marker { color: var(--copper); }

/* HTML résumé: reads as a single printed page */
.resume { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: clamp(22px, 4vw, 44px); display: grid; gap: 26px; }
.resume header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: end; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.resume header h3 { font-size: clamp(26px, 3vw, 34px); font-variation-settings: "wdth" 122; font-weight: 800; }
.resume header p { font: 13px/1.6 var(--mono); color: var(--muted); }
.resume section { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; }
.resume section > h4 { margin: 0; font: 600 12px/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.resume .entry + .entry { margin-top: 14px; }
.resume .entry b { font-family: var(--display); font-variation-settings: "wdth" 108; }
.resume .entry .when { display: block; font: 13px/1.5 var(--mono); color: var(--muted); }
.resume ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.resume ul li::marker { color: var(--copper); }
.resume p, .resume li { font-size: 15.5px; }

/* ===== Case studies ===== */
.case-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-block: 1px solid var(--line); margin: 0; }
.case-meta > div { padding: 12px 16px 12px 0; display: grid; gap: 4px; }
.case-meta dt { font: 12px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.case-meta dd { margin: 0; font-size: 15px; }
.case { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 96px; display: grid; gap: 2px; font-size: 14px; }
.toc a { display: flex; align-items: center; min-height: 40px; text-decoration: none; color: var(--muted); border-left: 2px solid var(--line); padding-left: 12px; }
.toc a:hover { color: var(--ink); border-color: var(--copper); }
.case-body { display: grid; gap: 56px; min-width: 0; }
.case-body section { display: grid; gap: 16px; scroll-margin-top: 90px; }
.case-body section > h2 { font-size: clamp(24px, 2.8vw, 32px); display: flex; gap: 14px; align-items: baseline; }
.case-body section > h2 .step { font: 600 13px/1 var(--mono); color: var(--copper); letter-spacing: 0.06em; }
.case-body p, .case-body li { color: var(--muted); max-width: 44em; }
.case-body ul, .case-body ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.case-body li::marker { color: var(--copper); }
.case-body strong { color: var(--ink); }
.case-body code { font: 0.9em var(--mono); background: var(--sunk); padding: 1px 5px; border-radius: 3px; color: var(--ink); }
.fault { border: 1px solid var(--line); border-left: 4px solid var(--copper); background: var(--surface); padding: 18px 20px; border-radius: 4px; display: grid; gap: 8px; }
.fault h3 { font-size: 18px; }
.fault dl { display: grid; grid-template-columns: 96px 1fr; gap: 6px 14px; margin: 0; }
.fault dt { font: 12px/1.6 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.fault dd { margin: 0; color: var(--muted); }
.diagram { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 20px; display: grid; gap: 12px; }
.diagram svg { width: 100%; height: auto; font-family: var(--mono); }
.diagram figcaption { font: 13px/1.5 var(--mono); color: var(--muted); }
.diagram .box { fill: var(--paper); stroke: var(--field-line); stroke-width: 1.5; }
.diagram .box.hot { fill: color-mix(in srgb, var(--ember) 14%, var(--paper)); stroke: var(--ember); }
.diagram .zone { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 6 5; }
.diagram .wire { fill: none; stroke: var(--copper); stroke-width: 2; }
.diagram .wire.dash { stroke-dasharray: 5 5; }
.diagram .pad { fill: var(--copper); }
.diagram .t { fill: var(--ink); font-size: 14px; font-weight: 600; }
.diagram .s { fill: var(--muted); font-size: 12px; }
.diagram .z { fill: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.shot { margin: 0; border: 2px dashed var(--field-line); border-radius: 4px; padding: 28px; display: grid; place-items: center; text-align: center; color: var(--muted); font: 13px/1.5 var(--mono); min-height: 160px; }
.next-case { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; border-top: 2px solid var(--ink); padding-top: 20px; }
.next-case a { display: grid; gap: 4px; text-decoration: none; min-height: 44px; }
.next-case a span { font: 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.next-case a b { font-family: var(--display); font-variation-settings: "wdth" 115; font-size: 20px; }

/* 404 */
.lost { padding-block: 72px 96px; }
.lost .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.lost .copy { display: grid; gap: 22px; }
.lost .copy p { color: var(--muted); font-size: 19px; }
.lost ul { list-style: none; padding: 0; margin: 0; display: grid; }
.lost ul a { display: flex; align-items: center; min-height: 44px; }

/* Responsive */
@media (max-width: 900px) {
  .hero .wrap, .split, .band-head, .sheet-intro, .reviews, .plan, .faq-cols, .lost .wrap { grid-template-columns: 1fr; gap: 32px; }
  .sheet-intro .actions { justify-content: flex-start; }
  .ticket.tilt { transform: none; }
  .flow { grid-template-columns: 1fr 1fr; gap: 28px 0; }
  .flow li:nth-child(2) .track { margin-right: 0; }
  .creds, .jobs { grid-template-columns: 1fr; gap: 24px; }
  .case { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .case-meta { grid-template-columns: 1fr 1fr; }
  .learning .wrap { grid-template-columns: 1fr; }
  .foot .wrap { grid-template-columns: 1fr 1fr; }
  .foot .wrap > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .menu .opt { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .top .wrap { min-height: 56px; gap: 8px; }
  .mark { font-size: 16px; gap: 8px; }
  .mark img { width: 26px; height: 26px; }
  .menu { font-size: 14px; }
  .menu a { padding-inline: 8px; }
  .hero { padding-block: 32px 48px; }
  .hero .copy { gap: 18px; }
  .hero p.lede { font-size: 17px; }
  .band { padding-block: 52px; }
  .rate { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
  .rate p { grid-column: 1 / -1; grid-row: 2; }
  .flow { grid-template-columns: 1fr; }
  .flow .track { display: none; }
  .towns, .features, .row2 { grid-template-columns: 1fr; }
  .ticket { padding: 22px 18px 18px; }
  .ticket dl, .plan .ticket dl { grid-template-columns: 1fr; gap: 2px; }
  .ticket dd { margin-bottom: 8px; }
  .proj, .history > div, .resume section { grid-template-columns: 1fr; gap: 12px; }
  .spec th { width: 110px; }
  .faq .answer { padding-right: 0; }
  .fault dl { grid-template-columns: 1fr; }
  .diagram { padding: 12px; }
  .case-meta { grid-template-columns: 1fr; }
  form.quote { padding: 20px 16px; }
  .foot .wrap { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 400px) {
  .menu .opt2 { display: none; }
  .devices { grid-template-columns: 1fr; }
}

/* Print: the résumé and case studies print as clean black-on-white documents */
@media print {
  :root {
    --paper: #fff; --surface: #fff; --sunk: #fff; --ink: #000; --muted: #333; --line: #bbb; --field-line: #888;
    --board: #fff; --board-ink: #000; --board-muted: #333; --copper: #000; --board-copper: #000; --ok: #000;
    color-scheme: light;
  }
  body { font-size: 11pt; padding: 0; background: #fff; }
  .top, .foot, .quickbar, .skip, .actions, .no-print, .toc, .next-case { display: none !important; }
  .band { padding-block: 16pt; border: 0; }
  .board { background: #fff; }
  a { text-decoration: none; }
  .ticket.tilt { transform: none; box-shadow: none; }
  .resume { border: 0; padding: 0; }
  body.print-resume main > *:not(#resume) { display: none !important; }
  body.print-resume #resume { padding: 0; }
  body.print-resume #resume .band-head { display: none; }
  /* Fit the résumé on one Letter page */
  body.print-resume .resume { gap: 11pt; }
  body.print-resume .resume header { padding-bottom: 9pt; }
  body.print-resume .resume section { grid-template-columns: 112pt minmax(0, 1fr); gap: 12pt; }
  body.print-resume .resume p, body.print-resume .resume li { font-size: 10pt; line-height: 1.38; }
  body.print-resume .resume .entry + .entry { margin-top: 7pt; }
  body.print-resume .resume .entry .when { font-size: 8.5pt; }
  body.print-resume .resume ul { margin-top: 3pt; gap: 1pt; }
  h2, h3 { break-after: avoid; }
  .proj, .history > div, .resume .entry, .fault, .diagram { break-inside: avoid; }
}

/* Quote section helpers (kept out of inline styles so the CSP can forbid them) */
.muted-copy { color: var(--muted); margin-top: 14px; max-width: 32em; }
#quote .email-line { margin-top: 18px; }
.area-label { display: block; margin-top: 36px; }
.contact-card { display: grid; gap: 14px; align-content: start; }
.contact-card .actions { margin-top: 8px; }
.addr.big { font-size: clamp(17px, 2.2vw, 20px); }
.diagram .scroll { overflow-x: auto; border-radius: 2px; }
.diagram .scroll svg { min-width: 640px; }
.diagram .scroll:focus-visible { outline-offset: 2px; }
figure.review-slot { margin: 0; }
.review-slot blockquote { margin: 0; color: var(--ink); font-size: 18px; }

/* ===== Motion =====
   Rules (from the ui-ux-pro-max motion guide): transform/opacity only, every animation means something,
   1–2 moving focal points per view, reveals 8–16px over 400–600ms, 40ms staggers capped at 8 items,
   exits faster than entrances, never block input. Everything here sits behind
   prefers-reduced-motion: no-preference, so reduced-motion users get the final state instantly. */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 160ms;
  --t-base: 280ms;
  --t-reveal: 560ms;
}

.hero-art { position: relative; min-width: 0; }
.hero-art .ticket { position: relative; z-index: 1; }
.hero { overflow-x: clip; }
.u-solder { background: linear-gradient(90deg, var(--ember), var(--molten), var(--ember)) no-repeat 0 92% / 100% 0.065em; padding-bottom: 0.02em; }

@media (prefers-reduced-motion: no-preference) {
  /* Cross-page transitions (Chromium): header stays put, page content swaps with a short rise */
  @view-transition { navigation: auto; }
  .top { view-transition-name: site-header; }
  main { view-transition-name: page; }
  ::view-transition-old(page) { animation: vt-out 160ms var(--ease-in) both; }
  ::view-transition-new(page) { animation: vt-in 320ms var(--ease-out) both; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

  /* Hero: the work order drops in and the underline heats up */
  @keyframes trace-draw { to { stroke-dashoffset: 0; } }
  @keyframes pad-on { to { opacity: 0.85; } }
  @keyframes signal { 0% { stroke-dashoffset: 1.25; opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }

  .hero-art .ticket { animation: ticket-in 700ms var(--ease-out) 120ms both; }
  @keyframes ticket-in { from { opacity: 0; transform: translateY(-18px) rotate(4deg); } }
  @media (max-width: 900px) { @keyframes ticket-in { from { opacity: 0; transform: translateY(14px); } } }
  .u-solder { animation: solder 900ms var(--ease-out) 500ms both; }
  @keyframes solder { from { background-size: 0% 0.065em; } }
  .hero .facts li::before { animation: led 1.2s ease-in-out 3; animation-delay: calc(1.4s + var(--i, 0) * 200ms); }
  .hero .facts li:nth-child(2)::before { --i: 1; }
  .hero .facts li:nth-child(3)::before { --i: 2; }
  @keyframes led { 50% { opacity: 0.35; } }

  /* Scroll reveal. Hidden state only exists once site.js has marked what is already on screen. */
  html.reveal-ready [data-reveal]:not(.in) { opacity: 0; transform: translateY(14px); }
  html.reveal-ready [data-reveal] { transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out); transition-delay: calc(var(--i, 0) * 45ms); }

  /* Process: the track "charges" stage by stage once the row is on screen */
  .flow .track::after { content: ""; position: absolute; inset: 0; background: var(--copper); transform: scaleX(0); transform-origin: left; }
  .flow.in .track::after { animation: charge 520ms var(--ease-out) forwards; }
  .flow.in li:nth-child(1) .track::after { animation-delay: 300ms; }
  .flow.in li:nth-child(2) .track::after { animation-delay: 820ms; }
  .flow.in li:nth-child(3) .track::after { animation-delay: 1340ms; }
  .flow .pill i { transition: transform var(--t-base) var(--ease-spring), background-color var(--t-base); }
  .flow.in li .pill i { animation: pill-on 420ms var(--ease-spring) both; }
  .flow.in li:nth-child(2) .pill i { animation-delay: 520ms; }
  .flow.in li:nth-child(3) .pill i { animation-delay: 1040ms; }
  .flow.in li:nth-child(4) .pill i { animation-delay: 1560ms; }
  @keyframes charge { to { transform: scaleX(1); } }
  @keyframes pill-on { from { transform: scale(0); } 60% { transform: scale(1.6); } to { transform: scale(1); } }

  /* Job log: the stamp lands after the ticket arrives (the job is done) */
  .job.in .stamp { animation: stamp 520ms var(--ease-spring) 420ms both; }
  @keyframes stamp { from { opacity: 0; transform: scale(1.8) rotate(-12deg); } to { opacity: 1; transform: scale(1) rotate(-3deg); } }
  .job.in .ba .after b { animation: tick-in 500ms var(--ease-out) 300ms both; }
  @keyframes tick-in { from { opacity: 0; transform: translateY(8px); } }

  /* Case-study diagrams: wires draw source → destination, then one signal pass */
  .diagram .wire.draw { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
  .diagram.in .wire.draw { animation: wire-draw 800ms var(--ease-out) forwards; animation-delay: calc(250ms + var(--i, 0) * 160ms); }
  .diagram .wire.dash { opacity: 0; }
  .diagram.in .wire.dash { animation: fade-in 500ms ease forwards; animation-delay: calc(250ms + var(--i, 0) * 160ms); }
  .diagram .sig { fill: none; stroke: var(--copper); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0.04 1.2; opacity: 0; }
  .diagram.in .sig { animation: signal 1.4s linear 2; animation-delay: calc(1400ms + var(--i, 0) * 220ms); }
  .diagram .box { transition: fill var(--t-base); }
  @keyframes fade-in { to { opacity: 1; } }
  @keyframes wire-draw { 0% { opacity: 0; stroke-dashoffset: 1; } 12% { opacity: 1; } 100% { opacity: 1; stroke-dashoffset: 0; } }

  /* Micro-interactions: quick, small, and on transform only */
  .btn { transition: transform var(--t-fast) var(--ease-out), background-color var(--t-base), color var(--t-base), border-color var(--t-base); position: relative; overflow: hidden; }
  .btn:hover { transform: translateY(-1px); }
  .btn:active { transform: translateY(0) scale(0.97); transition-duration: 80ms; }
  .btn.solid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--board-copper) 38%, transparent) 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
  .btn.solid:hover::after { transform: translateX(120%); transition: transform 700ms var(--ease-out); }
  .devices a { transition: transform var(--t-fast) var(--ease-out), border-color var(--t-base), background-color var(--t-base); }
  .devices a:hover { transform: translateY(-2px); }
  .devices a:active { transform: scale(0.97); }
  .devices a svg { transition: transform var(--t-base) var(--ease-spring); }
  .devices a:hover svg { transform: scale(1.15) rotate(-6deg); }
  .menu a { transition: color var(--t-fast), box-shadow var(--t-base); }
  .copy-btn { transition: border-color var(--t-base), transform var(--t-fast) var(--ease-out); }
  .copy-btn:active { transform: scale(0.94); }
  .top { transition: box-shadow var(--t-base), background-color var(--t-base); }
  .proj .links a.case::after { display: inline-block; transition: transform var(--t-base) var(--ease-spring); }
  .proj .links a.case:hover::after { transform: translateX(4px); }
  .toc a { transition: color var(--t-fast), border-color var(--t-base), padding-left var(--t-base) var(--ease-out); }
  .next-case a b { transition: color var(--t-fast); }

  /* FAQ: answers slide open instead of snapping (Chromium 131+, others snap as before) */
  @supports (interpolate-size: allow-keywords) {
    :root { interpolate-size: allow-keywords; }
    .faq details::details-content { block-size: 0; overflow: clip; transition: block-size 320ms var(--ease-out), content-visibility 320ms allow-discrete; }
    .faq details[open]::details-content { block-size: auto; }
  }
  .faq summary::after { transition: transform var(--t-base) var(--ease-spring), background-color var(--t-base); }
  .faq details[open] summary::after { transform: rotate(180deg); }

  /* Portfolio datasheet: one scan pass across the part line, status LED blinks a few times */
  .part { position: relative; overflow: hidden; }
  .part::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--copper) 22%, transparent), transparent); transform: translateX(-110%); animation: scan 1.6s var(--ease-out) 400ms 1 forwards; pointer-events: none; }
  @keyframes scan { to { transform: translateX(380%); } }
  .part .ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; animation: led 1.4s ease-in-out 1s 4; }

  .quickbar { transition: transform 260ms var(--ease-out), visibility 260ms; }
  .quickbar.is-hidden { transition-duration: 180ms; transition-timing-function: var(--ease-in); }
}

/* Pointer glow on the intake card (fine pointers only) */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .intake::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--t-base);
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--copper) 13%, transparent), transparent 70%);
  }
  .intake:hover::before { opacity: 1; }
  .intake > * { position: relative; }
}

.top.is-scrolled { box-shadow: 0 8px 24px -18px color-mix(in srgb, var(--ink) 55%, transparent); }
.toc a.is-active { color: var(--ink); border-color: var(--copper); padding-left: 16px; }


.job .ba b { white-space: nowrap; }
@media (max-width: 400px) { .job .ba b { font-size: 19px; } .job .ba > div { padding: 12px; } }

/* Header call to action (repair pages). Phones use the sticky quote bar instead. */
.nav-cta { min-height: 44px; padding: 0 16px; margin-left: 10px; font-size: 15px; border-radius: 6px; }
@media (max-width: 760px) { .nav-cta { display: none; } }

/* ===== Dragon hero ===== */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image:
    radial-gradient(circle at 50% 0, transparent 13px, var(--scale) 14px, transparent 15.5px),
    radial-gradient(circle at 50% 0, transparent 13px, var(--scale) 14px, transparent 15.5px);
  background-size: 30px 16px; background-position: 0 0, 15px 8px;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent); mask-image: linear-gradient(180deg, #000 30%, transparent);
}
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(900px 520px at 78% 42%, rgba(179, 32, 26, 0.32), transparent 70%); }
.hero-art { position: relative; min-width: 0; padding-top: 190px; }
.hero-art .ticket { position: relative; z-index: 1; background: color-mix(in srgb, var(--surface) 94%, transparent); border-color: #4A2C2E; box-shadow: 0 30px 80px -30px rgba(229, 57, 44, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.dragon-eye { position: absolute; top: -70px; left: 50%; width: 480px; max-width: none; height: auto; transform: translateX(-50%); z-index: 0; pointer-events: none; }
.dragon-eye .lid { fill: #140C0D; stroke: var(--ember); stroke-width: 3; }
.dragon-eye .ring { fill: none; stroke: var(--ember); stroke-opacity: 0.45; }
.dragon-eye .ring2 { fill: none; stroke: var(--molten); stroke-opacity: 0.35; }
.dragon-eye .crack { fill: none; stroke: var(--molten); stroke-width: 2.5; stroke-linecap: round; }
.dragon-eye .ring, .dragon-eye .ring2, .dragon-eye .pupil { transform-box: view-box; transform-origin: 250px 250px; }
.embers { position: absolute; left: 0; right: 0; bottom: 0; height: 520px; z-index: -1; pointer-events: none; }
.embers i { position: absolute; bottom: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--molten); box-shadow: 0 0 10px var(--molten); opacity: 0; }
.embers i:nth-child(1) { left: 6%; --d: 7s; --w: 0s; --x: 30px; }
.embers i:nth-child(2) { left: 15%; --d: 9s; --w: 1.2s; --x: -20px; width: 3px; height: 3px; background: var(--ember); }
.embers i:nth-child(3) { left: 27%; --d: 8s; --w: 3s; --x: 40px; width: 5px; height: 5px; background: #FF9A5C; }
.embers i:nth-child(4) { left: 39%; --d: 10s; --w: 0.6s; --x: -35px; width: 3px; height: 3px; }
.embers i:nth-child(5) { left: 51%; --d: 7.5s; --w: 2.2s; --x: 25px; background: var(--ember); }
.embers i:nth-child(6) { left: 60%; --d: 9.5s; --w: 4s; --x: -15px; width: 6px; height: 6px; background: #FFB27A; }
.embers i:nth-child(7) { left: 69%; --d: 6.5s; --w: 1.6s; --x: 45px; width: 3px; height: 3px; }
.embers i:nth-child(8) { left: 78%; --d: 8.5s; --w: 3.4s; --x: -30px; background: var(--ember); }
.embers i:nth-child(9) { left: 86%; --d: 7.2s; --w: 0.2s; --x: 20px; width: 5px; height: 5px; background: #FF9A5C; }
.embers i:nth-child(10) { left: 94%; --d: 11s; --w: 2.8s; --x: -40px; width: 3px; height: 3px; }
.embers i:nth-child(11) { left: 45%; --d: 8.8s; --w: 5s; --x: 10px; }
.embers i:nth-child(12) { left: 22%; --d: 9.8s; --w: 6s; --x: -12px; width: 3px; height: 3px; background: var(--ember); }
.claws { display: block; width: 100%; height: 56px; margin-top: -1px; }
.claws path { stroke: var(--ember); stroke-width: 4; stroke-linecap: round; fill: none; }
@media (max-width: 900px) {
  .hero-art { padding-top: 150px; max-width: 460px; margin-inline: auto; width: 100%; }
  .dragon-eye { width: 340px; top: -40px; }
  .embers { height: 360px; }
}
@media (max-width: 400px) { .hero-art { padding-top: 130px; } .dragon-eye { width: 290px; top: -30px; } }

@media (prefers-reduced-motion: no-preference) {
  /* Loops are finite: ~30-60s of life after load, then the hero rests. They also pause off screen. */
  .embers i { animation: rise var(--d, 8s) linear var(--w, 0s) 4; }
  .dragon-eye .ring { animation: spin 60s linear 2; }
  .dragon-eye .ring2 { animation: spin 90s linear 1 reverse; }
  .dragon-eye .pupil { animation: blink 6s cubic-bezier(0.65, 0, 0.35, 1) 2.5s 8; }
  .dragon-eye .iris { animation: glow 3.2s ease-in-out 10; }
  .dragon-eye .crack { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s var(--ease-out) 0.4s forwards; }
  .claws path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.5s var(--ease-out) forwards; animation-delay: calc(0.9s + var(--i, 0) * 0.12s); }
  .claws path:nth-child(2) { --i: 1; }
  .claws path:nth-child(3) { --i: 2; }
  .dragon-eye { animation: eye-in 1.1s var(--ease-out) both; }
  .hero.is-idle *, .hero.is-idle::before, .hero.is-idle::after { animation-play-state: paused !important; }
  @keyframes rise { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(var(--x, 20px), -500px) scale(0.2); opacity: 0; } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.06); } }
  @keyframes glow { 50% { opacity: 0.72; } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes eye-in { from { opacity: 0; transform: translateX(-50%) scale(0.9); } }
}
@media print { .dragon-eye, .embers, .claws { display: none; } }

/* Portfolio header: lab status terminal (real stack only) */
.sheet-intro { align-items: center; }
.sheet-intro .intro-copy { align-self: start; }
.intro-copy { display: grid; gap: 24px; }
.sheet-intro .intro-copy .actions { justify-content: flex-start; }
.term { margin: 0; background: #0D0809; border: 1px solid #3A2224; border-radius: 10px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(229, 57, 44, 0.5); min-width: 0; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 12px/1 var(--mono); color: var(--muted); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #4A2C2E; }
.term-bar i:first-child { background: var(--ember); }
.term-bar span { margin-left: 8px; }
.term-body { margin: 0; padding: 18px; font: 13.5px/1.9 var(--mono); color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.term-body .l { display: block; }
.term-body b { color: var(--copper); font-weight: 600; }
.term-body em { color: var(--molten); font-style: normal; }
.term-body .cursor { display: inline-block; width: 9px; height: 16px; background: var(--copper); vertical-align: -3px; }
@media (prefers-reduced-motion: no-preference) {
  /* steps(1, start): a 1ms jump-end step can land a rounding error short of the end and stay hidden in Chromium */
  .term-body .l { animation: fade-in 1ms steps(1, start) both; }
  .term-body .l:nth-child(1) { animation-delay: 0.5s; }
  .term-body .l:nth-child(2) { animation-delay: 1.1s; }
  .term-body .l:nth-child(3) { animation-delay: 1.7s; }
  .term-body .l:nth-child(4) { animation-delay: 2.3s; }
  .term-body .l:nth-child(5) { animation-delay: 2.9s; }
  .term-body .l { opacity: 0; }
  .term-body .cursor { animation: led 1s steps(1) 3.2s 10; }
  .term { animation: ticket-in 800ms var(--ease-out) 150ms both; }
}

/* ===== Portfolio dragon =====
   Layers, back to front: aura, shockwave rings, blurred glow copy, the art, a light sheen masked to the
   art's shape, an eye glint, then the particle canvas (drawn by site.js). .dragon carries the pointer
   parallax (--px/--py), .dragon-body carries the float, so the two never fight over one transform.
   Reduced-motion users get the still art: every animation and the canvas are behind no-preference. */
.sheet-head { position: relative; isolation: isolate; overflow-x: clip; }
.sheet-head::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(760px 520px at 76% 46%, rgba(179, 32, 26, 0.28), transparent 70%); }
.dragon-stage { position: relative; min-width: 0; }
.dragon { position: relative; width: 112%; margin: -40px -6% 0; aspect-ratio: 600 / 493; transform: translate3d(calc(var(--px, 0) * 14px), calc(var(--py, 0) * 10px), 0) rotate(calc(var(--px, 0) * 2deg)); transition: transform 600ms var(--ease-out); cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.dragon-body, .dragon-body img, .dragon-sheen, .dragon-fx, .dragon-aura { position: absolute; inset: 0; }
.dragon-body img { width: 100%; height: 100%; display: block; }
.dragon-img { filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.6)); }
.dragon-glow { position: absolute; inset: -12.2% -10%; background: url(/img/dragon-glow.webp) center / 100% 100% no-repeat; opacity: 0.32; } /* pre-blurred art, padded 20px around 200px */
.dragon-aura { inset: 6% 4% 0 18%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 64, 40, 0.42), rgba(179, 32, 26, 0.16) 55%, transparent); }
.dragon-ring { position: absolute; left: 80%; top: 50%; width: 46%; aspect-ratio: 1; margin: -23% 0 0 -23%; border-radius: 50%; border: 2px solid var(--ember); box-shadow: 0 0 24px var(--ember), inset 0 0 18px rgba(229, 57, 44, 0.6); opacity: 0; pointer-events: none; }
.dragon-sheen { -webkit-mask: url(/img/dragon-mask.webp) center / 100% 100% no-repeat; mask: url(/img/dragon-mask.webp) center / 100% 100% no-repeat; overflow: hidden; mix-blend-mode: screen; }
.dragon-sheen i { position: absolute; top: -20%; bottom: -20%; left: 0; width: 26%; background: linear-gradient(100deg, transparent, rgba(255, 190, 160, 0.85) 50%, transparent); transform: translateX(-140%) skewX(-18deg); opacity: 0; }
.dragon-glint { position: absolute; left: 82%; top: 52%; width: 16%; aspect-ratio: 1; margin: -8% 0 0 -8%; opacity: 0; mix-blend-mode: screen; pointer-events: none;
  background: radial-gradient(closest-side, #fff 0, #ffb59a 12%, rgba(255, 60, 40, 0.5) 32%, transparent 70%),
    linear-gradient(90deg, transparent 0, rgba(255, 200, 180, 0.9) 50%, transparent 100%) center / 100% 3px no-repeat,
    linear-gradient(0deg, transparent 0, rgba(255, 200, 180, 0.7) 50%, transparent 100%) center / 3px 70% no-repeat; }
.dragon-fx { inset: -12% -8% -6%; width: 116%; height: 118%; pointer-events: none; }
.dragon-stage .term { position: relative; z-index: 1; margin: -24% 0 0 auto; width: 88%; }
@media (max-width: 900px) {
  .dragon { width: 100%; margin: -8px 0 0; }
  .dragon-stage .term { width: 100%; margin-top: -18%; }
}

@media (prefers-reduced-motion: no-preference) {
  .dragon { animation: dragon-summon 1.5s var(--ease-out) 0.1s backwards; }
  .dragon-body { animation: dragon-float 7s ease-in-out 1.6s infinite; }
  .dragon-glow { animation: dragon-pulse 3.2s ease-in-out 1.6s infinite; }
  .dragon-aura { animation: dragon-aura 4.4s ease-in-out infinite; }
  .dragon-ring { animation: dragon-ring 4.8s cubic-bezier(0.2, 0.7, 0.3, 1) infinite; }
  .dragon-ring:nth-child(2) { animation-delay: 0.35s; }
  .dragon-ring:nth-child(3) { animation-delay: 1.6s; }
  .dragon-ring:nth-child(4) { animation-delay: 3.2s; }
  .dragon-sheen i { animation: dragon-sheen 6s ease-in-out 1.8s infinite; }
  .dragon-glint { animation: dragon-glint 5s ease-in-out 1.2s infinite; }
  /* Click or tap: the dragon roars (shake, flare, fast rings). site.js adds .roar and sparks. */
  .dragon.roar .dragon-body { animation: dragon-roar 700ms cubic-bezier(0.36, 0.07, 0.19, 0.97); }
  .dragon.roar .dragon-glow { animation: dragon-flare 900ms ease-out; }
  .dragon.roar .dragon-ring { animation: dragon-ring 900ms cubic-bezier(0.2, 0.7, 0.3, 1); }
  .dragon.roar .dragon-ring:nth-child(3) { animation-delay: 120ms; }
  .dragon.roar .dragon-ring:nth-child(4) { animation-delay: 240ms; }
  .dragon.roar .dragon-glint { animation: dragon-glint 900ms ease-out; }
  .dragon.is-idle, .dragon.is-idle * { animation-play-state: paused !important; }
  @keyframes dragon-summon {
    0% { opacity: 0; transform: translateY(40px) scale(0.8); filter: blur(14px) brightness(3) saturate(0); }
    55% { opacity: 1; filter: blur(0) brightness(1.8) saturate(1.4); }
    100% { opacity: 1; filter: none; }
  }
  @keyframes dragon-float { 50% { transform: translateY(-16px) rotate(-1.4deg); } }
  @keyframes dragon-pulse { 50% { opacity: 0.7; } }
  @keyframes dragon-aura { 50% { transform: scale(1.08); opacity: 0.7; } }
  @keyframes dragon-ring { 0% { transform: scale(0.15); opacity: 0.95; } 100% { transform: scale(2.6); opacity: 0; } }
  @keyframes dragon-sheen { 0%, 55% { transform: translateX(-140%) skewX(-18deg); opacity: 0; } 58% { opacity: 1; } 85%, 100% { transform: translateX(480%) skewX(-18deg); opacity: 0; } }
  @keyframes dragon-glint { 0%, 70%, 100% { opacity: 0; transform: scale(0.3) rotate(0); } 80% { opacity: 1; transform: scale(1.15) rotate(45deg); } 90% { opacity: 0.6; transform: scale(0.8) rotate(90deg); } }
  @keyframes dragon-roar { 10%, 90% { transform: translate(-2px, 1px) rotate(-0.6deg); } 20%, 80% { transform: translate(4px, -2px) rotate(0.8deg) scale(1.02); } 30%, 50%, 70% { transform: translate(-7px, 2px) rotate(-1.2deg) scale(1.04); } 40%, 60% { transform: translate(7px, -3px) rotate(1.2deg) scale(1.04); } }
  @keyframes dragon-flare { 0% { opacity: 1; transform: scale(1.08); } 100% { opacity: 0.32; } }
}
@media print { .dragon { display: none; } .dragon-stage .term { margin-top: 0; width: 100%; } }

/* ===== Ember: 3D dragon pet + site guide =====
   The WebGL canvas is opaque black and screen-blended, so only the dragon's light shows on the page.
   It never takes pointer events: site.js and pet.js hit-test the dragon themselves. */
.ember-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 15; pointer-events: none; mix-blend-mode: screen; opacity: 0; transition: opacity 900ms var(--ease-out); }
.ember-canvas.is-on { opacity: 1; }
/* With the 3D dragon awake, the 2D art steps aside (it keeps its box, which is the 3D dragon's perch). */
.pet-on .dragon { opacity: 0; visibility: hidden; transition: opacity 700ms var(--ease-out), visibility 0s 700ms; }
.ember-bubble { position: fixed; left: 0; top: 0; z-index: 31; max-width: 220px; padding: 9px 13px; border-radius: 12px; background: var(--surface); border: 1px solid #4A2C2E; color: var(--ink); font: 600 14px/1.35 var(--body); box-shadow: 0 12px 30px -12px rgba(229, 57, 44, 0.6); pointer-events: none; opacity: 0; transform: translate(calc(var(--x, -999px) - 50%), calc(var(--y, -999px) - 100%)) scale(0.9); transition: opacity 200ms ease, transform 200ms var(--ease-out); }
.ember-bubble.is-on { opacity: 1; transform: translate(calc(var(--x, -999px) - 50%), calc(var(--y, -999px) - 100%)); }
.ember-bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: var(--surface); border: solid #4A2C2E; border-width: 0 1px 1px 0; transform: translateX(-50%) rotate(45deg); }

.ember-launch { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px 0 12px; border-radius: 999px; border: 1px solid #5A2E2C; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); font: 700 15px/1 var(--body); cursor: pointer; box-shadow: 0 10px 30px -10px rgba(229, 57, 44, 0.7); transition: transform var(--t-fast) ease, border-color var(--t-fast) ease; }
@supports (backdrop-filter: blur(8px)) { .ember-launch { backdrop-filter: blur(8px); } }
.ember-launch:hover { transform: translateY(-2px); border-color: var(--ember); }
.ember-launch:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.ember-launch[aria-expanded="true"] { border-color: var(--ember); }

.ember-panel { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 60px); z-index: 30; width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: var(--surface); border: 1px solid #4A2C2E; border-radius: 16px; box-shadow: 0 30px 80px -24px rgba(229, 57, 44, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4); overflow: hidden; }
.ember-panel[hidden] { display: none; }
.ember-panel header { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.ember-panel header div { flex: 1; min-width: 0; }
.ember-panel h2 { font-size: 18px; margin: 0; line-height: 1.2; }
.ember-panel header p { margin: 2px 0 0; font: 12px/1.4 var(--mono); color: var(--muted); }
.ember-x { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.ember-x:hover { color: var(--ink); border-color: var(--line); }
.ember-x svg { width: 18px; height: 18px; }
.ember-log { overflow-y: auto; padding: 14px 16px; display: grid; align-content: start; gap: 10px; overscroll-behavior: contain; }
.ember-log:focus-visible { outline: 2px solid var(--copper); outline-offset: -2px; }
.ember-msg { margin: 0; padding: 10px 13px; border-radius: 12px; font-size: 15px; line-height: 1.45; max-width: 92%; }
.ember-msg.bot { background: var(--sunk); border: 1px solid var(--line); color: var(--ink); border-top-left-radius: 4px; }
.ember-msg.me { justify-self: end; background: var(--fire); color: #fff; border-top-right-radius: 4px; }
.ember-msg a { color: var(--copper); }
.ember-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.ember-chips button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid #4A2C2E; background: none; color: var(--ink); font: 600 13px/1 var(--body); cursor: pointer; }
.ember-chips button:hover { border-color: var(--ember); background: rgba(229, 57, 44, 0.12); }
.ember-form { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.ember-form input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--field-line); background: var(--paper); color: var(--ink); font: 15px var(--body); }
.ember-form input:focus-visible { outline: 2px solid var(--copper); outline-offset: 1px; }
.ember-form .btn { min-height: 44px; padding: 0 16px; }
@media (max-width: 640px) {
  .ember-panel { left: 12px; right: 12px; width: auto; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 60px); max-height: min(70vh, 520px); }
  .ember-launch { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
  .ember-panel:not([hidden]) { animation: ember-pop 260ms var(--ease-out); }
  .ember-msg { animation: ember-msg 240ms var(--ease-out); }
  @keyframes ember-pop { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
  @keyframes ember-msg { from { opacity: 0; transform: translateY(6px); } }
}
@media print { .ember-canvas, .ember-bubble, .ember-launch, .ember-panel { display: none !important; } }
