/* ==========================================================================
   Hexdump-style theme for What-Security — original implementation.
   Color themes via [data-theme] on <html>; switcher in nav + terminal.
   ========================================================================== */

:root, [data-theme="matrix"] {
  --bg: #060a08;
  --bg-deep: #030605;
  --fg: #d8e6dc;
  --muted: #7d8f83;
  --accent: #3dff7c;
  --accent-dim: rgba(61, 255, 124, 0.14);
  --border: rgba(61, 255, 124, 0.18);
  --panel: rgba(10, 20, 14, 0.82);
  --glow: 0 0 14px rgba(61, 255, 124, 0.55), 0 0 42px rgba(61, 255, 124, 0.22);
}
[data-theme="dracula"] {
  --bg: #1b1c26;
  --bg-deep: #14151d;
  --fg: #e2e2ec;
  --muted: #8b8ba3;
  --accent: #bd93f9;
  --accent-dim: rgba(189, 147, 249, 0.14);
  --border: rgba(189, 147, 249, 0.2);
  --panel: rgba(33, 34, 46, 0.85);
  --glow: 0 0 14px rgba(189, 147, 249, 0.5), 0 0 42px rgba(189, 147, 249, 0.2);
}
[data-theme="nord"] {
  --bg: #242933;
  --bg-deep: #1d222b;
  --fg: #dce3ec;
  --muted: #93a5b7;
  --accent: #88c0d0;
  --accent-dim: rgba(136, 192, 208, 0.14);
  --border: rgba(136, 192, 208, 0.22);
  --panel: rgba(41, 48, 61, 0.85);
  --glow: 0 0 14px rgba(136, 192, 208, 0.45), 0 0 42px rgba(136, 192, 208, 0.18);
}
[data-theme="gruvbox"] {
  --bg: #1d2021;
  --bg-deep: #161819;
  --fg: #e2d9c2;
  --muted: #a89984;
  --accent: #fabd2f;
  --accent-dim: rgba(250, 189, 47, 0.14);
  --border: rgba(250, 189, 47, 0.22);
  --panel: rgba(40, 42, 40, 0.85);
  --glow: 0 0 14px rgba(250, 189, 47, 0.45), 0 0 42px rgba(250, 189, 47, 0.18);
}
[data-theme="mono"] {
  --bg: #0a0a0a;
  --bg-deep: #050505;
  --fg: #e8e8e8;
  --muted: #8a8a8a;
  --accent: #e8e8e8;
  --accent-dim: rgba(232, 232, 232, 0.1);
  --border: rgba(232, 232, 232, 0.18);
  --panel: rgba(18, 18, 18, 0.85);
  --glow: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto;
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrapper { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 60px;
}
.logo-link {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  text-shadow: var(--glow);
  white-space: nowrap;
}
.logo-link:hover { text-decoration: none; opacity: 0.85; }

.main-menu { min-width: 0; }
.main-menu ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-menu a {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 4px;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.main-menu a:hover { color: var(--accent); background: var(--accent-dim); text-decoration: none; }
.main-menu li.active a {
  color: var(--accent);
  font-weight: 700;
}
.main-menu li.active a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: var(--glow);
}

.theme-dots { display: flex; gap: 9px; align-items: center; flex-shrink: 0; }
.theme-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.theme-dot:hover { transform: scale(1.25); }
.theme-dot[data-theme="matrix"]  { background: #3dff7c; }
.theme-dot[data-theme="dracula"] { background: #bd93f9; }
.theme-dot[data-theme="nord"]    { background: #88c0d0; }
.theme-dot[data-theme="gruvbox"] { background: #fabd2f; }
.theme-dot[data-theme="mono"]    { background: #e8e8e8; }
.theme-dot.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); }

@media (max-width: 900px) {
  .site-header .wrapper { gap: 14px; height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .main-menu { order: 3; flex-basis: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .main-menu ul { gap: 2px; padding-bottom: 4px; }
  .main-menu a { padding: 6px 10px; font-size: 12px; }
  .main-menu li.active a::after { left: 10px; right: 10px; }
  .theme-dots { order: 2; margin-left: auto; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero { padding: 84px 0 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-prompt { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.hero-prompt .user { color: var(--accent); }
.hero-prompt .cursor {
  display: inline-block;
  width: 9px;
  height: 16px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 6px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-name {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(52px, 9vw, 104px);
  line-height: 0.95;
  margin: 0 0 26px;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: var(--glow);
  letter-spacing: 2px;
}

.hero-bio {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--fg);
  max-width: 46ch;
  margin: 0 0 30px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }
.term-btn {
  display: inline-block;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.term-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.term-btn.primary { background: var(--accent); color: var(--bg-deep); border-color: var(--accent); font-weight: 700; }
.term-btn.primary:hover { opacity: 0.88; color: var(--bg-deep); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
@media (max-width: 560px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }
.stat-value {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: 26px;
  color: var(--accent);
  text-shadow: var(--glow);
}
.stat-label { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------------------------
   Terminal window
   -------------------------------------------------------------------------- */

.terminal {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-size: 13.5px;
}
.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.tl { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); opacity: 0.7; }
.terminal-title { flex: 1; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 1px; }

.terminal-body {
  padding: 16px;
  height: 340px;
  overflow-y: auto;
  line-height: 1.75;
}
.terminal-body .t-cmd  { color: var(--accent); }
.terminal-body .t-key  { color: var(--muted); }
.terminal-body .t-out  { color: var(--fg); white-space: pre-wrap; word-break: break-word; }
.terminal-body .t-ok   { color: var(--accent); }

.terminal-inputline { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--panel); }
.terminal-prompt { color: var(--accent); white-space: nowrap; }
.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 13.5px;
  caret-color: var(--accent);
}
.terminal-hint { padding: 8px 16px 14px; font-size: 12px; color: var(--muted); }
.terminal-hint code { color: var(--accent); background: var(--accent-dim); padding: 1px 6px; border-radius: 3px; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: 64px 0; }
.section-kicker { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.section-kicker::before { content: "// "; color: var(--accent); }
.section-title {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
  margin: 0 0 10px;
  color: var(--fg);
}
.section-title .dot { color: var(--accent); text-shadow: var(--glow); }
.section-sub { color: var(--muted); font-size: 14px; margin: 0 0 36px; }
.section-more { float: right; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 18px; }
.section-more:hover { color: var(--accent); text-decoration: none; }

/* Disclosure cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 22px;
  clear: both;
}
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 22px;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.card-source {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 8px;
  margin-bottom: 14px;
}
.card-title { font-size: 15.5px; font-weight: 700; line-height: 1.45; margin: 0 0 10px; }
.card-date { font-size: 12px; color: var(--muted); }
.card-summary { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* --------------------------------------------------------------------------
   Post layout
   -------------------------------------------------------------------------- */

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  padding: 64px 0;
}
@media (max-width: 900px) { .post-layout { grid-template-columns: 1fr; } }

.post-title {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  margin: 0 0 8px;
}
.post-meta { color: var(--muted); font-size: 13px; margin-bottom: 34px; }
.post-content { line-height: 1.8; }
.post-content h2, .post-content h3 { color: var(--accent); }
.post-content pre, .command-section pre {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
}
.post-content code, .command-section code { color: var(--accent); }
.post-content pre code, .command-section pre code { color: var(--fg); }
.command-section { margin-bottom: 36px; }
.command-section h3 { color: var(--accent); }
.post-content blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  color: var(--fg);
}
.post-content img { max-width: 100%; border-radius: 6px; border: 1px solid var(--border); }

.sidebar-widget {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
}
.sidebar-widget h3 {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.sidebar-widget h3::before { content: "~ "; color: var(--accent); }
.sidebar-face { width: 100%; border-radius: 6px; display: block; margin-bottom: 12px; }
.sidebar-stats { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.sidebar-stats li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.sidebar-stats li:last-child { border-bottom: none; }
.sidebar-stats .val { color: var(--accent); }
.sidebar-links { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.sidebar-links li { padding: 4px 0; }

/* --------------------------------------------------------------------------
   Media / about pages
   -------------------------------------------------------------------------- */

.page-heading { padding: 72px 0 8px; }
.page-title {
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  margin: 0;
  color: var(--fg);
}
.page-title::before { content: "$ "; color: var(--accent); }
.page-intro { color: var(--muted); margin: 10px 0 36px; }

.link-list { list-style: none; margin: 0 0 48px; padding: 0; }
.link-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--border);
}
.link-list .src {
  flex: 0 0 130px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}
.link-list .yr { flex: 0 0 52px; font-size: 12px; color: var(--muted); }
.link-list a { color: var(--fg); }
.link-list a:hover { color: var(--accent); }

.hof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hof-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--fg);
}
.hof-item:hover { border-color: var(--accent); text-decoration: none; }

/* --------------------------------------------------------------------------
   Generic content pages (cheat sheets, about)
   -------------------------------------------------------------------------- */

.page-content { padding-bottom: 24px; }
.about { max-width: 760px; }
.tagline { font-size: 17px; color: var(--muted); font-weight: 400; }
.container-face { margin: 20px 0; }
.face {
  width: 140px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.about-description { max-width: 68ch; }
.contact-contaiver .gist-file { border-color: var(--border) !important; }

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

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 26px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.site-footer .wrapper {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
