/* ==========================================================================
   Repairo Support — design system
   Audience: non-technical, often stressed, frequently on a phone because
   their computer is the thing that is broken. Priorities in order:
   legibility, one obvious next action, no jargon, works offline-ish, prints.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink:            #14181f;
  --ink-2:          #3d4654;
  --ink-3:          #5b6675;
  --bg:             #ffffff;
  --surface:        #f4f6f9;
  --surface-2:      #e9edf3;
  --border:         #d7dee7;
  --border-strong:  #b6c1cf;

  --accent:         #1d4ed8;
  --accent-hover:   #1739a8;
  --on-accent:      #ffffff;
  --accent-soft:    #eaf0ff;

  --danger:         #b91c1c;
  --danger-soft:    #fdeceb;
  --danger-border:  #f0b3ae;

  --warn:           #9a5b00;
  --warn-soft:      #fdf3e2;
  --warn-border:    #eccb96;

  --ok:             #116932;
  --ok-soft:        #e9f7ee;
  --ok-border:      #9ed2b3;

  --header-bg:      #14181f;
  --header-ink:     #ffffff;

  --radius:   10px;
  --radius-lg:16px;

  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 20px;  --space-5: 32px;  --space-6: 48px;
  --space-7: 72px;  --space-8: 96px;

  --shadow-sm: 0 1px 2px rgba(20, 24, 31, .06), 0 1px 3px rgba(20, 24, 31, .08);
  --shadow-md: 0 4px 12px rgba(20, 24, 31, .08), 0 2px 4px rgba(20, 24, 31, .05);

  --measure: 68ch;
  --page:    1120px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:            #eef2f7;
    --ink-2:          #b8c2cf;
    --ink-3:          #94a0b0;
    --bg:             #10141a;
    --surface:        #171d26;
    --surface-2:      #212a36;
    --border:         #2b3542;
    --border-strong:  #3e4a5a;

    --accent:         #7ba4ff;
    --accent-hover:   #a2c0ff;
    --on-accent:      #0b0f14;
    --accent-soft:    #182338;

    --danger:         #ff9a92;
    --danger-soft:    #2b1715;
    --danger-border:  #6b2f2a;

    --warn:           #f0c07a;
    --warn-soft:      #2a2013;
    --warn-border:    #6a5326;

    --ok:             #86e0a8;
    --ok-soft:        #12251a;
    --ok-border:      #2c5a3c;

    --header-bg:      #060a0f;
    --header-ink:     #ffffff;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 14px rgba(0,0,0,.45);
  }
}

:root[data-theme="dark"] {
  --ink:#eef2f7; --ink-2:#b8c2cf; --ink-3:#94a0b0;
  --bg:#10141a; --surface:#171d26; --surface-2:#212a36;
  --border:#2b3542; --border-strong:#3e4a5a;
  --accent:#7ba4ff; --accent-hover:#a2c0ff; --on-accent:#0b0f14; --accent-soft:#182338;
  --danger:#ff9a92; --danger-soft:#2b1715; --danger-border:#6b2f2a;
  --warn:#f0c07a;  --warn-soft:#2a2013;  --warn-border:#6a5326;
  --ok:#86e0a8;    --ok-soft:#12251a;    --ok-border:#2c5a3c;
  --header-bg:#060a0f; --header-ink:#ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,.45);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) { body { font-size: 19px; } }

img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--space-3); font-weight: 800;
                 letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 4.2vw, 2.15rem); margin-top: var(--space-6); }
h3 { font-size: clamp(1.18rem, 3vw, 1.4rem); font-weight: 700; margin-top: var(--space-5); }
p, ul, ol { margin: 0 0 var(--space-4); max-width: var(--measure); }
li { margin-bottom: var(--space-2); }
strong, b { font-weight: 700; }
code, kbd, samp { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--accent-hover); }

:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0; }

/* Long identifiers, file names and URLs must never blow out the layout */
.breakable { overflow-wrap: anywhere; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--space-4); }
@media (min-width: 1024px) { .wrap { padding-inline: var(--space-5); } }
.narrow { max-width: 780px; }
.section { padding-block: var(--space-6); }
@media (min-width: 768px) { .section { padding-block: var(--space-7); } }
.section--tint { background: var(--surface); border-block: 1px solid var(--border); }

