/* ==========================================================================
   VISLY STUDIO — FINAL MASTERPIECE (SECURED)
   ========================================================================== */

:root {
  --bg-main: #0a0404; 
  --bg-alt: #120606; 
  --card-bg: rgba(22, 10, 10, 0.65);
  
  --border-subtle: rgba(255, 94, 0, 0.2);
  --border-hover: rgba(255, 94, 0, 0.5);
  
  --text-main: #ffffff;
  --text-muted: #bda2b1;
  --text-dim: #8b7582;

  --visly-grad: linear-gradient(135deg, #ff5e00, #ff004c);
  --studio-grad: linear-gradient(135deg, #8b5cf6, #d946ef);
  --gradient-btn: linear-gradient(135deg, #ff5e00, #ff004c);
  --accent-orange: #ff5e00;
  --accent-red: #ff004c;

  --aurora-1: rgba(255, 0, 76, 0.25);
  --aurora-2: rgba(255, 94, 0, 0.2);
  --aurora-3: rgba(139, 92, 246, 0.15);

  --font-sig: 'Italianno', cursive;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

[data-theme="light"] {
  --bg-main: #fdf5f2; 
  --bg-alt: #f7e6e1;  
  --card-bg: rgba(255, 255, 255, 0.7);
  
  --border-subtle: rgba(255, 94, 0, 0.2);
  --border-hover: rgba(255, 94, 0, 0.5);

  --text-main: #1f0b0f;
  --text-muted: #6b5a61;
  --text-dim: #9ca3af;

  --visly-grad: linear-gradient(135deg, #d9003f, #e65c00);
  --studio-grad: linear-gradient(135deg, #6d28d9, #9333ea);
  --gradient-btn: linear-gradient(135deg, #e65c00, #d9003f);
  --accent-orange: #d9003f;
  --accent-red: #e65c00;

  --aurora-1: rgba(217, 0, 63, 0.15);
  --aurora-2: rgba(230, 92, 0, 0.1);
  --aurora-3: rgba(255, 183, 0, 0.1);
}

/* ==========================================================================
   HACKER PROTECTION (ANTI-COPY/ANTI-DRAG)
   ========================================================================== */
body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease;
  
  /* Disables text selection */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none; 
}

img, svg { -webkit-user-drag: none; }

input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ==========================================================================
   RESET & LAYOUT FIXES (HORIZONTAL LOCK)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* MASTER FIX: Strict overflow hidden to completely block mobile side-shifting */
html, body { 
  width: 100%; 
  max-width: 100vw; 
  overflow-x: hidden !important; 
  scroll-behavior: smooth; 
  -webkit-overflow-scrolling: touch;
}

main { overflow-x: hidden !important; width: 100%; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 10; }

/* ==========================================================================
   FLAWLESS MESH BACKGROUND
   ========================================================================== */
.mesh-bg {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: -3; overflow: hidden; background: var(--bg-main);
  transition: background 0.4s ease;
}

.mesh-blob {
  position: absolute; border-radius: 50%; filter: blur(90px);
  animation: float-blob 12s infinite alternate ease-in-out;
}

.color-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: var(--aurora-1); animation-delay: 0s; }
.color-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: var(--aurora-2); animation-delay: -4s; }
.color-3 { top: 40%; left: 60%; width: 45vw; height: 45vw; background: var(--aurora-3); animation-delay: -8s; }

.color-cursor {
  width: 400px; height: 400px; background: var(--aurora-1);
  opacity: 0.8; transition: top 0.3s ease-out, left 0.3s ease-out; 
  pointer-events: none; transform: translate(-50%, -50%);
  animation: none; 
}

@keyframes float-blob {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 10%) scale(1.1); }
  100% { transform: translate(-5%, -5%) scale(0.9); }
}

.noise-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  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: 0.04; z-index: -2; pointer-events: none;
}

/* ==========================================================================
   FIXED NAVBAR
   ========================================================================== */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 9999;
  background: rgba(10, 4, 4, 0.85); 
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle); transition: background-color 0.3s;
}
[data-theme="light"] .navbar { background: rgba(253, 246, 242, 0.85); }

.nav-container {
  max-width: 1140px; margin: 0 auto; padding: 8px 24px; 
  display: flex; align-items: center; justify-content: space-between;
}

