/* ==========================================================================
   Félix Pupo Pérez - Cyber Dark Theme Portfolio
   ========================================================================== */

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #111726;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.25);
  --border-accent: rgba(99, 102, 241, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #38bdf8;

  --accent-cyan: #38bdf8;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --gradient-cyber: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #a855f7 100%);
  --gradient-card: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
  --shadow-glow-indigo: 0 0 30px rgba(99, 102, 241, 0.2);
}

/* Base resets & typography */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.row > * {
  min-width: 0;
}

:not(pre) > code,
.inline-code {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

@media (max-width: 575.98px) {
  .badge {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    text-align: center;
    line-height: 1.35;
  }
}

/* Cyber Grid Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -2;
}

/* Ambient glow orbs */
.ambient-glow-1 {
  position: fixed;
  top: -100px;
  left: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.09) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
}

.ambient-glow-2 {
  position: fixed;
  top: 40%;
  right: -100px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
}

/* Typography styles */
h1, h2, h3, h4, h5, h6 {
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: var(--gradient-cyber);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-cyan { color: var(--accent-cyan) !important; }
.text-indigo { color: var(--accent-indigo) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-muted-custom { color: var(--text-secondary); }

.font-mono {
  font-family: var(--font-mono);
}

/* Navbar */
.navbar-custom {
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
  padding: 0.85rem 0;
  z-index: 1030;
}

.navbar-custom.scrolled {
  background: rgba(10, 13, 20, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-bottom-color: rgba(56, 189, 248, 0.2);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
}

.brand-badge {
  background: var(--gradient-cyber);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  letter-spacing: 1px;
}

.nav-link-custom {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  position: relative;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link-custom:hover,
.nav-link-custom.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link-custom.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  border-radius: 2px;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
}

.glass-card-interactive {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.glass-card-interactive:hover {
  color: inherit;
}

/* Badges & Tech Tags */
.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tech-tag:hover {
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-1px);
}

.tech-tag-cyan {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
}

.tech-tag-indigo {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  color: #818cf8;
}

.tech-tag-purple {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.tech-tag-emerald {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
}

.tech-tag-amber {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--accent-amber);
}

.tech-tag-rose {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.25);
  color: #fb7185;
}

/* Live Status Indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: #34d399;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: inherit;
  border-radius: inherit;
  animation: ripple 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes ripple {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* Buttons */
.btn-cyber-primary {
  background: linear-gradient(135deg, #0284c7 0%, #4338ca 50%, #7c3aed 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
}

.btn-cyber-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #3730a3 50%, #6d28d9 100%);
  color: #ffffff !important;
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.45);
}

.btn-cyber-primary i {
  color: #ffffff !important;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
  flex-shrink: 0;
}

.btn-cyber-outline {
  background: rgba(15, 23, 42, 0.75);
  color: #f1f5f9 !important;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
}

.btn-cyber-outline:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
}

.btn-cyber-outline i {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.btn-xs {
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}

/* Breadcrumbs */
.breadcrumb-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
  min-width: 0;
}

.breadcrumb-custom a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-custom a:hover {
  color: var(--accent-cyan);
}

.breadcrumb-custom .separator {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.breadcrumb-custom .active {
  color: var(--accent-cyan);
  font-weight: 500;
}

/* Timeline Components */
.timeline-track {
  position: relative;
  padding-left: 2.25rem;
}

.timeline-track::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent-indigo) 50%, rgba(255, 255, 255, 0.05) 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.25rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.25rem;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  z-index: 2;
}

.timeline-item.active-role::before {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald);
}

/* Section Header */
.section-header {
  margin-bottom: 2.5rem;
}

.section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

/* Stat Box */
.stat-card {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--gradient-cyber);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.35rem;
}

/* Filter Controls */
.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gradient-cyber);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* Sub-section Navigation Cards */
.subpage-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.subpage-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  color: inherit;
}

.subpage-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.subpage-card:hover .subpage-icon {
  background: var(--gradient-cyber);
  color: #fff;
  transform: scale(1.08);
}

/* Profile Avatar & Interactive Hover Photo */
.profile-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.profile-avatar-svg {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
  background: linear-gradient(135deg, #1e293b, #0f172a);
}

.profile-photo-wrapper {
  position: relative;
  display: inline-block;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  padding: 4px;
  background: var(--gradient-cyber);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.35);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.profile-photo-wrapper:hover {
  transform: scale(1.04);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.55), 0 0 15px rgba(56, 189, 248, 0.4);
}

.profile-photo-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-primary);
}

.profile-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 50%;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-serious {
  opacity: 1;
  z-index: 1;
  transform: scale(1);
}

.photo-smile {
  opacity: 0;
  z-index: 2;
  transform: scale(1.04);
}

.profile-photo-wrapper:hover .photo-serious {
  opacity: 0;
  transform: scale(0.96);
}

.profile-photo-wrapper:hover .photo-smile {
  opacity: 1;
  transform: scale(1);
}

.profile-badge-icon {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--bg-primary);
  border: 2px solid var(--accent-emerald);
  color: var(--accent-emerald);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  z-index: 10;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Form Styles */
