:root {
  --font-weight: 400;
  --line-height: 1.6;
  --text-color: #333;
  --bg-color: #f8f8f8;
}

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

body {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 18px;
  line-height: var(--line-height);
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.5s ease, color 0.5s ease;
  min-height: 500vh;
}

.app-container {
  min-height: 100%;
  transition: all 0.3s ease;
}

/* Header Styles */
.header-container {
  background: linear-gradient(180deg, #fff 0%, #f8f8f8 100%);
  border-bottom: 1px solid #e0e0e0;
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blog-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 500;
  color: #222;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}

.nav-link:hover {
  color: #333;
}

.header-glitch {
  animation: headerGlitch 0.1s infinite;
}

@keyframes headerGlitch {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* Main Content */
.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
}

@media (max-width: 768px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: none;
  }
}

/* Posts */
.posts-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.post-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.post-image {
  height: 200px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-placeholder {
  font-size: 48px;
  opacity: 0.3;
}

.image-glitch {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    #e8e8e8,
    #e8e8e8 2px,
    #d0d0d0 2px,
    #d0d0d0 4px
  );
  animation: imageGlitch 0.5s infinite;
}

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

.post-content {
  padding: 24px;
}

.post-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: var(--font-weight);
  margin-bottom: 8px;
  color: #222;
  line-height: 1.3;
}

.post-meta {
  font-size: 14px;
  color: #888;
  margin-bottom: 12px;
}

.post-excerpt {
  color: #555;
  line-height: var(--line-height);
}

.post-duplicate {
  border: 2px dashed #ccc;
  background: rgba(255,255,255,0.5);
}

.corrupted-post {
  border-left: 3px solid #8b0000;
  animation: postPulse 2s infinite;
}

.corrupted-post .post-title {
  color: #4a0000;
}

@keyframes postPulse {
  0%, 100% { box-shadow: 0 1px 3px rgba(139,0,0,0.1); }
  50% { box-shadow: 0 1px 10px rgba(139,0,0,0.3); }
}

.post-aware {
  position: relative;
}

.post-aware::after {
  content: '👁';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  opacity: 0.3;
  animation: watchingEye 3s infinite;
}

@keyframes watchingEye {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.sidebar-detached {
  z-index: 50;
}

.sidebar-widget {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sidebar-widget h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #222;
}

.sidebar-widget ul {
  list-style: none;
}

.sidebar-widget li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #666;
}

.sidebar-widget li:last-child {
  border-bottom: none;
}

.sidebar-aware {
  background: #1a1a1a;
  color: #aaa;
}

.sidebar-aware h3 {
  color: #ff6666;
}

.sidebar-aware p {
  font-family: monospace;
  font-size: 12px;
  margin: 4px 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  margin-top: 60px;
}

.site-footer p {
  font-size: 14px;
  color: #888;
  margin-bottom: 8px;
}

.footer-link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #333;
}

/* Scroll Indicator */
.scroll-indicator {
  font-size: 14px;
  font-weight: bold;
  animation: indicatorPulse 1s infinite;
}

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

/* Infinite Content */
.infinite-section {
  padding: 60px 20px;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.infinite-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  color: #4a0000;
  font-style: italic;
}

/* Void Overlay */
.void-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 0%, #000 100%);
  z-index: 1000;
}

/* Fake Error */
.fake-error {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 100, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
}

.error-content {
  background: #fff;
  padding: 40px;
  border-radius: 0;
  text-align: center;
  max-width: 400px;
  border: 2px solid #000;
  box-shadow: 5px 5px 0 #000;
}

.error-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  margin-bottom: 20px;
  color: #c00;
}

.error-content p {
  margin-bottom: 12px;
  font-family: monospace;
}

.error-small {
  font-size: 12px;
  color: #666;
}

.error-content button {
  margin-top: 20px;
  padding: 10px 40px;
  background: #c0c0c0;
  border: 2px outset #fff;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
}

.error-content button:active {
  border-style: inset;
}

.error-hint {
  font-size: 11px;
  color: #999;
  margin-top: 20px;
  font-style: italic;
}

/* Layer-specific overrides */
.layer-2 .post-card:nth-child(3) {
  margin-left: 4px;
}

.layer-3 .post-card {
  animation: layer3Drift 5s infinite ease-in-out;
}

@keyframes layer3Drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

.layer-4 .post-card {
  animation: layer4Pulse 3s infinite;
}

@keyframes layer4Pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(0.95); }
}

.layer-5 {
  animation: layer5Decay 2s infinite;
}

@keyframes layer5Decay {
  0%, 100% { 
    filter: contrast(1) saturate(1);
  }
  33% { 
    filter: contrast(1.05) saturate(0.9);
  }
  66% {
    filter: contrast(0.95) saturate(0.8);
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .blog-title {
    font-size: 22px;
  }
  
  .nav-links {
    gap: 16px;
  }
  
  .nav-link {
    font-size: 12px;
  }
  
  .post-title {
    font-size: 18px;
  }
  
  .post-image {
    height: 150px;
  }
  
  .post-content {
    padding: 16px;
  }
  
  .scroll-indicator {
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Custom scrollbar for desktop */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 6px;
}

.layer-4 ::-webkit-scrollbar-thumb,
.layer-5 ::-webkit-scrollbar-thumb {
  background: #4a0000;
}

.layer-5 ::-webkit-scrollbar-track {
  background: #1a1a1a;
}