/* =============================================================
   Cybersecurity Blog — style.css
   Dark, minimal, blue/cyan/purple accents. No animations beyond
   subtle hover transitions. Plain CSS, no build step.
   ============================================================= */

:root {
  --bg: #0a0e14;
  --surface: #121824;
  --surface-2: #161d2b;
  --border: #212a3a;
  --border-hover: #2f3d54;
  --text: #e6edf5;
  --text-muted: #93a1b5;
  --text-faint: #5c6a80;

  --blue: #4c8dff;
  --cyan: #22d3ee;
  --purple: #a78bfa;
  --accent-gradient: linear-gradient(90deg, var(--blue), var(--cyan));

  --font-heading: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --radius: 8px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; margin: 0 0 0.5em; line-height: 1.25; }
p { margin: 0 0 1em; }

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

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--cyan); color: #04101c; padding: 10px 16px; font-family: var(--font-mono); font-size: 13px;
}
.skip-link:focus { left: 16px; top: 16px; }

/* -----------------------------------------------------------
   Navbar
   ----------------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { font-family: var(--font-heading); font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-gradient); }

.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.nav-links a { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none; background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  width: 38px; height: 38px; color: var(--text); cursor: pointer;
}

/* -----------------------------------------------------------
   Hero
   ----------------------------------------------------------- */
.hero { padding: 88px 0 56px; border-bottom: 1px solid var(--border); }
.hero-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); }
.hero h1 span { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-muted); max-width: 60ch; font-size: 16px; }

/* -----------------------------------------------------------
   Sections
   ----------------------------------------------------------- */
.section { padding: 56px 0; }
.section-title { font-size: 24px; margin-bottom: 24px; }

/* -----------------------------------------------------------
   Article grid + cards
   ----------------------------------------------------------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.article-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card-meta-top { display: flex; align-items: center; justify-content: space-between; }
.card-tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--cyan); background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 3px 9px; border-radius: 4px;
}
.card-platform { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }

.article-card h3 { font-size: 18px; margin-bottom: 2px; }
.article-card .desc { color: var(--text-muted); font-size: 14px; flex-grow: 1; }

.card-meta-bottom {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-faint);
}
.difficulty { display: inline-flex; align-items: center; gap: 6px; }
.difficulty::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.difficulty.easy { color: #3fb950; }
.difficulty.medium { color: #d29922; }
.difficulty.hard { color: #f0883e; }

.read-btn {
  margin-top: 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.article-card:hover .read-btn { border-color: var(--cyan); color: var(--cyan); }

/* -----------------------------------------------------------
   About section (on homepage)
   ----------------------------------------------------------- */
.about-section { border-top: 1px solid var(--border); }
.about-section p { color: var(--text-muted); max-width: 68ch; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag-pill {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}

/* -----------------------------------------------------------
   Buttons
   ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px; padding: 11px 20px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent-gradient); color: #04101c; }
.btn-outline { border-color: var(--border-hover); color: var(--text); }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* -----------------------------------------------------------
   Footer
   ----------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.footer-links a { font-size: 13px; color: var(--text-muted); }
.footer-links a:hover { color: var(--cyan); }
.footer-copy { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

/* -----------------------------------------------------------
   Article page header (added on top of each article, unstyled body below)
   ----------------------------------------------------------- */
.article-header-bar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.article-header-bar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; flex-wrap: wrap; gap: 10px;
}
.article-header-bar a {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.article-header-bar a:hover { color: var(--cyan); }
.article-header-bar .article-header-nav { display: flex; gap: 20px; }
.article-header-bar .disabled { color: var(--text-faint); pointer-events: none; opacity: 0.5; }

/* -----------------------------------------------------------
   Article content (body of each article page)
   Kept simple on purpose — plain, readable, no sidebar/TOC.
   ----------------------------------------------------------- */
.article-page-header { padding: 40px 0 24px; border-bottom: 1px solid var(--border); }
.article-page-header .card-tag { margin-bottom: 14px; display: inline-block; }
.article-page-header h1 { font-size: clamp(26px, 4vw, 38px); max-width: 24ch; }
.article-page-meta {
  display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint);
}
.article-page-meta strong { color: var(--text-muted); font-weight: 500; }

.article-content { max-width: 700px; margin: 0 auto; padding: 48px 24px 64px; }
.article-content h2 { font-size: 23px; margin-top: 2.1em; scroll-margin-top: 80px; }
.article-content h3 { font-size: 18px; margin-top: 1.7em; }
.article-content p { color: #cbd5e1; }
.article-content ul, .article-content ol { color: #cbd5e1; padding-left: 1.4em; margin: 0 0 1em; }
.article-content li { margin-bottom: 0.4em; }
.article-content a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.article-content strong { color: var(--text); }
.article-content img { border-radius: var(--radius); border: 1px solid var(--border); margin: 1.5em 0; }
.article-content code { font-family: var(--font-mono); background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }

.callout {
  border: 1px solid var(--border-hover); border-left: 3px solid var(--blue);
  background: var(--surface); border-radius: var(--radius); padding: 14px 18px; margin: 1.5em 0;
}
.callout-title { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; color: var(--blue); }
.callout.warning { border-left-color: #f0883e; }
.callout.warning .callout-title { color: #f0883e; }
.callout.tip { border-left-color: #3fb950; }
.callout.tip .callout-title { color: #3fb950; }
.callout p:last-child { margin-bottom: 0; }

.code-block { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 1.5em 0; }
.code-block .code-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint);
}
.code-block pre { margin: 0; padding: 16px; overflow-x: auto; background: var(--surface); }
.code-block pre code { background: none; padding: 0; font-size: 13.5px; color: #cbd5e1; }
.copy-btn {
  background: transparent; border: 1px solid var(--border-hover); color: var(--text-faint);
  font-family: var(--font-mono); font-size: 11px; padding: 3px 9px; border-radius: 4px; cursor: pointer;
}
.copy-btn:hover { color: var(--cyan); border-color: var(--cyan); }

.article-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 14px; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.article-content th { background: var(--surface); font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; color: var(--text-muted); }
.article-content td { color: var(--text-muted); }

.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); }

/* -----------------------------------------------------------
   Responsive
   ----------------------------------------------------------- */
@media (max-width: 720px) {
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--bg); flex-direction: column; padding: 24px; gap: 18px;
    transform: translateX(100%); transition: transform 0.2s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .article-grid { grid-template-columns: 1fr; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}
