/* ============================================================
   MileTech — Global Stylesheet
   Brand color: #2E5984 (steel blue from logo)
   ============================================================ */

:root {
  --brand:        #2E5984;
  --brand-dark:   #1B3A57;
  --brand-light:  #4A7BAA;
  --brand-pale:   #E8F0F7;
  --accent:       #D4A843;
  --text:         #1A1A2E;
  --text-light:   #5A6478;
  --bg:           #FFFFFF;
  --bg-alt:       #F7F9FC;
  --border:       #E2E8F0;
  --radius:       8px;
  --shadow:       0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --shadow-lg:    0 8px 30px rgba(0,0,0,.08);
  --transition:   .25s cubic-bezier(.4,0,.2,1);
  --max-w:        1140px;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', var(--font-body);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---------- Utilities ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--brand-dark); }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.015em; }
h3 { font-size: 1.25rem; }
p  { color: var(--text-light); max-width: 680px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 600; font-size: .95rem;
  transition: all var(--transition);
  cursor: pointer; border: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-outline { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-shop { background: var(--accent); color: #fff; }
.btn-shop:hover { background: #c19930; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 40px; width: auto; }

/* Desktop: nav-links floats right inside the nav bar */
.nav-links {
  display: flex; align-items: center; gap: 32px;
  position: absolute; right: 24px; top: 0; height: 70px;
}
.nav-links a {
  font-weight: 500; font-size: .9rem; color: var(--text-light);
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--brand); border-radius: 1px;
  transform: scaleX(0); transform-origin: right; transition: transform var(--transition);
}
.nav-links a:hover { color: var(--brand); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: var(--brand); }
.nav-links a.active::after { transform: scaleX(1); }

/* Mobile toggle */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; position: relative; z-index: 1100;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  position: absolute; left: 7px; transition: all var(--transition);
}
.nav-toggle span:nth-child(1) { top: 10px; }
.nav-toggle span:nth-child(2) { top: 17px; }
.nav-toggle span:nth-child(3) { top: 24px; }
.nav-toggle.open span:nth-child(1) { top: 17px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 17px; transform: rotate(-45deg); }

/* Mobile menu: full-screen white overlay */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-inner { height: 64px; }
  .nav-logo img { height: 34px; }
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    background: #ffffff;
    padding-top: 80px;
    padding-bottom: 32px;
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 1050;
    overflow-y: auto;
    right: auto;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a {
    padding: 20px 28px;
    font-size: 1.15rem;
    font-weight: 600;
    width: 100%;
    display: block;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    height: auto;
  }
  .nav-links a:hover,
  .nav-links a.active {
    background: var(--brand-pale);
    color: var(--brand);
  }
  .nav-links a::after { display: none; }
  .nav-links .btn {
    margin: 24px 28px;
    width: calc(100% - 56px);
    justify-content: center;
    border-bottom: none;
    font-size: 1.05rem;
    padding: 14px 28px;
    display: flex;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--brand-pale) 0%, transparent 70%);
  z-index: -1;
}
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 20px;
  background: var(--brand-pale); color: var(--brand);
  font-size: .82rem; font-weight: 600;
  margin-bottom: 20px;
}
.hero-badge svg { width: 14px; height: 14px; }
.hero h1 { margin-bottom: 20px; }
.hero h1 span { color: var(--brand); }
.hero p { font-size: 1.1rem; margin-bottom: 32px; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.hero-mockup {
  width: 100%; max-width: 520px;
  border-radius: 12px;
}

@media (max-width: 768px) {
  .hero { padding: 110px 0 60px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .hero-visual { order: -1; }
}

/* ---------- Features / Cards ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header p { margin: 12px auto 0; }

.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.feature-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px;
  transition: all var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-light); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 10px;
  background: var(--brand-pale); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { margin-bottom: 10px; }
.feature-card p { font-size: .92rem; }

@media (max-width: 900px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .features-grid { grid-template-columns: 1fr; } }

/* ---------- Models table ---------- */
.models-table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.models-table {
  width: 100%; border-collapse: collapse;
  font-size: .9rem;
}
.models-table th {
  background: var(--brand); color: #fff;
  padding: 14px 20px; text-align: left; font-weight: 600;
  white-space: nowrap;
}
.models-table td {
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.models-table tbody tr:hover { background: var(--brand-pale); }
.models-table .check { color: var(--brand); font-weight: 700; text-align: center; }

/* ---------- Screenshot showcase ---------- */
.showcase-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.showcase-item {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.showcase-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.showcase-item img { width: 100%; }
.showcase-caption {
  padding: 14px 18px; font-size: .85rem; font-weight: 500; color: var(--text-light);
  background: var(--bg-alt);
}
@media (max-width: 600px) { .showcase-grid { grid-template-columns: 1fr; } }

/* ---------- CTA Section ---------- */
.cta-section {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #fff; text-align: center;
  padding: 72px 24px; border-radius: 16px;
  margin: 0 24px;
  position: relative; overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute; top: -50%; right: -20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
}
.cta-section h2 { color: #fff; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,.8); margin: 0 auto 28px; }
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-buttons .btn-primary { background: #fff; color: var(--brand-dark); }
.cta-buttons .btn-primary:hover { background: var(--brand-pale); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand img { height: 32px; margin-bottom: 12px; }
.footer-brand p { font-size: .88rem; max-width: 280px; }
.footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-light); margin-bottom: 14px; }
.footer a { display: block; font-size: .9rem; color: var(--text-light); padding: 4px 0; transition: color var(--transition); }
.footer a:hover { color: var(--brand); }
.footer-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: .82rem; color: var(--text-light);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Plugin Page Specifics ---------- */
.plugin-hero {
  padding: 140px 0 60px;
  background: linear-gradient(180deg, var(--brand-pale) 0%, var(--bg) 100%);
}
.plugin-hero-inner {
  text-align: center;
}
.plugin-hero h1 { margin-bottom: 16px; }
.plugin-hero p { margin: 0 auto 32px; font-size: 1.1rem; }

.tech-specs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.tech-spec {
  text-align: center; padding: 28px 16px;
  background: #fff; border-radius: var(--radius); border: 1px solid var(--border);
}
.tech-spec .number { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--brand); }
.tech-spec .label { font-size: .85rem; color: var(--text-light); margin-top: 4px; }
@media (max-width: 700px) { .tech-specs { grid-template-columns: 1fr 1fr; } }
@media (max-width: 400px) { .tech-specs { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.contact-info-card {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 20px 0; border-bottom: 1px solid var(--border);
}
.contact-info-card:last-child { border-bottom: none; }
.contact-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--brand-pale); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-form label { display: block; font-weight: 500; font-size: .88rem; margin-bottom: 6px; color: var(--text); }
.contact-form input,
.contact-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px;
  font-family: var(--font-body); font-size: .92rem;
  transition: border-color var(--transition);
  margin-bottom: 18px;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-pale); }
.contact-form textarea { min-height: 120px; resize: vertical; }
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Animations ---------- */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Stagger children */
.stagger > * { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.stagger.visible > *:nth-child(1) { transition-delay: .05s; }
.stagger.visible > *:nth-child(2) { transition-delay: .1s; }
.stagger.visible > *:nth-child(3) { transition-delay: .15s; }
.stagger.visible > *:nth-child(4) { transition-delay: .2s; }
.stagger.visible > *:nth-child(5) { transition-delay: .25s; }
.stagger.visible > *:nth-child(6) { transition-delay: .3s; }
.stagger.visible > * { opacity: 1; transform: translateY(0); }

/* ---------- Scroll-to-top ---------- */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(20px);
  transition: all var(--transition);
  pointer-events: none;
}
.scroll-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.scroll-top:hover { background: var(--brand-dark); transform: translateY(-2px); }
.scroll-top svg { width: 20px; height: 20px; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--brand-dark); color: #fff;
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: center; gap: 24px;
  font-size: .88rem;
  transform: translateY(100%);
  transition: transform .4s ease;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner p { color: rgba(255,255,255,.85); max-width: none; margin: 0; }
.cookie-banner a { color: var(--accent); text-decoration: underline; }
.cookie-banner .btn { padding: 8px 20px; font-size: .82rem; white-space: nowrap; }
@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; gap: 12px; text-align: center; padding: 20px; }
}

/* ---------- Architecture diagram responsive ---------- */
.architecture-diagram { overflow-x: auto; }
.architecture-diagram svg { min-width: 700px; }

/* ---------- Pulse animation for alarm demo ---------- */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: .5; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ---------- Hero decorative elements ---------- */
.hero-decoration {
  position: absolute; z-index: -1; opacity: .06;
  width: 500px; height: 500px;
}
.hero-decoration-1 { top: -150px; right: -100px; }
.hero-decoration-2 { bottom: -200px; left: -150px; }

/* ---------- Product card enhanced ---------- */
.product-card-featured {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 40px; align-items: center;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 40px;
  transition: all var(--transition);
  max-width: 900px; margin: 0 auto;
}
.product-card-featured:hover { box-shadow: var(--shadow-lg); border-color: var(--brand-light); }
.product-card-image {
  border-radius: 8px; overflow: hidden;
  background: var(--bg-alt); border: 1px solid var(--border);
}
.product-card-image img { width: 100%; display: block; }
@media (max-width: 768px) {
  .product-card-featured { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
}

/* ---------- FAQ Accordion ---------- */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item:hover { box-shadow: var(--shadow); }
.faq-item[open] { border-color: var(--brand-light); box-shadow: var(--shadow); }
.faq-item summary {
  padding: 18px 24px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 1rem;
  color: var(--brand-dark);
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  transition: background var(--transition);
}
.faq-item summary:hover { background: var(--bg-alt); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.3rem; font-weight: 400;
  color: var(--brand); flex-shrink: 0;
  margin-left: 16px;
  transition: transform .2s ease;
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-light);
  font-size: .94rem;
  line-height: 1.7;
}
.faq-answer strong { color: var(--text); }
