/* autolycus.io: tokens and rationale live in /var/www/autolycus.io/DESIGN.md. */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  /* Blue team: resting state */
  --color-bg: #061318;
  --color-surface: #0B1E26;
  --color-surface-2: #102A34;
  --color-line: #1D3E4A;
  --color-line-strong: #2E6272;
  --color-text: #E8F3F4;          /* 16.7:1 on bg, >= 7.9:1 anywhere on the backdrop */
  --color-text-muted: #9DB8BE;    /* solid surfaces only (7.1:1 on surface-2), never on the photo */
  --color-teal: #1FC2AE;          /* primary fill; bg-coloured text on it 8.4:1 */
  --color-ice: #6EC6E8;           /* crest sky blue: links, focus, accents; 9.8:1 on bg */
  /* Red team: hover / active state */
  --color-red: #EE4B2B;           /* crest flame: hover fill/borders; bg-coloured text on it 5.1:1, 4.1:1 vs surface-2 */
  --color-red-soft: #FF8266;      /* hover text; 7.8:1 on bg */
  /* Crest accent */
  --color-bronze: #B8894A;        /* crest rim; decorative rules and frames; 6.0:1 on bg */
  --color-on-fill: #061318;
  --color-focus: #6EC6E8;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --text-display: clamp(2.5rem, 1.4rem + 4.6vw, 5rem);
  --text-h1: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
  --text-h2: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  --text-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-lead: clamp(1.125rem, 1.02rem + 0.45vw, 1.375rem);
  --text-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --text-small: 0.9375rem;
  --text-label: 0.8125rem;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --space-9: 96px; --space-10: 128px;
  --gutter: clamp(16px, 4vw, 48px);
  --container: 1200px;
  --panel-pad: clamp(var(--space-5), 5vw, var(--space-8));
  --section-gap: clamp(var(--space-7), 8vw, var(--space-9));

  --radius: 2px;
  --border: 1px solid var(--color-line);
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, .7);

  --dur-fast: 150ms;
  --dur-base: 220ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

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

html {
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text);
  overflow-x: clip;
}

main { flex: 1; }

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); line-height: 1.25; }

p { margin: 0; max-width: 65ch; text-wrap: pretty; }
p + p { margin-top: var(--space-4); }

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-ice);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-red-soft); }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

:where(ul, ol)[role="list"] { list-style: none; margin: 0; padding: 0; }

/* Author display rules (e.g. .btn) would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--color-teal);
  color: var(--color-on-fill);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

/* ---------- Backdrop (site-wide SOC photo, pre-baked duotone) ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--color-bg);
  pointer-events: none;
}
.backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { margin-top: var(--section-gap); }
.section:last-child { margin-bottom: var(--section-gap); }

.panel {
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--panel-pad);
}

.section-head { max-width: 46rem; margin-bottom: var(--space-7); }
.section-head p:not(.eyebrow) { margin-top: var(--space-4); color: var(--color-text-muted); font-size: var(--text-lead); }

.grid { display: grid; gap: var(--space-5); }
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 19, 24, .94);
  border-bottom: var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 72px;
}

/* Web lockups: header = tagline version at >= 1024px, compact version below; footer = tagline version. See DESIGN.md §5 */
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.brand img { width: auto; height: 60px; }
@media (max-width: 479px) { .brand img { height: 48px; } }
/* Footer always uses the tagline lockup; let it shrink to the container on very narrow screens */
.site-footer .brand img { height: auto; width: min(254px, 100%); }

.nav-toggle {
  display: none;
  font: inherit;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 0 var(--space-4);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav-toggle:hover { border-color: var(--color-red); color: var(--color-red-soft); }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.site-nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-small);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.site-nav a:not(.btn):hover { color: var(--color-red-soft); border-bottom-color: var(--color-red); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--color-teal); }
.site-nav .btn { margin-left: var(--space-3); }

@media (max-width: 799px) {
  .js .nav-toggle { display: inline-flex; align-items: center; }
  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: var(--border);
    padding: var(--space-4) var(--gutter) var(--space-5);
  }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-wrap: wrap; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; }
  .js .site-nav a:not(.btn) { display: flex; min-height: 48px; padding-inline: 0; font-size: 1rem; border-bottom: var(--border); }
  .js .site-nav .btn { margin: var(--space-4) 0 0; justify-content: center; }
}

