/* Hood CA index — no external resources. */
:root {
  --bg: #f6f7f9;
  --bg-alt: #eef1f4;
  --surface: #ffffff;
  --text: #141a22;
  --muted: #4f5b6a;
  --border: #d9dee5;
  --accent: #0b6b66;
  --accent-hover: #08524e;
  --on-accent: #ffffff;
  --accent-soft: #e2f1ef;
  --focus: #1b6fd1;
  --code-bg: #eef1f4;

  --benign: #136c2e;
  --benign-bg: #e3f3e7;
  --malicious: #a8231a;
  --malicious-bg: #fbe6e4;
  --pending: #855a00;
  --pending-bg: #fbf0d4;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .05);
  --font: "Segoe UI", "Noto Sans", "Noto Sans Arabic", "IBM Plex Sans Arabic", Tahoma, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218;
    --bg-alt: #121821;
    --surface: #161d27;
    --text: #e7ebf0;
    --muted: #a0abb9;
    --border: #2a3340;
    --accent: #4cc2b7;
    --accent-hover: #6fd3c9;
    --on-accent: #06201e;
    --accent-soft: #11302d;
    --focus: #79b8ff;
    --code-bg: #1d2531;

    --benign: #6fd88a;
    --benign-bg: #13281b;
    --malicious: #ff8f87;
    --malicious-bg: #33171a;
    --pending: #e8bc58;
    --pending-bg: #2e2412;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

/* Language is decided in <head>; hide until Arabic strings are applied.
   The delayed reveal is a safety net if the script fails to load. */
.i18n-pending body { visibility: hidden; animation: reveal 0s 1.5s forwards; }
@keyframes reveal { to { visibility: visible; } }

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-block-start: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
html[lang="ar"] body { font-size: 1.0625rem; line-height: 1.85; }

h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
html[lang="ar"] :is(h1, h2, h3) { letter-spacing: 0; line-height: 1.45; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--code-bg);
  padding: .1em .35em;
  border-radius: 4px;
  unicode-bidi: isolate;
}
strong { font-weight: 600; }

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

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 32px; } }

.skip {
  position: absolute;
  inset-inline-start: 8px;
  inset-block-start: -100px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  z-index: 10;
}
.skip:focus { inset-block-start: 8px; }

/* Header */
.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-block-end: 1px solid var(--border);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.125rem; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { width: 26px; height: 26px; color: var(--accent); flex: none; }
.topnav { display: flex; align-items: center; gap: 8px; }

.lang { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-inline-end: 4px; }
.lang button {
  font: inherit; font-size: .8125rem; line-height: 1; font-weight: 600;
  padding: 8px 10px; min-height: 34px;
  background: transparent; color: var(--muted); border: 0; cursor: pointer;
}
.lang button + button { border-inline-start: 1px solid var(--border); }
.lang button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); }
.lang button:hover { color: var(--text); }
.lang button:focus-visible { outline-offset: -2px; border-radius: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 6px 14px;
  border-radius: 8px; border: 1px solid transparent;
  font-weight: 600; font-size: .9375rem; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { color: var(--text); border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-lg { min-height: 44px; padding: 10px 20px; font-size: 1rem; }

@media (max-width: 479px) {
  .topbar-in { gap: 8px; }
  .topnav { gap: 6px; }
  .topnav .btn { padding-inline: 10px; font-size: .875rem; }
  .topnav .btn-ghost { display: none; } /* login stays reachable in the hero and footer */
  .lang { margin-inline-end: 0; }
}

/* Hero */
.hero { display: grid; gap: 40px; padding-block: 56px 64px; align-items: center; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.1fr .9fr; gap: 56px; padding-block: 88px 96px; } }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; margin-block-end: 14px; }
html[lang="ar"] .eyebrow { text-transform: none; letter-spacing: 0; font-size: .9375rem; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 700; max-width: 22ch; }
html[lang="ar"] h1 { max-width: 24ch; }
.lead { color: var(--muted); font-size: 1.0625rem; margin-block-start: 18px; max-width: 62ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 28px; }

