/* CloakTrace Lite. No build step, no web fonts, no images but the logo: the Content-Security-
   Policy allows only this file for styles, so nothing here may depend on inline style. */

:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --fg: #14161a; --muted: #5b6371;
  --line: #e2e5ea; --line-strong: #cfd4dc;
  --accent: #2f5bd3; --accent-hover: #2249b4; --accent-fg: #ffffff; --accent-soft: #e9efff;
  --ok: #1f7a45; --ok-bg: #ecf7f0; --ok-line: #8cc9a3;
  --warn: #9a5b00; --warn-bg: #fff6e6; --warn-line: #e9a23b;
  --bad: #b3261e; --bad-bg: #fdeeed; --bad-line: #eba39e;
  --code: #eef0f4;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -6px rgba(16, 24, 40, .10);
  --radius: 14px; --radius-sm: 10px;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014; --surface: #161a21; --surface-2: #1c212a; --fg: #e9ecf1; --muted: #9ba4b4;
    --line: #262c36; --line-strong: #343b47;
    --accent: #7d9cf0; --accent-hover: #9bb3f5; --accent-fg: #0c1020; --accent-soft: #1a2342;
    --ok: #7fd3a0; --ok-bg: #12241a; --ok-line: #2f6b47;
    --warn: #f0bd6a; --warn-bg: #2a2010; --warn-line: #a0701f;
    --bad: #f2948d; --bad-bg: #2c1514; --bad-line: #7d3430;
    --code: #1f242e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -8px rgba(0, 0, 0, .55);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column; }   /* footer at the bottom of short pages */
body > main { flex: 1 0 auto; width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
p, li { text-wrap: pretty; }
code { font-family: var(--mono); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 8px;
  background: var(--accent); color: var(--accent-fg); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px;
  min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none;
  font-weight: 750; font-size: 17px; letter-spacing: -0.01em; }
.brand:hover { color: var(--fg); }
.brand img { display: block; border-radius: 8px; box-shadow: var(--shadow-sm); }
.brand-lite { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-links { display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); }
.nav a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px;
  color: var(--muted); font-size: 14.5px; font-weight: 550; text-decoration: none;
  transition: background-color .15s, color .15s; }
.nav a:hover { color: var(--fg); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav a.nav-cta { height: 44px; padding: 0 18px; color: var(--accent-fg); background: var(--accent); box-shadow: var(--shadow-sm); font-weight: 650; }
.nav a.nav-cta:hover { background: var(--accent-hover); color: var(--accent-fg); }

/* ---------- hero (home) ---------- */
.hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1000px 380px at 15% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(700px 300px at 95% 0%, color-mix(in srgb, var(--warn-line) 10%, transparent), transparent 70%); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 5px 12px 5px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 550; box-shadow: var(--shadow-sm); }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.hero h1 { font-size: clamp(34px, 5.4vw, 56px); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 14px; max-width: 18ch; }
.hl { color: var(--accent); }
.lede { color: var(--muted); font-size: clamp(16px, 1.9vw, 19px); max-width: 62ch; margin: 0 0 28px; }

.trace-form { display: flex; gap: 10px; padding: 8px; max-width: 760px; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.trace-form:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.field-icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.field input { width: 100%; height: 52px; padding: 0 14px 0 42px; border: 0; border-radius: 10px;
  background: transparent; color: var(--fg); font: 16px var(--mono); }
.field input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.field input:focus { outline: none; }
.trace-form:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }

button { font: inherit; cursor: pointer; }
#go { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px;
  padding: 0 24px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-fg);
  font-weight: 650; white-space: nowrap; transition: background-color .15s, transform .05s; }
#go:hover { background: var(--accent-hover); }
#go:active { transform: translateY(1px); }
#go:disabled { cursor: progress; opacity: .85; }
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent-fg) 35%, transparent); border-top-color: var(--accent-fg); }
.trace-form[aria-busy="true"] .spinner { display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .trace-form[aria-busy="true"] .spinner { animation-duration: 2.4s; } }

#captcha:not(:empty) { margin: 14px 0 0; }
.hint { max-width: 760px; margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }
.hint + .hint { margin-top: 4px; }
.hint a { color: inherit; }
.hint a:hover { color: var(--fg); }
.visitors { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 24px 0 0; padding: 0; }
.visitors li { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 550; }