/* ---------- Buttons: teal (blue team) → red (red team) on hover ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-5);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-teal); color: var(--color-on-fill); }
.btn--primary:hover { background: var(--color-red); color: var(--color-on-fill); }
.btn--secondary {
  background: rgba(6, 19, 24, .6);
  color: var(--color-text);
  border-color: var(--color-line-strong);
}
.btn--secondary:hover { border-color: var(--color-red); color: var(--color-red-soft); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ice);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--color-bronze);
}
.lead { font-size: var(--text-lead); line-height: 1.55; }
.meta {
  margin-top: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.04em;
  color: var(--color-text);
}
code { font-family: var(--font-mono); font-size: 0.95em; overflow-wrap: anywhere; }

/* ---------- Hero (sits directly on the backdrop: --color-text only) ---------- */
.hero { padding-top: clamp(var(--space-8), 12vw, var(--space-10)); }
.hero__grid { display: grid; gap: var(--space-7); align-items: center; }
.hero__crest { display: none; }
@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) auto; }
  .hero__crest { display: block; width: auto; height: clamp(380px, 34vw, 500px); }
}
.hero h1 { font-size: var(--text-display); max-width: 16ch; }
.hero .lead { margin-top: var(--space-5); max-width: 40rem; }
.hero .eyebrow { color: var(--color-text); }
/* Home h1 carries the "Penetration testing" eyebrow for search relevance; keep it on its own line */
h1 > .eyebrow { display: flex; line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-7); }

.proof {
  margin-top: var(--space-8);
  display: grid;
  gap: 1px;
  background: var(--color-line);
  border: var(--border);
}
@media (min-width: 720px) { .proof { grid-template-columns: repeat(3, 1fr); } }
.proof li {
  background: var(--color-surface);
  padding: var(--space-5);
}
.proof strong { display: block; font-weight: 600; font-size: 1.0625rem; }
.proof span { display: block; margin-top: var(--space-1); color: var(--color-text-muted); font-size: var(--text-small); }

/* ---------- Discipline cards (sword / shield) ---------- */
.card {
  position: relative;
  background: var(--color-surface-2);
  border: var(--border);
  border-top: 3px solid var(--color-teal);
  border-radius: var(--radius);
  padding: var(--space-6);
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.card:hover { border-top-color: var(--color-red); }
@media (hover: hover) { .card:hover { transform: translateY(-2px); } }
.card__icon {
  width: 48px;
  height: 48px;
  color: var(--color-teal);
  margin-bottom: var(--space-5);
  transition: color var(--dur-base) var(--ease-out);
}
.card:hover .card__icon { color: var(--color-red); }
.card p { color: var(--color-text-muted); }
.card h3 + p { margin-top: var(--space-3); }
.card__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: var(--space-5); }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  border-top: 1px solid var(--color-line-strong);
  padding-top: var(--space-5);
  transition: border-color var(--dur-base) var(--ease-out);
}
.step:hover { border-top-color: var(--color-red); }
.step__num {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--color-ice);
  margin-bottom: var(--space-3);
  transition: color var(--dur-base) var(--ease-out);
}
.step:hover .step__num { color: var(--color-red-soft); }
.step p { margin-top: var(--space-2); color: var(--color-text-muted); }

/* ---------- Testimonials ---------- */
.quote {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  background: var(--color-surface-2);
  border: var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  transition: border-color var(--dur-base) var(--ease-out);
}
.quote:hover { border-color: var(--color-red); }
.quote svg { width: 32px; height: 32px; color: var(--color-teal); transition: color var(--dur-base) var(--ease-out); }
.quote:hover svg { color: var(--color-red); }
.quote blockquote { margin: 0; flex: 1; font-size: 1.0625rem; }
.quote figcaption { font-size: var(--text-small); color: var(--color-text-muted); border-top: var(--border); padding-top: var(--space-4); }
.quote figcaption strong { display: block; color: var(--color-text); font-weight: 600; }
.quote--placeholder blockquote { color: var(--color-text-muted); font-style: italic; }

/* ---------- CTA band ---------- */
.cta {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  border-left: 3px solid var(--color-teal);
  transition: border-color var(--dur-base) var(--ease-out);
}
.cta:hover { border-left-color: var(--color-red); }
@media (min-width: 900px) { .cta { grid-template-columns: 1fr auto; } }
.cta p { margin-top: var(--space-3); color: var(--color-text-muted); }
.cta .actions { margin-top: 0; }

/* ---------- About ---------- */
.emblem-feature { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 900px) { .emblem-feature { grid-template-columns: auto 1fr; } }
.emblem-feature img { width: auto; height: clamp(300px, 60vw, 400px); margin-inline: auto; }
.emblem-feature h2 + p { margin-top: var(--space-4); color: var(--color-text-muted); }
.emblem-feature dl { margin: var(--space-6) 0 0; display: grid; gap: var(--space-5); }
.emblem-feature dt { font-weight: 600; }
.emblem-feature dd { margin: var(--space-1) 0 0; color: var(--color-text-muted); }
.emblem-feature dt::before {
  content: "";
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: var(--space-3);
  background: var(--swatch, var(--color-teal));
}
.emblem-feature .swatch--red { --swatch: var(--color-red); }
.emblem-feature .swatch--ice { --swatch: var(--color-ice); }
.emblem-feature .swatch--bronze { --swatch: var(--color-bronze); }

