/* ═══════════════════════════════════════════════
   NETHRAX — Shared Stylesheet
   All pages import this file.
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@400;500;600;700&display=swap');

/* ─── CSS VARIABLES ─────────────────────────── */
:root {
  --bg:        #07090d;
  --bg2:       #0c1016;
  --bg3:       #111820;
  --border:    #1a2535;
  --border2:   #243347;

  --accent:    #00ffe0;   /* cyan  — Docker  */
  --red:       #ff4d6d;   /* red   — Nmap    */
  --yellow:    #ffd166;   /* gold  — Linux   */
  --purple:    #7b61ff;   /* purple— Network */

  --text:      #b8cfe0;
  --text2:     #7a96aa;
  --muted:     #3d5568;
  --white:     #e8f2fa;

  --code-bg:   #060a0e;
  --mono:      'Share Tech Mono', monospace;
  --sans:      'Rajdhani', sans-serif;

  --radius:    6px;
  --transition: 0.2s ease;
}

/* ─── RESET ─────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Scanline texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 255, 224, 0.012) 3px,
    rgba(0, 255, 224, 0.012) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; }

/* ─── SCROLLBAR ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ═══════════════════════════════════════════════
   HEADER / NAV
   ═══════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  height: 58px;
  background: rgba(7, 9, 13, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 1rem;
}

.site-logo {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  white-space: nowrap;
}
.site-logo .slash { color: var(--red); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text2);
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  letter-spacing: 0.08em;
  transition: all var(--transition);
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  border-color: rgba(0,255,224,0.3);
  background: rgba(0,255,224,0.06);
}

/* colour overrides per section */
.site-nav a[href*="nmap"]:hover,
.site-nav a[href*="nmap"].active   { color: var(--red);    border-color: rgba(255,77,109,0.3);  background: rgba(255,77,109,0.06); }
.site-nav a[href*="linux"]:hover,
.site-nav a[href*="linux"].active  { color: var(--yellow); border-color: rgba(255,209,102,0.3); background: rgba(255,209,102,0.06); }
.site-nav a[href*="network"]:hover,
.site-nav a[href*="network"].active{ color: var(--purple); border-color: rgba(123,97,255,0.3);  background: rgba(123,97,255,0.06); }

.nav-home {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.nav-home:hover { color: var(--white); border-color: var(--border2); }

/* ═══════════════════════════════════════════════
   PAGE HERO (used on topic pages)
   ═══════════════════════════════════════════════ */
.page-hero {
  position: relative;
  padding: 4rem 2rem 3rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.page-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
  pointer-events: none;
}

.page-hero-glow {
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 280px;
  pointer-events: none;
}

.page-hero-inner {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
}

.page-hero-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.page-hero h1 {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--white);
  letter-spacing: 0.12em;
  line-height: 1.15;
}

.page-hero p {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: var(--text2);
  max-width: 520px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.4rem;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 0.1em;
  border: 1px solid var(--border2);
  color: var(--text2);
}

/* ═══════════════════════════════════════════════
   LAYOUT — two-column wrapper
   ═══════════════════════════════════════════════ */
.page-wrap {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
  align-items: start;
}

/* ─── SIDEBAR ────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 74px;
  height: fit-content;
  padding-right: 1.5rem;
  border-right: 1px solid var(--border);
}

.sidebar-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-left: 10px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text2);
  padding: 6px 10px;
  border-left: 2px solid transparent;
  letter-spacing: 0.05em;
  transition: all var(--transition);
  border-radius: 0 3px 3px 0;
}
.sidebar-nav a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.03);
}
.sidebar-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(0,255,224,0.05);
}

.sidebar-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background var(--transition);
}
.sidebar-nav a.active .sidebar-dot { background: var(--accent); }

/* ─── MAIN ───────────────────────────────────── */
.page-main {
  min-width: 0;
  padding-left: 2.5rem;
}

/* ═══════════════════════════════════════════════
   CONTENT BLOCKS
   ═══════════════════════════════════════════════ */

/* Section block */
.content-section {
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.content-section.visible {
  opacity: 1;
  transform: none;
}

.section-heading {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  transition: border-color var(--transition), transform var(--transition);
}
.card:hover {
  transform: translateY(-2px);
}

.card-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.55rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.6;
}

.card strong { color: var(--white); font-weight: 600; }

/* ─── CODE BLOCK ─────────────────────────────── */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.code-lang {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.15em;
}

