/* Layout: a calm typographic opening, then the connected map as the centrepiece; every later section reads as another way of using connections. */
/* Colours: AttackSight product tokens (dashboard-frontend/src/styles/tokens.css). */
:root {
  --surface-0: #0a0a0a;
  --surface-1: #171717;
  --surface-panel: rgba(23, 23, 23, 0.7);
  --surface-2: #262626;
  --line: #262626;
  --line-brand: rgba(34, 197, 94, 0.3);
  --line-strong: #404040;
  --text-strong: #f5f5f5;
  --text: #e5e5e5;
  --text-muted: #a3a3a3;
  --text-subtle: #737373;
  --brand-400: #4ade80;
  --brand-500: #22c55e;
  --brand-fill: rgba(34, 197, 94, 0.18);
  --on-brand: #052e16;
  --selection: #22d3ee;
  --warning: #facc15;
  --progress: #38bdf8;
  --severity-critical: #ef4444;
  --severity-high: #f97316;
  --severity-medium: #eab308;
  --severity-low: #3b82f6;
  --severity-high-soft: #fdba74;
  --severity-medium-soft: #fde047;
  --severity-low-soft: #93c5fd;
  --kind-domain: #34d399;
  --kind-host: #22d3ee;
  --kind-ip: #c084fc;
  --kind-finding: #f87171;
  --kind-lookalike: #f472b6;
  --kind-email: #60a5fa;
  --kind-person: #e879f9;
  --kind-breach: #fb7185;
  --kind-company: #f5f5f5;
  --motion-fast: 150ms;
  --motion-base: 300ms;
  --motion-draw: 900ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface-0); }
a { color: var(--brand-400); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid rgba(74, 222, 128, 0.5); outline-offset: 2px; border-radius: var(--radius-md); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); }
.wrap { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); max-width: 1400px; margin-inline: auto; }

/* Header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: rgba(10, 10, 10, 0.88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 32px; height: 72px; }
.top img { height: 52px; width: auto; display: block; }
.top nav { display: flex; gap: 28px; margin-left: auto; font-size: 14px; }
.top nav a { color: var(--text-muted); }
.top nav a:hover { color: var(--text-strong); text-decoration: none; }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: var(--radius-md); font: 600 14px/1 var(--sans); border: 1px solid var(--line-strong); color: var(--text-strong); background: var(--surface-1); cursor: pointer; white-space: nowrap; transition: border-color var(--motion-fast), background var(--motion-fast); }
.btn:hover { text-decoration: none; border-color: rgba(34, 197, 94, 0.5); }
.btn-primary { background: var(--brand-500); border-color: var(--brand-500); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-400); border-color: var(--brand-400); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }

/* Opening */
.opening { padding-block: 96px 56px; }
.opening .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px 64px; align-items: end; }
h1 { margin: 0; font-size: clamp(42px, 6vw, 84px); line-height: 1.0; letter-spacing: -0.045em; font-weight: 600; color: var(--text-strong); text-wrap: balance; }
.opening .lede { font-size: 18px; line-height: 1.6; color: var(--text-muted); margin: 0 0 28px; max-width: 30em; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* The connected map */
.map-band { padding-block: 0 104px; }
.map { display: grid; grid-template-columns: minmax(0, 1fr) 340px; border: 1px solid var(--line-brand); border-radius: var(--radius-xl); background: var(--surface-panel); overflow: hidden; }
.map-main { min-width: 0; border-right: 1px solid var(--line); }
.map-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--line); }
.tabs button { font: 600 13px/1 var(--sans); color: var(--text-muted); background: none; border: 0; border-radius: var(--radius-md); padding: 8px 12px; cursor: pointer; transition: color var(--motion-fast), background var(--motion-fast); }
.tabs button:hover { color: var(--text-strong); }
.tabs button[aria-pressed="true"] { background: var(--brand-fill); color: var(--brand-400); }
.map-bar .hint { font-size: 12px; color: var(--text-subtle); margin-left: auto; }
.canvas { overflow-x: auto; padding: 12px 8px 8px; }
.canvas svg { display: block; width: 100%; min-width: 720px; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-muted); list-style: none; margin: 0; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

