/* Dockton IT — Signal design system
   Sizes are in rem so the site follows the visitor's own browser text size.
   Colors follow the visitor's light/dark setting; prefs.js can override both. */

@font-face { font-family: "Public Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/public-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/public-sans-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 900; font-style: normal; font-display: swap; src: url("/fonts/public-sans-latin-900-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

/* ---------- Tokens: light (default, and always for print) ---------- */
:root {
  color-scheme: light;

  --page: #ffffff;          /* ground */
  --surface: #f1f3f4;       /* quiet panels */
  --ink: #0f1d2b;
  --ink-muted: #3a4653;
  --navy: #14365c;          /* structure: bars, card headers, number squares */
  --on-navy: #ffffff;
  --navy-tint: #e2ebf4;     /* steps panels */
  --link: #14365c;
  --signal: #f5b700;        /* the one call to action */
  --on-signal: #0f1d2b;     /* always dark, in both themes */
  --signal-tint: #fff1c2;   /* tips and warnings */
  --border: #5d6873;
  --focus: #14365c;

  --font-display: "Public Sans", Arial, sans-serif;
  --font-body: "Atkinson Hyperlegible", Verdana, sans-serif;

  --space-1: 0.5rem;   /* 8px at default size */
  --space-2: 1rem;     /* 16px */
  --space-3: 1.5rem;   /* 24px */
  --space-4: 2.5rem;   /* 40px */
  --space-5: 4rem;     /* 64px */
  --gutter: clamp(1.5rem, 5vw, 4rem);

  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 12px;
}

/* ---------- Tokens: dark ----------
   Same block twice: once for "follow my computer's setting",
   once for "I pressed the Dark mode button". Keep them identical. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e1823;
    --surface: #16222f;
    --ink: #eef2f6;
    --ink-muted: #b8c2cc;
    --navy: #1e4877;
    --on-navy: #ffffff;
    --navy-tint: #182c43;
    --link: #a9cdf5;
    --signal-tint: #2c2512;
    --border: #8a96a2;
    --focus: #f5b700;
  }
}
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --page: #0e1823;
    --surface: #16222f;
    --ink: #eef2f6;
    --ink-muted: #b8c2cc;
    --navy: #1e4877;
    --on-navy: #ffffff;
    --navy-tint: #182c43;
    --link: #a9cdf5;
    --signal-tint: #2c2512;
    --border: #8a96a2;
    --focus: #f5b700;
  }
}

/* ---------- Text size buttons ----------
   Percentages multiply the visitor's own browser setting, never replace it. */
:root[data-text="large"] { font-size: 120%; }
:root[data-text="larger"] { font-size: 140%; }

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.1875rem;   /* 19px */
  line-height: 1.58;      /* 30px */
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); color: var(--ink); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

a { color: var(--link); }
a:hover { text-decoration-thickness: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.on-navy a:focus-visible, .on-navy button:focus-visible { outline-color: var(--signal); }

.skip {
  position: absolute; left: var(--space-2); top: -10rem;
  background: var(--signal); color: var(--on-signal); border: 2px solid var(--on-signal);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-md);
  font-weight: 700; z-index: 10;
}
.skip:focus { top: var(--space-2); }

/* ---------- Utility bar ---------- */
.utility {
  background: var(--navy); color: var(--on-navy);
  padding: var(--space-1) var(--gutter);
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3);
  justify-content: space-between; align-items: center;
  font-size: 1rem; line-height: 1.5rem;
}
.utility a { color: var(--signal); font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.utility a:hover { text-decoration: underline; }

/* Display controls (built by prefs.js; hidden if JavaScript is off) */
.prefs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.prefs[hidden] { display: none; }
.prefs-group { display: flex; align-items: center; gap: var(--space-1); }
.prefs-label { font-weight: 700; margin-right: 0.25rem; }
.prefs button {
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--on-navy);
  border: 2px solid var(--on-navy); border-radius: var(--radius-md);
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1;
  cursor: pointer;
}
.prefs button:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.prefs button[aria-pressed="true"] { background: var(--on-navy); color: var(--navy); }
.prefs .size-1 { font-size: 1.0625rem; }
.prefs .size-2 { font-size: 1.3125rem; }
.prefs .size-3 { font-size: 1.5625rem; }

