/* ─── Reset & Variables ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0d0f14;
  --bg-card:    #13161e;
  --bg-hover:   #1a1e28;
  --border:     #252932;
  --text:       #c9cdd8;
  --text-dim:   #6b7280;
  --text-head:  #e8eaf0;
  --accent:     #4ade80;       /* green — GATEKEEP pass colour */
  --accent-dim: #166534;
  --danger:     #f87171;
  --link:       #60a5fa;
  --font:       system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:       "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --radius:     8px;
  --max-w:      1100px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { color: var(--text-head); line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; margin-bottom: 1.5rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
p  { margin-bottom: 1rem; }
a  { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container.narrow { max-width: 640px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }

section { padding: 5rem 0; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-head);
  font-family: var(--mono);
  text-decoration: none;
}

.site-nav { display: flex; gap: 2rem; }
.site-nav a { color: var(--text-dim); font-size: 0.9rem; transition: color 0.15s; }
.site-nav a:hover { color: var(--text-head); text-decoration: none; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: 6rem 0 5rem;
  border-bottom: 1px solid var(--border);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 640px;
  margin: 1.5rem 0 2rem;
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: #22c55e; border-color: #22c55e; text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-dim); text-decoration: none; }

/* ─── Feature Cards ──────────────────────────────────────────────────────── */
.features { border-bottom: 1px solid var(--border); }

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.15s;
}
.feature-card:hover { border-color: var(--accent-dim); }

.feature-icon { font-size: 1.75rem; margin-bottom: 1rem; }

/* ─── Tool Cards ─────────────────────────────────────────────────────────── */
.tools-section { border-bottom: 1px solid var(--border); }

.tool-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.tool-card:hover { border-color: var(--link); background: var(--bg-hover); text-decoration: none; }
.tool-card h3 { color: var(--text-head); margin-bottom: 0.5rem; }

.tool-tag {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ─── Article Cards ──────────────────────────────────────────────────────── */
.articles-section { border-bottom: 1px solid var(--border); }

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.article-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.article-card:hover { border-color: var(--accent-dim); text-decoration: none; }
.article-card h3 { color: var(--text-head); margin: 0.4rem 0 0.5rem; }
.article-card p { font-size: 0.9rem; color: var(--text-dim); margin: 0; }

.article-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Newsletter ─────────────────────────────────────────────────────────── */
.newsletter-section { border-bottom: 1px solid var(--border); text-align: center; }

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.5rem 0 1rem;
}

.newsletter-form input[type="email"] {
  flex: 1 1 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  outline: none;
}
.newsletter-form input[type="email"]:focus { border-color: var(--link); }

.privacy-notice { font-size: 0.8rem; color: var(--text-dim); }
.privacy-notice a { color: var(--text-dim); text-decoration: underline; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { padding: 3rem 0; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid p { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.5rem; }
.footer-grid a { color: var(--text-dim); text-decoration: underline; }

.footer-copy { font-size: 0.8rem; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 1.5rem; }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.success { color: var(--accent); }
.error   { color: var(--danger); font-size: 0.9rem; margin-top: 0.5rem; }

/* ─── Category / service monogram tag ───────────────────────────────────── */
.cat-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  line-height: 1.4;
  flex-shrink: 0;
}

/* ─── Feature icon (SVG) ─────────────────────────────────────────────────── */
.feature-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  color: var(--accent);
}
.feature-icon svg {
  width: 40px;
  height: 40px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Scan page specific ─────────────────────────────────────────────────── */
.scan-form { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.scan-form input[type="url"] {
  flex: 1 1 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-family: var(--mono);
  outline: none;
}
.scan-form input[type="url"]:focus { border-color: var(--link); }

.scan-status {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  display: none;
}
.scan-status.visible { display: block; }

/* ─── Article page ───────────────────────────────────────────────────────── */
.article-hero { padding: 4rem 0 3rem; border-bottom: 1px solid var(--border); }
.article-hero .article-tag { font-size: 0.8rem; }

.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  line-height: 1.75;
}

.article-body h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: 1rem;
}

.article-body p { margin-bottom: 1.1rem; }

.article-body ul, .article-body ol {
  margin: 0.5rem 0 1.1rem 1.5rem;
}

.article-body li { margin-bottom: 0.35rem; }

.article-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

.article-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.article-body blockquote {
  border-left: 3px solid var(--accent-dim);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
  font-style: italic;
}

.article-body .callout {
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.article-body .callout strong { color: var(--accent); }

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1.25rem 0;
}

.article-body th {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
  color: var(--text-head);
  font-weight: 600;
}

.article-body td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.9rem;
  color: var(--text);
}

.article-body tr:nth-child(even) td { background: var(--bg-card); }

.article-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 1rem;
  font-family: var(--mono);
}

.article-related {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 3rem;
}

.article-related h3 {
  color: var(--text-head) !important;
  font-size: 0.95rem !important;
  margin-top: 0 !important;
  margin-bottom: 1rem;
}

.article-related-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-related-links a {
  font-size: 0.875rem;
  color: var(--link);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-nav { gap: 1rem; }
  section { padding: 3rem 0; }
  .hero { padding: 3rem 0; }
}
