/*
 * site.css — Shadewash's own site.
 *
 * No web fonts, no CDN, no analytics, no third-party anything: the page makes
 * exactly zero requests it did not ship with. That is not austerity for its
 * own sake. A product whose whole claim is "nothing leaves your device" cannot
 * sensibly have a marketing site that loads five trackers to say so, and the
 * Leak Check tab would be a hypocrite if this page phoned home while a reader
 * used it. Everything here is one stylesheet, two scripts and seven PNGs.
 *
 * Tokens match src/options/options.css so the site and the product look like
 * one thing.
 */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #1d2026;
  --muted: #5b6270;
  --line: #e0e3e9;
  --accent: #2f5fb8;
  --on-accent: #ffffff;
  --danger: #a32020;
  --warn: #8a5a00;
  --good: #17683c;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --radius: 13px;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.05), 0 8px 24px -12px rgba(20, 22, 26, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --surface: #1d2027;
    --surface-2: #23272f;
    --text: #e6e8ec;
    --muted: #9aa2b0;
    --line: #2c313a;
    --accent: #7ba6f0;
    --on-accent: #10131a;
    --danger: #f08a8a;
    --warn: #e5b567;
    --good: #6cc48e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --surface: #1d2027;
  --surface-2: #23272f;
  --text: #e6e8ec;
  --muted: #9aa2b0;
  --line: #2c313a;
  --accent: #7ba6f0;
  --on-accent: #10131a;
  --danger: #f08a8a;
  --warn: #e5b567;
  --good: #6cc48e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* ------------------------------------------------------------------ nav */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 60px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 680; letter-spacing: -0.015em; }
.brand svg { display: block; }
.brand b { font-size: 17px; font-weight: 680; }
.brand .tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px;
}

.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tabs button {
  appearance: none; border: 1px solid transparent; background: transparent;
  color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 580;
  padding: 7px 13px; border-radius: 9px; cursor: pointer;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.tabs button:hover { background: var(--surface-2); color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----------------------------------------------------------------- hero */

.hero { padding: 54px 0 34px; }
.hero h1 {
  margin: 0 0 14px; font-size: clamp(30px, 6vw, 44px); line-height: 1.12;
  letter-spacing: -0.03em; font-weight: 700; max-width: 20ch;
}
.hero .lede { margin: 0 0 24px; font-size: clamp(16.5px, 2.4vw, 19px); color: var(--muted); max-width: 54ch; }

.claims { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; }
.claims li {
  font-size: 13.5px; font-weight: 570; padding: 5px 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 99px;
}

.cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  appearance: none; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 11px 19px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: transform 120ms var(--ease), background 140ms var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { text-decoration: none; }
.btn.small { padding: 7px 13px; font-size: 13.5px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------- cards */

section.panel { padding-bottom: 60px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin: 0 0 18px;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.quiet { background: var(--surface-2); }

h2 { font-size: clamp(21px, 3.4vw, 26px); letter-spacing: -0.02em; margin: 44px 0 6px; }
h2:first-child { margin-top: 0; }
h3 { font-size: 16.5px; margin: 0 0 6px; font-weight: 650; }
.sub { color: var(--muted); margin: 0 0 20px; max-width: 62ch; }
p { max-width: 68ch; }

/* --------------------------------------------------------------- steps */

ol.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
ol.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 26px 48px; border-left: 2px solid var(--line); margin-left: 15px;
}
ol.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: -16px; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font-size: 14px; font-weight: 680;
}
ol.steps h3 { margin-top: 2px; }
ol.steps p { margin: 0; color: var(--muted); }

/* ----------------------------------------------------------- shots */

figure { margin: 0 0 18px; }
figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
}
figcaption { margin-top: 9px; font-size: 13.5px; color: var(--muted); }

.shot-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.shot-grid figure { margin: 0; }
.shot-narrow { max-width: 340px; }

/* ---------------------------------------------------------------- forms */

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
label.field .hint { font-weight: 450; color: var(--muted); }

input[type="text"], input[type="email"], textarea, select {
  width: 100%; font: inherit; font-size: 15px;
  padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
textarea { resize: vertical; min-height: 96px; }
textarea.code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 150px; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.status { font-size: 13.5px; color: var(--muted); min-height: 1.4em; }
.status.good { color: var(--good); }

/* ------------------------------------------------------------- findings */

.headline {
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
  border: 1px solid var(--line); background: var(--surface);
  border-left: 5px solid var(--muted);
}
.headline h3 { font-size: 18px; margin-bottom: 5px; }
.headline p { margin: 0; color: var(--muted); }
.headline[data-risk="critical"] { border-left-color: var(--danger); }
.headline[data-risk="high"] { border-left-color: var(--danger); }
.headline[data-risk="medium"] { border-left-color: var(--warn); }
.headline[data-risk="low"] { border-left-color: var(--muted); }
.headline[data-risk="good"] { border-left-color: var(--good); }

.group-title {
  font-size: 12px; font-weight: 680; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 24px 0 8px;
}

ul.findings { list-style: none; margin: 0; padding: 0; }
ul.findings li {
  border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 15px; margin-bottom: 8px; background: var(--surface);
}
.f-head { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.f-head strong { font-size: 15px; font-weight: 640; }
.f-what { margin: 5px 0 0; font-size: 14.2px; color: var(--muted); }
.f-detail {
  margin: 7px 0 0; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted); word-break: break-all;
}

.pill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px; border: 1px solid;
}
.pill[data-risk="critical"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.pill[data-risk="high"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.pill[data-risk="medium"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pill[data-risk="low"] { color: var(--muted); border-color: var(--line); }
.pill[data-risk="good"] { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }

.note {
  font-size: 14px; padding: 11px 14px; border-radius: 10px; margin-bottom: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.note[data-tone="warn"] { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.note[data-tone="good"] { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.note p { margin: 0; }

/* ---------------------------------------------------------------- misc */

.limits { border-left: 4px solid var(--warn); }
.limits ol { margin: 0; padding-left: 20px; }
.limits li + li { margin-top: 8px; }

details.faq { border-top: 1px solid var(--line); padding: 14px 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
details.faq summary::marker { color: var(--muted); }
details.faq p { margin: 10px 0 0; color: var(--muted); }

table.perms { width: 100%; border-collapse: collapse; font-size: 14px; }
table.perms th, table.perms td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.perms th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
table.perms code { font-size: 12.5px; }

code, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}

footer.site {
  border-top: 1px solid var(--line); margin-top: 20px;
  padding: 28px 0 44px; font-size: 13.5px; color: var(--muted);
}
footer.site p { margin: 0 0 8px; max-width: 70ch; }
footer.site .links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
footer.site .credit { margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------ the error */

.oops { min-height: 100svh; display: grid; place-items: center; padding: 40px 16px; }
.oops .card { max-width: 620px; box-shadow: var(--shadow); }
.oops h1 { font-size: clamp(25px, 5vw, 33px); letter-spacing: -0.02em; margin: 0 0 10px; }

@media (max-width: 620px) {
  .topbar .wrap { min-height: 0; padding-top: 10px; padding-bottom: 10px; }
  .tabs { margin-left: 0; width: 100%; }
  .tabs button { flex: 1 1 auto; text-align: center; }
  .hero { padding: 34px 0 24px; }
  .card { padding: 18px 16px; }
  ol.steps > li { padding-left: 38px; }
}
