@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&family=VT323&display=swap');

:root {
  --bg: #080b0d;
  --bg2: #0d1117;
  --bg3: #111820;
  --border: #1a2a1a;
  --border-bright: #00ff41;
  --accent: #00ff41;
  --accent2: #00d4ff;
  --accent3: #ff6b35;
  --text: #a8b8a8;
  --text-bright: #e0ffe0;
  --text-dim: #445544;
  --card-bg: #0a0f0a;
  --card-hover: #0f1a0f;
  --glow: 0 0 20px rgba(0,255,65,0.3);
  --glow-strong: 0 0 40px rgba(0,255,65,0.5), 0 0 80px rgba(0,255,65,0.2);
  --scanline-opacity: 0.03;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  cursor: crosshair;
  overflow-x: hidden;
}

/* SCANLINES */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,var(--scanline-opacity)) 2px,
    rgba(0,0,0,var(--scanline-opacity)) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* NOISE TEXTURE */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
  opacity: 0.5;
}

/* MATRIX RAIN CANVAS */
#matrix-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); opacity: 0.5; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* SELECTION */
::selection { background: rgba(0,255,65,0.2); color: var(--accent); }

/* ─── HEADER ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,11,13,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  padding: 0 24px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 900;
  color: var(--accent);
  text-shadow: var(--glow);
  letter-spacing: 4px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo::before {
  content: '//';
  color: var(--text-dim);
  font-size: 14px;
}

.logo-cursor {
  display: inline-block;
  width: 10px;
  height: 18px;
  background: var(--accent);
  margin-left: 4px;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

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

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 11px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ─── NAVIGATION TABS ─── */
.nav-tabs {
  display: flex;
  gap: 0;
  padding: 0 24px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  max-width: 100%;
  overflow-x: auto;
}

.nav-tab {
  padding: 14px 28px;
  cursor: pointer;
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
}

.nav-tab::before {
  content: '[';
  margin-right: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.nav-tab::after {
  content: ']';
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-tab:hover {
  color: var(--text-bright);
}

.nav-tab:hover::before,
.nav-tab:hover::after {
  opacity: 0.5;
}

.nav-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-shadow: 0 0 10px rgba(0,255,65,0.5);
}

.nav-tab.active::before,
.nav-tab.active::after {
  opacity: 1;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  position: relative;
  z-index: 1;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── SECTION HEADER ─── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.section-title {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 4px;
  text-transform: uppercase;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-bright), transparent);
  opacity: 0.3;
}

.section-count {
  color: var(--text-dim);
  font-size: 11px;
}

/* ─── SEARCH BAR ─── */
.search-bar {
  position: relative;
  margin-bottom: 24px;
  max-width: 400px;
}

.search-bar input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-bright);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  padding: 10px 16px 10px 36px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0,255,65,0.15);
}

.search-bar input::placeholder {
  color: var(--text-dim);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 12px;
}

/* ─── SOFTWARE: CATEGORY FOLDERS ─── */
.category-block {
  margin-bottom: 32px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  margin-bottom: 0;
}

.category-header:hover {
  background: var(--card-hover);
  border-left-color: var(--accent);
  box-shadow: var(--glow);
}

.category-arrow {
  color: var(--accent);
  font-size: 12px;
  transition: transform 0.2s;
}

.category-block.open .category-arrow {
  transform: rotate(90deg);
}

.category-name {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 2px;
}

.category-count {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 11px;
}

.category-items {
  display: none;
  padding: 16px 0 0 0;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.category-block.open .category-items {
  display: grid;
}

/* ─── CARDS ─── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 16px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  animation: slideIn 0.3s ease both;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: rgba(0,255,65,0.4);
  background: var(--card-hover);
  box-shadow: 0 0 20px rgba(0,255,65,0.1), inset 0 0 20px rgba(0,255,65,0.02);
  transform: translateY(-2px);
}

.card:hover::before {
  opacity: 1;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 12px;
  image-rendering: pixelated;
}

.card-icon-placeholder {
  width: 40px;
  height: 40px;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 18px;
  margin-bottom: 12px;
}

.card-name {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 14px;
  min-height: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--glow);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--accent2);
}

.btn-secondary:hover {
  background: var(--accent2);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0,212,255,0.4);
}

/* ─── ARTICLES LIST ─── */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
  color: inherit;
}

.article-card::after {
  content: '>';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 20px;
  transition: all 0.2s;
}

.article-card:hover {
  border-color: rgba(0,255,65,0.4);
  background: var(--card-hover);
  box-shadow: 0 0 20px rgba(0,255,65,0.08);
}

.article-card:hover::after {
  color: var(--accent);
  right: 16px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.article-date {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.article-tag {
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  letter-spacing: 1px;
}

.article-title {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.article-preview {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
  opacity: 0.8;
}

/* ─── ARTICLE PAGE ─── */
.article-page {
  display: none;
}

.article-page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  cursor: pointer;
  margin-bottom: 28px;
  font-size: 12px;
  letter-spacing: 1px;
  transition: color 0.2s;
  background: none;
  border: none;
}

.article-back:hover {
  color: var(--accent);
}

.article-full-title {
  font-family: 'Orbitron', monospace;
  font-size: 24px;
  font-weight: 900;
  color: var(--text-bright);
  letter-spacing: 2px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-full-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 1px;
}

.article-body {
  max-width: 760px;
  line-height: 1.8;
}

.article-body h1, .article-body h2, .article-body h3 {
  font-family: 'Orbitron', monospace;
  color: var(--text-bright);
  margin: 28px 0 14px;
  letter-spacing: 2px;
}

.article-body h1 { font-size: 20px; color: var(--accent); }
.article-body h2 { font-size: 16px; border-left: 3px solid var(--accent); padding-left: 12px; }
.article-body h3 { font-size: 14px; color: var(--accent2); }

.article-body p { margin-bottom: 16px; color: var(--text); }

.article-body a { color: var(--accent2); text-decoration: none; border-bottom: 1px solid rgba(0,212,255,0.3); }
.article-body a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.article-body code {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 2px 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
}

.article-body pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

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

.article-body img {
  max-width: 100%;
  border: 1px solid var(--border);
  margin: 16px 0;
}

.article-body blockquote {
  border-left: 3px solid var(--accent3);
  padding: 8px 16px;
  color: var(--text-dim);
  background: var(--bg2);
  margin: 16px 0;
}

.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.article-body li { margin-bottom: 6px; color: var(--text); }

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ─── LINKS GRID ─── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 13px;
  letter-spacing: 1px;
}

/* ─── LOADING ─── */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  letter-spacing: 2px;
  animation: loadingPulse 1.5s ease-in-out infinite;
}

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

/* ─── FOOTER ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .nav-tab { padding: 12px 16px; font-size: 11px; }
  .main-content { padding: 20px 16px; }
  .article-full-title { font-size: 18px; }
  .category-items { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: 1fr; }
}
