/* Article Detail - HUD / Dossier Layout
   Uses existing theme primitives from /styles/dark-theme.css
*/

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #ff2e4c;
  color: #0a0e1a;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Cyber Header - matching index.html */
header.cyber-header {
  position: relative;
  z-index: 100;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(10px);
  min-height: 100px;
  display: flex;
  align-items: center;
  padding: 0 2em;
  border-bottom: 2px solid #ff2e4c;
  box-shadow: 
    0 0 20px rgba(255, 46, 76, 0.5),
    0 8px 32px rgba(0, 0, 0, 0.6);
}

.cyber-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.cyber-brand:hover .cyber-logo {
  filter: drop-shadow(0 0 30px rgba(255, 46, 76, 0.5));
  transform: scale(1.05);
}

.cyber-logo {
  height: 56px;
  width: 56px;
  margin-right: 1.5em;
  filter: drop-shadow(0 0 15px rgba(255, 46, 76, 0.5));
  transition: all 0.3s ease;
  will-change: transform, filter;
}

.cyber-title {
  font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  font-size: 2.5em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ff2e4c 0%, #ff6b7a 50%, #ff2e4c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  text-shadow: 0 0 30px rgba(255, 46, 76, 0.5);
  animation: titleGlitch 5s ease-in-out infinite;
  will-change: transform;
}

@keyframes titleGlitch {
  0%, 90%, 100% { transform: translate3d(0, 0, 0); }
  92% { transform: translate3d(-2px, 0, 0); }
  94% { transform: translate3d(2px, 0, 0); }
  96% { transform: translate3d(-1px, 0, 0); }
}

/* Thin glowing scrollbar */
:root {
  scrollbar-color: var(--accent-color) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgb(from var(--accent-color) r g b / 0.45);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(from var(--accent-color) r g b / 0.7);
}

.article-shell {
  width: 100%;
}

.article-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--spacing-2xl);
  align-items: start;
}

@media (max-width: 980px) {
  .article-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
}

.hud-sidebar {
  position: sticky;
  top: calc(var(--spacing-2xl) + 80px);
  align-self: start;
}

@media (max-width: 980px) {
  .hud-sidebar {
    position: static;
  }
}

.hud-sidebar-inner {
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg);
  background: rgb(from var(--bg-color) r g b / 0.55);
  border: 1px solid rgb(from var(--border-color) r g b / 0.85);
  backdrop-filter: blur(10px) saturate(120%);
}

.hud-sidebar-title {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: var(--spacing-md);
}

.hud-toc {
  position: relative;
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-toc::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  bottom: 2px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgb(from var(--text-secondary) r g b / 0.55),
    transparent
  );
}

.hud-toc a {
  display: block;
  padding: 10px 10px;
  margin: 2px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgb(from var(--text-color) r g b / 0.9);
  text-decoration: none;
  border-bottom: none;
  position: relative;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.35;
}

.hud-toc a::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgb(from var(--border-color) r g b / 0.9);
  box-shadow: 0 0 0 0 transparent;
}

.hud-toc a.is-active {
  color: var(--text-secondary);
  text-shadow: 0 0 8px rgb(from var(--text-secondary) r g b / 0.45);
}

.hud-toc a.is-active::before {
  background: var(--text-secondary);
  box-shadow: 0 0 12px rgb(from var(--text-secondary) r g b / 0.6);
}

.hud-download {
  margin-top: var(--spacing-lg);
  display: inline-block;
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--accent-color);
  border: 1px solid rgb(from var(--accent-color) r g b / 0.55);
  padding: 12px 14px;
  border-radius: var(--border-radius-md);
  background: rgb(from var(--bg-color) r g b / 0.35);
}

.hud-download:hover {
  background: rgb(from var(--accent-color) r g b / 0.08);
  box-shadow: 0 0 18px rgb(from var(--accent-glow) r g b / 0.35);
}

.hud-frame {
  position: relative;
  padding: 0;
  border-radius: var(--border-radius-lg);
  background: rgb(from var(--bg-color) r g b / 0.65);
  border: 1px solid rgb(from var(--text-secondary) r g b / 0.24);
  box-shadow: 0 10px 48px rgb(from var(--bg-color) r g b / 0.4);
  backdrop-filter: blur(10px) saturate(120%);
  overflow: clip;
}