.form-control-cyber {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}

.form-control-cyber:focus {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  color: #fff;
  outline: none;
}

.form-control-cyber::placeholder {
  color: var(--text-muted);
}

/* Code Snippet Box */
.code-box {
  background: #06090e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #38bdf8;
  overflow-x: auto;
}

/* ==========================================================================
   Blog & Long-Form Article Styles
   ========================================================================== */

/* Blog Card Layout */
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
  color: inherit;
}

.blog-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.blog-hero-featured {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.1);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.blog-hero-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-cyber);
}

/* Article Prose Typography */
.article-prose {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.8;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-prose h2 {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 2.75rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-color);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-prose h3 {
  color: var(--text-highlight);
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-prose p {
  margin-bottom: 1.35rem;
}

.article-prose ul, .article-prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-prose li {
  margin-bottom: 0.5rem;
}

.article-prose strong {
  color: #fff;
  font-weight: 600;
}

.article-prose a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.article-prose a:hover {
  color: #7dd3fc;
}

.article-prose blockquote {
  border-left: 3px solid var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  color: #e2e8f0;
  font-style: italic;
}

/* Enhanced Code Block Container */
.code-block-wrapper {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 0;
}

.code-block-header > span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-block-wrapper pre {
  margin: 0;
  padding: 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
  background: transparent;
}

.code-block-wrapper pre code {
  font-family: var(--font-mono);
  color: #e2e8f0;
  background: transparent;
  padding: 0;
  border: none;
  text-shadow: none;
}

/* Prism Syntax Highlighting - Cyber Dark Theme */
code[class*="language-"],
pre[class*="language-"] {
  font-family: var(--font-mono) !important;
  font-size: 0.88rem;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.6;
  tab-size: 4;
  hyphens: none;
  color: #e2e8f0;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #64748b;
  font-style: italic;
}

.token.punctuation {
  color: #94a3b8;
}

.token.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
  color: #f59e0b;
}

.token.deleted {
  color: #f43f5e;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #34d399;
}

.token.operator,
.token.entity,
.token.url {
  color: #38bdf8;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #c084fc;
}

.token.function,
.token.class-name {
  color: #60a5fa;
  font-weight: 500;
}

.token.regex,
.token.important,
.token.variable {
  color: #fb7185;
}

.token.decorator,
.token.annotation {
  color: #818cf8;
}

.token.important,
.token.bold {
  font-weight: 700;
}

.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

/* YAML & JSON Key Tweaks */
.language-yaml .token.key.atrule {
  color: #38bdf8;
}

.language-json .token.property {
  color: #38bdf8;
}

/* Bash / Shell Tweaks */
.language-bash .token.function {
  color: #38bdf8;
}

.language-bash .token.parameter {
  color: #cbd5e1;
}

.language-bash .token.variable {
  color: #f59e0b;
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #38bdf8;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Copy Code Button */
.btn-copy-code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-copy-code:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* Callouts & Alert Boxes */
.article-callout {
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem;
  margin: 1.75rem 0;
  border-left: 4px solid;
}

.article-callout-info {
  background: rgba(56, 189, 248, 0.08);
  border-left-color: var(--accent-cyan);
  color: #e0f2fe;
}

.article-callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: var(--accent-amber);
  color: #fef3c7;
}

.article-callout-success {
  background: rgba(16, 185, 129, 0.08);
  border-left-color: var(--accent-emerald);
  color: #d1fae5;
}

/* Table of Contents (TOC) */
.toc-card {
  position: sticky;
  top: 90px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-link {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.toc-link:hover, .toc-link.active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border-left-color: var(--accent-cyan);
}

/* GitHub Repo Feature Box */
.github-repo-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.9) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-glow);
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.github-repo-card .row > * {
  min-width: 0;
}

.github-repo-card .d-flex {
  flex-wrap: wrap;
  min-width: 0;
}