.nav-brand { text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.nav-logo-visly {
  font-family: var(--font-sig); font-size: clamp(2rem, 5vw, 2.5rem); line-height: 1; padding-bottom: 0.1em;
  background: var(--visly-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-logo-studio {
  font-family: var(--font-heading); font-size: clamp(0.7rem, 2vw, 0.85rem); font-weight: 800; letter-spacing: 0.25em;
  background: var(--studio-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-menu { display: flex; gap: 32px; }
.nav-link { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: 0.3s; }
.nav-link:hover { color: var(--text-main); }
.nav-actions { display: flex; align-items: center; gap: 16px; }

.theme-btn {
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.theme-btn:hover { background: rgba(255, 94, 0, 0.1); }
.sun-icon { display: none; width: 22px; height: 22px; }
.moon-icon { display: block; width: 22px; height: 22px; }
[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

.btn-nav {
  padding: 8px 20px; border-radius: 100px; font-weight: 600; text-decoration: none;
  background: rgba(255, 94, 0, 0.1); color: var(--text-main); border: 1px solid var(--border-subtle); transition: 0.3s;
}
.btn-nav:hover { background: var(--gradient-btn); color: #fff; border-color: transparent; }

.hamburger { display: none; background: transparent; border: none; color: var(--text-main); cursor: pointer; }

/* ==========================================================================
   MOBILE DRAWER (SOLID PROFESSIONAL BACKGROUND)
   ========================================================================== */
.mobile-drawer {
  position: fixed; top: 0; right: -100%; 
  width: 80%; max-width: 350px; height: 100vh;
  background: #060202; 
  z-index: 10000; display: flex; flex-direction: column; padding: 32px 24px;
  transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1); box-shadow: -20px 0 60px rgba(0,0,0,0.9);
}
[data-theme="light"] .mobile-drawer { background: #fdf5f2; }
.mobile-drawer.active { right: 0; }

.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 50px; }
.close-btn { background: transparent; border: none; color: var(--text-main); cursor: pointer; }
.drawer-links { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.mobile-link { font-size: 1.5rem; font-weight: 700; color: var(--text-main); text-decoration: none; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary {
  padding: 16px 36px; background: var(--gradient-btn); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 100px; font-weight: 700; font-size: 1rem; text-decoration: none; border: none;
  box-shadow: 0 8px 24px rgba(255, 94, 0, 0.3); cursor: pointer; transition: 0.3s;
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(255, 94, 0, 0.5); transform: translateY(-2px); }
.btn-primary:active, .btn-service:active, .btn-portfolio:active {
  background: var(--accent-red) !important; transition: 0s !important; transform: scale(0.95) !important; box-shadow: none !important;
}

.btn-secondary {
  padding: 16px 36px; background: var(--card-bg); border: 1px solid var(--border-subtle);
  color: var(--text-main); border-radius: 100px; font-weight: 600; text-decoration: none; transition: 0.3s;
}
.btn-secondary:hover { border-color: var(--accent-orange); color: var(--accent-orange); }

.btn-service {
  width: 100%; padding: 14px 0; margin-top: auto; background: rgba(255, 94, 0, 0.1); border: 1px solid var(--border-subtle);
  color: var(--text-main); font-weight: 600; font-size: 0.95rem; border-radius: 8px; cursor: pointer; transition: 0.3s;
}
.btn-service:hover { background: var(--gradient-btn); color: #fff; border-color: transparent; }

.btn-portfolio {
  display: inline-block; padding: 14px 24px; border-radius: 8px; width: 100%; text-align: center;
  background: var(--card-bg); border: 1px solid var(--border-subtle);
  color: var(--text-main); font-weight: 600; text-decoration: none; font-size: 0.95rem; margin-top: auto; transition: 0.3s;
}
.btn-portfolio:hover { background: var(--gradient-btn); color: #fff; border-color: transparent; transform: translateY(-2px); }

.hover-pop { transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hover-pop:active { transform: scale(0.92) !important; }

.css-animate-up { opacity: 0; transform: translateY(30px); animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   DESKTOP HERO
   ========================================================================== */
.hero { 
  position: relative; width: 100%; min-height: 100vh; 
  display: flex; flex-direction: column; justify-content: center; align-items: center; 
  padding: 80px 20px 40px; 
}
.hero-content { 
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 24px; width: 100%;
}
.hero-brand-wrap {
  display: flex; align-items: baseline; justify-content: center; gap: 12px; margin-bottom: 4px;
}
.hero-logo-visly {
  font-family: var(--font-sig); font-size: clamp(4.5rem, 15vw, 8rem); line-height: 1; padding-bottom: 0.1em;
  background: var(--visly-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-logo-studio {
  font-family: var(--font-heading); font-size: clamp(1.1rem, 3.5vw, 1.8rem); font-weight: 800; letter-spacing: 0.25em; color: var(--accent-orange);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px;
  background: rgba(255, 94, 0, 0.05); border: 1px solid var(--border-subtle); border-radius: 100px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
}
.pulsing-dot { 
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-red); box-shadow: 0 0 10px var(--accent-red); animation: blink 1.5s infinite alternate; 
}
@keyframes blink { 0% { opacity: 0.3; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1.2); } }

.hero-title { font-family: var(--font-heading); font-size: clamp(1.6rem, 7vw, 3rem); font-weight: 800; line-height: 1.2; max-width: 800px; margin: 0; }
.gradient-text { background: var(--gradient-btn); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: clamp(0.9rem, 2.5vw, 1.05rem); color: var(--text-muted); max-width: 500px; line-height: 1.5; padding: 0 10px; margin: 0;}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 8px; width: 100%;}

/* ==========================================================================
   DESKTOP SECTION ALIGNMENT (PERFECT FRAME FIX)
   ========================================================================== */
.section { 
  padding: 120px 0 80px; 
  width: 100%;
  scroll-margin-top: 60px; /* Offset stops exactly below Navbar */
  overflow: hidden; /* Secures section boundary */
}

.alt-bg { 
  background: linear-gradient(180deg, transparent 0%, rgba(14, 5, 5, 0.5) 15%, rgba(14, 5, 5, 0.5) 85%, transparent 100%);
  border: none;
}
[data-theme="light"] .alt-bg { 
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.4) 15%, rgba(255, 255, 255, 0.4) 85%, transparent 100%);
}

.section-header { text-align: center; margin-bottom: 50px; width: 100%; }
.section-tag { font-family: var(--font-heading); background: var(--gradient-btn); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.85rem; font-weight: 800; margin-bottom: 8px; }
.section-title { font-family: var(--font-heading); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; }

.glass-card {
  background: var(--card-bg); border: 1px solid var(--border-subtle); border-radius: 20px;
  padding: 32px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s ease; position: relative;
}
.hover-glow-desktop:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: 0 10px 40px rgba(255, 94, 0, 0.15); }

.flex-card { display: flex; flex-direction: column; justify-content: space-between; height: 100%; gap: 24px;}
.card-icon { font-size: 2.2rem; margin-bottom: 16px; }
.glass-card h3 { font-family: var(--font-heading); font-size: 1.35rem; margin-bottom: 12px; }
.glass-card p { color: var(--text-muted); font-size: 0.95rem; }
.benefit-title { color: var(--accent-orange); margin-bottom: 12px; }

.browser-bar { background: rgba(0,0,0,0.15); border-bottom: 1px solid var(--border-subtle); padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; border-radius: 12px 12px 0 0; margin: -32px -32px 24px -32px;}
[data-theme="light"] .browser-bar { background: rgba(0,0,0,0.05); }
.dots { display: flex; gap: 6px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(150,150,150,0.4); }
.dots span:nth-child(1) { background: #ff5f56; }
.dots span:nth-child(2) { background: #ffbd2e; }
.dots span:nth-child(3) { background: #27c93f; }
.portfolio-content { padding: 0 32px 32px 32px; display: flex; flex-direction: column; flex-grow: 1; gap: 12px;}
.category-tag { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; color: var(--accent-orange); text-transform: uppercase; display: block;}

/* ==========================================================================
   SMART FORM
   ========================================================================== */
.form-wrapper { max-width: 860px; width: 100%; margin: 0 auto; padding: 48px; }
.form-header { text-align: center; margin-bottom: 40px; }
.form-sub { color: var(--text-muted); font-size: 1rem; margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.input-group { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.input-group label { font-weight: 600; font-size: 0.95rem; color: var(--text-main); }

.smart-form input[type="text"], .smart-form textarea {
  width: 100%; background: var(--bg-alt); border: 1px solid var(--border-subtle); color: var(--text-main);
  padding: 16px; border-radius: 12px; font-family: var(--font-body); font-size: 0.95rem; outline: none; transition: 0.3s;
}
.smart-form input:focus, .smart-form textarea:focus { border-color: var(--accent-orange); box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.2); }

.custom-select-container { position: relative; width: 100%; }
.select-selected {
  background: var(--bg-alt); border: 1px solid var(--border-subtle); color: var(--text-main);
  padding: 16px; border-radius: 12px; font-size: 0.95rem; cursor: pointer; user-select: none; text-align: left;
}
.select-selected::after { content: "▼"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 0.8rem; color: var(--text-muted); }
.select-selected.select-arrow-active { border-color: var(--accent-orange); box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.2); }
.select-items {
  position: absolute; background-color: var(--bg-main); border: 1px solid var(--border-subtle); top: 100%; left: 0; right: 0;
  z-index: 99; border-radius: 12px; margin-top: 8px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.5); text-align: left;
}
.select-hide { display: none; }
.select-items div { padding: 14px 16px; cursor: pointer; color: var(--text-main); border-bottom: 1px solid var(--border-subtle); font-size: 0.95rem; transition: 0.2s;}
.select-items div:last-child { border-bottom: none; }
.select-items div:hover { background-color: var(--accent-orange); color: #fff; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.custom-checkbox {
  display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg-alt);
  border: 1px solid var(--border-subtle); border-radius: 12px; cursor: pointer; font-weight: 500; font-size: 0.9rem; transition: 0.3s;
}
.custom-checkbox:hover { border-color: var(--accent-orange); }
.custom-checkbox input { display: none; }
.check-box { width: 20px; height: 20px; border: 2px solid var(--text-muted); border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.custom-checkbox input:checked + .check-box { background: var(--accent-orange); border-color: var(--accent-orange); }
.custom-checkbox input:checked + .check-box::after { content: "✔"; color: white; font-size: 12px; font-weight: bold; }

.form-footer { margin-top: 32px; text-align: center; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { padding: 60px 0 40px; text-align: center; border: none; }
.footer-content { display: flex; flex-direction: column; align-items: center; }
.footer-brand { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-bottom: 24px; }
.footer-links { display: flex; justify-content: center; gap: 32px; margin-bottom: 16px; flex-wrap: wrap;}
.footer-links a { color: var(--text-muted); font-weight: 500; text-decoration: none; transition: 0.3s; }
.footer-links a:hover { color: var(--text-main); }
.footer-email { margin-bottom: 20px; }
.footer-email a { color: var(--accent-orange); font-weight: 700; text-decoration: none; transition: 0.3s; font-size: 1.05rem; }
.footer-email a:hover { color: var(--accent-red); }
.copyright { color: var(--text-dim); font-size: 0.9rem; }

/* ==========================================================================
   DESKTOP GRID SYSTEM
   ========================================================================== */
@media (min-width: 769px) {
  .desktop-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 24px !important;
    width: 100% !important;
    transform: none !important; 
  }
  .swiper-slide {
    width: 100% !important;
    opacity: 1 !important;
    transform: none !important;
    margin: 0 !important;
  }
}

/* ==========================================================================
   MOBILE RESPONSIVE FIXES (NAVBAR & SWIPER)
   ========================================================================== */
@media (max-width: 900px) {
  .nav-menu { display: none; }
  .hamburger { display: flex; }
  .nav-container { justify-content: space-between; }
  .nav-actions { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Hides Start Project button on mobile navbar to fix ugly spacing */
  .btn-nav { display: none !important; }
  .nav-actions { gap: 16px; }

  .hero-buttons { flex-direction: column; width: 100%; max-width: 320px; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
  .form-wrapper { padding: 32px 20px; }

  /* SWIPER FIX: overflow hidden prevents page from shifting sideways */
  .swiper {
    width: 100%;
    padding: 30px 0; 
    overflow: hidden !important; 
  }

  .desktop-grid {
    display: flex !important; 
  }

  .swiper-slide {
    width: 82vw !important; 
    height: auto; 
    opacity: 0.65;
    transform: scale(0.9);
    transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    border-color: rgba(255, 255, 255, 0.05);
  }

  .swiper-slide-active {
    opacity: 1 !important;
    transform: scale(1) !important;
    border-color: var(--accent-orange) !important;
    box-shadow: 0 10px 40px rgba(255, 94, 0, 0.25) !important;
  }
}

@media (min-width: 2000px) {
  .container { max-width: 1400px; }
  html { font-size: 18px; }
}