/* any any deny — site stylesheet
   Identity: firewall-rulebase aesthetic. Monospace-first, near-black,
   one accent color (deny red). Dark is the default theme; light theme
   activates via data-theme="light" on <html>. */

:root {
  --bg: #0a0c10;
  --bg-raised: #10141b;
  --bg-inset: #05070a;
  --border: #222834;
  --text: #e8eaed;
  --text-muted: #8b949e;
  --accent: #f4483c;          /* deny red */
  --accent-dim: #b3271e;
  --allow: #3fb950;           /* used only inside rule-table motifs */
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg: #fbfbfa;
  --bg-raised: #ffffff;
  --bg-inset: #f1f1ef;
  --border: #dcdcd7;
  --text: #191c21;
  --text-muted: #5c6570;
  --accent: #c22b20;
  --accent-dim: #e0574c;
  --allow: #1a7f37;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

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

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, .mono { font-family: var(--mono); letter-spacing: -0.02em; }

/* ---------- Header: terminal window titlebar ---------- */

header {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.dots { display: flex; gap: 7px; }
.dots i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dots i:nth-child(1) { background: #f4483c; }
.dots i:nth-child(2) { background: #d9a03f; }
.dots i:nth-child(3) { background: #3fb950; }

.title { color: var(--text); font-weight: 700; font-size: 0.95rem; }
.title:hover { text-decoration: none; }
.title .ast { color: var(--accent); letter-spacing: 0.1em; }
.title .path { color: var(--text-muted); font-weight: 400; }

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 3px;
  background: var(--text-muted);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

nav { margin-left: auto; display: flex; gap: 18px; }
nav a { color: var(--text-muted); }
nav a:hover { color: var(--text); text-decoration: none; }
nav a.active { color: var(--accent); }

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1;
  padding: 2px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }

/* ---------- Page body ---------- */

main { padding: 52px 0 72px; }

.hero { padding: 12px 0 8px; }

.hero h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 16px;
}

.hero h1 .accent { color: var(--accent); }

.hero p.lede {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 660px;
}

.hero-avatar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.hero-avatar > div { flex: 1 1 0; min-width: 260px; }

.avatar {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

h2 {
  font-size: 1.2rem;
  margin: 52px 0 16px;
}
h2::before { content: "# "; color: var(--accent); }

p + p { margin-top: 14px; }
.muted { color: var(--text-muted); }

/* ---------- Rule table (hero motif) ---------- */

.rule-table {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 36px 0 8px;
  overflow-x: auto;
}

.rule-table table { border-collapse: collapse; width: 100%; min-width: 560px; }

.rule-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 10px 18px 6px;
  border-bottom: 1px solid var(--border);
}

.rule-table td { padding: 7px 18px; color: var(--text-muted); white-space: nowrap; }

.rule-table tr.final td {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-top: 1px solid var(--border);
}

.rule-table .allow { color: var(--allow); }
.rule-table .deny { color: var(--accent); font-weight: 700; }
.rule-table .note { color: var(--text-muted); font-style: italic; }

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.card h3 { font-size: 1rem; margin-bottom: 8px; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { font-size: 0.95rem; color: var(--text-muted); }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-bottom: 12px;
}
.badge.soon { border-color: var(--accent); color: var(--accent); }
.badge.live { border-color: var(--allow); color: var(--allow); }

/* ---------- Email signup ---------- */

.signup {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  margin-top: 52px;
}

.signup h2 { margin-top: 0; }

.signup form {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.signup input[type="email"] {
  flex: 1;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 1rem;
  font-family: var(--mono);
}
.signup input[type="email"]:focus { outline: none; border-color: var(--accent); }

.signup button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--mono);
  cursor: pointer;
}
.signup button:hover { background: var(--accent-dim); }

.signup .fine-print { font-size: 0.85rem; color: var(--text-muted); margin-top: 12px; }

.signup .confirm {
  display: none;
  margin-top: 12px;
  color: var(--allow);
  font-family: var(--mono);
  font-size: 0.9rem;
}

/* ---------- Blog index ---------- */

.post-list { margin-top: 32px; display: flex; flex-direction: column; gap: 18px; }

.post-item {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
}

.post-item .date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-item h3 { font-size: 1.05rem; margin: 6px 0 8px; }
.post-item h3 a { color: var(--text); }
.post-item h3 a:hover { color: var(--accent); text-decoration: none; }
.post-item p { font-size: 0.95rem; color: var(--text-muted); }

/* ---------- Blog post ---------- */

.backlink { font-family: var(--mono); font-size: 0.85rem; }

article { max-width: 720px; }

.post-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 24px 0 6px;
}
.sep { opacity: 0.5; padding: 0 6px; }

article > h1 {
  font-size: 1.7rem;
  line-height: 1.3;
  margin-bottom: 18px;
}

article p { margin: 15px 0; }
article ul, article ol { margin: 15px 0 15px 26px; }
article li { margin: 6px 0; }
article h2 { margin-top: 44px; }
article h3 { font-size: 1rem; margin: 28px 0 10px; color: var(--text); }

.toc {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.toc .label {
  display: block;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.toc ol { margin: 0 0 0 22px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--text-muted); }
.toc a:hover { color: var(--accent); }

pre {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.55;
  margin: 18px 0;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

.code-comment { color: var(--text-muted); font-style: italic; }
.code-bad { color: var(--accent); }
.code-good { color: var(--allow); }

.callout {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 22px 0;
  font-size: 0.95rem;
}
.callout.tip { border-left-color: var(--allow); }
.callout .label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ---------- Post figures ---------- */

figure { margin: 26px 0; }

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

figcaption {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---------- PAC tester tool ---------- */

.tool { margin-top: 32px; }

.tool-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tool-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.tool-label .opt { text-transform: none; letter-spacing: 0; opacity: 0.8; }

#pac-input {
  width: 100%;
  min-height: 320px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.55;
  padding: 14px 16px;
  resize: vertical;
  tab-size: 4;
}
#pac-input:focus { outline: none; border-color: var(--accent); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
  align-items: end; /* inputs stay level even if a label wraps */
}

.tool-grid input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 9px 12px;
}
.tool-grid input:focus { outline: none; border-color: var(--accent); }

.tool-grid select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 9px 12px;
}
.tool-grid select:focus { outline: none; border-color: var(--accent); }

