/* Cyberpunk Theme - Homepage Optimized */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Orbitron:wght@400;500;700;900&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --dark-bg: #0a0a0a;
  --dark-fg: #ffffff;
  --glass-bg: rgba(10, 10, 10, 0.9);
  --glass-border: rgba(255, 0, 98, 0.3);
  --neon-pink: #ff0062;
  --bright-cyan: #0FF6DF;
  --bright-green: #39DE8D;
  --bright-yellow: #F2F200;
  --electric-purple: #8a1bFF;
  --dark-magenta: #cb0c59;
  --hot-pink: #E60073;
  --acid-green: #B2FF00;

  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --font-display: 'Orbitron', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --shadow: 0 2px 12px rgba(255, 0, 98, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: var(--dark-fg) !important;
  background-color: #000e1b !important;
  background-image: none !important;
}

/* Firefox-specific optimizations */
@-moz-document url-prefix() {
  body {
    background-image: none;
    background: #001a33;
  }

  .bg-layers {
    opacity: 0.08;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
  }

  .bg-layers .grid,
  .bg-layers .scan {
    will-change: auto;
    backface-visibility: hidden;
  }
}

/* ===== BACKGROUND LAYERS ===== */
.bg-layers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Styles for HTML child elements inside .bg-layers */
.bg-layers .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(0, 0, 128, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(0, 31, 63, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.15;
  pointer-events: none;
}

.bg-layers .scan {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(0, 128, 255, 0.03) 15px, rgba(0, 128, 255, 0.03) 16px);
  opacity: 0.1;
  pointer-events: none;
}

/* ===== LAYOUT ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 40px;
}

/* ===== HOME ICON ===== */
.home-icon {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 1001;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  color: #ffffff;
}

.home-icon:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(15, 246, 223, 0.2);
  background: rgba(10, 10, 10, 0.98);
}

.home-icon:focus {
  outline: 2px solid var(--bright-cyan);
  outline-offset: 2px;
}

.home-icon svg {
  fill: currentColor;
}

/* ===== HEADER ===== */
header {
  margin-bottom: 40px;
}

.labels {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px 0;
}

.label {
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(15, 246, 223, 0.08);
  border: 1px solid rgba(15, 246, 223, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.label:hover {
  background: rgba(15, 246, 223, 0.15);
  border-color: rgba(15, 246, 223, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 246, 223, 0.2);
}

.label.active {
  background: rgba(255, 0, 98, 0.15);
  border-color: rgba(255, 0, 98, 0.5);
  color: var(--neon-pink);
  font-weight: 600;
  box-shadow: 0 0 15px rgba(255, 0, 98, 0.3);
}

.label:focus {
  outline: 2px solid var(--bright-cyan);
  outline-offset: 2px;
}

/* ===== HERO SECTION ===== */
.hero {
  text-align: center;
  padding: 60px 20px;
  margin-bottom: 60px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle at center, rgba(255, 0, 98, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(48px, 8vw, 72px);
  color: var(--neon-pink);
  text-shadow:
    0 0 40px rgba(255, 0, 98, 0.8),
    0 0 40px rgba(255, 0, 98, 0.8);
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--neon-pink), var(--bright-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--bright-cyan);
  margin-bottom: 16px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(15, 246, 223, 0.4);
}

.intro {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--dark-fg);
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* ===== CTA BUTTONS ===== */
.cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  min-height: 48px;
  border: 1px solid transparent;
}

.btn.primary {
  background: linear-gradient(135deg, var(--neon-pink), var(--dark-magenta));
  color: white;
  box-shadow: 0 4px 15px rgba(255, 0, 98, 0.3);
}

.btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 0, 98, 0.5);
}

.btn.ghost {
  background: transparent;
  border-color: var(--bright-cyan);
  color: var(--bright-cyan);
}

.btn.ghost:hover {
  background: rgba(15, 246, 223, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(15, 246, 223, 0.3);
}

.btn:focus {
  outline: 2px solid var(--bright-cyan);
  outline-offset: 2px;
}

.btn svg {
  fill: currentColor;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.search-bar:focus-within {
  border-color: var(--bright-cyan);
  box-shadow: 0 0 20px rgba(15, 246, 223, 0.3);
}

.search-bar svg {
  fill: var(--bright-cyan);
  margin-right: 12px;
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--dark-fg);
  font-size: 16px;
  font-family: var(--font-body);
}

.search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* ===== POSTS SECTION ===== */
main {
  margin-bottom: 80px;
}

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.post {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.post::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg,
      rgba(0, 245, 255, 0.3),
      rgba(255, 27, 107, 0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.post:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 0, 98, 0.2);
}

.post:focus-within {
  outline: 2px solid var(--bright-cyan);
  outline-offset: 2px;
}

.post-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 245, 255, 0.2);
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 700;
  color: var(--bright-cyan);
  margin-bottom: 12px;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  opacity: 0.85;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--bright-cyan);
}

.post-meta svg {
  fill: currentColor;
}

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tag {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 246, 223, 0.08);
  border: 1px solid rgba(15, 246, 223, 0.3);
  transition: all 0.3s ease;
  font-weight: 500;
  cursor: pointer;
}

.tag:hover {
  background: rgba(15, 246, 223, 0.15);
  border-color: rgba(15, 246, 223, 0.5);
  transform: scale(1.05);
}

.post-excerpt {
  color: var(--dark-fg);
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--neon-pink);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.read-more:hover {
  gap: 12px;
  text-shadow: 0 0 10px rgba(255, 0, 98, 0.5);
}

.read-more::after {
  content: '→';
  transition: transform 0.3s ease;
}

.read-more:hover::after {
  transform: translateX(4px);
}

/* ===== LOADING & ERROR STATES ===== */
.loading,
.error {
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: var(--bright-cyan);
}

.error {
  color: var(--neon-pink);
}

.error h3 {
  margin-bottom: 16px;
  font-size: 24px;
}

.error p {
  margin-bottom: 20px;
  opacity: 0.9;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--glass-border);
  margin-top: 60px;
}

.social-links {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  box-shadow: var(--shadow);
  color: var(--bright-cyan);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(15, 246, 223, 0.3);
}

.back-to-top:focus {
  outline: 2px solid var(--bright-cyan);
  outline-offset: 2px;
}

.back-to-top svg {
  fill: currentColor;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .container {
    padding: 15px;
    padding-top: 30px;
  }

  .hero {
    padding: 40px 15px;
    margin-bottom: 40px;
  }

  .posts {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .labels {
    gap: 8px;
    padding: 12px 0;
  }

  .label {
    font-size: 13px;
    padding: 8px 16px;
  }

  .cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .home-icon {
    top: 16px;
    left: 16px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .posts {
    grid-template-columns: 1fr;
  }

  .post-cover {
    height: 160px;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --dark-bg: #000000;
    --dark-fg: #ffffff;
    --glass-border: rgba(0, 245, 255, 0.8);
  }

  .post,
  header,
  footer {
    border-color: rgba(0, 245, 255, 0.5);
  }
}

/* ===== PRINT STYLES ===== */
@media print {

  .bg-layers,
  .back-to-top,
  .home-icon,
  .search-bar,
  .labels {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .post {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