/* Interrupted border illusion */
.hud-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      to right,
      transparent 0 16px,
      rgb(from var(--text-secondary) r g b / 0.35) 16px 64px,
      transparent 64px 120px,
      rgb(from var(--text-secondary) r g b / 0.35) 120px 180px,
      transparent 180px 100%
    ) top / 100% 1px no-repeat,
    linear-gradient(
      to right,
      transparent 0 40px,
      rgb(from var(--text-secondary) r g b / 0.22) 40px 92px,
      transparent 92px 160px,
      rgb(from var(--text-secondary) r g b / 0.22) 160px 220px,
      transparent 220px 100%
    ) bottom / 100% 1px no-repeat,
    linear-gradient(
      to bottom,
      transparent 0 18px,
      rgb(from var(--text-secondary) r g b / 0.28) 18px 82px,
      transparent 82px 130px,
      rgb(from var(--text-secondary) r g b / 0.28) 130px 200px,
      transparent 200px 100%
    ) left / 1px 100% no-repeat,
    linear-gradient(
      to bottom,
      transparent 0 36px,
      rgb(from var(--text-secondary) r g b / 0.2) 36px 96px,
      transparent 96px 160px,
      rgb(from var(--text-secondary) r g b / 0.2) 160px 230px,
      transparent 230px 100%
    ) right / 1px 100% no-repeat;
  opacity: 0.95;
}

.hud-corner {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 900;
  color: rgb(from var(--text-secondary) r g b / 0.7);
  font-size: 14px;
  text-shadow: 0 0 10px rgb(from var(--text-secondary) r g b / 0.35);
  pointer-events: none;
}

.hud-corner.tl { left: 10px; top: 8px; }
.hud-corner.tr { right: 10px; top: 8px; }
.hud-corner.bl { left: 10px; bottom: 10px; }
.hud-corner.br { right: 10px; bottom: 10px; }

.hud-progress {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgb(from var(--bg-color) r g b / 0.82);
  border-bottom: 1px solid rgb(from var(--border-color) r g b / 0.7);
}

.hud-progress-bar {
  height: 3px;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--text-secondary),
    var(--accent-color)
  );
  box-shadow: 0 0 16px rgb(from var(--accent-glow) r g b / 0.25);
}

.hud-progress-label {
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgb(from var(--text-color) r g b / 0.85);
  text-transform: uppercase;
}

.hud-inner {
  padding: var(--spacing-2xl);
}

@media (max-width: 600px) {
  .hud-inner {
    padding: var(--spacing-lg);
  }
}

.hud-subject {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: var(--spacing-sm);
}

.hud-title {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  line-height: 1.15;
  margin-bottom: var(--spacing-lg);
}

.hud-meta {
  border-top: 1px solid rgb(from var(--border-color) r g b / 0.75);
  border-bottom: 1px solid rgb(from var(--border-color) r g b / 0.75);
  padding: var(--spacing-md) 0;
  display: grid;
  gap: 8px;
}

.hud-meta-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.hud-meta-row .k {
  color: rgb(from var(--text-color) r g b / 0.7);
  letter-spacing: 0.06em;
}

.hud-meta-row .v {
  color: rgb(from var(--text-color) r g b / 0.92);
}

.hud-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hud-tag {
  font-family: var(--font-mono);
  color: var(--accent-color);
  border: 1px solid rgb(from var(--accent-color) r g b / 0.55);
  padding: 2px 8px;
  border-radius: var(--border-radius-sm);
  background: rgb(from var(--accent-color) r g b / 0.06);
}

.hud-body {
  margin-top: var(--spacing-2xl);
  font-family: var(--font-family);
  color: rgb(from var(--text-color) r g b / 0.92);
  line-height: 1.8;
  font-size: 1.06rem;
}

.hud-body p {
  color: rgb(from var(--text-color) r g b / 0.92);
  line-height: 1.8;
}

.hud-body h2, .hud-body h3 {
  scroll-margin-top: 120px;
}

/* Keyword highlighting: only the keywords look like variables */
.hud-kw {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-shadow: 0 0 10px rgb(from var(--text-secondary) r g b / 0.25);
  font-weight: 700;
}

/* Lists become technical log steps */
.hud-body ul,
.hud-body ol {
  padding-left: 0;
  margin: var(--spacing-md) 0 var(--spacing-lg) 0;
}

.hud-body li {
  list-style: none;
  position: relative;
  padding-left: 44px;
  margin: 10px 0;
}

.hud-body li::before {
  content: ">>";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  color: var(--accent-color);
  letter-spacing: 0.05em;
}

/* Similar block integrates as nodes */
.hud-related {
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgb(from var(--border-color) r g b / 0.75);
}

.hud-related-title {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  margin-bottom: var(--spacing-md);
}

.hud-related a {
  font-family: var(--font-mono);
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid rgb(from var(--accent-color) r g b / 0.6);
}

.hud-related a:hover {
  color: var(--accent-glow);
  border-bottom-color: var(--accent-glow);
}

/* Footer matching index.html */
footer {
  position: relative;
  z-index: 10;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(10px);
  border-top: 2px solid rgba(255, 46, 76, 0.3);
  padding: 2.5rem 2rem;
  text-align: center;
  color: #8a94a6;
  margin-top: 4em;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

footer a {
  color: #ff2e4c;
  text-decoration: none;
  transition: all 0.2s ease;
}

footer a:hover {
  color: #ff6e6a;
  text-shadow: 0 0 8px rgba(255, 46, 76, 0.5);
}