.link { fill: none; stroke: var(--line-strong); stroke-width: 1.25; transition: opacity var(--motion-base) var(--ease-in-out), stroke var(--motion-base); }
.link.lit { stroke: var(--text-muted); stroke-width: 1.5; }
.link.lit.risk { stroke: var(--severity-high); }
.link.dashed { stroke-dasharray: 3 4; }
.link.inferred { stroke-dasharray: 2 4; }
.link.lit.inferred { stroke: var(--warning); }
.link.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 600ms var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.llabel { font: 10px var(--sans); fill: var(--text); transition: opacity var(--motion-base); pointer-events: none; }
.llabel-bg { fill: var(--surface-0); stroke: var(--line-strong); }
.item { cursor: pointer; transition: opacity var(--motion-base) var(--ease-in-out); }
.item rect.body { fill: var(--surface-1); stroke: var(--line-strong); transition: stroke var(--motion-fast); }
.item:hover rect.body { stroke: rgba(34, 197, 94, 0.6); }
.item text { fill: var(--text); font: 11px var(--mono); pointer-events: none; }
.item text.sans { font-family: var(--sans); }
.item.sel rect.body { stroke: var(--selection); stroke-width: 2; }
.item:focus { outline: none; }
.item:focus-visible rect.body { stroke: var(--brand-400); stroke-width: 2; }
.dim { opacity: 0.22; }
.hide { opacity: 0; }

.inspector { padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.inspector .kicker { font-size: 12px; color: var(--brand-400); font-weight: 600; }
.inspector h3 { margin: 0; font-size: 20px; line-height: 1.3; color: var(--text-strong); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.inspector p { margin: 0; color: var(--text-muted); font-size: 14px; }
.inspector ol, .inspector ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.inspector li { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 13px; color: var(--text); }
.inspector li .dot { transform: translateY(-1px); }
.inspector li small { display: block; color: var(--text-subtle); font-size: 12px; }
.inspector .foot { margin-top: auto; font-size: 12px; color: var(--text-subtle); border-top: 1px solid var(--line); padding-top: 12px; }

/* Sections */
.band { padding-block: 104px; border-top: 1px solid var(--line); }
h2 { margin: 0 0 18px; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 600; color: var(--text-strong); max-width: 17em; text-wrap: balance; }
h3 { text-wrap: balance; }
.section-lede { font-size: 18px; color: var(--text-muted); max-width: 36em; margin: 0 0 56px; }
p { margin: 0 0 12px; }

/* List versus context */
.contrast { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.contrast > div { padding: 28px 40px 0 0; min-width: 0; }
.contrast > div + div { padding: 28px 0 0 40px; border-left: 1px solid var(--line); }
.contrast h3 { margin: 0 0 4px; font-size: 18px; color: var(--text-strong); font-weight: 600; }
.contrast .sub { color: var(--text-muted); font-size: 15px; margin: 0 0 20px; }
.flat { list-style: none; margin: 0; padding: 0; }
.flat li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; align-items: center; }
.sev { display: inline-flex; justify-content: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.sev-h { background: rgba(249, 115, 22, .2); color: var(--severity-high-soft); }
.sev-m { background: rgba(234, 179, 8, .2); color: var(--severity-medium-soft); }
.sev-l { background: rgba(59, 130, 246, .2); color: var(--severity-low-soft); }
.chain { list-style: none; margin: 0; padding: 0; counter-reset: c; }
.chain li { position: relative; padding: 10px 0 18px 36px; counter-increment: c; font-size: 15px; }
.chain li::before { content: counter(c); position: absolute; left: 0; top: 9px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--severity-high); color: var(--severity-high-soft); font: 600 11px/20px var(--sans); text-align: center; background: var(--surface-0); }
.chain li::after { content: ""; position: absolute; left: 11px; top: 35px; bottom: -8px; width: 2px; background: rgba(249, 115, 22, .35); }
.chain li:last-child::after { display: none; }
.chain small { display: block; color: var(--text-muted); font-size: 13px; }
.verdict-line { margin-top: 8px; padding: 14px 16px; border: 1px solid rgba(249, 115, 22, .35); border-radius: var(--radius-lg); background: rgba(249, 115, 22, .06); font-size: 15px; color: var(--text-strong); }

/* Questions only connected data answers */
.asks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; list-style: none; margin: 0; padding: 0; }
.asks li { padding: 22px 0; border-top: 1px solid var(--line); }
.asks b { display: block; color: var(--text-strong); font-weight: 600; font-size: 17px; line-height: 1.4; margin-bottom: 6px; }
.asks span { color: var(--text-muted); font-size: 15px; }

/* Engines */
.engines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.engines li { display: grid; grid-template-columns: 180px 220px minmax(0, 1fr); gap: 8px 32px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.engines .n { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-strong); }
.engines .d { font-size: 14px; color: var(--brand-400); font-weight: 600; }
.engines .adds { color: var(--text-muted); font-size: 15px; }
.engines .adds .dot { margin-right: 6px; }

/* Principles */
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.three > div { padding: 28px 28px 0 0; min-width: 0; }
.three > div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.three h3 { margin: 0 0 8px; font-size: 19px; color: var(--text-strong); font-weight: 600; }
.three p { color: var(--text-muted); font-size: 15px; }

/* Risk */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: center; }
.score { padding: 28px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 40px; align-items: center; border: 1px solid var(--line-brand); border-radius: var(--radius-xl); background: var(--surface-panel); }
.ring { position: relative; width: 160px; height: 160px; }
.ring svg { width: 160px; height: 160px; display: block; }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .val b { font-size: 42px; font-weight: 600; color: var(--severity-medium); font-variant-numeric: tabular-nums; line-height: 1; }
.ring .val span { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.ring-arc { animation: arc var(--motion-draw) var(--ease-out) both; }
@keyframes arc { from { stroke-dasharray: 0 377; } }
.parts { display: grid; gap: 16px; }
.part { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 16px; align-items: center; font-size: 14px; }
.part .bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.part .bar i { display: block; height: 100%; width: var(--w); border-radius: 999px; background: var(--text-muted); transform-origin: left; animation: grow var(--motion-draw) var(--ease-out) both; }
@keyframes grow { from { transform: scaleX(0); } }
.caption { font-size: 12px; color: var(--text-subtle); margin: 12px 0 0; }
.points { margin: 0; padding: 0; list-style: none; }
.points li { padding: 16px 0; border-top: 1px solid var(--line); }
.points li:last-child { border-bottom: 1px solid var(--line); }
.points b { color: var(--text-strong); display: block; font-weight: 600; }
.points span { color: var(--text-muted); font-size: 15px; }

/* Assurance */
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 48px; }
.trust div { padding: 22px 0; border-top: 1px solid var(--line); }
.trust b { color: var(--text-strong); display: block; font-weight: 600; margin-bottom: 4px; }
.trust span { color: var(--text-muted); font-size: 15px; }

