/* ============================================
   1. CSS VARIABLES & THEME
   ============================================ */
:root {
  --graphite-900: #0b0d12;
  --graphite-800: #11131a;
  --graphite-700: #1a1d26;
  --graphite-600: #292d3a;
  --neon-violet: #b026ff;
  --neon-violet-soft: rgba(176, 38, 255, 0.15);
  --neon-cyan: #00f3ff;
  --neon-cyan-soft: rgba(0, 243, 255, 0.15);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Orbitron', 'Segoe UI', sans-serif;
}

/* ============================================
   2. BASE & RESET
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

::selection {
  background: rgba(0, 243, 255, 0.25);
  color: #ffffff;
}

body {
  font-family: var(--font-body);
  background-color: var(--graphite-900);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
}

address {
  font-style: normal;
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(135deg, var(--neon-violet), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   4. UTILITIES & LAYOUT
   ============================================ */
.container {
  width: 90%;
  max-width: 1200px;
  margin-inline: auto;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ============================================
   5. HEADER & NAVIGATION
   ============================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  padding: 1.25rem 0;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease;
}

.site-header.scrolled {
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

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

.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  color: #ffffff;
  letter-spacing: 1px;
  white-space: nowrap;
}

.main-nav ul {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.main-nav a {
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  position: relative;
  transition: color 0.3s ease;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-violet), var(--neon-cyan));
  transition: width 0.35s ease;
}

.main-nav a:hover {
  color: #ffffff;
}

.main-nav a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   6. BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-violet), var(--neon-cyan));
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-3px);
  filter: brightness(1.15);
}

.btn-glow {
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.25), 0 0 10px rgba(176, 38, 255, 0.15);
}

.btn-glow:hover {
  box-shadow: 0 0 35px rgba(0, 243, 255, 0.35), 0 0 60px rgba(176, 38, 255, 0.25);
}

.btn.sent {
  background: linear-gradient(135deg, #22c55e, #06b6d4);
}

/* ============================================
   7. HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, var(--graphite-700), var(--graphite-900) 65%);
  padding: 8rem 0 4rem;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 13, 18, 0.25), rgba(11, 13, 18, 0.92));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.hero-desc {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 2.75rem;
}

/* ============================================
   8. FLOATING DASHBOARDS
   ============================================ */
.dashboards-container {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.dashboard {
  position: absolute;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 1rem;
  color: #ffffff;
  font-family: var(--font-display);
  width: 170px;
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.08);
  pointer-events: none;
}

.dash-header {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.5rem;
}

.dash-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 0.5rem;
}

.dash-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.dash-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--neon-violet), var(--neon-cyan));
  width: 70%;
  animation: dashPulse 3.5s ease-in-out infinite alternate;
}

.dash-1 {
  top: 22%;
  left: 8%;
  animation: float1 7s ease-in-out infinite;
}

.dash-2 {
  top: 34%;
  right: 10%;
  animation: float2 8s ease-in-out infinite;
}

.dash-3 {
  bottom: 22%;
  left: 10%;
  animation: float3 9s ease-in-out infinite;
}

/* ============================================
   9. GLASS SYSTEM
   ============================================ */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.glass-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 243, 255, 0.18);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), 0 0 25px rgba(0, 243, 255, 0.06);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 2.5rem;
}

/* ============================================
   10. SECTIONS & SHARED LAYOUT
   ============================================ */
.section {
  padding: 8rem 0;
  position: relative;
}

.section-header {
  max-width: 600px;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 0.75rem 0 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section-tag {
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--neon-violet);
  font-weight: 700;
}

/* ============================================
   11. ABOUT SECTION
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-text > p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.about-cards {
  display: grid;
  gap: 1.25rem;
}

.about-cards .glass-card {
  padding: 1.5rem;
}

.about-cards h4 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--neon-cyan);
}

.about-cards p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Crystal Lattice (CSS 3D) */
.lattice-wrap {
  width: 320px;
  height: 320px;
  margin-inline: auto;
  perspective: 1000px;
}

.lattice {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: latticeRotate 24s linear infinite;
}

.lattice-plane {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 243, 255, 0.1);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(0, 243, 255, 0.06) 25px),
    repeating-linear-gradient(90deg, transparent, transparent 24px, rgba(0, 243, 255, 0.06) 25px);
}

