/*
Theme Name: AIMSEON Theme (Preloader + Fade)
Theme URI: https://yourdomain.com
Author: Your Name
Author URI: https://yourdomain.com
Description: AIMSEON theme with mobile optimization, animations, responsive images, and preloader spinner.
Version: 2.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aimseon
*/

:root { --accent:#00adb5; --header-h:72px; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Arial", system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background-color: #0d0d0d; color: #f5f5f5; overflow-x: hidden; position: relative; }

/* Fade-in effect */
body.fade-init { opacity: 0; transition: opacity 0.8s ease-in-out; }
body.fade-loaded { opacity: 1; }

/* Preloader overlay */
#preloader {
  position: fixed;
  inset: 0;
  background: #0d0d0d;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 3000;
  transition: opacity 0.8s ease;
}
#preloader.hidden {
  opacity: 0;
  pointer-events: none;
}
.loader-svg { width: 120px; height: auto; margin-bottom: 15px; }
.loader-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: loaderDraw 2s linear infinite;
}
@keyframes loaderDraw {
  0% { stroke-dashoffset: 500; }
  100% { stroke-dashoffset: -500; }
}

/* Header & Nav */
header { position: fixed; inset: 0 0 auto 0; width: 100%; background: rgba(17, 17, 17, 0.95); backdrop-filter: blur(8px); display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; z-index: 1000; border-bottom: 1px solid #222; height: var(--header-h); }
header .logo { font-size: 1.6rem; font-weight: 700; color: #fff; }
nav { display: flex; gap: 1.5rem; }
nav a { text-decoration: none; color: #f5f5f5; font-weight: 500; transition: color 0.2s ease; }
nav a:hover { color: var(--accent); }
.menu-toggle { display: none; cursor: pointer; font-size: 1.8rem; color: #f5f5f5; background: none; border: none; }
.menu-dropdown { display: none; position: absolute; top: calc(var(--header-h) - 4px); right: 20px; background: #222; border: 1px solid #333; border-radius: 8px; flex-direction: column; min-width: 170px; z-index: 1001; opacity: 0; transform: translateY(-10px); transition: opacity 0.25s ease, transform 0.25s ease; }
.menu-dropdown.show { display: flex; opacity: 1; transform: translateY(0); }
.menu-dropdown a { padding: 0.75rem 1rem; color: #f5f5f5; }
.menu-dropdown a:hover { background: var(--accent); color: #fff; }

/* Sections */
section { min-height: 100vh; padding: calc(var(--header-h) + 2rem) 2rem 2rem; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.hero { background: linear-gradient(135deg, #0d0d0d, #1a1a1a); }
.hero .infinity-svg { width: 300px; margin-bottom: 30px; }
.hero h1 { font-size: 3.2rem; margin-bottom: 1rem; }
.hero p { font-size: 1.15rem; max-width: 680px; line-height: 1.6; color: #ddd; }

.cta-button { margin-top: 2rem; padding: 0.9rem 1.8rem; background: var(--accent); border: none; border-radius: 30px; color: #fff; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: background 0.2s, transform 0.2s; }
.cta-button:hover { background: #008a91; transform: translateY(-3px); }

footer { background: #111; text-align: center; padding: 1rem; font-size: 0.9rem; border-top: 1px solid #222; color: #aaa; }

/* Animations */
.infinity-path { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 500; stroke-dashoffset: 500; animation: draw 3s ease-in-out infinite; }
@keyframes draw { 0% { stroke-dashoffset: 600; } 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -600; } }
.scroll-indicator { margin-top: 40px; font-size: 0.9rem; color: #aaa; display: flex; flex-direction: column; align-items: center; animation: bounce 2s infinite; cursor: pointer; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
.service-card:hover { transform: translateY(-8px); box-shadow: 0 0 20px rgba(0,173,181,0.6); }
.about-card:hover { transform: translateY(-6px); box-shadow: 0 0 18px rgba(0,173,181,0.5); }
.brands-track { display: flex; width: max-content; gap: 3rem; animation: slideBrands 20s linear infinite; }
@keyframes slideBrands { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Responsive logos */
.brand-logo { max-width: 120px; height: auto; opacity: 0.85; transition: transform 0.2s, opacity 0.2s; }
.brand-logo:hover { transform: scale(1.08); opacity: 1; }
@media (max-width: 768px) { .brand-logo { max-width: 90px; } }
@media (max-width: 500px) { .brand-logo { max-width: 70px; } }

/* Mobile adjustments */
@media (max-width: 768px) {
  nav { display: none; }
  .menu-toggle { display: block; font-size: 2rem; }
  .hero .infinity-svg { width: 220px; }
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1rem; }
}
@media (max-width: 600px) {
  .hero .infinity-svg { width: 180px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 0.95rem; padding: 0 1rem; }
  .cta-button { font-size: 0.9rem; padding: 0.7rem 1.4rem; }
  .services-container, .about-container { grid-template-columns: 1fr; }
}
