/* ============================================================
   CyberUnit @ UNG — Global Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Exo+2:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ──────────────────────────────────────── */
:root {
  --bg:          #0d0d0d;
  --surface:     #141414;
  --border:      #1f1f1f;
  --accent:      #00ff88;
  --accent-dim:  #00cc6a;
  --text:        #e0e0e0;
  --text-muted:  #666666;
  --danger:      #ff4444;
  --warn:        #ffaa00;
  --info:        #4488ff;
}

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

html {
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

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

/* ─── Base Styles ────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  animation: fadeIn 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text);
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-dim);
}

code, pre {
  font-family: 'Share Tech Mono', monospace;
}

img {
  max-width: 100%;
  height: auto;
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes gridPulse {
  0%, 100% { opacity: 0.03; }
  50%       { opacity: 0.06; }
}

/* ─── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

main {
  padding: 2rem 0 4rem;
}

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
}

.navbar .container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.navbar-logo-img {
  height: 38px;
  width: auto;
  display: block;
  transition: opacity 0.2s;
}
.navbar-logo:hover .navbar-logo-img {
  opacity: 0.8;
}
.navbar-logo-text {
  margin-left: 0.6rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.navbar-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.navbar-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  transition: color 0.2s;
}
.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--accent);
}
.navbar-links a:hover::after,
.navbar-links a.active::after {
  transform: scaleX(1);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  aria-label: "Toggle navigation";
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.navbar-links.open {
  display: flex;
}

/* ─── Page offset for fixed navbar ──────────────────────── */
body > main,
.page-body {
  padding-top: 80px;
}

/* ─── Hero Section ───────────────────────────────────────── */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridPulse 4s ease-in-out infinite;
  pointer-events: none;
}

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

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--accent);
  min-height: 1.4em;
}

.typewriter-cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 1rem 0 2rem;
  max-width: 560px;
}

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

/* ─── Stats Bar ──────────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 2rem 0;
  flex-wrap: wrap;
}

.stat-item {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}
.stat-item strong {
  color: var(--accent);
  display: block;
  font-size: 1.4rem;
}

/* ─── Section Heading ────────────────────────────────────── */
.section-heading {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-muted);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}
.section-heading span {
  color: var(--accent);
}

/* ─── Topic Grid ─────────────────────────────────────────── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

/* ─── Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.2);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.card-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* ─── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-beginner {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 136, 0.3);
}
.badge-intermediate {
  background: rgba(255, 170, 0, 0.1);
  color: var(--warn);
  border: 1px solid rgba(255, 170, 0, 0.3);
}

/* ─── Button ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.btn:hover {
  background: rgba(0, 255, 136, 0.1);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.2);
  color: var(--accent);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent-dim);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}
.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  min-height: 36px;
}

/* ─── Code Block ─────────────────────────────────────────── */
.code-block {
  background: #1a1a1a;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  margin: 1rem 0;
  color: var(--text);
}

code {
  background: #1a1a1a;
  border-radius: 3px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
  color: var(--accent);
}

/* ─── Callout ────────────────────────────────────────────── */
.callout {
  border-left: 3px solid;
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}
.callout-info {
  border-color: var(--info);
  background: rgba(68, 136, 255, 0.07);
  color: #88aaff;
}
.callout-warn {
  border-color: var(--warn);
  background: rgba(255, 170, 0, 0.07);
  color: #ffcc55;
}
.callout-danger {
  border-color: var(--danger);
  background: rgba(255, 68, 68, 0.07);
  color: #ff8888;
}

/* ─── Progress Bar ───────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease, background 0.3s;
}
.progress-weak   { background: var(--danger); }
.progress-fair   { background: var(--warn); }
.progress-strong { background: var(--accent); }

/* ─── Quiz Box ───────────────────────────────────────────── */
.quiz-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.quiz-question {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  min-height: 44px;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(0, 255, 136, 0.04);
}
.quiz-option.correct {
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent);
}
.quiz-option.wrong {
  border-color: var(--danger);
  background: rgba(255, 68, 68, 0.1);
  color: var(--danger);
}
.quiz-option:disabled {
  cursor: not-allowed;
}

.quiz-feedback {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  display: none;
}
.quiz-feedback.correct {
  background: rgba(0, 255, 136, 0.08);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  display: block;
}
.quiz-feedback.wrong {
  background: rgba(255, 68, 68, 0.08);
  color: #ff8888;
  border-left: 3px solid var(--danger);
  display: block;
}

.quiz-score {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}
.quiz-score-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.quiz-score-msg {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-top: 80px;
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb span {
  margin: 0 0.4rem;
}

/* ─── Topic Header ───────────────────────────────────────── */
.topic-header {
  margin-bottom: 2rem;
}
.topic-header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.topic-icon-large {
  font-size: 2.5rem;
}
.topic-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.read-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Topic Image ────────────────────────────────────────── */
.topic-image-wrap {
  margin: 1.5rem 0 2rem;
}
.topic-image-wrap img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.topic-image-placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
}
.topic-image-placeholder .placeholder-icon {
  font-size: 3rem;
}

