/* ==========================================================================
   Custom CSS — Fluxuterra Bespoke Identity
   Refined high-tech aesthetic to differentiate from standard templates.
   ========================================================================== */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --primary: #2dd4bf;
  --primary-dark: #0d9488;
  --accent: #06b6d4;
  --bg-dark: #020617;
  --card-dark: rgba(15, 23, 42, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-muted: #94a3b8;
  --glass-bg: rgba(2, 6, 23, 0.7);
  --noise-opacity: 0.03;
}

/* ---------- Base & Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  scroll-behavior: smooth;
  overflow-x: hidden; /* Prevent horizontal overflow */
  width: 100%;
  position: relative;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

/* Background Noise Texture */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: var(--noise-opacity);
  pointer-events: none;
  z-index: 9999;
}

/* Aura Background Glows */
.aura-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.15) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  transition: transform 0.2s ease-out;
}

@media (max-width: 768px) {
  .aura-glow { width: 300px; height: 300px; filter: blur(50px); }
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* ---------- Navbar (Floating Glass) ---------- */
#navbar {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  padding: 0.75rem 1.5rem;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* =========================================================
   FLOATING LANGUAGE TOGGLE
   ========================================================= */
.floating-lang-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  gap: 0.25rem;
}

.lang-btn {
  background: transparent;
  border: none;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.4);
}

.lang-btn.active {
  background: var(--primary);
  color: #020617;
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
}

@media (max-width: 768px) {
  .floating-lang-toggle {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

@media (max-width: 640px) {
  #navbar {
    width: calc(100% - 2rem);
    padding: 0.6rem 1rem;
    top: 1rem;
  }
}

#navbar.scrolled {
  top: 1rem;
  width: 95%;
  background: rgba(2, 6, 23, 0.9);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

#menu-btn {
  display: none;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.2);
  color: var(--primary);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  #menu-btn { display: flex; }
}

#menu-btn:hover {
  background: rgba(45, 212, 191, 0.2);
  transform: scale(1.05);
}

/* ---------- Mobile Menu Overlay ---------- */
#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(2, 6, 23, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-link {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  transition: color 0.3s ease;
}

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

#close-menu {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

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

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

/* ---------- Hero Section ---------- */
#hero {
  min-height: 100vh;
  padding-top: 8rem;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  #hero { padding-top: 6rem; text-align: center; }
  #hero h1 { font-size: 3rem !important; }
  #hero p { font-size: 1.1rem; margin-left: auto; margin-right: auto; }
  #hero .flex { justify-content: center; }
  .btn-primary, .btn-outline {
    width: 100%;
    justify-content: center;
  }
  .hero-visual-bg { width: 100%; opacity: 0.3; }
}

/* Typography Scale Utilities */
.text-balance {
  text-wrap: balance;
}

@media (max-width: 640px) {
  h1 { font-size: 2.5rem !important; line-height: 1.1; }
  h2 { font-size: 2rem !important; }
  h3 { font-size: 1.5rem !important; }
  .section-label { font-size: 0.65rem !important; }
}

@media (max-width: 480px) {
  #hero h1 { font-size: 2.5rem !important; }
}

.hero-visual-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(45, 212, 191, 0.1) 0%, transparent 60%);
  z-index: -1;
}

.gradient-text {
  background: linear-gradient(to right, #ffffff, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ---------- Bento Grid (Services) ---------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  gap: 1.5rem;
}

.bento-card {
  position: relative;
  background: var(--card-dark);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  width: 100%;
}

.bento-card:hover {
  border-color: rgba(45, 212, 191, 0.3);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.bento-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.3;
  transition: opacity 0.4s ease, transform 0.6s ease;
}

.bento-card:hover .bento-card-bg {
  opacity: 0.5;
  transform: scale(1.1);
}

.bento-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-dark) 20%, transparent 100%);
  z-index: 1;
}

.bento-card-content {
  position: relative;
  z-index: 2;
}

/* Grid Spanning */
.col-span-2 { grid-column: span 2 / span 2; }
.row-span-2 { grid-row: span 2 / span 2; }

@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .bento-grid { 
    grid-template-columns: 1fr !important; 
    grid-auto-rows: auto !important;
    gap: 1rem;
  }
  /* Enforce single column reset for spans */
  .bento-grid .col-span-2, 
  .bento-grid .row-span-2 { 
    grid-column: span 1 / span 1 !important; 
    grid-row: span 1 / span 1 !important;
  }
  .bento-card {
    min-height: 250px;
    padding: 1.5rem;
  }
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--primary);
  color: var(--bg-dark);
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: 100px;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(45, 212, 191, 0.4);
}

.btn-outline {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 100px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(45, 212, 191, 0.05);
}

/* ---------- Text & Utilities ---------- */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
  display: block;
}

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

/* ---------- Marquee ---------- */
.marquee-container {
  overflow: hidden;
  user-select: none;
  display: flex;
  gap: 2rem;
}

@media (max-width: 768px) {
  .marquee-container { gap: 1rem; }
}

.marquee-content {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  gap: 2rem;
  min-width: 100%;
  animation: scroll 30s linear infinite;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100% - 2rem)); }
}

/* ---------- Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

/* ---------- Globe ---------- */
#globe-container {
  width: 100%;
  height: 500px;
  cursor: grab;
}

@media (max-width: 768px) {
  #globe-container { height: 350px; }
}

#globe-container:active {
  cursor: grabbing;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--card-border);
  background: #010409;
}