/* ===== CSS Variables & Reset ===== */
:root {
  --primary: #0b1a2e;
  --primary-light: #1a2f4a;
  --accent: #f0c040;
  --accent-light: #f5d060;
  --gold: #d4a837;
  --gold-light: #e8c55a;
  --text: #1e293b;
  --text-light: #475569;
  --bg: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.75);
  --glass: rgba(255, 255, 255, 0.2);
  --glass-border: rgba(255, 255, 255, 0.3);
  --shadow: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-hover: 0 16px 48px rgba(0,0,0,0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --hero-gradient: linear-gradient(135deg, #0b1a2e 0%, #1a2f4a 40%, #2c3e50 100%);
  --card-gradient: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.4));
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.75);
    --glass: rgba(0, 0, 0, 0.25);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-hover: 0 16px 48px rgba(0,0,0,0.6);
    --hero-gradient: linear-gradient(135deg, #020617 0%, #0b1a2e 50%, #1e293b 100%);
    --card-gradient: linear-gradient(145deg, rgba(30,41,59,0.85), rgba(15,23,42,0.5));
  }
}

/* ===== Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240,192,64,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(240,192,64,0); }
}

/* ===== Header & Nav ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(11, 26, 46, 0.75);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background var(--transition);
}
header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header nav > a {
  display: flex;
  align-items: center;
  transition: transform var(--transition);
}
header nav > a:hover {
  transform: scale(1.03);
}
header nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
header nav ul li a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
header nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform var(--transition);
}
header nav ul li a:hover {
  color: var(--accent);
  background: rgba(240,192,64,0.1);
}
header nav ul li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* ===== Hero ===== */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  background: var(--hero-gradient);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out;
}
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(240,192,64,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 30%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}
#hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}
#hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}
#hero h1::after {
  content: '⚡';
  display: inline-block;
  margin-left: 0.3em;
  animation: float 3s ease-in-out infinite;
}
#hero p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: rgba(255,255,255,0.85);
  max-width: 640px;
  margin: 1.2rem auto 2.2rem;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}
#hero a {
  display: inline-block;
  padding: 0.85rem 2.4rem;
  margin: 0.4rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}
#hero a:first-of-type {
  background: var(--accent);
  color: var(--primary);
  box-shadow: 0 4px 20px rgba(240,192,64,0.4);
}
#hero a:first-of-type:hover {
  background: var(--accent-light);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px rgba(240,192,64,0.5);
}
#hero a:last-of-type {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(4px);
}
#hero a:last-of-type:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}

/* ===== Sections ===== */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem;
  animation: fadeInUp 0.6s ease-out;
  animation-timeline: view();
  animation-range: entry 0% entry 30%;
}
section h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
}
section h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 4px;
}
@media (prefers-color-scheme: dark) {
  section h2 { color: var(--accent); }
}

/* ===== About ===== */
#about {
  background: var(--card-gradient);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow);
  margin: 0 1.5rem 3rem;
}
#about h2 { margin-top: 0; }
#about p {
  color: var(--text-light);
  margin-bottom: 1.2rem;
  max-width: 800px;
}
#about h3 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
}
@media (prefers-color-scheme: dark) {
  #about h3 { color: var(--accent-light); }
}

/* ===== Cards (Products, Solutions, Insights) ===== */
#products, #solutions, #insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 5rem 1.5rem;
}
#products h2, #solutions h2, #insights h2 {
  grid-column: 1 / -1;
  margin-bottom: 0.5rem;
}
#products article, #solutions article, #insights article {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
  animation: fadeInScale 0.5s ease-out;
  animation-timeline: view();
  animation-range: entry 0% entry 30%;
  position: relative;
  overflow: hidden;
}
#products article::before, #solutions article::before, #insights article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  opacity: 0;
  transition: opacity var(--transition);
}
#products article:hover::before, #solutions article:hover::before, #insights article:hover::before {
  opacity: 1;
}
#products article:hover, #solutions article:hover, #insights article:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
#products h3, #solutions h3, #insights h3 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 0.8rem;
}
#products p, #solutions p, #insights p {
  color: var(--text-light);
  font-size: 0.95rem;
}
#insights time {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 500;
}

/* ===== Services ===== */
#services {
  padding: 5rem 1.5rem;
}
#services h2 {
  display: block;
  text-align: center;
}
#services h2::after {
  left: 50%;
  transform: translateX(-50%);
}
#services ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}
#services ul li {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.5rem;
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  animation: fadeInUp 0.5s ease-out;
  animation-timeline: view();
  animation-range: entry 0% entry 30%;
  position: relative;
}
#services ul li::after {
  content: '→';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: all var(--transition);
  color: var(--accent);
}
#services ul li:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  padding-right: 2.5rem;
}
#services ul li:hover::after {
  opacity: 1;
  right: 1rem;
}

/* ===== FAQ ===== */
#faq {
  padding: 5rem 1.5rem;
}
#faq h2 {
  display: block;
  text-align: center;
}
#faq h2::after {
  left: 50%;
  transform: translateX(-50%);
}
details {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  cursor: pointer;
}
details:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
details[open] {
  border-color: var(--accent);
  background: var(--card-bg);
}
summary {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--primary);
  padding: 0.3rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--accent);
  transition: transform var(--transition);
}
details[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}
details p {
  margin-top: 0.8rem;
  color: var(--text-light);
  padding-top: 0.8rem;
  border-top: 1px solid var(--glass-border);
  animation: fadeInUp 0.3s ease-out;
}

/* ===== Contact ===== */
#contact {
  background: var(--card-gradient);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow);
  margin: 0 1.5rem 3rem;
  text-align: center;
}
#contact h2 {
  display: block;
  text-align: center;
}
#contact h2::after {
  left: 50%;
  transform: translateX(-50%);
}
#contact p {
  color: var(--text-light);
  margin: 0.6rem 0;
  font-size: 1.05rem;
}
#contact p:first-of-type {
  margin-top: 1.5rem;
}

/* ===== Footer ===== */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  margin-top: 3rem;
}
footer nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-bottom: 2rem;
}
footer nav ul li a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}
footer nav ul li a:hover {
  color: var(--accent);
  background: rgba(240,192,64,0.08);
}
footer p {
  font-size: 0.85rem;
  margin: 0.5rem 0;
  line-height: 1.6;
}
footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
footer a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  header nav {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
  }
  header nav ul {
    justify-content: center;
    gap: 0.15rem;
  }
  header nav ul li a {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
  }
  #hero {
    padding: 5rem 1.2rem 3rem;
    min-height: 90vh;
  }
  #hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
  }
  #hero a {
    padding: 0.7rem 1.8rem;
    font-size: 0.9rem;
  }
  section {
    padding: 3rem 1rem;
  }
  #about, #contact {
    padding: 2rem 1.5rem;
    margin-left: 1rem;
    margin-right: 1rem;
  }
  #products, #solutions, #insights {
    grid-template-columns: 1fr;
    padding: 3rem 1rem;
    gap: 1.5rem;
  }
  #services ul {
    grid-template-columns: 1fr 1fr;
  }
  footer {
    padding: 2rem 1rem;
  }
  footer nav ul {
    gap: 0.3rem 0.8rem;
  }
}

@media (max-width: 480px) {
  header nav ul li a {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }
  #services ul {
    grid-template-columns: 1fr;
  }
  #hero h1 {
    font-size: clamp(1.5rem, 10vw, 2rem);
  }
  #hero p {
    font-size: 0.95rem;
  }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ===== Focus visible ===== */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}