:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-secondary: #0f172a;
  --card: rgba(30, 41, 59, 0.65);
  --text: #f8fafc;
  --subtext: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #3b82f6;
  --secondary: #60a5fa;
  --accent: #38bdf8;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --card: rgba(255, 255, 255, 0.7);
  --text: #020617;
  --subtext: #475569;
  --border: rgba(15, 23, 42, 0.08);
  --primary: #2563eb;
  --secondary: #3b82f6;
  --accent: #0ea5e9;
}

body[data-theme="light"] {
  background: var(--bg);
  color: var(--text);
}

body[data-theme="light"] .bg-slate-950 {
  background-color: var(--bg) !important;
}

body[data-theme="light"] .bg-slate-950\/60,
body[data-theme="light"] .bg-slate-900\/70,
body[data-theme="light"] .bg-slate-900\/80,
body[data-theme="light"] .bg-slate-900\/90 {
  background-color: rgba(255, 255, 255, 0.84) !important;
  color: var(--text) !important;
}

body[data-theme="light"] .bg-white\/5 {
  background-color: rgba(248, 250, 252, 0.82) !important;
}

body[data-theme="light"] .text-white,
body[data-theme="light"] .text-slate-100 {
  color: var(--text) !important;
}

body[data-theme="light"] .text-slate-200 {
  color: var(--subtext) !important;
}

body[data-theme="light"] .text-slate-300 {
  color: var(--subtext) !important;
}

body[data-theme="light"] .text-slate-400 {
  color: #64748b !important;
}

body[data-theme="light"] .border-white\/10 {
  border-color: rgba(15, 23, 42, 0.12) !important;
}

body[data-theme="light"] .shadow-2xl {
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08) !important;
}

body[data-theme="light"] .site-nav.scrolled {
  background: rgba(248, 250, 252, 0.8) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

body[data-theme="light"] .loading-card {
  background: rgba(255, 255, 255, 0.8) !important;
}

body[data-theme="light"] .bg-slate-800 {
  background-color: #e2e8f0 !important;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.12),
      transparent 30%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(56, 189, 248, 0.08),
      transparent 35%
    );
  z-index: -1;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(56, 189, 248, 0.3);
}

.logo-badge,
.nav-link,
.mobile-link,
.card,
.glass-card,
.magnetic,
.btn-ripple {
  transition: all 0.25s ease;
}

.site-nav {
  border-radius: 999px;
  margin-top: 0.75rem;
}

.site-nav.scrolled {
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.28);
}

.glass-card {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.22);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.section-heading {
  max-width: 760px;
}

.section-heading h2 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
}

.hero-title {
  font-family: "Space Grotesk", sans-serif;
}

.nav-link {
  position: relative;
  color: var(--subtext);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 100%;
  height: 1px;
  transform: scaleX(0);
  transform-origin: center;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: transform 0.25s ease;
}

.nav-link.active,
.nav-link:hover {
  color: var(--text);
}

.nav-link.active::after,
.nav-link:hover::after {
  transform: scaleX(1);
}

.mobile-link {
  color: var(--subtext);
}

.mobile-link:hover {
  color: var(--text);
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition:
    opacity 0.6s ease,
    visibility 0.6s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.action-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 70;
  max-width: min(22rem, calc(100vw - 3rem));
  padding: 0.95rem 1rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
  backdrop-filter: blur(18px);
  transform: translateY(18px);
  opacity: 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.action-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 2.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
}

.loading-ring {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.cursor-glow {
  display: none;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 60;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.tilt-card:hover {
  transform: translateY(-2px);
}

.floating-tech {
  position: absolute;
}

.floating-tech-1 {
  top: 10%;
  right: -1.2rem;
}

.floating-tech-2 {
  top: 60%;
  left: -1rem;
  animation-delay: 0.8s;
}

.floating-tech-3 {
  bottom: 10%;
  right: 7%;
  animation-delay: 1.4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: "";
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 0;
  height: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transform: translate(-50%, -50%);
  transition:
    width 0.4s ease,
    height 0.4s ease;
}

.btn-ripple:active::after {
  width: 240px;
  height: 240px;
}

#back-to-top {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

#back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 768px) {
  .floating-tech {
    display: none;
  }

  .loading-card {
    border-radius: 1.5rem;
  }
}

@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;
  }

  .cursor-glow,
  .floating-tech,
  .loading-screen {
    display: none !important;
  }
}
