@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- Reset & Layers --- */
@layer reset, base, components, utilities;

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
  }

  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }

  img, svg, video {
    max-inline-size: 100%;
    block-size: auto;
    display: block;
  }

  button, input, select, textarea {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
  }

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

@layer base {
  :root {
    color-scheme: light dark;

    /* --- Theme Color Tokens (Light & Dark) --- */
    --brand-primary: #00f2fe;    /* Electric Cyan */
    --brand-secondary: #4facfe;  /* Deep Blue */
    --brand-accent: #a18cd1;     /* Violet Glow */

    /* light-dark() variables */
    --bg-base: light-dark(#f8fafc, #090d16);
    --bg-surface: light-dark(rgba(255, 255, 255, 0.7), rgba(15, 23, 42, 0.6));
    --bg-surface-solid: light-dark(#ffffff, #0f172a);
    --bg-card-hover: light-dark(rgba(255, 255, 255, 0.9), rgba(30, 41, 59, 0.8));
    
    --text-primary: light-dark(#0f172a, #f8fafc);
    --text-muted: light-dark(#475569, #94a3b8);
    --text-inverse: light-dark(#f8fafc, #0f172a);
    
    --border-color: light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.08));
    --border-hover: light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.2));
    
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 30px -4px light-dark(rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.3));
    --shadow-lg: 0 20px 50px -8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
    --glow-effect: light-dark(rgba(79, 172, 254, 0.15), rgba(0, 242, 254, 0.15));

    /* --- Typography Tokens --- */
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --fs-sm: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
    --fs-base: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
    --fs-md: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
    --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    --fs-xl: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
    --fs-xxl: clamp(2rem, 1.6rem + 1.5vw, 3rem);
    --fs-display: clamp(2.5rem, 2rem + 3vw, 4.5rem);
  }

  body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    background-image: 
      radial-gradient(circle at 10% 20%, var(--glow-effect) 0%, transparent 40%),
      radial-gradient(circle at 90% 80%, rgba(161, 140, 209, 0.1) 0%, transparent 40%);
    background-attachment: fixed;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    text-wrap: balance;
  }

  p {
    text-wrap: pretty;
  }
}

