/* Master Patrol public website.
   Plain CSS, no build step. Colours follow the portal's shadcn-style slate palette
   (portal/app/globals.css): navy #0F172A is the brand colour. */

:root {
  color-scheme: light dark;

  --navy: #0f172a;
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-muted: #f1f5f9;
  --card: #ffffff;
  --text: #020817;
  --text-muted: #475569;
  --border: #e2e8f0;
  --link: #1d4ed8;
  --focus: #2563eb;
  --btn-bg: #0f172a;
  --btn-text: #f8fafc;
  --btn-hover: #1e293b;
  --btn2-bg: #ffffff;
  --btn2-text: #0f172a;
  --btn2-border: #cbd5e1;
  --hero-bg: #0f172a;
  --hero-text: #f8fafc;
  --hero-muted: #cbd5e1;
  --draft-bg: #fef3c7;
  --draft-text: #78350f;
  --draft-border: #f59e0b;
  --ph-bg: #fef9c3;
  --ph-text: #713f12;
  --icon-bg: #f1f5f9;
  --icon-fg: #0f172a;

  --radius: 0.5rem;
  --maxw: 72rem;
  --readw: 46rem;
  --gutter: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020817;
    --bg-subtle: #0b1222;
    --bg-muted: #0f172a;
    --card: #0f172a;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --link: #93c5fd;
    --focus: #93c5fd;
    --btn-bg: #f8fafc;
    --btn-text: #0f172a;
    --btn-hover: #e2e8f0;
    --btn2-bg: #0f172a;
    --btn2-text: #f8fafc;
    --btn2-border: #334155;
    --hero-bg: #0f172a;
    --hero-text: #f8fafc;
    --hero-muted: #cbd5e1;
    --draft-bg: #422006;
    --draft-text: #fde68a;
    --draft-border: #d97706;
    --ph-bg: #3f3a12;
    --ph-text: #fef08a;
    --icon-bg: #1e293b;
    --icon-fg: #e2e8f0;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.125rem; margin: 0 0 0.4rem; }
p { margin: 0 0 1rem; }

code, kbd { font-family: var(--mono); font-size: 0.92em; }
kbd {
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 0.3em;
  background: var(--bg-muted);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  z-index: 100;
}
.skip-link:focus { top: 0.5rem; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 640px) { :root { --gutter: 24px; } }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.wordmark svg { width: 30px; height: 30px; flex: none; }
.wordmark:hover { text-decoration: none; }
@media (prefers-color-scheme: dark) {
  .wordmark svg { border-radius: 7px; box-shadow: 0 0 0 1px #334155; }
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.25rem;
}
.site-nav a {
  display: inline-block;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.975rem;
}
.site-nav a:hover { color: var(--text); background: var(--bg-muted); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--bg-muted); }
.site-nav { margin-left: auto; }
.header-signin { min-height: 40px; padding: 0.45rem 1rem; }

@media (max-width: 639px) {
  .site-header .wrap { padding-top: 0.6rem; padding-bottom: 0.5rem; }
  .wordmark { order: 1; }
  .header-signin { order: 2; }
  .site-nav { order: 3; width: 100%; margin-left: 0; }
  .site-nav ul { justify-content: space-between; }
  .site-nav a { padding: 0.45rem 0.5rem; font-size: 0.95rem; }
}

/* ---------- Buttons ---------- */
.btn, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  border: 1px solid transparent;
}
.btn { background: var(--btn-bg); color: var(--btn-text); }
.btn:hover { background: var(--btn-hover); }
.btn-secondary { background: var(--btn2-bg); color: var(--btn2-text); border-color: var(--btn2-border); }
.btn-secondary:hover { background: var(--bg-muted); }

