/* ==========================================================================
   REY871.DEV - MODERN TECH & AI BLOG
   Aesthetic: Cyberpunk Minimalist / Dark Tech / Futuristic Neon Glassmorphism
   Designed for Rey 871 (19 years old, Ecuadorian AI Builder // rey871.dev)
   ========================================================================== */

:root {
  --bg-main: #06090f;
  --bg-card: rgba(13, 19, 32, 0.75);
  --bg-card-hover: rgba(18, 27, 45, 0.85);
  --bg-header: rgba(6, 9, 15, 0.85);
  --bg-terminal: #070b12;

  --primary: #00f2fe;
  --primary-glow: rgba(0, 242, 254, 0.35);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --violet: #8b5cf6;
  --violet-glow: rgba(139, 92, 246, 0.3);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(0, 242, 254, 0.3);

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

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Base Reset & Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background Cyber Grid & Glow */
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

.ambient-glow-1 {
  position: absolute;
  top: 5%;
  left: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.ambient-glow-2 {
  position: absolute;
  top: 30%;
  right: 10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--violet-glow) 0%, transparent 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #06090f;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Utility Helpers */
.text-cyan { color: var(--primary); }
.text-emerald { color: var(--emerald); }
.text-violet { color: var(--violet); }
.border-cyan { border-color: var(--primary); }

/* Header & Navigation */
.header-scrolled {
  background-color: var(--bg-header) !important;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
}
.nav-link:hover {
  color: var(--primary);
}
.nav-link:hover::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  border-radius: 2px;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0284c7);
  color: #06090f;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 18px var(--primary-glow);
  transition: all 0.25s ease;
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-hover);
  color: var(--primary);
}

/* Glass Card */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}
.glass-panel:hover {
  border-color: var(--border-hover);
}

/* Terminal Simulator */
.terminal-window {
  background: var(--bg-terminal);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 242, 254, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  background: #0d131f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-body {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  height: 240px;
  overflow-y: auto;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.terminal-line {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.prompt-symbol {
  color: var(--primary);
  font-weight: 600;
  user-select: none;
}

.terminal-output {
  margin-left: 0.5rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.terminal-input-bar {
  background: #090e17;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-input-field {
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 100%;
}

.terminal-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
.terminal-chip:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

/* Category Filter Buttons */
.cat-filter-btn, .proj-filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.cat-filter-btn:hover, .proj-filter-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}
.cat-filter-btn.active, .proj-filter-btn.active {
  background: var(--primary);
  color: #06090f;
  border-color: var(--primary);
  box-shadow: 0 0 14px var(--primary-glow);
}

/* Articles Cards */
.article-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.article-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 242, 254, 0.12);
}

.article-image-box {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.article-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.article-card:hover .article-img {
  transform: scale(1.06);
}
.article-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 19, 32, 0.95) 0%, transparent 60%);
}

.article-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(6, 9, 15, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-tag-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #06090f;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.article-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.article-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.article-excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.tag-pill {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.article-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.author-avatar-small {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: #06090f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
}
.author-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}
.author-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-read-article {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}
.btn-read-article:hover {
  transform: translateX(4px);
}

/* Projects Cards */
.project-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--emerald);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.7), 0 0 20px var(--emerald-glow);
}

.project-img-wrapper {
  position: relative;
  height: 190px;
  overflow: hidden;
}
.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover .project-img {
  transform: scale(1.05);
}
.project-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 19, 32, 0.95) 0%, transparent 50%);
}

.project-cat-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(6, 9, 15, 0.85);
  border: 1px solid var(--border-color);
  color: var(--emerald);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.project-featured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #06090f;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.project-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  align-self: flex-start;
  margin-bottom: 0.75rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.project-subtitle {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.project-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.2rem;
  flex: 1;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}
.stack-badge {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.project-actions {
  display: flex;
  gap: 0.6rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.btn-project-details {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}
.btn-project-details:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--emerald);
  border-color: var(--emerald);
}

.btn-project-demo {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #06090f;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-project-demo:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 14px var(--emerald-glow);
}

/* Tech Stack Grid */
.stack-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.25s ease;
}
.stack-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

.stack-icon-box {
  width: 44px;
  height: 44px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary);
}

.stack-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.stack-cat {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.stack-level-pill {
  font-size: 0.7rem;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Prompt Enhancer Lab */
.prompt-lab-container {
  background: radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.05) 0%, transparent 60%),
              radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 60%),
              var(--bg-card);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.prompt-preset-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.prompt-preset-pill:hover {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.code-output-box {
  background: #05080e;
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content-wrapper {
  background: #090e18;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  max-width: 850px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 242, 254, 0.15);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 19, 32, 0.6);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.modal-close-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.modal-body {
  padding: 2rem 2.25rem;
  overflow-y: auto;
  flex: 1;
}

/* Comments & Interactive Section */
.comment-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}
.comment-author {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.comment-age-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  color: var(--text-muted);
}
.comment-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.comment-text {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.comment-reply {
  margin-top: 1rem;
  background: rgba(0, 242, 254, 0.04);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
}
.reply-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.reply-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #06090f;
  background: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}
.reply-text {
  font-size: 0.84rem;
  color: #e2e8f0;
}

/* Toast Notifications */
.toast-notification {
  background: #0d1424;
  border: 1px solid var(--primary);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), 0 0 20px var(--primary-glow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}
.toast-show {
  transform: translateY(0);
  opacity: 1;
}

/* Code Syntax Styling in Articles */
.code-block-wrapper {
  background: #06090e;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.code-block-header {
  background: #0f1624;
  padding: 0.4rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.code-pre {
  padding: 1rem;
  overflow-x: auto;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .prompt-lab-container {
    padding: 1.5rem;
  }
  .modal-body {
    padding: 1.25rem;
  }
  .terminal-body {
    height: 200px;
  }
}
