/* RatChecker website. Built from design-system.md, which takes every value from the desktop app (app/ui/styles.css).
   Layout: one left-aligned 1040px column; each section is an app surface (scanner, report, settings, download). */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --sunken: #0e0e10;
  --panel: #121214;
  --raised: #18181b;
  --line: #1c1c1f;
  --line-2: #202023;
  --line-4: #2a2a2e;
  --text: #f2f2f3;
  --text-2: #d6d6da;
  --text-3: #b4b4ba;
  --muted: #8b8b92;
  --faint: #6f6f76;
  --red: #ff8a8a;
  --red-soft: rgba(255, 107, 107, .12);
  --red-tint: rgba(255, 107, 107, .08);
  --amber: #f2b84b;
  --amber-soft: rgba(242, 184, 75, .12);
  --green: #5fd49a;
  --green-soft: rgba(95, 212, 154, .12);
  --blue: #8fb4ff;
  --blue-soft: rgba(143, 180, 255, .12);
  --code-kw: #9aa4ff;
  --code-str: #8fd6a8;
  --code-com: #6b6b72;
  --gutter: #4d4d54;
  --dash: #2e2e33;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text-2); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; text-align: left; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
h1, h2 { margin: 0; color: var(--text); font-weight: 600; text-wrap: balance; }
p, dl, dd { margin: 0; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
@media (max-width: 640px) { .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } }

/* top bar: the app's title bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { height: 56px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; }
.links { display: flex; gap: 24px; margin-left: auto; font-size: 14px; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--text-2); }
@media (max-width: 760px) { .links { display: none; } .top-in > .btn { margin-left: auto; } }

/* buttons */
.btn { height: 36px; padding: 0 16px; border: 1px solid var(--line-4); border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer; flex: none; }
.btn:hover { background: #151517; border-color: #36363b; }
.btn.primary { border: 0; font-weight: 600; background: var(--text); color: var(--bg); }
.btn.primary:hover { background: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* hero */
.hero { padding-block: 64px 32px; }
h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; max-width: 20ch; }
.lead { margin-top: 16px; max-width: 62ch; font-size: 16px; color: var(--text-3); }
.actions { margin-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.note { font-size: 13px; color: var(--faint); }
@media (max-width: 640px) { .hero { padding-block: 48px 24px; } h1 { font-size: 28px; letter-spacing: -0.015em; } }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; }
.card-t { font-size: 20px; letter-spacing: -0.01em; line-height: 1.3; }
.card-s { margin-top: 4px; font-size: 13px; color: var(--muted); }

/* scanner */
.scanner { padding: 24px; display: grid; gap: 20px; }
@media (max-width: 640px) { .scanner { padding: 16px; } }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-ctl { display: flex; align-items: center; gap: 16px; }
.switch-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 32px; height: 18px; border-radius: 9px; background: var(--line-4); position: relative; flex: none; transition: background .12s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 7px; background: var(--muted); transition: transform .12s, background .12s; }
.switch.on, .switch-row input:checked + .switch { background: var(--green); }
.switch.on::after, .switch-row input:checked + .switch::after { transform: translateX(14px); background: var(--bg); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--blue); outline-offset: 2px; }

.drop { min-height: 84px; border: 1px dashed var(--dash); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: var(--sunken); color: var(--muted); cursor: pointer; transition: border-color .12s, background .12s; }
.drop:hover { border-color: #3a3a40; }
.drop.over { border-color: var(--blue); background: rgba(143, 180, 255, .06); }
.drop .t { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); }
.drop .d { display: block; font-size: 13px; color: var(--faint); margin-top: 2px; }