.hero .btn { background: #f8fafc; color: #0f172a; }
.hero .btn:hover { background: #e2e8f0; }
.hero .btn-secondary { background: transparent; color: #f8fafc; border-color: #475569; }
.hero .btn-secondary:hover { background: #1e293b; }
.hero :focus-visible { outline-color: #93c5fd; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- Home ---------- */
.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: clamp(3rem, 8vw, 5.5rem) 0;
  border-bottom: 1px solid var(--border);
}
.hero h1 { color: var(--hero-text); max-width: 20ch; }
.hero .lede { color: var(--hero-muted); font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 42rem; }
.hero .fineprint { color: var(--hero-muted); font-size: 0.95rem; margin-top: 1rem; margin-bottom: 0; }
.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.hero .eyebrow { color: #93c5fd; }

.section { padding: clamp(2.75rem, 6vw, 4.5rem) 0; }
.section.alt { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-intro { max-width: 44rem; color: var(--text-muted); margin-bottom: 2rem; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem 1.25rem 1rem;
}
.card p { color: var(--text-muted); font-size: 0.98rem; }
.card p:last-child { margin-bottom: 0; }
.card .icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--icon-bg);
  color: var(--icon-fg);
  margin-bottom: 0.75rem;
}
.card .icon svg { width: 22px; height: 22px; }

.split {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: start;
}

.checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.checklist li { position: relative; padding-left: 1.75rem; margin-bottom: 0.6rem; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.5em;
  width: 0.7rem;
  height: 0.4rem;
  border-left: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(-45deg);
  color: var(--text);
}

.callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem;
}
.callout h3 { font-size: 1.25rem; }

.cta-band { text-align: center; }
.cta-band .actions { justify-content: center; }
.cta-band p { max-width: 38rem; margin-left: auto; margin-right: auto; color: var(--text-muted); }

/* ---------- Document pages (legal, support, security) ---------- */
.page-head {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.page-head h1 { margin-bottom: 0.4rem; }
.page-head .meta { color: var(--text-muted); margin: 0; font-size: 0.98rem; }

.draft-banner {
  background: var(--draft-bg);
  color: var(--draft-text);
  border-bottom: 2px solid var(--draft-border);
  font-size: 0.98rem;
}
.draft-banner .wrap { padding-top: 0.7rem; padding-bottom: 0.7rem; }
.draft-banner p { margin: 0; }
.draft-banner strong { font-weight: 700; }

.doc {
  padding-top: 2rem;
  padding-bottom: 3.5rem;
}
.doc > * { max-width: var(--readw); }
.doc h2 { margin-top: 2.5rem; padding-top: 0.25rem; font-size: 1.45rem; scroll-margin-top: 1rem; }
.doc h3 { margin-top: 1.5rem; scroll-margin-top: 1rem; }
.doc ul, .doc ol { padding-left: 1.35rem; margin: 0 0 1rem; }
.doc li { margin-bottom: 0.4rem; }
.doc li > ul, .doc li > ol { margin-top: 0.4rem; }
.doc .summary {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
}
.doc .summary h2 { margin-top: 0; font-size: 1.15rem; }
.doc .summary ul { margin-bottom: 0; }

.toc {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
}
.toc h2 { font-size: 1rem; margin: 0 0 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.toc ol { margin: 0; padding-left: 1.35rem; columns: 2 16rem; column-gap: 2rem; }
.toc li { margin-bottom: 0.25rem; break-inside: avoid; }

.table-scroll { overflow-x: auto; margin: 0 0 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.96rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
th { background: var(--bg-muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Placeholders that Kris must fill in before publishing (see README.md). */
.ph {
  background: var(--ph-bg);
  color: var(--ph-text);
  border-radius: 3px;
  padding: 0 0.2em;
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Step-by-step instructions */
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 0.9rem;
  min-height: 1.9rem;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.platforms { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); margin-bottom: 1rem; }
.platforms .card h3 { font-size: 1.15rem; margin-bottom: 0.9rem; }
.platforms .card p, .platforms .card li { color: var(--text); }
.note { color: var(--text-muted); font-size: 0.96rem; }
.ui { font-weight: 600; white-space: nowrap; }
.inline-icon { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.15em; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 2rem 0;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: flex-start; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0 0 0.35rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header, .site-footer, .skip-link, .toc { display: none; }
  .draft-banner { border: 1px solid #000; }
  a { color: inherit; }
}
.hero .fineprint a { color: inherit; }

.platforms .card h3 { margin-top: 0; }

/* Tables become labelled rows on narrow screens. */
@media (max-width: 639px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.stack tr, table.kv tr { display: block; border-bottom: 1px solid var(--border); padding: 0.5rem 0; }
  table.stack tr:last-child, table.kv tr:last-child { border-bottom: 0; }
  table.stack td, table.kv th, table.kv td { display: block; border: 0; padding: 0.2rem 0.85rem; }
  table.kv th { background: none; }
  table.stack td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  table.stack td:first-child { font-weight: 600; }
  table.stack td:first-child::before { display: none; }
}