/* ─── Topic Content ──────────────────────────────────────── */
.topic-content {
  margin-bottom: 3rem;
}
.content-section {
  margin-bottom: 2rem;
}
.content-section h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.content-section p {
  color: var(--text);
  margin-bottom: 0.75rem;
}

/* ─── CIA Triad ──────────────────────────────────────────── */
.cia-triad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.cia-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  text-align: center;
}
.cia-box .cia-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.cia-box h4 {
  font-family: 'Share Tech Mono', monospace;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.cia-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Threat Cards ───────────────────────────────────────── */
.threat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.threat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.threat-card .threat-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.threat-card h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.threat-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Password Table ─────────────────────────────────────── */
.password-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.password-table th {
  font-family: 'Share Tech Mono', monospace;
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.password-table th.bad  { color: var(--danger); }
.password-table th.good { color: var(--accent); }
.password-table td {
  padding: 0.5rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  border-bottom: 1px solid rgba(31,31,31,0.5);
}
.password-table .bad-pw { color: var(--danger); }
.password-table .good-pw { color: var(--accent); }

/* ─── Terminal Window ────────────────────────────────────── */
.terminal-window {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
}
.terminal-titlebar {
  background: #1a1a1a;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dot.red   { background: #ff5f57; }
.terminal-dot.yellow{ background: #ffbd2e; }
.terminal-dot.green { background: #28c840; }
.terminal-titlebar-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}
.terminal-body {
  padding: 1.25rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.88rem;
}
.terminal-line {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  margin-bottom: 0.6rem;
  align-items: start;
}
.terminal-cmd {
  color: var(--accent);
}
.terminal-desc {
  color: var(--text-muted);
}
.terminal-prompt {
  color: var(--text-muted);
  margin-right: 0.5rem;
}

/* ─── Network Flow Diagram ───────────────────────────────── */
.network-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.flow-node {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  text-align: center;
  min-width: 80px;
}
.flow-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  font-family: 'Share Tech Mono', monospace;
}

/* ─── IR Lifecycle Diagram ───────────────────────────────── */
.ir-lifecycle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
  counter-reset: ir-step;
}
.ir-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  position: relative;
  counter-increment: ir-step;
}
.ir-step::before {
  content: counter(ir-step);
  display: block;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  line-height: 28px;
  margin: 0 auto 0.5rem;
  font-weight: bold;
}
.ir-step h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.ir-step p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Career Cards ───────────────────────────────────────── */
.career-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.career-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.career-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}
.career-card h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.career-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Resource Links ─────────────────────────────────────── */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}
.resource-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s, background 0.2s;
}
.resource-link:hover {
  border-color: var(--accent);
  background: rgba(0,255,136,0.04);
}
.resource-link h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.resource-link p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}
.resource-link .link-arrow {
  color: var(--accent);
  font-size: 1.2rem;
  margin-left: 1rem;
  flex-shrink: 0;
}

/* ─── Password Strength Demo ─────────────────────────────── */
.demo-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1rem 0;
}
.demo-box label {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.demo-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}
.demo-input:focus {
  border-color: var(--accent);
}
.strength-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0.25rem;
}
.strength-tips {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  list-style: none;
}
.strength-tips li {
  padding: 0.2rem 0;
}
.strength-tips li.pass { color: var(--accent); }
.strength-tips li.fail { color: var(--text-muted); }

/* ─── Caesar Cipher Demo ─────────────────────────────────── */
.cipher-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cipher-slider-wrap {
  grid-column: 1 / -1;
}
.cipher-slider-wrap label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}
.cipher-note {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}
.cipher-btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ─── Hygiene Checklist ──────────────────────────────────── */
.checklist {
  list-style: none;
  margin: 0.5rem 0;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(31,31,31,0.6);
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.checklist li:last-child { border-bottom: none; }
.checklist li:hover { color: var(--text); }
.checklist li.checked { color: var(--accent); }
.checklist-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}
.checklist li.checked .checklist-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.checklist-checkbox::after {
  content: '';
}
.checklist li.checked .checklist-checkbox::after {
  content: '✓';
  font-size: 0.8rem;
  font-weight: bold;
}
.checklist-score {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  text-align: right;
}
.checklist-score span { color: var(--accent); }

/* ─── Topic Navigation ───────────────────────────────────── */
.topic-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.topic-nav a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem 1rem;
  transition: border-color 0.2s, color 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.topic-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.topic-nav .spacer { flex: 1; }

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: 'Share Tech Mono', monospace;
}

