/* CyberBadgers security scanners — styles follow the CyberBadgers design system tokens. */

:root {
  --ink: #151514;
  --ink-muted: #275e68;
  --surface: #faf7f2;
  --surface-raised: #ffffff;
  --brand: #ff8b47;
  --on-brand: #151514;
  --brand-alt: #275e68;
  --positive: #499f68;
  --warning: #e8a33d;
  --negative: #ca054d;
  --link: #275e68;
  --line: #151514;
  --frame-shadow: #275e68;

  --font: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-frame: 6px 6px 0 var(--frame-shadow);
  --shadow-frame-brand: 6px 6px 0 var(--brand);

  --check-ring: #275e68;
  --logo-light-display: block;
  --logo-dark-display: none;

  color-scheme: light;
}

/* Dark theme tokens. Two triggers, identical values:
   1) explicit choice — data-theme="dark" (set by theme.js) or the Dark radio (works without JS);
   2) auto — system preference, unless Light was chosen explicitly. */
:root[data-theme="dark"],
:root:has(#theme-dark:checked) {
  --ink: #faf7f2;
  --ink-muted: #98cfd8;
  --surface: #151514;
  --surface-raised: #151514;
  --link: #98cfd8;
  --line: #98cfd8;
  --check-ring: #98cfd8;
  --logo-light-display: none;
  --logo-dark-display: block;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not(:has(#theme-light:checked)) {
    --ink: #faf7f2;
    --ink-muted: #98cfd8;
    --surface: #151514;
    --surface-raised: #151514;
    --link: #98cfd8;
    --line: #98cfd8;
    --check-ring: #98cfd8;
    --logo-light-display: none;
    --logo-dark-display: block;
    color-scheme: dark;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Typography */
h1, h2, h3 { margin: 0; color: var(--ink); }

h1 {
  font-size: 44px;
  line-height: 52px;
  font-weight: 800;
  text-transform: uppercase;
}

h2 {
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  margin-bottom: var(--space-3);
}

h3 {
  font-size: 18px;
  line-height: 26px;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

.small,
small {
  font-size: 13px;
  line-height: 18px;
}

.muted { color: var(--ink-muted); }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

code, pre {
  font-family: var(--mono);
  font-size: 14px;
}

code {
  overflow-wrap: anywhere;
}

pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-3);
  background: var(--surface-raised);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 20px;
}
pre code { overflow-wrap: normal; white-space: pre; }

ul { margin: 0 0 var(--space-3); padding-left: var(--space-4); }
ul:last-child { margin-bottom: 0; }
li + li { margin-top: var(--space-1); }

/* Header */
.site-header {
  padding: var(--space-6) 0 var(--space-5);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.logo { min-width: 0; }
.logo img {
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}
.logo .logo-for-light { display: var(--logo-light-display); }
.logo .logo-for-dark { display: var(--logo-dark-display); }

/* Theme switcher: icon-only segmented control (Tabler icons) */
.theme-switch {
  position: relative;
  display: inline-flex;
  flex: none;
  gap: var(--space-1);
  margin: 0;
  padding: var(--space-1);
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.theme-switch label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--ink-muted);
  cursor: pointer;
}

.theme-switch label:hover { color: var(--ink); }

.theme-switch input:checked + label {
  background: var(--brand);
  color: var(--on-brand);
}

.theme-switch input:focus-visible + label {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.lead {
  margin-top: var(--space-3);
  max-width: 640px;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 26px;
}

/* Sections: decorative circuit-trace marker (circle + line), brand colour, never text */
main section {
  padding: var(--space-5) 0;
}

main section > h2,
.card > h2 {
  position: relative;
}

main section > h2::before {
  content: "";
  display: block;
  width: 72px;
  height: 12px;
  margin-bottom: var(--space-3);
  background:
    radial-gradient(circle at 6px 6px, var(--brand) 5px, transparent 5.5px),
    linear-gradient(var(--brand), var(--brand)) 10px 5px / 62px 2px no-repeat;
}

/* Table */
.table-frame {
  margin-bottom: var(--space-4);
  background: var(--surface-raised);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-frame);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: var(--space-3);
  vertical-align: top;
}

thead th {
  font-weight: 700;
  font-size: 13px;
  line-height: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  border-bottom: 2px solid var(--line);
}

tbody tr + tr td { border-top: 1px solid var(--ink-muted); }

/* Status pill: always text + mark, never colour alone */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2) 0 var(--space-1);
  border: 1px solid var(--ink-muted);
  border-radius: 999px;
  font-size: 13px;
  line-height: 22px;
  white-space: nowrap;
}

.status-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.status-planned .status-mark {
  border: 3px solid var(--warning);
}

.status-active .status-mark {
  background: var(--positive);
}

.status-retired .status-mark {
  background: var(--negative);
}

/* Lists with check marks */
.checks {
  list-style: none;
  padding-left: 0;
}
.checks li {
  position: relative;
  padding-left: var(--space-5);
}
.checks li + li { margin-top: var(--space-3); }
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--check-ring);
  border-radius: 50%;
}

/* Cards */
.cards,
.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.card {
  background: var(--surface-raised);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-frame);
  padding: var(--space-4);
}

.card-accent {
  box-shadow: var(--shadow-frame-brand);
}

.contact h2 {
  font-size: 24px;
  line-height: 32px;
}

/* Footer */
.site-footer {
  margin-top: var(--space-6);
  padding: var(--space-5) 0 var(--space-6);
  border-top: 2px solid var(--line);
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

.site-footer p { margin: 0; }

/* Small screens */
@media (max-width: 640px) {
  .wrap { padding: 0 var(--space-3); }

  .site-header { padding: var(--space-5) 0 var(--space-4); }

  .topbar { margin-bottom: var(--space-4); }
  .logo img { height: 40px; }
  .theme-switch label { width: 32px; height: 32px; }
  .theme-switch svg { width: 18px; height: 18px; }

  h1 {
    font-size: 32px;
    line-height: 40px;
  }

  h2 {
    font-size: 26px;
    line-height: 34px;
  }

  /* Stack table rows as labelled blocks */
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  table, tbody, tr, td { display: block; }

  td {
    display: grid;
    grid-template-columns: 7.5em 1fr;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }

  td::before {
    content: attr(data-label);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
  }

  tbody tr { padding: var(--space-2) 0; }
  tbody tr + tr { border-top: 1px solid var(--ink-muted); }
  tbody tr + tr td { border-top: 0; }

  td .status { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