.skip-link {
  position: absolute; left: var(--space-3); top: -100px; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius); font-weight: 700;
}
.skip-link:focus { top: var(--space-3); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg); color: var(--header-ink);
}
.site-header a { color: var(--header-ink); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  min-height: 64px; padding-block: var(--space-2);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { height: 30px; width: auto; }
.brand span { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 14px; font: inherit; font-weight: 600; font-size: .95rem;
  color: var(--header-ink); background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius); cursor: pointer;
}
.nav-toggle:hover { background: rgba(255,255,255,.18); }
.nav-toggle svg { width: 20px; height: 20px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; max-width: none; }
.site-nav a {
  display: flex; align-items: center; min-height: 48px;
  padding: var(--space-2) var(--space-3);
  text-decoration: none; font-weight: 600; border-radius: var(--radius);
}
.site-nav a:hover { background: rgba(255,255,255,.12); }
.site-nav a[aria-current="page"] { background: rgba(255,255,255,.16); }

@media (max-width: 1099px) {
  /* Full-width drawer stacked under the bar, not squeezed into the flex row. */
  .site-nav { display: none; width: 100%; padding-bottom: var(--space-3); }
  .site-nav.is-open { display: block; }
  .site-nav ul { display: grid; gap: 2px; }
  .site-nav a { border: 1px solid rgba(255,255,255,.14); }
}
@media (min-width: 1100px) {
  .nav-toggle { display: none; }
  .site-nav { order: 2; }
  .theme-toggle { order: 3; }
  .site-nav ul { display: flex; gap: 2px; align-items: center; }
  /* Seven items have to sit on one line inside the 1056px content column.
     The mobile drawer above keeps the full-size targets. */
  .site-nav a { font-size: 1rem; padding-inline: 10px; }
}

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 auto;
  color: var(--header-ink); background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius); cursor: pointer;
}
.theme-toggle:hover { background: rgba(255,255,255,.18); }
.theme-toggle svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .theme-toggle .i-moon,
:root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun,
:root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .i-moon { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .i-sun  { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-6) var(--space-6); }
@media (min-width: 768px) { .hero { padding-block: var(--space-7) var(--space-6); } }
.hero p.lead { font-size: clamp(1.1rem, 2.6vw, 1.32rem); color: var(--ink-2); max-width: 60ch; }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--space-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 12px 26px;
  font: inherit; font-weight: 700; font-size: 1.05rem; line-height: 1.25;
  text-align: center; text-decoration: none; cursor: pointer;
  border-radius: var(--radius); border: 2px solid transparent;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--secondary { background: var(--bg); color: var(--ink); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-3); }