.tool-actions { display: flex; gap: 10px; margin-top: 18px; }

.tool-batch { margin-top: 28px; }
#batch-input {
  width: 100%;
  min-height: 110px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.55;
  padding: 12px 14px;
  resize: vertical;
}
#batch-input:focus { outline: none; border-color: var(--accent); }

.btn-primary, .btn-secondary, .btn-ghost {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 9px 20px;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary { background: none; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-muted); }
.btn-ghost {
  background: none; border: none; color: var(--text-muted);
  font-weight: 400; font-size: 0.8rem; padding: 2px 4px;
}
.btn-ghost:hover { color: var(--accent); }

.tool-results { margin-top: 8px; }
.tool-results h2 { margin-top: 36px; }

.verdict {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-raised);
  padding: 18px 20px;
  margin-top: 28px;
}
.verdict-proxy { border-left-color: var(--accent); }
.verdict-direct { border-left-color: var(--allow); }
.verdict-error { border-left-color: var(--text-muted); }

.verdict-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.verdict-text { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.verdict-sub { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; }

.trace-src { white-space: normal; overflow-wrap: anywhere; }
.rule-table td.note { color: var(--text-muted); }

.finding {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
  padding: 14px 18px;
  margin: 12px 0;
}
.finding p { font-size: 0.92rem; color: var(--text-muted); margin-top: 6px; }
.finding-head { display: flex; align-items: center; gap: 10px; }
.badge.sev-error { border-color: var(--accent); color: var(--accent); }
.badge.sev-warn { border-color: #d9a03f; color: #d9a03f; }
.badge.sev-info { border-color: var(--allow); color: var(--allow); }
.finding .badge { margin-bottom: 0; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

footer p + p { margin-top: 8px; }
footer .sig { font-family: var(--mono); font-size: 0.8rem; }
footer .sig .ast { color: var(--accent); }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.45rem; }
  body { font-size: 16px; }
}
