/* ============================================================
   DETECTRA — Design System
   Tokens: ink (near-black, blue-tinted), paper (cool off-white),
   signal red (alert/detection accent, used sparingly), steel
   (graphite borders), slate (muted text).
   Type: Space Grotesk (display) + IBM Plex Sans (body) +
   IBM Plex Mono (data / readouts only).
   ============================================================ */

:root {
  --ink: #0e1013;
  --ink-soft: #171a1f;
  --paper: #f3f4f6;
  --paper-raised: #ffffff;
  --steel: #2b3038;
  --steel-line: #e2e4e8;
  --steel-line-dark: #30343b;
  --slate: #5b6472;
  --slate-dark: #9aa2ad;
  --signal: #e2321f;
  --signal-dark: #b8220f;
  --signal-tint: #fdeceb;
  --ok: #1f7a4d;

  --font-display: "Space Grotesk", "IBM Plex Sans", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --max-width: 1180px;
  --radius: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  :root { --transition-base: 180ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --transition-base: 0ms; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 1.4rem + 1.3vw, 2.4rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; color: var(--steel); max-width: 62ch; }
p.lede { font-size: 1.15rem; color: var(--ink); max-width: 56ch; }

a { color: var(--ink); }
a:not(.btn):not(.card):not(.nav__logo) { text-decoration-thickness: 1px; text-underline-offset: 3px; }

img { max-width: 100%; display: block; }

ul, ol { padding-left: 1.2em; color: var(--steel); }
li { margin-bottom: 0.4em; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.mono { font-family: var(--font-mono); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  z-index: 200;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Reticle bracket motif ----------
   Structural corner brackets, drawn from the logo's circular
   parentheses framing the crosshair. Used to mark section
   boundaries and frame key panels — not decoration. */
.reticle {
  position: relative;
}
.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--signal);
  opacity: 0.85;
}
.reticle::before {
  top: -1px; left: -1px;
  border-right: none; border-bottom: none;
}
.reticle::after {
  bottom: -1px; right: -1px;
  border-left: none; border-top: none;
}

.section-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  margin-bottom: 14px;
}
.section-mark::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--signal);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 244, 246, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--steel-line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 24px;
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav__logo img { height: 30px; width: 30px; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  text-decoration: none;
  color: var(--steel);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-base), border-color var(--transition-base);
}
.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--signal);
}
.nav__cta { display: flex; align-items: center; gap: 14px; }
.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}
.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
}
.nav__toggle span::before { position: absolute; top: -6px; }
.nav__toggle span::after { position: absolute; top: 6px; }

@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--steel-line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 28px 18px;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links li { width: 100%; }
  .nav__links a { display: block; padding: 12px 0; width: 100%; }
  .nav__cta .btn-text { display: none; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--ink);
  color: #fff;
}
.btn--primary:hover { background: var(--signal); }
.btn--outline {
  background: transparent;
  border-color: var(--steel-line);
  color: var(--ink);
}
.btn--outline:hover { border-color: var(--ink); }
.btn--signal {
  background: var(--signal);
  color: #fff;
}
.btn--signal:hover { background: var(--signal-dark); }
.btn--on-dark.btn--outline {
  border-color: var(--steel-line-dark);
  color: #fff;
}
.btn--on-dark.btn--outline:hover { border-color: #fff; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 72px 0 90px;
  border-bottom: 1px solid var(--steel-line);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 920px) {
  .hero__grid { grid-template-columns: 1fr; }
}
.hero h1 { margin-bottom: 20px; }
.hero p.lede { margin-bottom: 30px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.hero__stack {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--steel-line);
}
.hero__stack-item { font-family: var(--font-mono); font-size: 0.82rem; color: var(--slate); }
.hero__stack-item strong { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); font-weight: 600; }

/* ---------- Scan console (hero visual) ---------- */
.console {
  background: var(--ink);
  border-radius: 6px;
  padding: 22px;
  position: relative;
  font-family: var(--font-mono);
  color: #e7e9ec;
  box-shadow: 0 30px 60px -30px rgba(14, 16, 19, 0.45);
}
.console__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--steel-line-dark);
}
.console__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--steel-line-dark); }
.console__title { font-size: 0.78rem; color: var(--slate-dark); margin-left: 8px; }
.console__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  padding: 9px 0;
  border-bottom: 1px dashed var(--steel-line-dark);
}
.console__row:last-of-type { border-bottom: none; }
.console__label { color: var(--slate-dark); }
.console__value { color: #e7e9ec; text-align: right; }
.console__value--flag { color: var(--signal); font-weight: 600; }
.console__value--ok { color: #58c98a; font-weight: 600; }
.console__meter {
  margin-top: 16px;
  height: 6px;
  background: var(--steel-line-dark);
  border-radius: 4px;
  overflow: hidden;
}
.console__meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--signal), #ff6a52);
  width: 97.8%;
}
.console__footnote {
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--slate-dark);
  line-height: 1.5;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 80px 0; }