.btn--ghost { background: transparent; color: var(--accent); border-color: currentColor; }
.btn--ghost:hover { background: var(--accent-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- Callouts ---------- */
.note {
  border: 1px solid var(--border); border-left: 6px solid var(--ink-3);
  background: var(--surface); border-radius: var(--radius);
  padding: var(--space-4); margin: 0 0 var(--space-4); max-width: var(--measure);
}
.note > :last-child { margin-bottom: 0; }
.note h3, .note h4 {
  margin: 0 0 var(--space-2); font-size: 1.08rem; font-weight: 800;
  display: flex; align-items: flex-start; gap: 10px; line-height: 1.35;
}
.note h3 svg, .note h4 svg { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 3px; }
.note--danger { border-color: var(--danger-border); border-left-color: var(--danger); background: var(--danger-soft); }
.note--danger h3, .note--danger h4 { color: var(--danger); }
.note--warn   { border-color: var(--warn-border); border-left-color: var(--warn); background: var(--warn-soft); }
.note--warn h3, .note--warn h4 { color: var(--warn); }
.note--ok     { border-color: var(--ok-border); border-left-color: var(--ok); background: var(--ok-soft); }
.note--ok h3, .note--ok h4 { color: var(--ok); }
.note--info   { border-color: var(--border-strong); border-left-color: var(--accent); background: var(--accent-soft); }
.note--info h3, .note--info h4 { color: var(--accent); }

.note--wide { max-width: none; }

/* ---------- Big keyboard key ---------- */
kbd.key {
  display: inline-block; min-width: 2.6em; padding: 4px 10px; margin: 0 2px;
  font-family: var(--font); font-size: .95em; font-weight: 800; text-align: center;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--border-strong); border-bottom-width: 3px;
  border-radius: 7px; box-shadow: var(--shadow-sm);
}
kbd.key--xl { font-size: 1.5rem; padding: 10px 20px; border-bottom-width: 4px; }

/* ---------- Numbered steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; max-width: none; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 var(--space-5) 68px;
  margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  font-size: 1.4rem; font-weight: 800; line-height: 1;
  color: var(--on-accent); background: var(--accent);
  border-radius: 50%;
}
.steps > li::after {
  content: ""; position: absolute; left: 23px; top: 54px; bottom: 8px;
  width: 2px; background: var(--border);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps h3 { margin: 6px 0 var(--space-2); font-size: clamp(1.15rem, 3vw, 1.35rem); font-weight: 800; }
.steps > li > :last-child { margin-bottom: 0; }
@media (max-width: 520px) {
  .steps > li { padding-left: 56px; }
  .steps > li::before { width: 40px; height: 40px; font-size: 1.2rem; }
  .steps > li::after { left: 19px; top: 46px; }
}

/* ---------- Cards ---------- */
.grid { display: grid; gap: var(--space-4); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 700px)  { .grid--2 { grid-template-columns: repeat(2, 1fr); }
                             .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; }
.card p { max-width: none; color: var(--ink-2); font-size: .98rem; }
.card .btn { margin-top: auto; }

.card--link { text-decoration: none; color: inherit; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.card--link:hover { border-color: var(--accent); box-shadow: var(--shadow-md); color: inherit; }
.card--link .card-cta { margin-top: auto; padding-top: var(--space-3); font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 8px; }
.card--link:hover .card-cta { color: var(--accent-hover); }
@media (prefers-reduced-motion: reduce) { .card--link { transition: none; } }

.card__media {
  background: #fff; border-radius: var(--radius); margin-bottom: var(--space-3);
  aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--border);
}
.card__media img { max-height: 100%; width: auto; object-fit: contain; }

/* ---------- Figures ---------- */
figure { margin: 0 0 var(--space-4); }
figure img {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff;
}
figcaption { font-size: .92rem; color: var(--ink-3); margin-top: var(--space-2); max-width: var(--measure); }

.video-wrap {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: #000; margin-bottom: var(--space-3);
}
.video-wrap video { width: 100%; aspect-ratio: 854 / 480; }

/* ---------- Boot key finder ---------- */
.finder { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
          padding: var(--space-4); box-shadow: var(--shadow-sm); }
@media (min-width: 768px) { .finder { padding: var(--space-5); } }
.finder label { display: block; font-weight: 700; margin-bottom: var(--space-2); font-size: 1.05rem; }
.finder .hint { font-size: .95rem; color: var(--ink-3); margin: 0 0 var(--space-3); max-width: none; }
.finder input[type="search"] {
  width: 100%; min-height: 56px; padding: 12px 16px;
  font: inherit; font-size: 1.1rem; color: var(--ink);
  background: var(--bg); border: 2px solid var(--border-strong);
  border-radius: var(--radius); -webkit-appearance: none; appearance: none;
}
.finder input[type="search"]:focus { border-color: var(--accent); }
.finder input::placeholder { color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.chip {
  min-height: 44px; padding: 8px 16px; font: inherit; font-weight: 600; font-size: .95rem;
  color: var(--ink); background: var(--surface); cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 999px;
}
.chip:hover { background: var(--surface-2); border-color: var(--ink-3); }

.results { margin-top: var(--space-4); }
.result-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); max-width: none; }
.result {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  padding: var(--space-3); margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.result__brand { font-weight: 800; font-size: 1.08rem; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.result__type { font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
                color: var(--ink-3); flex: 0 0 auto; }
.result__keys { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
.result__keys .sep { color: var(--ink-3); align-self: center; font-size: .85rem; }
.empty { padding: var(--space-4); background: var(--warn-soft); border: 1px solid var(--warn-border);
         border-radius: var(--radius); }
.empty > :last-child { margin-bottom: 0; }

/* ---------- Accordion ---------- */
.faq { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
       background: var(--bg); margin-bottom: var(--space-4); }
.faq details + details { border-top: 1px solid var(--border); }
.faq summary {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4); min-height: 44px; cursor: pointer;
  font-weight: 700; font-size: 1.05rem; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--surface); }
.faq summary .chev {
  width: 22px; height: 22px; flex: 0 0 auto; margin-top: 2px; color: var(--ink-3);
  transition: transform .2s ease;
}
.faq details[open] summary .chev { transform: rotate(90deg); }
.faq details[open] summary { background: var(--surface); }
.faq .faq__body { padding: 0 var(--space-4) var(--space-4); }
.faq .faq__body > :last-child { margin-bottom: 0; }
.faq .faq__body p, .faq .faq__body ul, .faq .faq__body ol { max-width: var(--measure); }
@media (prefers-reduced-motion: reduce) { .faq summary .chev { transition: none; } }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 34px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--ok-soft); border: 2px solid var(--ok);
}
.checklist li::after {
  content: ""; position: absolute; left: 6px; top: .62em;
  width: 6px; height: 11px; border: solid var(--ok);
  border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.crosslist { list-style: none; padding: 0; }
.crosslist li { position: relative; padding-left: 34px; }
.crosslist li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--danger-soft); border: 2px solid var(--danger);
}
.crosslist li::after {
  content: "\00d7"; position: absolute; left: 4px; top: .18em;
  font-size: 1.25rem; font-weight: 800; line-height: 1; color: var(--danger);
}

