/* adversarial.sh — hand-written, dependency-free CSS
   Design: fresh-minimal terminal aesthetic. One accent. Generous whitespace. */

:root {
  --bg: #0a0d0a;
  --bg-raise: #0f130f;
  --bg-inset: #070907;
  --fg: #d9e2d9;
  --fg-bright: #f2f7f2;
  --muted: #8b978b;
  --faint: #5a665a;
  --accent: #4ade80;
  --accent-dim: #2a7a4a;
  --accent-ink: #06110a;
  --danger: #f87171;
  --warn: #fbbf24;
  --border: #1d251d;
  --border-bright: #2c3a2c;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo,
    Consolas, "Liberation Mono", monospace;
  --maxw: 72rem;
  --radius: 6px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* faint terminal grid */
  background-image:
    linear-gradient(rgba(74, 222, 128, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 222, 128, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1, h2, h3, h4 {
  color: var(--fg-bright);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1rem; }

code, pre, kbd, samp {
  font-family: var(--mono);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 13, 10, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fg-bright);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.logo:hover { text-decoration: none; }

.logo .glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-inset);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.logo .tld { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
}

.site-nav a[aria-current="page"]::before {
  content: "./";
  color: var(--faint);
}

/* Sign-in link: subtle bordered pill, last nav item. */
.site-nav a.nav-signin {
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  color: var(--fg);
}

.site-nav a.nav-signin:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover { background: #6eeea0; color: var(--accent-ink); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-bright);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 5.5rem 0 4rem;
  overflow: hidden;
}

/* subtle scanlines over the hero only */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 3px,
    rgba(0, 0, 0, 0.12) 3px 4px
  );
  opacity: 0.5;
}

.hero .wrap { position: relative; z-index: 1; }

.prompt-line {
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.prompt-line .dollar { color: var(--faint); }

.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 42rem;
  margin-bottom: 2.25rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 3.5rem;
}

/* ---------- terminal window ---------- */

.terminal {
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-inset);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 18px 50px rgba(0, 0, 0, 0.45);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raise);
}

.terminal-bar .dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--border-bright);
}

.terminal-bar .dot:nth-child(1) { background: #3f2a2a; }
.terminal-bar .dot:nth-child(2) { background: #3f3a2a; }
.terminal-bar .dot:nth-child(3) { background: var(--accent-dim); }

.terminal-title {
  margin-left: 0.5rem;
  color: var(--faint);
  font-size: 0.78rem;
}

.terminal-body {
  padding: 1.1rem 1.2rem 1.3rem;
  font-size: 0.88rem;
  line-height: 1.75;
  min-height: 21rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-body .ps1 { color: var(--accent); }
.terminal-body .cmd { color: var(--fg-bright); }
.terminal-body .dim { color: var(--faint); }
.terminal-body .ok { color: var(--accent); }
.terminal-body .sev-high { color: var(--danger); }
.terminal-body .sev-med { color: var(--warn); }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */

.section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: 2.75rem;
}

.section-head .kicker {
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.section-head p {
  color: var(--muted);
  max-width: 44rem;
}

/* ---------- grids & cards ---------- */

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raise);
  padding: 1.5rem;
}

.card h3 { margin-bottom: 0.6rem; }
.card h3 .idx { color: var(--accent); margin-right: 0.5rem; }
.card p { color: var(--muted); font-size: 0.93rem; margin: 0; }
.card ul { color: var(--muted); font-size: 0.93rem; margin: 0.5rem 0 0; padding-left: 1.2rem; }
.card li { margin-bottom: 0.35rem; }

.card-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.88rem;
}

/* ---------- stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  background: var(--bg-raise);
  padding: 1.5rem 1.25rem;
}

.stat .num {
  display: block;
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat .lbl {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- code blocks ---------- */

.codeblock {
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-inset);
  overflow-x: auto;
}

.codeblock pre {
  margin: 0;
  padding: 1.1rem 1.25rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--fg);
}

.codeblock .c { color: var(--faint); }   /* comment */
.codeblock .k { color: var(--accent); }  /* key/keyword */
.codeblock .s { color: #a7f3c7; }        /* string */

/* ---------- steps ---------- */

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.steps li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 1.1rem;
  align-items: start;
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-raise);
  color: var(--accent);
  font-weight: 700;
}

.steps h3 { margin-bottom: 0.35rem; }
.steps p { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* ---------- library ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: var(--bg-raise);
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}

.filter-btn:hover { border-color: var(--accent); color: var(--fg); }

.filter-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.attack-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  color: var(--muted);
}

.tag.sev-critical { color: var(--danger); border-color: var(--danger); }
.tag.sev-high { color: var(--danger); border-color: #7a3a3a; }
.tag.sev-medium { color: var(--warn); border-color: #7a6530; }
.tag.sev-low { color: var(--accent); border-color: var(--accent-dim); }

.attack-card code {
  display: block;
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.state-note {
  grid-column: 1 / -1;
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.state-note .err { color: var(--danger); }

/* ---------- pricing ---------- */

.price-card { display: flex; flex-direction: column; }

.price-card .tier {
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.price-card .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg-bright);
  margin-bottom: 1rem;
}

.price-card .price small {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.price-card ul {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  flex: 1;
}

.price-card li {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.3rem 0 0.3rem 1.4rem;
  position: relative;
}

.price-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.price-card.featured {
  border-color: var(--accent-dim);
  position: relative;
}

.price-card.featured::before {
  content: "most popular";
  position: absolute;
  top: -0.7rem;
  left: 1.25rem;
  background: var(--bg);
  color: var(--accent);
  font-size: 0.72rem;
  padding: 0 0.5rem;
}

/* ---------- forms ---------- */

.form-grid {
  display: grid;
  gap: 1.1rem;
  max-width: 34rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea { resize: vertical; min-height: 8rem; }

.form-status {
  font-size: 0.9rem;
  min-height: 1.5rem;
}

.form-status.ok { color: var(--accent); }
.form-status.err { color: var(--danger); }

/* ---------- prose (legal pages) ---------- */

.prose h2 { font-size: 1.15rem; margin-top: 2.25rem; }
.prose p, .prose li { color: var(--muted); font-size: 0.95rem; }
.prose ul { padding-left: 1.25rem; }
.prose .updated { color: var(--faint); font-size: 0.82rem; }

/* ---------- 404 ---------- */

.notfound {
  padding: 7rem 0;
  text-align: left;
}

.notfound .code {
  color: var(--accent);
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0 0 0.5rem;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer nav ul {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 52rem) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }

  .nav-toggle { display: inline-block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .site-nav.open { display: block; }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }

  .site-nav li { width: 100%; }
  .site-nav a {
    display: block;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
  }

  .hero { padding: 3.5rem 0 3rem; }
  .terminal-body { min-height: 17rem; font-size: 0.8rem; }
}

/* attack library extras */
.id-tag {
  color: var(--muted, #8b9a8b);
  border-style: dashed;
}
.mitigation {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted, #8b9a8b);
}
.mitigation strong {
  color: var(--accent, #4ade80);
  font-weight: 600;
}
