/* ==========================================================================
   CURIOMAS RESEARCH & INNOVATION INSTITUTE (CRII)
   Comprehensive Design System — Light & Dark Mode Engine
   Default: Light Mode
   ========================================================================== */

:root {
  /* LIGHT MODE (Default) */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --nav-bg: rgba(255, 255, 255, 0.82);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --border-color: rgba(226, 232, 240, 0.85);
  --border-subtle: #e2e8f0;
  --border-focus: #2563eb;
  --border-glass: rgba(255, 255, 255, 0.6);

  --accent-primary: #2563eb;       /* Royal Research Blue */
  --accent-secondary: #0284c7;     /* Deep Cyan */
  --accent-tertiary: #6366f1;      /* Indigo */
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-crimson: #dc2626;

  --grad-primary: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
  --grad-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 70%);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-nav: 0 8px 32px 0 rgba(31, 38, 135, 0.08);

  --cursor-ring: rgba(37, 99, 235, 0.4);
  --cursor-dot: #2563eb;
}

[data-theme="dark"] {
  /* DARK MODE */
  --bg-primary: #070a13;
  --bg-surface: #0e1424;
  --bg-card: rgba(14, 20, 36, 0.85);
  --bg-card-hover: rgba(20, 28, 50, 0.95);
  --bg-glass: rgba(11, 17, 32, 0.8);
  --nav-bg: rgba(11, 17, 32, 0.78);

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

  --border-color: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-focus: #38bdf8;
  --border-glass: rgba(255, 255, 255, 0.12);

  --accent-primary: #38bdf8;       /* Bright Cyan */
  --accent-secondary: #818cf8;     /* Stellar Indigo */
  --accent-tertiary: #a855f7;      /* Nebula Purple */
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-crimson: #ef4444;

  --grad-primary: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  --grad-surface: linear-gradient(180deg, #0e1424 0%, #070a13 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12) 0%, transparent 70%);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.6);
  --shadow-nav: 0 12px 36px 0 rgba(0, 0, 0, 0.5);

  --cursor-ring: rgba(56, 189, 248, 0.5);
  --cursor-dot: #38bdf8;
}

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

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  background-image: var(--grad-glow);
  background-attachment: fixed;
}

/* Custom Interactive Scientific Cursor */
.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background-color: var(--cursor-dot);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease-out;
}

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--cursor-ring);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease-out, width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}

.custom-cursor-ring.active {
  width: 48px;
  height: 48px;
  border-color: var(--accent-primary);
  background-color: rgba(37, 99, 235, 0.08);
}

@media (pointer: coarse) {
  .custom-cursor-dot, .custom-cursor-ring {
    display: none !important;
  }
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   FLOATING 85% WIDTH GLASSY NAVBAR
   Separated from top, rounded pill capsule
   ========================================================================== */
.header-wrapper {
  position: sticky;
  top: 1.25rem;
  z-index: 1000;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
  pointer-events: none;
}

.navbar {
  pointer-events: auto;
  width: 85%;
  max-width: 1240px;
  height: 66px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  box-shadow: var(--shadow-nav);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.brand-logo-fallback {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  color: #ffffff;
  flex-shrink: 0;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent-primary);
}

.nav-link.active {
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme Switcher Button */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.theme-icon-sun {
  display: none;
}

.theme-icon-moon {
  display: block;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

/* ==========================================================================
   HERO SECTION WITH VIDEO BACKGROUND
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 5rem;
  overflow: hidden;
  margin-top: -80px; /* Offset under sticky navbar */
  padding-top: 140px;
}

.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.hero-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  filter: contrast(1.1) brightness(0.9);
  transition: opacity 0.5s ease;
}

[data-theme="dark"] .hero-bg-video {
  opacity: 0.28;
  filter: contrast(1.2) brightness(0.85);
}

.hero-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 40%, transparent 0%, var(--bg-primary) 78%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .hero-badge {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.hero-title {
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.hero-title-accent {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-subtitle {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   FEATURED ARTICLES & CONTENT SECTIONS
   ========================================================================== */
.section {
  padding: 5rem 0;
  position: relative;
}

.section-header {
  margin-bottom: 3rem;
  text-align: center;
}

.section-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.75rem;
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 4.5rem 0 2rem;
  margin-top: 6rem;
  transition: all 0.25s ease;
}

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

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 1rem 0;
  max-width: 360px;
}

.footer-col h4 {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   COOKIE CONSENT FLOATING BANNER
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  width: 90%;
  max-width: 620px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  z-index: 10000;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.show {
  transform: translateX(-50%) translateY(0);
}

.cookie-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .navbar {
    width: 92%;
  }
  .hero-title {
    font-size: 3rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .header-wrapper {
    top: 0.75rem;
    padding: 0 0.75rem;
  }
  .navbar {
    width: 96%;
    height: 58px;
    padding: 0 1rem;
    border-radius: 18px;
  }
  .brand-title {
    font-size: 0.88rem;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .nav-menu {
    position: fixed;
    top: 74px;
    left: 2%;
    width: 96%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1rem;
    display: none;
  }
  .nav-menu.show {
    display: flex;
  }
  .hero-section {
    padding-top: 110px;
    min-height: 75vh;
  }
  .hero-title {
    font-size: 2.3rem;
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    width: 94%;
  }
  .cookie-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