.sample { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sample-cap { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-block-end: 1px solid var(--border); font-weight: 600; font-size: .9375rem; }
.sample-tag { font-weight: 500; font-size: .75rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.sample-list { list-style: none; margin: 0; padding: 0; }
.sample-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.sample-list li + li { border-block-start: 1px solid var(--border); }
.sample-item { display: grid; gap: 4px; min-width: 0; }
.sample-item code { background: none; padding: 0; font-size: .8125rem; color: var(--text); overflow-wrap: anywhere; text-align: start; }
.sample-meta { color: var(--muted); font-size: .8125rem; }
.sample-foot { padding: 10px 16px; border-block-start: 1px solid var(--border); background: var(--bg-alt); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: .8125rem; font-weight: 600; line-height: 1.3;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-benign { color: var(--benign); background: var(--benign-bg); }
.pill-malicious { color: var(--malicious); background: var(--malicious-bg); }
.pill-pending { color: var(--pending); background: var(--pending-bg); }

/* Sections */
.section { padding-block: 64px; border-block-start: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }
h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); font-weight: 700; }
.section-lead { color: var(--muted); margin-block: 8px 32px; max-width: 70ch; }
h3 { font-size: 1.0625rem; font-weight: 650; }
html[lang="ar"] h3 { font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card > h3 { margin-block-end: 14px; }
.note { color: var(--muted); font-size: .875rem; margin-block-start: 16px; }

.cols { display: grid; gap: 20px; }
@media (min-width: 880px) { .cols { grid-template-columns: 1fr 1fr; gap: 24px; } }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; padding-block-start: 18px;
}
.steps li::before {
  content: counter(step);
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: .9375rem; margin-block-end: 12px;
}
.steps h3 { margin-block-end: 6px; }
.steps p { color: var(--muted); font-size: .9375rem; }
.steps p strong { color: var(--text); }
.steps code, .rules code { white-space: nowrap; }

/* Methodology */
.defs { margin: 0; display: grid; gap: 14px; }
.defs dt { font-weight: 600; }
.defs dd { margin: 2px 0 0; color: var(--muted); font-size: .9375rem; }
.meta-list { list-style: none; margin: 0; padding: 0; }
.meta-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 9px; border-block-end: 1px dashed var(--border); font-size: .9375rem; }
.meta-list li:last-child { border-block-end: 0; }
.opt { flex: none; font-size: .75rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; }

/* Verdict flow diagram */
.flow { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 28px; }
.node {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: grid; gap: 4px; align-content: center;
}
.node-t { font-weight: 650; }
.node-d { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.node-out { background: transparent; border-style: dashed; gap: 8px; justify-items: start; }
/* Connector arrows: vertical on small screens. */
.node + .node::before {
  content: ""; position: absolute;
  inset-inline-start: 50%; inset-block-start: -20px;
  width: 10px; height: 10px; margin-inline-start: -5px;
  border-inline-end: 2px solid var(--muted); border-block-end: 2px solid var(--muted);
  transform: rotate(45deg);
}
html[dir="rtl"] .node + .node::before { transform: rotate(-45deg); }
@media (min-width: 880px) {
  .flow { grid-template-columns: repeat(5, 1fr); gap: 28px; }
  .node + .node::before {
    inset-block-start: 50%; inset-inline-start: -20px;
    margin-inline-start: 0; margin-block-start: -5px;
    transform: rotate(-45deg);
  }
  html[dir="rtl"] .node + .node::before { transform: rotate(45deg); }
}

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: rule; align-content: start; }
.rules li { counter-increment: rule; position: relative; padding-inline-start: 44px; }
.rules li::before {
  content: counter(rule);
  position: absolute; inset-inline-start: 0; inset-block-start: 0;
  width: 28px; height: 28px; border-radius: 6px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface);
  font-weight: 700; font-size: .875rem; color: var(--accent);
}
.rules li:first-child::before { color: var(--malicious); }
.rules h3 { margin-block-end: 4px; }
.rules p { color: var(--muted); font-size: .9375rem; }

.bullets { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.bullets li { padding-inline-start: 2px; }
.bullets li::marker { color: var(--accent); }

/* Roles */
.roles { display: grid; gap: 20px; margin-block-start: 28px; }
.section-lead + .roles { margin-block-start: 0; }
@media (min-width: 880px) { .roles { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.roles .card > h3 { margin-block-end: 2px; }
.role-scope { color: var(--muted); font-size: .875rem; margin-block-end: 14px; }
.roles .bullets { font-size: .9375rem; }

/* Footer */
.footer { border-block-start: 1px solid var(--border); padding-block: 24px; color: var(--muted); font-size: .875rem; }
.footer-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.ver { font-family: var(--mono); font-size: .8125rem; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .lang button { transition: background-color .15s, color .15s, border-color .15s; }
}
.nw { white-space: nowrap; }
