:root {
  --bg: #05080f;
  --bg-elevated: rgba(12, 16, 28, 0.95);
  --accent: #4dc9ff;
  --accent-secondary: #2d7fff;
  --accent-soft: rgba(77, 201, 255, 0.1);
  --accent-glow: rgba(77, 201, 255, 0.35);
  --text-main: #f0f4f8;
  --text-secondary: #c8d4e0;
  --text-muted: #7a8a9a;
  --border-subtle: rgba(77, 201, 255, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 50px rgba(77, 201, 255, 0.12);
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: linear-gradient(145deg, #05080f 0%, #0a1020 50%, #05080f 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

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

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

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.96),
    rgba(0, 0, 0, 0.7),
    transparent
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 450;
}

.nav-links a {
  color: var(--text-muted);
  padding: 6px 0;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple));
  transition: width 0.2s ease-out;
}

.nav-links a:hover {
  color: var(--text-main);
}

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

.btn-outline {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  padding: 6px 16px;
  color: var(--text-main);
  margin-left: 8px;
  font-size: 0.85rem;
}

.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(0, 240, 255, 0.08);
}

/* Language Switch Button */
.lang-switch {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  margin-left: 8px;
}

.lang-switch:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

/* Nav Contact Link */
.nav-contact {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

.nav-contact:hover {
  color: var(--text-main);
}

/* Hero */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  overflow: hidden;
}

#ai-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
  background: radial-gradient(ellipse at center, #0d1525 0%, #0a0a0f 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  text-align: center;
  margin-top: 40px;
  pointer-events: none;
}

.hero-content a,
.hero-content button {
  pointer-events: auto;
}

.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-logo {
  font-size: clamp(4rem, 12vw, 7rem);
  margin: 0;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-shadow: 0 0 60px var(--accent-glow),
               0 0 100px rgba(45, 127, 255, 0.2);
  font-weight: 500;
  margin-bottom: 24px;
  position: relative;
  animation: heroGlow 4s ease-in-out infinite, heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes heroGlow {
  0%, 100% {
    text-shadow: 0 0 40px var(--accent-glow),
                 0 0 80px rgba(0, 102, 255, 0.3);
  }
  50% {
    text-shadow: 0 0 60px var(--accent),
                 0 0 120px var(--accent-glow),
                 0 0 180px rgba(0, 102, 255, 0.2);
  }
}

.hero-section h1 {
  font-size: clamp(4rem, 10vw, 6rem);
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.6),
               0 0 80px rgba(255, 255, 255, 0.3);
  font-weight: 700;
}

.hero-subtitle {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0;
  min-height: 1.8em;
  opacity: 1;
}

/* Typewriter cursor */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 1s ease-in-out infinite;
}

@keyframes cursorBlink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
  animation: fadeInUp 1.2s ease-out 0.6s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-primary,
.btn-ghost {
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  color: #0a1020;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.25);
}

.btn-ghost {
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--text-main);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--accent-glow);
}

.scroll-indicator {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mouse {
  width: 24px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  position: relative;
}

.mouse::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: #ffffff;
  animation: scroll-dot 1.4s ease-in-out infinite;
}

@keyframes scroll-dot {
  0% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  70% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* Sections */
.section {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 96px 20px 40px;
}

.section-header {
  text-align: left;
  max-width: 640px;
  margin-bottom: 36px;
  position: relative;
}

.section-header h2 {
  font-size: 1.5rem;
  margin: 0 0 8px;
  font-weight: 500;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

/* Section header smooth reveal */
.section-header.reveal.revealed {
  animation: smoothReveal 0.6s ease-out forwards;
}

/* Scroll Reveal Animations - Smooth */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  will-change: transform, opacity;
}

.reveal.revealed {
  animation: smoothReveal 0.6s ease-out forwards;
}

/* Smooth reveal - no bounce */
@keyframes smoothReveal {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered card animation */
.tech-card.reveal {
  --stagger-delay: calc(var(--card-index, 0) * 0.08s);
}

.tech-card.reveal.revealed {
  animation: cardSmoothReveal 0.7s ease-out forwards;
  animation-delay: var(--stagger-delay);
}

@keyframes cardSmoothReveal {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Technology cards */
.tech-section {
  margin-top: 40px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tech-card {
  padding: 48px 36px;
  background: radial-gradient(
      circle at top left,
      rgba(0, 212, 255, 0.08),
      transparent 60%
    ),
    rgba(10, 12, 20, 0.95);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.tech-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top right,
    rgba(0, 102, 255, 0.15),
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

.tech-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), var(--shadow-glow);
}

.tech-card:hover::before {
  opacity: 1;
}

.tech-number {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 80px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.03);
  line-height: 1;
  pointer-events: none;
  transition: all 0.4s ease;
}

.tech-card:hover .tech-number {
  color: rgba(255, 255, 255, 0.08);
  transform: scale(1.1);
}

.tech-animation {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 180px;
  position: relative;
  z-index: 1;
}

.tech-svg {
  width: 180px;
  height: 180px;
  filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.3));
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tech-card:hover .tech-svg {
  transform: scale(1.15) rotate(3deg);
  filter: drop-shadow(0 0 35px rgba(0, 212, 255, 0.6));
}

.tech-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
  letter-spacing: 0;
  font-weight: 500;
}