.section--border-top { border-top: 1px solid var(--steel-line); }
.section--raised { background: var(--paper-raised); }
.section--dark { background: var(--ink); color: #e7e9ec; }
.section--dark p { color: var(--slate-dark); }
.section--dark h2, .section--dark h3 { color: #fff; }

.section__head { max-width: 680px; margin-bottom: 48px; }
.section__head--wide { max-width: 760px; }

/* ---------- Grid of cards ---------- */
.grid {
  display: grid;
  gap: 1px;
  background: var(--steel-line);
  border: 1px solid var(--steel-line);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper-raised);
  padding: 32px 28px;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card__index { font-family: var(--font-mono); font-size: 0.78rem; color: var(--signal); margin-bottom: 14px; display: block; }
.card h3 { margin-bottom: 10px; }
.card p { margin-bottom: 0; font-size: 0.95rem; }
.card--link { transition: background var(--transition-base); }
.card--link:hover { background: var(--paper); }
.card ul { margin: 12px 0 0; padding-left: 1.1em; }
.card li { font-size: 0.92rem; margin-bottom: 0.5em; }

/* ---------- Process steps (genuinely sequential content only) ---------- */
.steps { counter-reset: step; }
.step {
  position: relative;
  padding: 28px 0 28px 64px;
  border-top: 1px solid var(--steel-line);
}
.step:last-child { border-bottom: 1px solid var(--steel-line); }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 28px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--signal);
}
.step h3 { margin-bottom: 8px; }

/* ---------- Two column split ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- Definition / fact list ---------- */
.deflist { border-top: 1px solid var(--steel-line); }
.deflist__row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--steel-line);
}
@media (max-width: 640px) { .deflist__row { grid-template-columns: 1fr; gap: 6px; } }
.deflist__term { font-family: var(--font-mono); font-size: 0.85rem; color: var(--slate); }
.deflist__detail p { margin-bottom: 0; }

/* ---------- Media type tiles (AI detection page) ---------- */
.tile {
  background: var(--paper-raised);
  padding: 30px 26px;
  border: 1px solid var(--steel-line);
}
.tile__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--signal);
  border: 1px solid var(--signal);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ---------- Callout / banner ---------- */
.callout {
  background: var(--ink);
  color: #fff;
  padding: 56px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.callout h2 { color: #fff; margin-bottom: 8px; }
.callout p { color: var(--slate-dark); margin-bottom: 0; }

/* ============================================================
   FORMS
   ============================================================ */
.form-field { margin-bottom: 22px; }
.form-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
  margin-bottom: 8px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 14px;
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--ink);
  outline: none;
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .form-field--row { grid-template-columns: 1fr; } }
.form-note { font-size: 0.82rem; color: var(--slate); margin-top: -6px; }
.form-status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  display: none;
}
.form-status.is-visible { display: block; }
.form-status--ok { background: #eaf6ef; color: var(--ok); border: 1px solid #bfe3cd; }
.form-status--error { background: var(--signal-tint); color: var(--signal-dark); border: 1px solid #f3c1bb; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--steel-line);
  background: var(--paper-raised);
  padding: 56px 0 28px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
@media (max-width: 760px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
.footer__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--ink); }
.footer__brand img { height: 26px; width: 26px; }
.footer__col h4 { font-size: 0.78rem; font-family: var(--font-mono); font-weight: 500; color: var(--slate); text-transform: none; margin-bottom: 16px; }
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { margin-bottom: 10px; }
.footer__col a { color: var(--steel); text-decoration: none; font-size: 0.92rem; }
.footer__col a:hover { color: var(--ink); text-decoration: underline; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--steel-line);
  font-size: 0.82rem;
  color: var(--slate);
}
.footer__bottom a { color: var(--slate); }

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.page-header {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--steel-line);
}
.page-header p.lede { margin-bottom: 0; }
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--slate); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }

/* ---------- Legal / long-form text pages ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--steel); }
.prose ul { margin-bottom: 1.2em; }

/* ---------- 404 ---------- */
.notfound {
  padding: 120px 0;
  text-align: left;
}
.notfound .mono { color: var(--signal); font-size: 0.95rem; }

/* Utility */
.mt-0 { margin-top: 0; }
.text-slate { color: var(--slate); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