/* --- Components --- */
@layer components {
  /* --- Glassmorphism --- */
  .glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s ease, 
                box-shadow 0.3s ease,
                background-color 0.3s ease;
  }

  .glass-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card-hover);
  }

  /* --- Navigation --- */
  .header-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: light-dark(rgba(248, 250, 252, 0.8), rgba(9, 13, 22, 0.8));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: padding 0.3s ease, background 0.3s ease;
  }

  .nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
  }

  .nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
  }

  .nav-links a {
    font-weight: 500;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    transition: color 0.25s ease;
    position: relative;
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--text-primary);
  }

  .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--brand-primary), var(--brand-secondary));
    transition: width 0.25s ease;
  }

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

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
  }

  /* --- Buttons --- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
  }

  .btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #090d16;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.25);
  }

  .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
    transform: translateY(-2px);
  }

  .btn-secondary {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
  }

  .btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
  }

  /* --- Theme Toggle Switch --- */
  .theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .theme-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: scale(1.05);
  }

  .theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
  }

  .theme-toggle-btn .sun-icon {
    display: none;
  }
  
  :root[color-scheme="light"] .theme-toggle-btn .moon-icon {
    display: none;
  }
  :root[color-scheme="light"] .theme-toggle-btn .sun-icon {
    display: block;
  }

  /* --- Mobile Nav Toggle --- */
  .mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
  }

  /* --- Hero Section --- */
  .hero-section {
    padding: 180px 2rem 100px;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 90vh;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .badge {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: var(--fs-xs);
    font-weight: 600;
    background: rgba(0, 242, 254, 0.1);
    color: var(--brand-primary);
    border: 1px solid rgba(0, 242, 254, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .hero-title {
    font-size: var(--fs-display);
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--brand-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .hero-description {
    font-size: var(--fs-md);
    color: var(--text-muted);
    max-width: 540px;
  }

  .hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
  }

  /* Floating visual graphics for Hero */
  .hero-visual {
    position: relative;
    width: 100%;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .visual-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.3) 0%, transparent 70%);
    filter: blur(20px);
    animation: pulse 8s infinite alternate;
  }

  .floating-card {
    position: absolute;
    padding: 1.5rem;
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .floating-card-1 {
    top: 15%;
    left: 5%;
    transform: rotate(-6deg);
    animation: float1 6s infinite ease-in-out;
  }

  .floating-card-2 {
    bottom: 15%;
    right: 5%;
    transform: rotate(6deg);
    animation: float2 7s infinite ease-in-out;
  }

  .floating-card-center {
    width: 280px;
    z-index: 2;
    transform: scale(1.05);
    animation: float3 8s infinite ease-in-out;
  }

  .floating-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-base);
  }

  .floating-card p {
    font-size: var(--fs-xs);
    color: var(--text-muted);
  }

  .icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #090d16;
  }

  /* --- Interactive Switcher & Services --- */
  .section-container {
    padding: 100px 2rem;
    max-width: 1200px;
    margin: 0 auto;
  }

  .section-header {
    text-align: center;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .section-title {
    font-size: var(--fs-xxl);
  }

  .section-subtitle {
    font-size: var(--fs-md);
    color: var(--text-muted);
    max-width: 600px;
  }

  .services-switcher {
    display: inline-flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 9999px;
    margin-bottom: 3rem;
  }

  .switcher-btn {
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    font-size: var(--fs-sm);
    transition: all 0.3s ease;
  }

  .switcher-btn.active {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #090d16;
    box-shadow: var(--shadow-sm);
  }

  .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
  }

  .service-card {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
  }

  .service-card .icon-large {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(79, 172, 254, 0.1));
    border: 1px solid rgba(0, 242, 254, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
  }

  .service-card h3 {
    font-size: var(--fs-lg);
  }

  .service-card p {
    color: var(--text-muted);
    font-size: var(--fs-sm);
  }

  .service-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    font-size: var(--fs-sm);
  }

  .service-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .service-features li svg {
    color: var(--brand-primary);
    flex-shrink: 0;
  }

  /* --- Interactive Calculator --- */
  .calculator-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 3rem;
    align-items: start;
  }

  .calculator-config {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
  }

  .config-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .config-group h3 {
    font-size: var(--fs-md);
    border-left: 3px solid var(--brand-primary);
    padding-left: 0.75rem;
  }

  .checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
  }

  .calc-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: all 0.25s ease;
  }

  .calc-label:has(input:checked) {
    border-color: var(--brand-primary);
    background: rgba(0, 242, 254, 0.05);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.08);
  }

  .calc-label-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .calc-label-price {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--brand-secondary);
  }

  .range-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
  }

  .range-header {
    display: flex;
    justify-content: space-between;
    font-weight: 500;
  }

  .custom-range {
    width: 100%;
    accent-color: var(--brand-primary);
    cursor: pointer;
  }

  .calculator-summary {
    position: sticky;
    top: 100px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .summary-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
  }

  .summary-line {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
    color: var(--text-muted);
  }

  .summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
  }

  .total-price {
    font-size: var(--fs-xxl);
    font-weight: 800;
    color: var(--brand-primary);
  }

  /* --- Testimonials --- */
  .testimonials-scroller {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem 0 2rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
  }

  .testimonial-card {
    flex: 0 0 380px;
    scroll-snap-align: start;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .quote-icon {
    color: var(--brand-primary);
    opacity: 0.3;
  }

  .testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
  }

  .author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #090d16;
    font-size: var(--fs-base);
  }

  .author-info h4 {
    font-size: var(--fs-base);
  }

  .author-info p {
    font-size: var(--fs-xs);
    color: var(--text-muted);
  }

  /* --- Contact Section --- */
  .contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: start;
  }

  .contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .info-item {
    display: flex;
    gap: 1rem;
  }

  .info-item .icon-wrapper {
    flex-shrink: 0;
  }

  .info-item h4 {
    font-size: var(--fs-md);
    margin-bottom: 0.25rem;
  }

  .info-item p {
    color: var(--text-muted);
    font-size: var(--fs-sm);
  }

  .contact-form {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .form-group label {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
  }

  .form-control {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }

  .form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
  }

  /* Modern Validity Styling */
  .form-control:user-invalid {
    border-color: #ef4444;
  }
  .form-control:user-valid {
    border-color: #22c55e;
  }

  /* --- Footer --- */
  .main-footer {
    background: light-dark(#f1f5f9, #05080e);
    border-top: 1px solid var(--border-color);
    padding: 5rem 2rem 2.5rem;
  }

  .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 4rem;
    margin-bottom: 3rem;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .footer-brand p {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    max-width: 320px;
  }

  .footer-links-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .footer-links-group h4 {
    font-size: var(--fs-base);
  }

  .footer-links-group ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .footer-links-group a {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    transition: color 0.25s ease;
  }

  .footer-links-group a:hover {
    color: var(--brand-primary);
  }

  .footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: var(--fs-xs);
  }

  .social-links {
    display: flex;
    gap: 1rem;
  }

  .social-links a {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  .social-links a:hover {
    background: var(--bg-card-hover);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: translateY(-2px);
  }
}

/* --- Utilities & Animations --- */
@layer utilities {
  .text-glow {
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
  }

  .glow-card-green {
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.08);
  }
}

/* --- Animations Keyframes --- */
@keyframes float1 {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-15px) rotate(-4deg); }
}

@keyframes float2 {
  0%, 100% { transform: translateY(0) rotate(6deg); }
  50% { transform: translateY(-20px) rotate(8deg); }
}

@keyframes float3 {
  0%, 100% { transform: translateY(0) scale(1.05); }
  50% { transform: translateY(12px) scale(1.03); }
}

@keyframes pulse {
  0% { transform: scale(0.9) translate(-5%, -5%); opacity: 0.8; }
  100% { transform: scale(1.1) translate(5%, 5%); opacity: 1; }
}

/* --- Scroll Driven Entry Animations --- */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes entry-fade-up {
      from {
        opacity: 0;
        transform: translateY(40px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .animate-on-scroll {
      animation: entry-fade-up auto cubic-bezier(0.16, 1, 0.3, 1) backwards;
      animation-timeline: view();
      animation-range: entry 5% entry 40%;
    }
  }
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1024px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
    padding-top: 140px;
  }

  .hero-content {
    align-items: center;
  }

  .hero-description {
    margin: 0 auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    height: 350px;
  }

  .floating-card-1 {
    left: 10%;
  }

  .floating-card-2 {
    right: 10%;
  }

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

  .calculator-summary {
    position: static;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none; /* Interactive menu drawer in production code */
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}