/* ---------- status and results ---------- */
#status { max-width: 760px; margin: 14px 0 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--fg); font-weight: 550; }
#status:empty { margin: 0; padding: 0; background: none; }  /* stays in the page so screen readers hear updates */
#result:not(:empty) { margin: 28px 0 8px; scroll-margin-top: 84px; }
.card, .verdict { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; margin: 16px 0; box-shadow: var(--shadow-sm); }
.verdict { position: relative; padding-left: 72px; border-left-width: 1px; }
.verdict::before { position: absolute; left: 22px; top: 22px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.verdict h2 { margin: 2px 0 6px; font-size: 21px; }
.verdict p { margin: 4px 0; }
.tone-split { background: var(--warn-bg); border-color: var(--warn-line); }
.tone-split::before { content: "!"; background: var(--warn-line); color: #1d1300; }
.tone-same { background: var(--ok-bg); border-color: var(--ok-line); }
.tone-same::before { content: "="; background: var(--ok); color: var(--surface); }
.tone-failed, .tone-partial { background: var(--bad-bg); border-color: var(--bad-line); }
.tone-failed::before, .tone-partial::before { content: "×"; background: var(--bad); color: var(--surface); }
.muted { color: var(--muted); font-size: 14px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card h3 { margin: 0; font-size: 17px; }
.card > h3 { margin-bottom: 12px; }
button.secondary { height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--fg); font-size: 13.5px; font-weight: 600; }
button.secondary:hover { background: var(--surface-2); }

.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 11px; padding-left: 20px; border-left: 2px solid var(--line); }
.tree ul.split { border-left-color: var(--warn-line); }
.node { position: relative; margin: 12px 0; }
.tree ul > .node::before { content: ""; position: absolute; left: -20px; top: 13px; width: 14px; border-top: 2px solid var(--line); }
.tree ul.split > .node::before { border-top-color: var(--warn-line); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.how { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.addr { font: 13px/1.45 var(--mono); background: var(--code); padding: 3px 8px; border-radius: 6px; word-break: break-all; }
.pill { font-size: 12px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.pill.bad, .bad-text { color: var(--bad); border-color: var(--bad-line); }
.bad-text { font-size: 13px; margin-top: 4px; }
.ends { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 0; }
.ends-label { font-size: 13px; color: var(--muted); }
.who { font-size: 13px; font-weight: 550; background: var(--ok-bg); border: 1px solid var(--ok-line);
  color: var(--fg); border-radius: 999px; padding: 2px 11px; }
.who-bad { background: var(--bad-bg); border-color: var(--bad-line); }
.split-note { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--warn); font-weight: 650; margin: 8px 0 0 2px; }
.split-note::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--warn-line);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn-line) 25%, transparent); }
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 10px 8px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
td { word-break: break-word; }
.card > .muted { margin: 14px 0 0; }

/* ---------- features and explainer (home) ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 40px 0 8px; }
.feature { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.feature-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.feature h2 { font-size: 17px; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }
.explain { display: grid; grid-template-columns: 1fr 1.35fr; gap: 40px; margin: 48px 0 16px; padding: 32px 36px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.explain .prose { max-width: none; }
.explain ul { margin: 0 0 14px; }
.explain h2 { font-size: 21px; margin: 0 0 8px; }
.explain h2 + p { margin-top: 0; }
.explain p + h2, .explain ul + h2 { margin-top: 28px; }

/* ---------- document pages ---------- */
.doc { padding-top: 48px; padding-bottom: 24px; }
.doc.has-toc { display: grid; grid-template-columns: minmax(0, 1fr) 240px; column-gap: 56px; }
.page-head { grid-column: 1 / -1; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.meta { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.page-lede { color: var(--muted); font-size: clamp(16px, 1.8vw, 18px); max-width: 62ch; margin: 12px 0 0; }
.steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none;
  margin: 0 0 36px; padding: 0; }
.steps li { display: flex; flex-direction: column; gap: 4px; padding: 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.steps strong { font-size: 16px; }
.steps li > span:last-child { color: var(--muted); font-size: 14.5px; }
.step-n { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-bottom: 8px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: 14px; }
.prose { max-width: 72ch; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 22px; margin: 40px 0 10px; padding-top: 4px; }
.prose h3 { font-size: 17px; margin: 24px 0 6px; }
.prose li { margin: 6px 0; }
.prose ul { padding-left: 22px; }
.prose li::marker { color: var(--muted); }
.prose table { margin: 8px 0 20px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--surface); }
.prose th { background: var(--surface-2); }
.prose th, .prose td { padding: 10px 12px; }
.prose code { font-size: .9em; background: var(--code); padding: 1px 6px; border-radius: 5px; }
.caps { text-transform: uppercase; font-size: 13.5px; letter-spacing: .01em; color: var(--muted); }
.toc { position: relative; }
.toc nav { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.toc-title { margin: 0 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 8px; padding: 5px 8px; margin: 0 -8px; border-radius: 8px; color: var(--muted);
  font-size: 13.5px; line-height: 1.35; text-decoration: none; }
.toc a::before { content: counter(toc) "."; min-width: 1.4em; color: color-mix(in srgb, var(--muted) 70%, transparent); }
.toc a:hover { color: var(--fg); background: var(--surface-2); }

/* ---------- footer ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.footer-inner { padding-top: 32px; padding-bottom: 36px; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; margin-bottom: 14px; }
.footer-links a { padding: 4px 12px; border-radius: 999px; color: var(--muted); font-weight: 550; text-decoration: none; }
.footer-links a:hover { color: var(--fg); background: var(--surface-2); }
.footer-links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.footer-agree { margin: 0 auto 6px; max-width: 70ch; }
.footer-agree a { color: var(--fg); }
.footer-copy { margin: 0 auto; max-width: 92ch; font-size: 13px; color: color-mix(in srgb, var(--muted) 85%, transparent); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .doc.has-toc { display: flex; flex-direction: column; }
  .page-head { order: -3; }
  .steps { order: -2; grid-template-columns: 1fr; }
  .toc { order: -1; margin: 0 0 28px; }
  .toc nav { position: static; max-height: none; }
  .features { grid-template-columns: 1fr; }
  .explain { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 600px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .site-header { position: static; }
  .header-inner { padding-top: 12px; padding-bottom: 12px; }
  .doc { padding-top: 32px; }
  .nav { width: 100%; justify-content: space-between; }
  .nav a.nav-cta { height: 40px; padding: 0 14px; }
  .header-inner { min-height: 56px; }
  .nav { gap: 2px; }
  .nav a { height: 32px; padding: 0 10px; font-size: 13.5px; }
  .hero { padding: 40px 0 28px; }
  .trace-form { flex-direction: column; padding: 6px; }
  #go { width: 100%; }
  .card, .verdict { padding: 16px; }
  .verdict { padding-left: 60px; }
  .verdict::before { left: 16px; top: 18px; }
  .explain { padding: 20px; }
}
