/* ============================================================
   handpiece.com — design system
   Palette: clinical teal + slate. Light theme, print friendly.
   Edit brand colors in :root only.
   ============================================================ */

:root {
  --brand: #0E6E7A;
  --brand-dark: #0A4F58;
  --brand-50: #EDF6F7;
  --brand-100: #D7EAEC;
  --accent: #C2410C;        /* primary CTA only — warm complement to the teal */
  --accent-dark: #9A3412;
  --ink: #13232E;
  --ink-2: #2E4655;
  --muted: #5F7484;
  --line: #E3E9ED;
  --line-2: #C9D5DC;
  --bg: #FFFFFF;
  --bg-soft: #F6F9FA;
  --bg-soft-2: #EEF3F5;
  --warn-bg: #FDF7EC;
  --warn-line: #E8D3A8;
  --warn-ink: #7A4E06;
  --ok: #0F6E4A;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(19, 35, 46, .06), 0 8px 24px -16px rgba(19, 35, 46, .18);
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
  background: var(--bg);
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 2.15rem; }
h2 { font-size: 1.5rem; margin-top: 2em; }
h3 { font-size: 1.16rem; margin-top: 1.6em; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .45em; }
strong { font-weight: 600; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-soft-2); padding: .12em .38em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); font-size: 1.12rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-dot { color: var(--muted); font-weight: 400; }
.brand-mark { width: 28px; height: 28px; flex: 0 0 28px; display: block; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) {
  color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-size: .95rem;
}
.site-nav a:not(.btn):hover { background: var(--bg-soft-2); text-decoration: none; color: var(--ink); }
.site-nav a:not(.btn)[aria-current="page"] { color: var(--brand-dark); background: var(--brand-50); font-weight: 500; }
.nav-toggle {
  display: none; margin-left: auto; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 7px 12px; font: inherit; font-size: .92rem; color: var(--ink-2); cursor: pointer;
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 11px 12px; }
  .site-nav .btn { margin-top: 8px; text-align: center; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px; font-size: .95rem; font-weight: 600;
  background: var(--accent); color: #fff; border: 1px solid var(--accent); cursor: pointer;
  box-shadow: 0 1px 2px rgba(19, 35, 46, .12), 0 4px 14px -8px rgba(194, 65, 12, .55);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; color: #fff; }
.btn:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.btn-ghost { background: #fff; color: var(--brand-dark); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--brand-50); border-color: var(--brand); color: var(--brand-dark); }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 52px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding: 44px 0 38px; } }
.eyebrow {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-dark);
  font-weight: 600; margin-bottom: 14px;
}
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 46ch; }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 30px; }
.section-head p { color: var(--muted); margin-bottom: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.card h3 { margin-top: 0; font-size: 1.05rem; }
.card p { margin-bottom: 0; font-size: .95rem; color: var(--ink-2); }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-link:hover h3 { color: var(--brand-dark); }
.card-tag { font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.card-more { margin-top: 14px; font-size: .9rem; color: var(--brand-dark); font-weight: 500; }

.badge {
  display: inline-block; font-size: .76rem; padding: 2px 9px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-dark); border: 1px solid var(--brand-100); font-weight: 500;
}
.badge-air { background: #EDF6F7; color: #0A4F58; border-color: #D7EAEC; }
.badge-elec { background: #F1F0FA; color: #3F3B7A; border-color: #DFDDF2; }
.badge-low { background: #F2F7EE; color: #3F6127; border-color: #DFEBD4; }
.badge-surg { background: #FBF2F2; color: #7E3030; border-color: #F0DADA; }
.badge-misc { background: #F4F5F6; color: #4A5A66; border-color: #E1E5E8; }

/* ---------- article ---------- */
.article { padding: 40px 0 64px; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { margin: 0 6px; color: var(--line-2); }
.article-meta { font-size: .87rem; color: var(--muted); margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.article-body { max-width: 760px; }
.article-body h2 { padding-top: .3em; }
.article-body figure { margin: 30px 0; }
.article-body figure svg { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.article-body figcaption { font-size: .86rem; color: var(--muted); margin-top: 10px; }

.toc {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin: 0 0 32px;
}
.toc strong { display: block; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.2em; font-size: .95rem; }
.toc li { margin-bottom: .2em; }

.callout {
  border: 1px solid var(--line-2); border-left: 3px solid var(--brand);
  background: var(--brand-50); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px; margin: 26px 0; font-size: .96rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: #C98A15; }
.callout-warn strong { color: var(--warn-ink); }
.callout-title { font-weight: 600; display: block; margin-bottom: 4px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 26px 0; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 600; font-size: .85rem; letter-spacing: .02em; color: var(--ink-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }

/* ---------- filter bar ---------- */
.filter-bar {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 14px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px;
}
@media (max-width: 900px) { .filter-bar { grid-template-columns: 1fr 1fr; } .filter-bar .field:first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .filter-bar { grid-template-columns: 1fr; } .filter-bar .field:first-child { grid-column: auto; } }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px;
  font: inherit; font-size: .95rem; color: var(--ink); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-100); border-color: var(--brand); }
.field-help { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.result-count { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.empty-state { padding: 34px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- email composer ----------
   Deliberately not a form. The site has no form endpoint, no
   server-side code and no database: every contact route is an
   ordinary mailto: link carrying a pre-filled skeleton. */
.composer {
  border: 1px solid var(--line-2); border-left: 3px solid var(--brand);
  background: var(--bg-soft); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 22px; margin: 24px 0;
}
.composer-title { font-weight: 600; margin-bottom: 6px; }
.composer > p:last-child { margin-bottom: 0; }
.composer .btn-row { margin: 16px 0 4px; }
.composer .btn-row:last-of-type { margin-bottom: 0; }
.composer-note { font-size: .84rem; color: var(--muted); margin: 12px 0 0; }

.check-list { list-style: none; padding: 0; margin: 0 0 10px; }
.check-list li {
  position: relative; padding-left: 26px; margin-bottom: .5em;
  font-size: .96rem; color: var(--ink-2);
}
.check-list li::before {
  content: ""; position: absolute; left: 5px; top: .6em;
  width: 7px; height: 7px; border-radius: 2px; background: var(--brand); opacity: .5;
}
.check-list strong { color: var(--ink); }

/* ---------- lists ---------- */
.clean-list { list-style: none; padding: 0; }
.clean-list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.clean-list li:last-child { border-bottom: 0; }
.clean-list strong { display: block; }
.clean-list span { color: var(--muted); font-size: .93rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 46px 0 34px; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--ink-2); }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .87rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.disclaimer { font-size: .84rem; color: var(--muted); line-height: 1.6; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- imagery ---------- */
.hero-media { margin: 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-media img { display: block; width: 100%; height: 100%; min-height: 320px; max-height: 460px; object-fit: cover; }

.stat-wrap { margin-top: 46px; }
.stat-wrap h3 { font-size: .95rem; margin: 0 0 14px; color: var(--ink-2); }
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat-strip > div { background: #fff; padding: 18px 20px; }
.stat-strip strong { display: block; font-size: 1.02rem; letter-spacing: -.01em; }
.stat-strip span { font-size: .85rem; color: var(--muted); line-height: 1.5; display: block; margin-top: 3px; }
@media (max-width: 900px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stat-strip { grid-template-columns: 1fr; } }

img.card-thumb {
  display: block; width: calc(100% + 44px); margin: -22px -22px 18px;
  height: 176px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--line);
}

.article-banner { margin: 0 0 30px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-soft); }
.article-banner img { display: block; width: 100%; height: 300px; object-fit: cover; }
@media (max-width: 640px) { .article-banner img { height: 190px; } }

/* ---------- fault finder (details/summary) ---------- */
details.fault {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 12px;
}
details.fault[open] { border-color: var(--line-2); }
details.fault > summary {
  cursor: pointer; padding: 15px 20px; font-weight: 500; font-size: 1rem; list-style: none;
  display: flex; align-items: center; gap: 10px; color: var(--ink);
}
details.fault > summary::-webkit-details-marker { display: none; }
details.fault > summary::before {
  content: ""; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); opacity: .55;
}
details.fault[open] > summary { border-bottom: 1px solid var(--line); color: var(--brand-dark); }
details.fault[open] > summary::before { opacity: 1; }
details.fault > summary:hover { background: var(--bg-soft); }
.fault-body { padding: 18px 20px 6px; font-size: .96rem; }
.fault-body ul { margin: 0; padding-left: 1.2em; }
.fault-body li { margin-bottom: .6em; }
