/* ===== CSS Variables & Reset ===== */
:root {
  --bg: #f8f9fa;
  --text: #1a1a2e;
  --primary: #1a1a2e;
  --accent: #ffd700;
  --accent-dark: #e6c200;
  --card: #fff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --max-w: 1200px;
  --gap: 24px;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --footer-bg: #1a1a2e;
  --footer-text: #ccc;
  --transition: 0.3s ease;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --hero-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --accent-gradient: linear-gradient(135deg, #ffd700, #ffb700);
  --dark-bg: #121212;
  --dark-card: #1e1e1e;
  --dark-text: #e0e0e0;
  --dark-nav: rgba(30, 30, 30, 0.95);
  --dark-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid #1a1a2e;
  color: #1a1a2e;
}

.btn-outline:hover {
  background: #1a1a2e;
  color: #fff;
}

/* ===== Section ===== */
.section {
  padding: 80px 0;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  text-align: center;
  color: var(--primary);
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: #555;
  max-width: 700px;
  margin: 0 auto 48px;
}

/* ===== Card ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ===== Grid ===== */
.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: box-shadow var(--transition), background var(--transition);
}

header.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo svg {
  width: 36px;
  height: 36px;
}

.logo span {
  background: linear-gradient(135deg, #1a1a2e, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  color: #333;
  transition: background 0.2s, color 0.2s;
}

nav a:hover {
  background: rgba(255, 215, 0, 0.15);
  color: #1a1a2e;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 4px;
  color: #1a1a2e;
}

.dark-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  color: #1a1a2e;
  transition: background 0.2s;
}

.dark-toggle:hover {
  background: rgba(255, 215, 0, 0.15);
}

/* ===== Hero ===== */
#hero {
  background: var(--hero-gradient);
  color: #fff;
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

#hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: radial-gradient(circle at 70% 50%, rgba(255, 215, 0, 0.1), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text h1 {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-text h1 span {
  color: var(--accent);
}

.hero-text p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 32px;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 40px;
  border: 1px solid var(--glass-border);
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.hero-card .big-num {
  font-size: 4rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.hero-card p {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 8px;
}

.hero-card .stat-row {
  display: flex;
  justify-content: space-around;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
}

.hero-card .stat {
  text-align: center;
}

.hero-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.hero-card .stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ===== About ===== */
#about {
  background: #fff;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-text h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.about-text p {
  margin-bottom: 16px;
  color: #444;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.about-stat {
  background: #f0f4ff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.about-stat .num {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a2e;
}

.about-stat .label {
  font-size: 0.9rem;
  color: #555;
}

.about-visual {
  background: linear-gradient(135deg, #f0f4ff, #fff);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
  justify-content: center;
}

.about-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.about-item .icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #1a1a2e;
  flex-shrink: 0;
}

.about-item .text {
  font-weight: 600;
}

/* ===== Products ===== */
#products {
  background: var(--bg);
}

.product-card {
  padding: 24px;
  text-align: center;
}

.product-card .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #1a1a2e;
}

.product-card h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.product-card p {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.product-card .tag {
  display: inline-block;
  padding: 4px 12px;
  background: #f0f4ff;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #1a1a2e;
  font-weight: 500;
}

/* ===== Services ===== */
#services {
  background: #fff;
}

.service-card {
  padding: 24px;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
}

.service-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.service-card p {
  color: #555;
  font-size: 0.95rem;
}

/* ===== Advantages ===== */
#advantages {
  background: var(--hero-gradient);
  color: #fff;
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.advantage-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  transition: background var(--transition);
}

.advantage-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.advantage-card .num {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 8px;
}

.advantage-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.advantage-card p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

/* ===== Testimonials ===== */
#testimonials {
  background: #fff;
}

.testimonial-card {
  padding: 24px;
  position: relative;
}

.testimonial-card::before {
  content: '\201C';
  font-size: 3rem;
  color: var(--accent);
  position: absolute;
  top: 16px;
  left: 24px;
  opacity: 0.3;
  font-family: serif;
}

.testimonial-card p {
  color: #444;
  font-style: italic;
  margin-bottom: 16px;
  padding-top: 16px;
}

.testimonial-card .author {
  font-weight: 700;
  color: #1a1a2e;
}

.testimonial-card .role {
  font-size: 0.85rem;
  color: #888;
}

/* ===== Case Studies ===== */
#cases {
  background: var(--bg);
}