.copy-btn {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 9px;
  letter-spacing: 0.1em;
  transition: all var(--transition);
}
.copy-btn:hover { color: var(--accent); border-color: rgba(0,255,224,0.4); }
.copy-btn.copied { color: #4ade80; border-color: rgba(74,222,128,0.4); }

pre {
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.8;
  color: #8fafc4;
}

/* Syntax colours */
pre .cmd  { color: var(--accent); }
pre .flag { color: var(--purple); }
pre .arg  { color: var(--yellow); }
pre .str  { color: #ff9eb5; }
pre .cmt  { color: var(--muted); font-style: italic; }
pre .kw   { color: var(--red); }
pre .val  { color: #a8e6cf; }

/* ─── TABLE ──────────────────────────────────── */
.cmd-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cmd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}

.cmd-table th {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-align: left;
  padding: 9px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.cmd-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(26,37,53,0.8);
  vertical-align: top;
}
.cmd-table tr:last-child td { border-bottom: none; }
.cmd-table tr:hover td { background: rgba(255,255,255,0.02); }

.cmd-table code {
  font-family: var(--mono);
  font-size: 0.77rem;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--code-bg);
  white-space: nowrap;
}

.cmd-table td:last-child { color: var(--text2); }

/* ─── CALLOUT / NOTE ─────────────────────────── */
.callout {
  display: flex;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border-left: 3px solid;
  margin: 1rem 0;
  font-size: 0.88rem;
}
.callout-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.6; }
.callout p { color: var(--text2); line-height: 1.6; }
.callout strong { color: var(--white); }

.callout.tip  { background: rgba(0,255,224,0.05);  border-color: rgba(0,255,224,0.3); }
.callout.warn { background: rgba(255,209,102,0.05); border-color: rgba(255,209,102,0.35); }
.callout.danger{ background: rgba(255,77,109,0.05); border-color: rgba(255,77,109,0.35); }

/* ═══════════════════════════════════════════════
   HOME PAGE — topic card grid
   ═══════════════════════════════════════════════ */
.home-hero {
  position: relative;
  padding: 5rem 2rem 4rem;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.home-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.28;
}

.home-hero-glow {
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 350px;
  background: radial-gradient(ellipse, rgba(0,255,224,0.1) 0%, transparent 68%);
  pointer-events: none;
}

.home-hero h1 {
  position: relative;
  font-family: var(--mono);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  color: var(--white);
  letter-spacing: 0.22em;
  text-shadow: 0 0 60px rgba(0,255,224,0.25);
}
.home-hero h1 .slash { color: var(--accent); }

.home-hero-sub {
  position: relative;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 1rem;
  letter-spacing: 0.14em;
}

.blink-cursor {
  display: inline-block;
  width: 8px; height: 1em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* topic cards on home */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 3rem auto 0;
  padding: 0 2rem 5rem;
}

.topic-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.topic-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
}

.topic-card:hover {
  transform: translateY(-4px);
  border-color: var(--border2);
}

.topic-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.topic-card-title {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--white);
  letter-spacing: 0.1em;
}

.topic-card-desc {
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.6;
  flex: 1;
}

.topic-card-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.topic-card-meta::before {
  content: '→';
}

/* Colour themes for each topic card */
.topic-card.docker  { --c: var(--accent); }
.topic-card.nmap    { --c: var(--red); }
.topic-card.linux   { --c: var(--yellow); }
.topic-card.network { --c: var(--purple); }

.topic-card::before        { background: var(--c); opacity: 0; transition: opacity 0.25s; }
.topic-card:hover::before  { opacity: 1; }
.topic-card:hover .topic-card-title { color: var(--c); }
.topic-card-meta { color: var(--muted); }
.topic-card:hover .topic-card-meta  { color: var(--c); }

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.12em;
}

/* ═══════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════ */
.hidden { display: none !important; }

mark {
  background: rgba(0,255,224,0.18);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 860px) {
  .page-wrap {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.2rem 4rem;
  }
  .sidebar { display: none; }
  .page-main { padding-left: 0; }
}

@media (max-width: 600px) {
  .site-header { padding: 0 1.2rem; }
  .site-nav a  { font-size: 0.65rem; padding: 4px 8px; }
  .home-hero   { padding: 3.5rem 1.2rem 2.5rem; }
  .topic-grid  { padding: 0 1.2rem 4rem; gap: 1rem; }
  pre          { font-size: 0.74rem; }
}

/* ═══════════════════════════════════════════════
   SPLASH SCREEN
   ═══════════════════════════════════════════════ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  animation: splash-pulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(0,255,224,0.5));
}

.splash-name {
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--white);
  letter-spacing: 0.3em;
  opacity: 0;
  animation: splash-fadein 0.6s ease 0.4s forwards;
}

.splash-name .slash { color: var(--accent); }

.splash-bar-wrap {
  width: 160px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: splash-fadein 0.4s ease 0.6s forwards;
}

.splash-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0,255,224,0.6);
  animation: splash-load 1.2s cubic-bezier(0.4,0,0.2,1) 0.7s forwards;
}

.splash-status {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.18em;
  opacity: 0;
  animation: splash-fadein 0.4s ease 0.8s forwards;
}

@keyframes splash-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 18px rgba(0,255,224,0.4)); }
  50%       { transform: scale(1.06); filter: drop-shadow(0 0 32px rgba(0,255,224,0.7)); }
}

@keyframes splash-fadein {
  to { opacity: 1; }
}

@keyframes splash-load {
  to { width: 100%; }
}