/* Wide screens: area · controls · phone. Narrow: controls on their own line. */
.utility .prefs { order: 2; }
.utility > a { order: 3; }
@media (max-width: 52em) {
  .utility .prefs { order: 4; flex-basis: 100%; gap: var(--space-1) var(--space-2); }
}
/* Phones: shorter words in the bar, but screen readers still hear them. */
@media (max-width: 30em) {
  .hide-narrow {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

/* ---------- Header ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--gutter);
}
.wordmark { display: flex; align-items: center; gap: var(--space-1); text-decoration: none; color: var(--ink); }
.wordmark span { font-family: var(--font-display); font-weight: 800; font-size: 1.625rem; line-height: 1.15; letter-spacing: -0.01em; }
.checker {
  display: grid; grid-template-columns: 1fr 1fr; width: 2.25rem; height: 2.25rem;
  border-radius: var(--radius-sm); overflow: hidden; flex: none;
}
.checker i:nth-child(1), .checker i:nth-child(4) { background: var(--navy); }
.checker i:nth-child(2), .checker i:nth-child(3) { background: var(--signal); }

.site-nav { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.site-nav a { font-weight: 700; font-size: 1.125rem; line-height: 1.5rem; padding: 0.625rem 0; }

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-4) var(--gutter) var(--space-5);
  display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-start;
}
.hero-copy { flex: 1 1 32.5rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.hero h1 { font-weight: 800; font-size: clamp(2.5rem, 1.5rem + 3.2vw, 4rem); line-height: 1.04; letter-spacing: -0.02em; }
.lead { font-size: 1.3125rem; line-height: 1.52; color: var(--ink-muted); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.5rem; padding: 0 2rem; border-radius: var(--radius-md);
  font-family: var(--font-body); font-weight: 700; font-size: 1.125rem; line-height: 1.33;
  text-decoration: none; text-align: center;
}
.btn:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.btn-signal { background: var(--signal); color: var(--on-signal); border: 2px solid var(--on-signal); }
.btn-outline { background: var(--page); color: var(--link); border: 2px solid var(--link); }

/* ---------- Steps ---------- */
.steps {
  flex: 1 1 25rem; min-width: 0;
  background: var(--navy-tint); border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3);
  scroll-margin-top: var(--space-2);
}
.steps h2 { font-weight: 700; font-size: 1.875rem; line-height: 1.27; }
.steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.steps li { display: flex; gap: var(--space-2); align-items: flex-start; }
.num {
  flex: none; width: 3.5rem; height: 3.5rem;
  background: var(--navy); color: var(--on-navy); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900; font-size: 1.75rem; line-height: 1;
}
.steps h3 { font-weight: 700; font-size: 1.4375rem; line-height: 1.3; }

.stripe { height: 12px; background: var(--signal); }

/* ---------- Services ---------- */
.services {
  background: var(--surface);
  padding: var(--space-5) var(--gutter);
  display: flex; flex-direction: column; gap: var(--space-4);
  scroll-margin-top: var(--space-2);
}
.services h2 { font-weight: 700; font-size: 1.875rem; line-height: 1.27; }
.cards { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.card {
  flex: 1 1 15rem; min-width: 0;
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--page);
  display: flex; flex-direction: column;
}
.card h3 {
  background: var(--navy); color: var(--on-navy);
  padding: var(--space-2) var(--space-3);
  font-weight: 700; font-size: 1.4375rem; line-height: 1.3;
}
.card p { padding: var(--space-3); }

/* ---------- Contact ---------- */
.contact {
  background: var(--navy); color: var(--on-navy);
  padding: var(--space-5) var(--gutter);
  display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start;
  scroll-margin-top: var(--space-2);
}
.contact h2 { color: var(--on-navy); font-weight: 700; font-size: 1.875rem; line-height: 1.27; }
.contact p { font-size: 1.3125rem; line-height: 1.52; }
.contact .phone {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.125rem, 1.6rem + 1.6vw, 2.75rem); line-height: 1.15; letter-spacing: -0.01em;
  color: var(--signal); text-decoration: none;
}
.contact .phone:hover { text-decoration: underline; }
.contact .email { color: var(--on-navy); font-weight: 700; }
.contact .save-contact { color: var(--on-navy); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  padding: var(--space-4) var(--gutter);
  display: flex; flex-direction: column; gap: var(--space-1);
  font-size: 1rem; line-height: 1.5; color: var(--ink-muted);
}
.site-footer strong { color: var(--ink); }
.site-footer a { color: inherit; }

/* ---------- 404 ---------- */
.notfound {
  padding: var(--space-5) var(--gutter);
  display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start;
  max-width: 48rem;
}
.notfound h1 { font-weight: 800; font-size: clamp(2.25rem, 1.6rem + 1.5vw, 2.75rem); line-height: 1.12; letter-spacing: -0.01em; }

@media (max-width: 30em) {
  .steps { padding: var(--space-3); }
  .num { width: 3rem; height: 3rem; font-size: 1.5rem; }
  .btn { width: 100%; }
}

