:root {
  --bg-body: #040815;
  --bg-elevated: #070b1f;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.2);
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
  color: var(--text-main);
  line-height: 1.6;
}

/* --- UTILS --- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto; 
  padding: 0 2rem; 
}

/* --- HEADER --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.8rem 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 1.2rem;
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1;
}

/* --- NAV --- */
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: #ccc;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: white;
}

/* --- SEARCH BAR --- */
.header-search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #aaa;
  font-size: 0.9rem;
  pointer-events: none;
}

.header-search-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0.5rem 1rem 0.5rem 2.2rem;
  color: white;
  font-size: 0.9rem;
  width: 200px;
  transition: width 0.3s ease, background 0.3s;
}

.header-search-input:focus {
  width: 280px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
}

/* --- SEARCH OVERLAY --- */
.search-overlay-container {
  position: relative;
  z-index: 999;
}

.search-dropdown {
  display: none; /* Toggled via JS */
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.9);
  overflow: hidden;
}

/* --- MOBILE TOGGLE --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.burger {
  width: 22px;
  height: 2px;
  background: #e5e7eb;
  border-radius: 999px;
}

/* --- HERO --- */
.hero {
  padding: 4.5rem 0 3rem;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-text h2 {
  font-size: 2.35rem;
  margin: 0 0 0.75rem;
}

.hero-text p {
  margin: 0 0 1.8rem;
  color: var(--text-muted);
  max-width: 30rem;
}

.hero-card {
  background: radial-gradient(circle at top left, #111827 0, #020617 55%, #000 100%);
  border-radius: 24px;
  padding: 1.75rem 1.6rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero-tag {
  display: inline-flex;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--accent-soft);
  color: #c7d2fe;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.5);
}

.hero-link {
  position: relative;
  color: #c4b5fd;
  text-decoration: none;
  font-size: 0.9rem;
}

/* --- HIGHLIGHTS --- */
.highlights {
  padding-bottom: 2.5rem;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.highlight-item {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* --- SECTIONS & CARDS --- */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: radial-gradient(circle at top left, #020617 0, #020617 50%, #000 100%);
}

.cards-grid {
  display: grid;
  /* CHANGED: More compact columns (min 300px -> 280px or flexible) */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 1.5rem;
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Double safety */
}

/* --- IMAGE CONTAINER (The Mask) --- */
.card-image-wrapper {
  width: 100%;
  height: 180px; /* Fixed window height */
  border-radius: 8px;
  
  /* CRITICAL FIXES FOR CLIPPING */
  overflow: hidden; 
  position: relative;
  z-index: 1;
  /* Forces browser to clip strict content */
  transform: translateZ(0); 
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  
  margin-bottom: 1rem;
  background: #000;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.4);
}

.card-image-inner {
  width: 100%;
  /* Height is auto to maintain aspect ratio, will be taller than wrapper */
  display: block;
  /* ANIMATION: Move Up and Down */
  animation: scrollImage 12s ease-in-out infinite alternate;
  object-fit: cover;
  min-height: 100%;
  will-change: transform;
}

@keyframes scrollImage {
  0% { transform: translateY(0); } /* Top */
  100% { transform: translateY(calc(-100% + 180px)); } /* Bottom (Height of wrapper) */
}

/* Pauses animation on hover so user can look at details */
.card:hover .card-image-inner {
  animation-play-state: running;
}


/* --- BADGES --- */
.badge {
  display: inline-flex;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border-width: 1px;
  border-style: solid;
}

.badge-news { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.5); color: #7dd3fc; }
.badge-edu { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.5); color: #6ee7b7; }
.badge-tech { background: rgba(129, 140, 248, 0.12); border-color: rgba(129, 140, 248, 0.6); color: #a5b4fc; }
.badge-ent { background: rgba(244, 114, 182, 0.16); border-color: rgba(244, 114, 182, 0.65); color: #f9a8d4; }

/* --- BUTTONS --- */
.btn-primary, .btn-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #a855f7);
  color: #f9fafb;
  box-shadow: 0 16px 35px rgba(79, 70, 229, 0.5);
}

.btn-nav {
  border: 1px solid rgba(79, 70, 229, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: #c7d2fe;
}

/* --- FOOTER --- */
.site-footer {
  padding: 2.5rem 0 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  background: radial-gradient(circle at top, #020617 0, #000 65%);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  padding-top: 0.9rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .hero-content, .newsletter { grid-template-columns: 1fr; }
  .cards-grid, .highlights-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    padding: 1rem;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: flex-start; }
  .cards-grid, .highlights-grid, .footer-grid { grid-template-columns: 1fr; }
}

/* Fix Newsletter Input on all pages */
.newsletter-form input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  outline: none;
  font-family: inherit;
  transition: all 0.3s;
}

.newsletter-form input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.newsletter-form input::placeholder {
  color: #9ca3af;
}