.case-card {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.case-card .case-img {
  height: 180px;
  background: var(--hero-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 800;
}

.case-card .case-body {
  padding: 24px;
}

.case-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.case-card p {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.case-card .case-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent);
  color: #1a1a2e;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===== Insights ===== */
#insights {
  background: #fff;
}

.insight-card {
  padding: 24px;
}

.insight-card .date {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 8px;
  display: block;
}

.insight-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.insight-card p {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.insight-card .read-more {
  font-weight: 600;
  color: #1a1a2e;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.insight-card .read-more:hover {
  color: var(--accent);
}

/* ===== FAQ ===== */
#faq {
  background: var(--bg);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 0;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-question .icon {
  font-size: 1.2rem;
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item.active .faq-question .icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 0 20px;
  display: none;
  color: #555;
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  display: block;
}

/* ===== HowTo ===== */
#howto {
  background: #fff;
}

.howto-steps {
  max-width: 700px;
  margin: 0 auto;
  counter-reset: step;
}

.howto-step {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.howto-step .step-num {
  counter-increment: step;
  content: counter(step);
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #1a1a2e;
  flex-shrink: 0;
}

.howto-step .step-content h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.howto-step .step-content p {
  color: #555;
  font-size: 0.95rem;
}

/* ===== Contact ===== */
#contact {
  background: #1a1a2e;
  color: #fff;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.contact-info p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-info .contact-item {
  margin-bottom: 12px;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-form label {
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.contact-form input,
.contact-form textarea {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form .btn {
  justify-self: start;
}

/* ===== Footer ===== */
footer {
  background: #0d0d1a;
  color: rgba(255, 255, 255, 0.7);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.6);
}

/* ===== Back to Top ===== */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #1a1a2e;
  color: var(--accent);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 99;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--accent);
  color: #1a1a2e;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
  --bg: #121212;
  --text: #e0e0e0;
  --primary: #e0e0e0;
  --card: #1e1e1e;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(30, 30, 30, 0.95);
  --footer-bg: #0a0a0a;
  --glass-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] #about,
[data-theme="dark"] #services,
[data-theme="dark"] #testimonials,
[data-theme="dark"] #insights,
[data-theme="dark"] #howto {
  background: #1a1a1a;
}

[data-theme="dark"] #cases,
[data-theme="dark"] #faq {
  background: #121212;
}

[data-theme="dark"] .about-stat {
  background: #2a2a2a;
}

[data-theme="dark"] .about-item {
  background: #2a2a2a;
}

[data-theme="dark"] .product-card .tag {
  background: #2a2a2a;
  color: #ccc;
}

[data-theme="dark"] .contact-form input,
[data-theme="dark"] .contact-form textarea {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .btn-outline {
  border-color: #e0e0e0;
  color: #e0e0e0;
}

[data-theme="dark"] .btn-outline:hover {
  background: #e0e0e0;
  color: #121212;
}

[data-theme="dark"] .dark-toggle {
  color: var(--accent);
}

[data-theme="dark"] .dark-toggle:hover {
  background: rgba(255, 215, 0, 0.2);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    transform: translateY(-120%);
    opacity: 0;
    transition: all var(--transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
  }

  nav.open {
    transform: translateY(0);
    opacity: 1;
  }

  nav a {
    width: 100%;
    padding: 12px 16px;
  }

  #hero {
    padding: 60px 0;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }

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

  .hero-text h1 {
    font-size: 2.2rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 600px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 0;
  }

  .section-title {
    font-size: 1.8rem;
  }
}

/* ===== Scroll Animation (Fade-in on scroll) ===== */
.section {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for grid items */
.grid .card:nth-child(1) { animation-delay: 0.1s; }
.grid .card:nth-child(2) { animation-delay: 0.2s; }
.grid .card:nth-child(3) { animation-delay: 0.3s; }
.grid .card:nth-child(4) { animation-delay: 0.4s; }
.grid .card:nth-child(5) { animation-delay: 0.5s; }
.grid .card:nth-child(6) { animation-delay: 0.6s; }
.grid .card:nth-child(7) { animation-delay: 0.7s; }
.grid .card:nth-child(8) { animation-delay: 0.8s; }

/* Hover animation for hero card */
.hero-card {
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2);
}

/* Smooth hover for advantage cards */
.advantage-card {
  transition: background var(--transition), transform var(--transition);
}

.advantage-card:hover {
  transform: translateY(-4px);
}

/* Case card image hover */
.case-card .case-img {
  transition: transform var(--transition);
}

.case-card:hover .case-img {
  transform: scale(1.05);
}

/* Insight card hover */
.insight-card {
  transition: transform var(--transition), box-shadow var(--transition);
}

.insight-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* About item hover */
.about-item {
  transition: transform var(--transition), box-shadow var(--transition);
}

.about-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}