/* ─── Inline SVG Illustrations ───────────────────────────── */
.topic-svg-wrap {
  margin: 1.5rem 0 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.topic-svg-wrap svg {
  max-width: 100%;
  height: auto;
}

/* ─── Topic Page Two-Column Layout ──────────────────────── */
.topic-container {
  max-width: 1220px;
}

.topic-layout {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 0 2.5rem;
  align-items: start;
}

.topic-main {
  min-width: 0; /* prevent grid blowout */
}

/* ─── Table of Contents Sidebar ──────────────────────────── */
.toc {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.84rem;
  /* Thin custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
.toc::-webkit-scrollbar       { width: 4px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.toc-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 5px;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
  /* hidden on desktop — TOC is always expanded */
  display: none;
}
.toc-toggle:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.toc-list {
  list-style: none;
  padding: 0.4rem 0 0.6rem;
  margin: 0;
}

.toc-list.toc-collapsed { display: none; }

.toc-sep {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0.75rem;
}

.toc-link {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.32rem 0.75rem 0.32rem 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.toc-link:hover {
  color: var(--text);
  background: rgba(0, 255, 136, 0.04);
  color: var(--text);
}
.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(0, 255, 136, 0.06);
}

.toc-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  color: #444;
  min-width: 18px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.toc-link.active .toc-num { color: var(--accent-dim); }

.toc-text {
  flex: 1;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.82rem;
  /* Prevent very long headings from blowing out the sidebar */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Quiz entry gets a distinct colour */
.toc-quiz .toc-text        { color: var(--info); }
.toc-quiz.active .toc-text { color: var(--info); }
.toc-quiz.active           { border-left-color: var(--info); background: rgba(68,136,255,0.06); }
.toc-quiz .toc-num         { color: var(--info); opacity: 0.6; }

/* ─── Command Reference Table ────────────────────────────── */
.cmd-group {
  margin-bottom: 1.25rem;
}
.cmd-group-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
  background: rgba(0, 255, 136, 0.06);
  border-left: 2px solid var(--accent);
  margin-bottom: 0.4rem;
}
.cmd-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 4px 4px 4px;
  overflow: hidden;
}
.cmd-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  border-bottom: 1px solid rgba(31, 31, 31, 0.6);
  align-items: stretch;
}
.cmd-row:last-child { border-bottom: none; }
.cmd-row:hover { background: rgba(0, 255, 136, 0.03); }
.cmd-cell {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  padding: 0.5rem 0.9rem;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  word-break: break-all;
}
.cmd-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 0.5rem 0.9rem;
  display: flex;
  align-items: center;
}

/* ─── Permissions Table ──────────────────────────────────── */
@media (max-width: 640px) {
  .perm-tables {
    grid-template-columns: 1fr !important;
  }
}

/* ─── SSH Key Steps ──────────────────────────────────────── */
.ssh-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.ssh-step {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.ssh-step:last-child { border-bottom: none; }
.ssh-step-num {
  width: 48px;
  min-width: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--bg);
  background: var(--accent);
  font-weight: bold;
}
.ssh-step-body {
  flex: 1;
  padding: 1rem 1.25rem;
  background: var(--surface);
}
.ssh-step-body h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.ssh-code {
  white-space: pre;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0.5rem 0 !important;
}
.ssh-step-note {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  border-left: 2px solid var(--border);
  padding-left: 0.6rem;
}

/* ─── Script Example ─────────────────────────────────────── */
.script-example {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.script-title {
  background: #1a1a1a;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.script-title::before {
  content: '📄';
}
.script-example .code-block {
  border-left: none;
  border-radius: 0;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.65;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Collapse TOC into header card on narrow screens ─────── */
@media (max-width: 1100px) {
  /* Switch to single-column — TOC floats to the top */
  .topic-layout {
    grid-template-columns: 1fr;
  }
  .topic-main {
    order: 2;
  }
  .toc {
    order: 1;
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: 1.5rem;
  }
  /* Show the toggle button */
  .toc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Wider container falls back to 960px cap */
  .topic-container {
    max-width: 960px;
  }
  /* Allow full-width text in TOC on small screens */
  .toc-text {
    white-space: normal;
  }
}

@media (max-width: 900px) {
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .cia-triad  { grid-template-columns: repeat(3, 1fr); }
  .threat-grid { grid-template-columns: repeat(2, 1fr); }
  .career-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .topic-grid  { grid-template-columns: repeat(2, 1fr); }
  .cia-triad   { grid-template-columns: 1fr; }
  .ir-lifecycle { grid-template-columns: repeat(2, 1fr); }
  .cipher-controls { grid-template-columns: 1fr; }

  .hamburger { display: flex; }

  .navbar-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(13,13,13,0.97);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 1rem;
  }
  .navbar-links.open {
    display: flex;
  }

  .stats-bar { gap: 1.25rem; }
  .hero { padding: 3rem 0 2.5rem; }
}

@media (max-width: 480px) {
  .topic-grid  { grid-template-columns: 1fr; }
  .threat-grid { grid-template-columns: 1fr; }
  .ir-lifecycle { grid-template-columns: 1fr; }
  .hero-btns { flex-direction: column; }
  .topic-nav { flex-direction: column; }
  .container { padding: 0 1rem; }
  .cmd-row { grid-template-columns: 1fr; }
  .cmd-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .ssh-step-num { width: 36px; min-width: 36px; font-size: 0.75rem; }
}