.github-repo-card .font-mono,
.github-repo-card .fs-5 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.github-repo-card .btn {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 575.98px) {
  .github-repo-card {
    padding: 1.1rem;
  }

  .github-repo-card .fs-5 {
    font-size: 1.05rem !important;
  }

  .github-repo-card .col-lg-4 {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .github-repo-card .col-lg-4 .btn {
    width: 100%;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    justify-content: center;
  }
}

/* Cyber Dark Tables */
.table-cyber {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.92rem;
}

@media (max-width: 767.98px) {
  .article-prose .table-cyber {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.table-cyber th {
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.table-cyber td {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(17, 24, 39, 0.5);
}

.table-cyber tr:last-child td {
  border-bottom: none;
}

.table-cyber tr:hover td {
  background: rgba(30, 41, 59, 0.6);
  color: #fff;
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 13, 20, 0.9);
  padding: 2.5rem 0 1.5rem 0;
}

/* Animations */
.fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Floating Return to Top Button */
.btn-return-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 0 15px rgba(56, 189, 248, 0.15);
  outline: none;
}

.btn-return-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.btn-return-to-top:hover {
  background: var(--gradient-cyber);
  border-color: transparent;
  color: #ffffff;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.55);
}

.btn-return-to-top:active {
  transform: translateY(-1px) scale(0.96);
}

@media (max-width: 768px) {
  .btn-return-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
}

/* ==========================================================================
   Article Media Lightbox & Zoom Engine
   ========================================================================== */
.article-prose img:not([src*="avatar"]):not(.avatar-img):not(.author-avatar),
.article-cover-img {
  cursor: zoom-in;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.article-prose img:not([src*="avatar"]):not(.avatar-img):not(.author-avatar):hover,
.article-cover-img:hover {
  transform: scale(1.015);
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.modal-shot-viewport {
  position: relative;
  height: calc(100vh - 125px);
  min-height: 450px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05080e;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.modal-shot-viewport.dragging {
  cursor: grabbing;
}

.modal-shot-wrapper {
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.modal-shot-img {
  max-height: 75vh;
  max-width: 90vw;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.85);
  transition: filter 0.2s ease;
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.carousel-nav-btn:hover {
  background: var(--gradient-cyber);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav-btn.prev-btn { left: 18px; }
.carousel-nav-btn.next-btn { right: 18px; }

.zoom-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zoom-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.zoom-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Lightbox Modal & Thumbnail Carousel Responsive Safeguards */
#shotModal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100% !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

#shotModal .modal-dialog {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

@media (min-width: 992px) {
  #shotModal .modal-dialog.modal-xl:not(.modal-fullscreen) {
    width: calc(100% - 2rem) !important;
    max-width: 1200px !important;
    height: calc(100% - 2rem) !important;
    max-height: calc(100% - 2rem) !important;
    margin: 1rem auto !important;
  }
}

#shotModal .modal-content {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#shotModal .modal-header {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  padding: max(0.5rem, env(safe-area-inset-top)) 0.75rem 0.5rem 0.75rem !important;
  z-index: 30 !important;
  background: #0a0d14 !important;
}

#shotModal .modal-header > div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: 1 1 0% !important;
  overflow: hidden !important;
}

#shotModal .modal-header > div:last-child {
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

#shotModal .modal-title,
#shotModalTitle,
#modalShotTitle {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#shotModal .btn-close {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  margin: 0 0 0 4px !important;
  opacity: 0.95 !important;
  background-color: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 6px !important;
  background-size: 0.85em !important;
}

#shotModal .btn-close:hover {
  opacity: 1 !important;
  background-color: rgba(244, 63, 94, 0.35) !important;
  border-color: rgba(244, 63, 94, 0.7) !important;
}

#shotModal .modal-body {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: relative !important;
  box-sizing: border-box !important;
}

#shotModal .modal-shot-viewport {
  flex: 1 1 0% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#shotModal .modal-shot-wrapper {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#shotModal .modal-shot-img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: contain !important;
  display: block !important;
  padding: 8px !important;
  box-sizing: border-box !important;
}

#shotModal .modal-footer,
#shotModal .modal-body > div:not(.modal-shot-viewport) {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.thumb-strip,
#thumbStrip,
#modalThumbStrip {
  display: flex !important;
  gap: 0.5rem;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 0.5rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) rgba(15, 23, 42, 0.6);
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box !important;
}

.thumb-item {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
}

@media (max-width: 991.98px) {
  #shotModal .modal-content {
    border: 0 !important;
    border-radius: 0 !important;
  }

  #fullscreenToggleBtn,
  #modalFullscreen,
  #fullscreenBtn,
  #zoomLevelIndicator {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  #shotModal .modal-header {
    padding: 0.4rem 0.55rem !important;
    gap: 0.35rem !important;
  }

  #shotModal .modal-header > div:first-child {
    gap: 0.35rem !important;
  }

  #shotModal .modal-title,
  #shotModalTitle,
  #modalShotTitle {
    font-size: 0.82rem !important;
  }

  #shotCounter,
  #modalShotCounter,
  #modalIndexBadge,
  #shotModalBadge {
    font-size: 0.65rem !important;
    padding: 0.2em 0.4em !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .zoom-toolbar {
    gap: 3px !important;
  }

  .zoom-btn,
  #modalZoomToggle {
    padding: 0.22rem 0.4rem !important;
    font-size: 0.72rem !important;
  }

  .carousel-nav-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.05rem !important;
  }

  .carousel-nav-btn.prev-btn,
  #prevShotBtn,
  #modalPrevShotBtn,
  #modalPrevBtn {
    left: 8px !important;
  }

  .carousel-nav-btn.next-btn,
  #nextShotBtn,
  #modalNextShotBtn,
  #modalNextBtn {
    right: 8px !important;
  }

  .thumb-strip,
  #thumbStrip,
  #modalThumbStrip {
    padding: 0.35rem 0.5rem !important;
    gap: 0.35rem !important;
  }

  .thumb-item {
    width: 52px !important;
    height: 36px !important;
  }

  #shotModalCaption,
  #modalShotDesc {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    margin-left: 0 !important;
  }
}