.tech-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
  position: relative;
  z-index: 1;
  font-weight: 400;
}

/* Partners */
.partners-section {
  margin-top: 40px;
}

.partners-horizontal {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 80px;
  padding: 50px 40px;
  background: transparent;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.partners-horizontal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 212, 255, 0.05) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* Partners physics reveal */
.partners-horizontal.reveal.revealed {
  animation: smoothReveal 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.partner-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}

.partner-logo-card:hover {
  transform: translateY(-4px);
}

.partner-logo-img {
  height: 50px;
  object-fit: contain;
  opacity: 0.6;
  transition: all 0.4s ease;
  filter: grayscale(1) brightness(1.5);
}

.partner-logo-card:hover .partner-logo-img {
  opacity: 0.9;
  filter: grayscale(0) brightness(1);
}

/* Footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 40px;
  padding: 24px 20px 22px;
  background: radial-gradient(
      circle at top,
      rgba(255, 255, 255, 0.08),
      transparent 55%
    ),
    rgba(0, 0, 0, 0.96);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.footer-right {
  text-align: right;
}

.footer-link {
  color: #ffffff;
  font-size: 0.85rem;
}

.footer-bottom {
  max-width: 1120px;
  margin: 0 auto;
  text-align: left;
  font-size: 0.75rem;
  color: rgba(154, 160, 194, 0.8);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  transition: all 0.3s ease;
  z-index: 100;
}

.mobile-menu-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--text-main);
  transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* NUS Logo special styling */
.nus-logo {
  filter: grayscale(1) brightness(1.5) !important;
}

.partner-logo-card:hover .nus-logo {
  filter: grayscale(0) brightness(1) !important;
}

/* Responsive */
@media (max-width: 900px) {
  .mobile-menu-btn {
    display: flex;
  }

  .nav-inner {
    padding-inline: 16px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 8px;
    transition: background 0.3s ease;
  }

  .nav-links a:hover {
    background: rgba(0, 212, 255, 0.1);
  }

  .lang-switch {
    margin-left: 0;
    padding: 12px 16px;
    width: 100%;
    text-align: center;
  }

  .section {
    padding-top: 80px;
  }

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

  .tech-number {
    font-size: 60px;
  }

  .partners-horizontal {
    flex-direction: column;
    gap: 40px;
    padding: 40px 30px;
  }

  .partner-logo-img {
    height: 50px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-right {
    text-align: left;
  }
}

@media (max-width: 600px) {
  .hero-content {
    text-align: left;
  }

  .hero-subtitle {
    font-size: 0.92rem;
  }

  .hero-cta {
    justify-content: flex-start;
  }

  .scroll-indicator {
    left: 20px;
    transform: none;
    align-items: flex-start;
  }

  .tech-card {
    padding: 30px 24px;
  }

  .tech-number {
    font-size: 50px;
    top: 16px;
    right: 16px;
  }
}

/* Footer smooth reveal */
.footer-inner.reveal.revealed {
  animation: smoothReveal 0.7s ease-out forwards;
}

/* Smooth page load */
body {
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #0a0a0f 0%, #0d1117 50%, #0a0a0f 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Footer link hover */
.footer-link {
  color: #ffffff;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

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

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