/* ---------- Table ---------- */
.table-scroll { overflow-x: auto; margin-bottom: var(--space-4);
                border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .98rem; }
th, td { text-align: left; padding: var(--space-3); border-bottom: 1px solid var(--border); }
th { background: var(--surface); font-weight: 800; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--header-bg); color: var(--header-ink);
  padding-block: var(--space-6); margin-top: var(--space-7);
}
.site-footer a { color: #cfe0ff; }
.site-footer h3 { color: var(--header-ink); margin-top: 0; font-size: 1rem;
                  text-transform: uppercase; letter-spacing: .08em; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 0; }
/* Standalone nav links need a real target, not a line of text (WCAG 2.2 target size). */
.site-footer li a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding-right: var(--space-2);
}
.footer-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-bottom { margin-top: var(--space-5); padding-top: var(--space-4);
                 border-top: 1px solid rgba(255,255,255,.16);
                 font-size: .9rem; color: #a9b4c4; }
.footer-bottom p { max-width: none; margin-bottom: var(--space-2); }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.text-muted { color: var(--ink-3); }
.small { font-size: .92rem; }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .nav-toggle, .theme-toggle, .no-print, .video-wrap { display: none !important; }
  body { font-size: 11.5pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  .faq details { display: block; }
  .faq .faq__body { display: block !important; }
  .section { padding-block: 12pt; }
  .steps > li::before { background: #000 !important; color: #fff !important;
                        -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .note { border: 1pt solid #000; break-inside: avoid; }
  .card, .steps > li, figure { break-inside: avoid; }
  h2 { break-after: avoid; }
}