.person { display: grid; gap: var(--space-5); align-items: start; max-width: 46rem; }
@media (min-width: 600px) { .person { grid-template-columns: 120px 1fr; } }
.person__avatar {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-bronze);
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--color-ice);
}
.person__role {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ice);
  margin-top: var(--space-2);
}
.person p:not(.person__role) { margin-top: var(--space-4); color: var(--color-text-muted); }

/* ---------- Contact ---------- */
.email-block { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-5); }
.email-link {
  display: inline-block;
  padding-block: var(--space-2);
  font-size: clamp(1.5rem, 1rem + 3vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-decoration-color: var(--color-teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  overflow-wrap: anywhere;
}
.email-link:hover { color: var(--color-red-soft); text-decoration-color: var(--color-red); }
.copy-status { font-size: var(--text-small); color: var(--color-ice); min-height: 1.5em; }
.checklist { margin: var(--space-5) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.checklist li { position: relative; padding-left: var(--space-6); color: var(--color-text-muted); }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-teal);
}
.checklist strong { color: var(--color-text); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--section-gap);
  background: var(--color-bg);
  border-top: var(--border);
  padding-block: var(--space-7);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.site-footer__inner { display: grid; gap: var(--space-6); }
/* Two columns only once the 254px tagline lockup and the full link row both fit */
@media (min-width: 1024px) { .site-footer__inner { grid-template-columns: 1fr auto; align-items: start; } }
.site-footer ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.site-footer a { color: var(--color-text); display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a:hover { color: var(--color-red-soft); }
.site-footer p { margin-top: var(--space-3); }


/* ---------- Content pages: linked cards, link lists, FAQ ---------- */
.card--link { display: block; text-decoration: none; color: inherit; }
.card--link:hover { color: inherit; }
.card__more { display: inline-flex; align-items: center; margin-top: var(--space-4); color: var(--color-ice); font-size: var(--text-small); font-weight: 600; transition: color var(--dur-base) var(--ease-out); }
.card--link:hover .card__more { color: var(--color-red-soft); }
.card--wide { grid-column: 1 / -1; }  /* spans the grid; closes an odd-numbered row */
.card--wide p { max-width: 46rem; }

.linklist { display: grid; gap: 1px; background: var(--color-line); border: var(--border); }
.linklist li { background: var(--color-surface); }
.linklist a { display: flex; align-items: center; min-height: 56px; padding: var(--space-4) var(--space-5); color: var(--color-text); text-decoration: none; font-weight: 600; border-left: 3px solid transparent; transition: border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out); }
.linklist a:hover { border-left-color: var(--color-red); color: var(--color-red-soft); }

.faq-item { border-top: 1px solid var(--color-line-strong); padding-top: var(--space-5); }
.faq-item + .faq-item { margin-top: var(--space-6); }
.faq-item h3 { max-width: 46rem; }
.faq-item p { margin-top: var(--space-3); color: var(--color-text-muted); }


/* ---------- Homepage CVE tracker ---------- */
.stats { display: grid; gap: 1px; background: var(--color-line); border: var(--border); margin-top: var(--space-6); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { background: var(--color-surface-2); padding: var(--space-6); }
.stat__num { display: block; font-weight: 600; font-size: clamp(2.25rem, 1.2rem + 4vw, 3.5rem); line-height: 1; letter-spacing: -0.02em; color: var(--color-teal); font-variant-numeric: tabular-nums; }
.stat__label { display: block; margin-top: var(--space-3); color: var(--color-text-muted); font-size: var(--text-small); }

.cve-chart { margin: var(--space-7) 0 0; }
.cve-chart figcaption { font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-4); }
.cve-chart figcaption [data-cve] { color: var(--color-text); }
.cve-bars { display: block; width: 100%; height: auto; }
.cve-grid { stroke: var(--color-line); stroke-width: 1; stroke-dasharray: 2 4; }
.cve-axis { stroke: var(--color-line-strong); stroke-width: 1; }
.cve-bar { fill: var(--color-teal); }
.cve-bar--now { opacity: 0.4; }

.cve-sev { margin-top: var(--space-7); }
.cve-sev__track { height: 10px; background: var(--color-surface-2); border: 1px solid var(--color-line); }
.cve-sev__fill { height: 100%; background: var(--color-red); }
.cve-sev__label { margin-top: var(--space-3); color: var(--color-text-muted); font-size: var(--text-small); }
.cve-sev__label strong { color: var(--color-text); font-weight: 600; }

.cve-meta { margin-top: var(--space-6); color: var(--color-text-muted); font-size: var(--text-small); }
.cve-meta a { color: var(--color-ice); }
.cve-meta a:hover { color: var(--color-red-soft); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .card:hover { transform: none; }
}