/* ---------- Services intro line ---------- */
.services-head { display: flex; flex-direction: column; gap: var(--space-2); }
.price-line { font-size: 1.3125rem; line-height: 1.52; }
.price-line a { font-weight: 700; }

/* ---------- Inner pages ---------- */
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration-thickness: 3px; }

.page-head {
  padding: var(--space-4) var(--gutter);
  display: flex; flex-direction: column; gap: var(--space-3);
  max-width: 60rem;
}
.page-head h1 { font-weight: 800; font-size: clamp(2.25rem, 1.4rem + 2.5vw, 3.25rem); line-height: 1.08; letter-spacing: -0.02em; }

.page-section {
  padding: var(--space-5) var(--gutter);
  display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start;
}
.page-section.surface { background: var(--surface); }
.page-section h2 { font-weight: 700; font-size: 1.875rem; line-height: 1.27; }
.page-section > p { max-width: 38em; }
.page-section .cards { width: 100%; max-width: 64rem; }
.page-section .steps { flex: none; width: 100%; max-width: 48rem; }

.card-body { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.card .card-body p { padding: 0; }
.price {
  font-family: var(--font-display); font-weight: 900;
  font-size: 2.75rem; line-height: 1.09; letter-spacing: -0.01em; color: var(--ink);
}
.price span { font-family: var(--font-body); font-weight: 700; font-size: 1.1875rem; letter-spacing: 0; color: var(--ink-muted); }
.fine { font-size: 1rem; line-height: 1.5; color: var(--ink-muted); }

.rules { margin: 0; padding-left: 1.2em; max-width: 38em; display: flex; flex-direction: column; gap: var(--space-1); }

.tip {
  background: var(--signal-tint); border-left: 8px solid var(--signal); border-radius: var(--radius-sm);
  padding: var(--space-3); max-width: 38em;
  display: flex; flex-direction: column; gap: var(--space-1);
}
.tip h3 { font-weight: 700; font-size: 1.3125rem; line-height: 1.33; }

.prose { max-width: 38em; display: flex; flex-direction: column; gap: var(--space-2); }
.prose h2 { margin-top: var(--space-3); }
.prose h2:first-child { margin-top: 0; }

/* ---------- Windows High Contrast and other forced-color modes ----------
   Backgrounds are replaced by the system's colors, so shapes drawn only
   with a background (checker, number squares, bars) get outlines instead. */
@media (forced-colors: active) {
  .checker { forced-color-adjust: none; border: 2px solid CanvasText; }
  .checker i:nth-child(1), .checker i:nth-child(4) { background: CanvasText; }
  .checker i:nth-child(2), .checker i:nth-child(3) { background: Canvas; }
  .num { border: 2px solid CanvasText; }
  .card h3 { border-bottom: 2px solid CanvasText; }
  .stripe { height: 0; border-top: 4px solid CanvasText; }
  .steps, .tip, .utility, .contact { border: 2px solid CanvasText; }
  .prefs button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
}

/* ---------- Print ----------
   For the fridge: no navigation or buttons, phone number large,
   links spelled out so they can be typed in later. */
@media print {
  @page { margin: 1.6cm; }
  html { font-size: 87.5%; }  /* body text about 12.5pt; the Text size buttons still apply */
  body { background: #fff; color: #000; }

  .skip, .utility, .site-nav, .actions, .stripe, .prefs { display: none !important; }

  .site-header { padding: 0 0 var(--space-2); border-bottom: 3px solid #000; }
  .checker { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .wordmark::after { content: "docktonit.com · (206) 829-0144"; margin-left: var(--space-2); font-weight: 700; }

  .hero, .services, .page-head, .page-section, .contact, .notfound, .site-footer { padding: var(--space-3) 0; background: none; }
  .hero { gap: var(--space-3); }
  .steps { background: none; border: 2px solid #000; padding: var(--space-3); }
  .num { background: none; color: #000; border: 2px solid #000; }
  .card { border-color: #000; break-inside: avoid; }
  .card h3 { background: none; color: #000; border-bottom: 2px solid #000; }
  .tip { background: none; border: 2px solid #000; border-left-width: 8px; }
  .contact { color: #000; border-top: 3px solid #000; break-inside: avoid; }
  .contact h2, .contact .phone, .contact .email { color: #000; }
  .contact .save-contact { display: none; }
  .steps, .tip, .rules li, h2, h3 { break-inside: avoid; }
  h2, h3 { break-after: avoid; }

  a { color: #000; text-decoration: none; }
  .page-section a[href^="/"]::after, .services a[href^="/"]::after, .prose a[href^="/"]::after { content: " (docktonit.com" attr(href) ")"; font-weight: 400; }
}