/* Questions */
.faq { border-top: 1px solid var(--line); max-width: 56em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 36px 20px 0; position: relative; font-weight: 600; color: var(--text-strong); font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 17px; color: var(--text-muted); font-weight: 400; font-size: 22px; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--text-muted); padding: 0 0 20px; margin: 0; max-width: 44em; }

/* Briefing */
.cta { padding: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; border: 1px solid var(--line-brand); border-radius: var(--radius-xl); background: var(--surface-panel); }
.cta h2 { margin-bottom: 10px; }
.cta p { color: var(--text-muted); font-size: 17px; max-width: 34em; margin: 0; }
.contact { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.contact small { color: var(--text-subtle); font-size: 12px; min-height: 1.2em; }

footer { border-top: 1px solid var(--line); padding-block: 32px 44px; font-size: 13px; color: var(--text-muted); }
footer .wrap { display: flex; gap: 24px 40px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
footer img { height: 44px; width: auto; display: block; }
.engine-line { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0; padding: 0; }
.maker { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.maker a { color: var(--text-strong); }
.maker .legal { justify-content: flex-end; }

/* Reading pages */
.prose { max-width: 44em; padding-block: 72px 96px; }
.prose h1 { font-size: clamp(34px, 4vw, 52px); margin-bottom: 12px; }
.prose h2 { max-width: none; font-size: 22px; letter-spacing: -0.01em; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--text-muted); }
.prose ul { padding-left: 20px; }
.prose .updated { color: var(--text-subtle); font-size: 14px; }

/* Consent */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface-1); border-top: 1px solid var(--line-brand); padding-bottom: env(safe-area-inset-bottom, 0px); }
.consent .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; padding-block: 18px; }
.consent p { margin: 0; color: var(--text); font-size: 14px; max-width: 44em; }
.consent p a { white-space: nowrap; }
.consent .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--text-strong); }
.legal { display: flex; gap: 16px; flex-wrap: wrap; }
.legal a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1100px) {
  .opening .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .map { grid-template-columns: minmax(0, 1fr); }
  .map-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .engines li { grid-template-columns: 160px minmax(0, 1fr); }
  .engines .adds { grid-column: 1 / -1; }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .top nav { display: none; }
  .top .btn { margin-left: auto; }
  .opening { padding-block: 48px 32px; }
  .band { padding-block: 64px; }
  .map-band { padding-block: 0 64px; }
  .map-bar .hint { display: none; }
  .contrast, .asks, .three, .trust { grid-template-columns: minmax(0, 1fr); }
  .contrast > div, .contrast > div + div, .three > div, .three > div + div { padding: 24px 0 8px; border-left: 0; }
  .contrast > div + div, .three > div + div { border-top: 1px solid var(--line); }
  .engines li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .score { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 20px; }
  .parts { width: 100%; }
  .part { grid-template-columns: 8em minmax(0, 1fr); font-size: 13px; }
  .cta { grid-template-columns: minmax(0, 1fr); padding: 28px 20px; }
  .maker { text-align: left; }
  .maker .legal { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .link.draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  .link.draw.inferred { stroke-dasharray: 2 4; }
}