.table { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--panel); }
.thead, .row > summary { display: grid; grid-template-columns: minmax(0, 1fr) 120px 132px 96px 72px; align-items: center; gap: 12px; padding: 0 18px; }
.thead { height: 38px; font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); }
.c-risk, .r-risk { text-align: right; }
@media (max-width: 720px) {
  .thead, .row > summary { grid-template-columns: minmax(0, 1fr) auto; padding: 0 12px; }
  .c-loader, .c-count, .c-risk, .r-loader, .r-count, .r-risk { display: none; }
}
.row { border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row > summary { min-height: 58px; padding-block: 8px; list-style: none; cursor: pointer; }
.row > summary::-webkit-details-marker { display: none; }
.row > summary:hover, .row[open] > summary { background: var(--raised); }
.r-mod { min-width: 0; }
.r-mod b { display: block; font-size: 14px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.r-mod small { display: block; font-family: var(--mono); font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }
.r-loader, .r-count { font-size: 13px; color: var(--text-3); }
.r-risk { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.r-risk b { color: var(--text); font-weight: 600; }
.ex { font-family: var(--sans); font-size: 12px; color: var(--faint); margin-left: 8px; font-weight: 400; }
.prog { grid-column: 1 / -1; height: 2px; background: var(--line); }
.prog > i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }

.tag { display: inline-flex; align-items: center; gap: 8px; padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 500; white-space: nowrap; justify-self: start; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.clean { color: var(--green); background: var(--green-soft); }
.tag.sus { color: var(--amber); background: var(--amber-soft); }
.tag.bad { color: var(--red); background: var(--red-soft); }
.tag.run { color: var(--blue); background: var(--blue-soft); }
.tag.run::before { animation: pulse 1s ease-in-out infinite; }
.tag.off { color: var(--muted); background: rgba(255, 255, 255, .06); }
@keyframes pulse { 50% { opacity: .25; } }

.row-body { padding: 4px 18px 20px; display: grid; gap: 12px; background: var(--raised); }
@media (max-width: 720px) { .row-body { padding: 4px 12px 16px; } }
.origin { font-size: 13px; color: var(--text-3); }
.origin.ok { color: var(--green); }
.origin.warn { color: var(--red); }
.findings { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--panel); }
.findings li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.findings li:last-child { border-bottom: 0; }
.findings .f-t { font-size: 14px; font-weight: 500; color: var(--text); }
.findings .f-d, .findings .f-l { grid-column: 2; font-size: 13px; color: var(--muted); }
.findings .f-l { font-family: var(--mono); font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }
.sev { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-radius: 5px; padding: 2px 6px; text-align: center; align-self: start; flex: none; }
.sev.hi { color: var(--red); background: var(--red-soft); }
.sev.med { color: var(--amber); background: var(--amber-soft); }
.sev.lo { color: var(--blue); background: var(--blue-soft); }
.sev.info { color: var(--muted); background: rgba(255, 255, 255, .06); }
.none, .next { font-size: 13px; color: var(--muted); }
.next a { color: var(--text); }
.err { font-size: 13px; color: var(--red); }
.fine { font-size: 13px; color: var(--faint); max-width: 80ch; }

/* sections */
.sec { padding-top: 96px; }
@media (max-width: 640px) { .sec { padding-top: 64px; } }
h2 { font-size: 28px; line-height: 1.2; letter-spacing: -0.015em; }
.sec-lead { margin-top: 12px; max-width: 62ch; color: var(--text-3); }
.sec-lead + .card { margin-top: 24px; }

/* report: the app's report view */
.report { margin-top: 24px; overflow: hidden; }
.rep-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 24px 20px; flex-wrap: wrap; }
.rep-id { min-width: 0; }
.rep-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.rep-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.rep-origin { margin-top: 8px; font-size: 13px; color: var(--text-3); }
.score { text-align: right; }
.score .l { font-size: 12px; letter-spacing: .08em; color: var(--faint); }
.score .v { font-size: 28px; font-weight: 600; color: var(--red); line-height: 1.2; font-variant-numeric: tabular-nums; }
.score .v small { font-size: 13px; font-weight: 400; color: var(--faint); }
.tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.tab { height: 36px; padding: 0 12px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text-2); }
.tab.on { color: var(--text); font-weight: 500; border-bottom-color: var(--text); }
.tab .n { color: var(--faint); font-weight: 400; margin-left: 4px; }
.rep-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; padding: 20px 24px 24px; }
.rep-body[data-panel="source"] { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 800px) { .score { text-align: left; } .rep-body { grid-template-columns: minmax(0, 1fr); padding: 16px; } .tabs { padding: 0 16px; } .rep-head { padding: 16px; } }
.flist { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; align-self: start; }
.fitem { width: 100%; display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.fitem:last-child { border-bottom: 0; }
.fitem:hover { background: #141416; }
.fitem.on { background: var(--raised); }
.fitem .ft { display: block; font-size: 14px; font-weight: 500; color: var(--text); }
.fitem .fl { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.fdetail { display: grid; gap: 12px; align-content: start; }
.dbox { border: 1px solid var(--line-2); border-radius: 12px; padding: 16px; }
.dbox .k { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.dbox p { margin-top: 8px; font-size: 14px; color: var(--text-3); }
.decode { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
@media (max-width: 520px) { .decode { grid-template-columns: minmax(0, 1fr); } }
.decode .v { font-family: var(--mono); font-size: 12px; background: var(--sunken); border: 1px solid var(--line-4); border-radius: 8px; padding: 8px 12px; overflow-wrap: anywhere; color: var(--text-3); }
.decode .v.hot { color: var(--red); border-color: rgba(255, 107, 107, .35); background: var(--red-tint); }
.decode .via { font-size: 12px; color: var(--faint); text-align: center; }
.code { background: var(--sunken); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 0; font-family: var(--mono); font-size: 13px; line-height: 1.75; overflow-x: auto; color: var(--text-2); }
.cl { display: flex; white-space: pre; min-width: max-content; padding-right: 16px; }
.cl .g { flex: none; width: 48px; padding-right: 16px; text-align: right; color: var(--gutter); user-select: none; }
.cl.hl { background: rgba(255, 107, 107, .1); }
.cl.hl .g { color: var(--red); }
.kw { color: var(--code-kw); }
.st { color: var(--code-str); }
.cm { color: var(--code-com); }

/* settings */
.settings { margin-top: 24px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow .st { font-size: 14px; font-weight: 500; color: var(--text); }
.srow .sd { margin-top: 2px; font-size: 13px; color: var(--muted); max-width: 62ch; }
@media (max-width: 640px) { .srow { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; } }
.seg { display: inline-flex; background: var(--sunken); border: 1px solid #1f1f23; border-radius: 8px; padding: 3px; gap: 2px; flex: none; }
.seg span { height: 28px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: #85858c; display: inline-flex; align-items: center; }
.seg span.on { color: #fff; background: #1f1f23; font-weight: 600; }

/* the app itself (demo/), live in a frame the size of its window; a screenshot on narrow screens */
.demo { margin: 24px 0 0; }
.demo-frame { display: block; width: 100%; height: 700px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); }
.demo-alt { display: none; }
.demo-alt img { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 12px; }
.demo-alt .btn { margin-top: 16px; }
.demo-cap { margin-top: 12px; font-size: 13px; color: var(--faint); }
@media (max-width: 999px) { .demo-frame { display: none; } .demo-alt { display: block; } }

/* download */
.dl { padding: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.kv { margin-top: 16px; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--text-2); }
.kv dd.mono { font-size: 12px; padding-top: 1px; }

/* questions */
.faq { margin-top: 24px; border-top: 1px solid var(--line); }
.faq > div { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 8px 32px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.faq dt { font-size: 14px; font-weight: 500; color: var(--text); }
.faq dd { font-size: 14px; color: var(--text-3); max-width: 62ch; }
@media (max-width: 720px) { .faq > div { grid-template-columns: minmax(0, 1fr); } }

.foot { margin-top: 96px; border-top: 1px solid var(--line); padding-block: 24px; font-size: 13px; color: var(--faint); }
.foot-in { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }

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

/* video: a still frame until the visitor presses play, then the YouTube player */
.video { position: relative; margin-top: 24px; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--panel); aspect-ratio: 16 / 9; max-width: 100%; }
.video img, .video iframe { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.video-note { margin-top: 12px; }
