:root {
  --bg-color: #030303;
  --surface-color: #0f0f0f;
  --surface-hover: #161616;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent-color: #39ff14;
  --border-color: rgba(255,255,255,0.08);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --header-height: 80px;
  --container-width: 1400px;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--accent-color); }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(3, 3, 3, 0.8);
  backdrop-filter: blur(20px);
  /* Removed border */
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.header-inner {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.brand-logo {
  height: 28px;
  display: block;
  filter: invert(1);
}

.brand-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-x {
  color: var(--accent-color);
}

.main-nav {
  display: flex;
  gap: 2.5rem;
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  transition: all 0.2s;
}

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

.nav-link svg {
  opacity: 0.7;
}

.nav-link:hover svg, .nav-link.active svg {
  opacity: 1;
  color: var(--accent-color);
}

/* Mobile Controls */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-nav-header {
  display: none;
}

/* Layout */
.content-wrapper {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + 2rem) 2rem 6rem;
  min-height: 100vh;
}

/* Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  grid-auto-rows: 350px;
}

/* Card Styles */
.news-item {
  position: relative;
  background: var(--surface-color);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  /* Removed border */
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
}

.news-item:hover {
  transform: translateY(-4px);
  background: var(--surface-hover);
  /* Smoother shadow instead of border */
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

/* Thumbnail */
.news-thumb-wrapper {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.news-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  filter: brightness(0.8);
}

.news-item:hover .news-thumb {
  transform: scale(1.05);
  filter: brightness(1);
}

/* Overlay Content (For Image Cards) */
.news-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  pointer-events: none;
}

/* Text Content */
.news-meta {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.news-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1.3;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Card Variants */
.card-hero {
  grid-column: span 2;
  grid-row: span 2;
}

.card-hero .news-title {
  font-size: 2.5rem;
  line-height: 1.1;
}

.card-featured {
  grid-column: span 1;
  grid-row: span 1;
}

/* Article View */
.article-view {
  animation: fadeIn 0.4s ease;
  width: 100%;
  /* Removed negative margin to prevent hiding behind header */
}

.article-header-block {
  text-align: center;
  max-width: 900px;
  margin: 4rem auto 3rem;
  padding: 0 1rem;
}

.article-meta-badge {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: var(--accent-color);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.75rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(57, 255, 20, 0.2);
}

.article-title {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.article-info {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-hero-img-container {
  width: 100%;
  max-width: 1200px;
  height: 600px;
  margin: 0 auto 4rem;
  border-radius: 24px; /* Softer radius */
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  /* Removed border */
}

.article-hero-container {
  width: 100vw;
  height: 85vh;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  margin-bottom: 0;
  /* Removed negative margin-top */
}

.article-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body-container {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.2rem;
  color: #ccc;
  line-height: 1.8;
}

.article-body p { margin-bottom: 2rem; }
.article-body h2 { color: #fff; font-size: 2rem; margin: 3rem 0 1.5rem; }
.article-body img { width: 100%; height: auto; border-radius: 12px; margin: 2rem 0; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.article-body a { color: var(--accent-color); border-bottom: 1px solid rgba(57, 255, 20, 0.3); }

.source-btn {
  display: inline-block;
  margin-top: 3rem;
  padding: 1rem 2.5rem;
  background: var(--text-primary);
  color: #000;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  transition: transform 0.2s;
}

.source-btn:hover {
  transform: scale(1.05);
  color: #000;
}

/* X Banner */
.x-banner {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 2000;
  width: calc(100% - 4rem);
  max-width: 500px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 0.8rem 1rem 0.8rem 0.8rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: slideUpBanner 0.5s cubic-bezier(0.2, 0, 0, 1) 2s forwards;
}

@keyframes slideUpBanner {
  to { transform: translateX(-50%) translateY(0); }
}

.x-banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.x-logo-circle {
  width: 40px;
  height: 40px;
  background: #fff;
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.x-text {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.x-text span:first-child {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
  color: #fff;
}

.x-text strong {
  font-weight: 800;
}

.x-sub {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.x-follow-btn {
  background: #fff;
  color: #000;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  transition: all 0.2s ease;
}

.x-follow-btn:hover {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
  transform: translateY(-1px);
}

.x-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}

.x-close-btn:hover {
  color: #fff;
}

/* Floating Share Bar */
.floating-share-bar {
  position: fixed;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
  animation: fadeIn 0.5s ease 0.5s forwards;
  opacity: 0;
}

.share-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.2s ease;
  cursor: pointer;
}

.share-icon:hover {
  transform: translateX(5px);
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
}

.share-icon.twitter:hover { background: #000; color: #fff; border-color: #fff; }
.share-icon.facebook:hover { background: #1877F2; color: #fff; }
.share-icon.reddit:hover { background: #FF4500; color: #fff; }

/* Footer */
.site-footer {
  background: #000;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  text-align: center;
}

.footer-content {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.footer-brand {
  margin-bottom: 1rem;
}

.footer-tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.footer-links a:hover {
  color: var(--accent-color);
}

.footer-copyright {
  color: #444;
  font-size: 0.8rem;
  margin-top: 1rem;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Loader */
.loader { height: 50vh; display: flex; align-items: center; justify-content: center; }
.spinner { width: 40px; height: 40px; background: var(--accent-color); animation: rotate 1s infinite; }
@keyframes rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(90deg); } }

/* Responsive */
@media (max-width: 1200px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .card-hero { grid-column: span 2; grid-row: span 2; }
}

@media (max-width: 1024px) {
  .floating-share-bar {
    left: 50%;
    top: auto;
    bottom: 2rem;
    transform: translateX(-50%);
    flex-direction: row;
    background: rgba(10, 10, 10, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.1);
  }
  
  .share-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
  }
  
  .share-icon:hover {
    transform: translateY(-5px);
  }
  
  /* Hide X Banner on mobile articles to prevent overlap */
  .article-view ~ .x-banner {
    display: none;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: #000;
    flex-direction: column;
    padding: 2rem;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(255,255,255,0.1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
    z-index: 1001;
    align-items: flex-start;
    gap: 1.5rem;
  }

  body.menu-open .main-nav {
    right: 0;
  }
  
  /* Overlay when menu open */
  body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
  }

  .mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .mobile-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
  }

  .nav-link {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
  }
  
  .nav-link.active {
    background: rgba(57, 255, 20, 0.1);
    color: var(--accent-color);
  }

  .news-grid { grid-template-columns: 1fr; }
  .card-hero { grid-column: 1; grid-row: auto; aspect-ratio: 16/9; }
  .article-title { font-size: 2.5rem; }
  .article-hero-img-container { height: 300px; border-radius: 0; width: 100vw; margin-left: -1rem; }
  .content-wrapper { padding: calc(var(--header-height) + 1rem) 1rem 4rem; }
}