.lattice-plane:nth-child(1) { transform: translateZ(0); }
.lattice-plane:nth-child(2) { transform: translateZ(40px); }
.lattice-plane:nth-child(3) { transform: translateZ(80px); }
.lattice-plane:nth-child(4) { transform: translateZ(120px); }
.lattice-plane:nth-child(5) { transform: rotateY(90deg) translateZ(160px) scaleX(0.6); }
.lattice-plane:nth-child(6) { transform: rotateY(90deg) translateZ(-160px) scaleX(0.6); }

/* ============================================
   12. PROGRAMS SECTION
   ============================================ */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.program-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--icon-color);
  box-shadow: 0 0 18px var(--icon-color);
  margin-bottom: 1.5rem;
  position: relative;
}

.card-icon::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 6px;
  background: var(--icon-color);
  opacity: 0.35;
}

.program-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.program-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.card-link {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  position: relative;
  width: max-content;
}

.card-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--neon-cyan);
  transition: width 0.3s ease;
}

.card-link:hover::after {
  width: 100%;
}

/* ============================================
   13. MATERIALS LAB SECTION
   ============================================ */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.lab-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.lab-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 243, 255, 0.06);
}

.lab-visual {
  height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lab-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%);
  opacity: 0.12;
}

.holo-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 40px var(--accent);
  position: relative;
  animation: holoSpin 8s linear infinite;
}

.holo-orb::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.35;
  animation: holoPulse 3s ease infinite;
}

.lab-meta {
  padding: 1.5rem;
}

.lab-meta h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

.meta-row {
  margin-top: 0.6rem;
}

.meta-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.meta-value {
  display: block;
  font-size: 0.9rem;
  color: var(--neon-cyan);
  margin-top: 0.15rem;
}

/* ============================================
   14. CONTACT SECTION
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.contact-info h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin: 0.75rem 0 1rem;
}

.contact-info > p {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.info-block {
  display: grid;
  gap: 1.5rem;
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.info-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.info-row a,
.info-row address {
  color: #ffffff;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.info-row a:hover {
  color: var(--neon-cyan);
}

/* ============================================
   15. HOLOGRAPHIC FORM ELEMENTS
   ============================================ */
.contact-form {
  position: relative;
}

.form-group {
  position: relative;
  margin-bottom: 2.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  padding: 1rem 0 0.6rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}

.form-group textarea {
  min-height: 90px;
}

.form-group label {
  position: absolute;
  left: 0;
  top: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: top 0.3s ease, font-size 0.3s ease, color 0.3s ease;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.input-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.input-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-violet), var(--neon-cyan));
  transition: width 0.4s ease;
}

.form-group input:focus ~ .input-line::after,
.form-group textarea:focus ~ .input-line::after {
  width: 100%;
}

/* ============================================
   16. FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner p + p {
  margin-top: 0.5rem;
}

/* ============================================
   17. KEYFRAMES
   ============================================ */
@keyframes float1 {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-18px) translateX(6px); }
}

@keyframes float2 {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(14px) translateX(-6px); }
}

@keyframes float3 {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-12px) translateX(8px); }
}

@keyframes dashPulse {
  0% { width: 30%; }
  100% { width: 90%; }
}

@keyframes latticeRotate {
  0% { transform: rotateX(70deg) rotateZ(0deg); }
  100% { transform: rotateX(70deg) rotateZ(360deg); }
}

@keyframes holoSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes holoPulse {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.25); opacity: 0.6; }
}

/* ============================================
   18. MEDIA QUERIES
   ============================================ */
@media (max-width: 1024px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .lattice-wrap {
    width: 260px;
    height: 260px;
  }

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

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

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: rgba(11, 13, 18, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 6rem;
    transition: right 0.4s ease;
    z-index: 1000;
  }

  .main-nav.open {
    right: 0;
  }

  .main-nav ul {
    flex-direction: column;
    padding: 0 2.5rem;
    gap: 1.75rem;
  }

  .dashboard {
    display: none;
  }

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

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

  .section {
    padding: 5.5rem 0;
  }

  .glass-panel {
    padding: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}