/* =========================================
   1. CSS Variables & Base Settings
   ========================================= */
:root {
  --bg-deep: #020617;
  --bg-surface: #0f172a;
  --bg-elevated: #1e293b;
  --primary: #22d3ee;
  --primary-dim: rgba(34, 211, 238, 0.15);
  --secondary: #3b82f6;
  --accent: #0ea5e9;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(34, 211, 238, 0.12);
  --glass-bg: rgba(15, 23, 42, 0.5);
  --radius: 16px;
  --transition: all 0.35s ease;
  --font-body: 'Inter', sans-serif;
  --font-display: 'Orbitron', sans-serif;
}

/* =========================================
   2. Reset & Typography
   ========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

p {
  margin-bottom: 1rem;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* =========================================
   3. Utilities & Reusable Components
   ========================================= */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 2.2rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--bg-deep);
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.25);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 45px rgba(34, 211, 238, 0.35);
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   4. Layout Grids
   ========================================= */
.grid {
  display: grid;
  gap: 2rem;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* =========================================
   5. Section Headers
   ========================================= */
.section {
  padding: 6rem 0;
  position: relative;
}

.section__header {
  margin-bottom: 3.5rem;
  text-align: center;
}

.section__label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.section__title {
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #bae6fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section__subtitle {
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 600px;
  font-size: 1.05rem;
}

/* =========================================
   6. Header & Navigation
   ========================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.25rem 0;
  transition: var(--transition);
}

.header.scrolled {
  padding: 0.75rem 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
}

.logo__icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.logo__text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.logo__accent {
  color: var(--primary);
}

.nav__list {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.nav__link {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  position: relative;
  transition: var(--transition);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav__link:hover,
.nav__link.active {
  color: var(--primary);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

.nav__toggle.active .hamburger {
  background: transparent;
}

.nav__toggle.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav__toggle.active .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* =========================================
   7. Hero Section
   ========================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #0f172a 0%, #020617 70%);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__decoration {
  position: absolute;
  top: 50%;
  right: 10%;
  transform: translateY(-50%);
  z-index: 1;
  opacity: 0.6;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero__title {
  margin-bottom: 1.25rem;
  background: linear-gradient(to right, #ffffff, #a5f3fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 540px;
  line-height: 1.7;
}

/* Holographic 3D Cube */
.scene {
  width: 220px;
  height: 220px;
  perspective: 800px;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateCube 25s infinite linear;
}

.face {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 2px solid rgba(34, 211, 238, 0.35);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(59, 130, 246, 0.08));
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.1) inset;
  backface-visibility: visible;
}

.face:nth-child(1) {
  transform: rotateY(0deg) translateZ(110px);
}

.face:nth-child(2) {
  transform: rotateY(90deg) translateZ(110px);
}

.face:nth-child(3) {
  transform: rotateY(180deg) translateZ(110px);
}

.face:nth-child(4) {
  transform: rotateY(-90deg) translateZ(110px);
}

.face:nth-child(5) {
  transform: rotateX(90deg) translateZ(110px);
}

.face:nth-child(6) {
  transform: rotateX(-90deg) translateZ(110px);
}

@keyframes rotateCube {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  100% {
    transform: rotateX(360deg) rotateY(720deg);
  }
}

/* =========================================
   8. About Section
   ========================================= */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about__text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.about__list {
  list-style: none;
  margin-top: 1.5rem;
}

.about__list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.about__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stat-card {
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.12);
}

.stat-card__value {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-card__label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* =========================================
   9. Programs Section
   ========================================= */
.programs {
  background: linear-gradient(to bottom, var(--bg-deep), #0b1224);
}

.card {
  padding: 2.5rem 2rem;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.5), 0 0 25px rgba(34, 211, 238, 0.15);
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.card__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
}

.card__title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.card__text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* =========================================
   10. Lab / Gallery Section
   ========================================= */
.lab {
  background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 40%),
              radial-gradient(circle at bottom left, rgba(34, 211, 238, 0.05), transparent 40%);
}

.project-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.6);
}

.project-card__visual {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card__badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--primary);
  border: 1px solid var(--border);
}

.project-card__meta {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.project-card__content {
  padding: 1.5rem;
}

.project-card__title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.project-card__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =========================================
   11. Contacts Section
   ========================================= */
.contacts__grid a {
  text-decoration: none;
  color: inherit;
}

.contact-card {
  padding: 2.5rem 2rem;
  text-align: center;
  transition: var(--transition);
}

.contact-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 35px rgba(34, 211, 238, 0.15);
}

.contact-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.5rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid var(--border);
}

.contact-card__icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
}

.contact-card__title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.contact-card__info {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =========================================
   12. Footer
   ========================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
}

.footer__copy {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.footer__location {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.6);
}

/* =========================================
   13. Responsive Media Queries
   ========================================= */
@media (max-width: 992px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__decoration {
    right: 5%;
    opacity: 0.35;
    transform: translateY(-50%) scale(0.75);
  }
}

@media (max-width: 768px) {
  .nav__list {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: rgba(2, 6, 23, 0.97);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    transition: right 0.35s ease;
    padding: 2rem 0;
  }

  .nav__list.active {
    right: 0;
  }

  .nav__toggle {
    display: block;
  }

  .grid--4,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .hero__decoration {
    display: none;
  }

  .hero {
    padding-top: 6rem;
  }

  .about__stats {
    grid-template-columns: 1fr 1fr;
  }

  .section {
    padding: 4rem 0;
  }
}

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

  .hero__title {
    font-size: 2rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }
}