/* ============================================
   ScanMan AI — Brand Styles
   Colors: ScanMan Red #E20613, Blue #004D98,
           Green #00A561, Teal #00844E
   Font:   Poppins
   ============================================ */

:root {
  --red: #E20613;
  --red-dark: #B80510;
  --blue: #004D98;
  --blue-light: #1877F2;
  --green: #00A561;
  --green-light: #61CE70;
  --teal: #00844E;
  --dark: #1A1A2E;
  --dark-surface: #222240;
  --gray-50: #F8F9FA;
  --gray-100: #F0F2F5;
  --gray-200: #E4E6EA;
  --gray-400: #8A8D91;
  --gray-600: #606770;
  --gray-800: #2D2D2D;
  --white: #FFFFFF;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
  background: var(--white);
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- NAV ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: all 0.3s;
}
.nav.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  padding: 10px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dark);
}
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--red);
  color: var(--white);
  border-radius: 10px;
  font-weight: 800;
  font-size: 20px;
}
.logo-text {
  font-size: 20px;
  font-weight: 400;
  color: var(--dark);
}
.logo-text strong { font-weight: 700; }
.logo-text small {
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
  vertical-align: super;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  text-decoration: none;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--red); }

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s;
  cursor: pointer;
  border: 2px solid transparent;
  font-family: inherit;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(226,6,19,0.3);
}
.btn-outline {
  background: transparent;
  color: var(--dark);
  border-color: var(--gray-200);
}
.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
}
.btn-outline-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}
.btn-outline-light:hover {
  background: var(--white);
  color: var(--red);
}
.btn-nav {
  background: var(--red);
  color: var(--white) !important;
  padding: 8px 20px;
  border-radius: 8px;
}
.btn-nav:hover {
  background: var(--red-dark);
  color: var(--white) !important;
}
.btn-lg { padding: 14px 32px; font-size: 16px; }

/* ---- HERO ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fafafa 0%, #fff0f0 30%, #f0f4ff 70%, #f0fff4 100%);
  z-index: -2;
}
.hero-bg::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(226,6,19,0.06) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-block;
  background: rgba(226,6,19,0.08);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--dark);
}
.text-gradient {
  background: linear-gradient(135deg, var(--red) 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 18px;
  color: var(--gray-600);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
}
.stat { text-align: center; }
.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--red);
}
.stat-label {
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 500;
}

/* ---- SECTIONS ---- */
.section {
  padding: 100px 0;
}
.section-dark {
  background: var(--dark);
  color: var(--white);
}
.section-dark .section-header p { color: rgba(255,255,255,0.6); }
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  margin-bottom: 12px;
}
.section-header p {
  font-size: 17px;
  color: var(--gray-600);
  max-width: 560px;
  margin: 0 auto;
}

/* ---- FEATURES GRID ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.3s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0,77,152,0.08);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-icon.icon-green { background: rgba(0,165,97,0.08); color: var(--green); }
.feature-icon.icon-red { background: rgba(226,6,19,0.08); color: var(--red); }
.feature-icon.icon-teal { background: rgba(0,132,78,0.08); color: var(--teal); }
.feature-icon.icon-dark { background: rgba(26,26,46,0.08); color: var(--dark); }
.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.7;
}

/* ---- STEPS ---- */
.steps {
  max-width: 700px;
  margin: 0 auto;
}
.step {
  display: flex;
  gap: 24px;
  margin-bottom: 40px;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 27px;
  top: 56px;
  bottom: -16px;
  width: 2px;
  background: rgba(255,255,255,0.15);
}
.step-number {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}
.step-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-content p {
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.step-detail code {
  display: inline-block;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--green-light);
}

/* ---- ARCHITECTURE DIAGRAM ---- */
.arch-diagram {
  max-width: 700px;
  margin: 0 auto 60px;
}
.arch-layer {
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 0;
}
.arch-app { background: var(--gray-50); border: 2px solid var(--gray-200); }
.arch-hook { background: rgba(226,6,19,0.06); border: 2px solid rgba(226,6,19,0.15); text-align: center; }
.arch-service { background: rgba(0,77,152,0.04); border: 2px solid rgba(0,77,152,0.15); }
.arch-output { background: rgba(0,165,97,0.04); border: 2px solid rgba(0,165,97,0.15); }
.arch-label {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--dark);
}
.arch-sublabel {
  font-size: 13px;
  color: var(--gray-600);
}
.arch-boxes {
  display: flex;
  gap: 12px;
}
.arch-box {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  position: relative;
}
.arch-box small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-400);
  margin-top: 2px;
}
.arch-box.box-local { border-color: var(--green); }
.arch-box.box-cloud { border-color: var(--blue); }
.arch-box.box-out { border-color: var(--green); font-size: 13px; }
.arch-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
  margin-right: 4px;
}
.tag-fast { background: rgba(0,165,97,0.1); color: var(--green); }
.tag-offline { background: rgba(0,132,78,0.1); color: var(--teal); }
.tag-smart { background: rgba(0,77,152,0.1); color: var(--blue); }
.tag-vision { background: rgba(226,6,19,0.1); color: var(--red); }
.arch-arrow {
  text-align: center;
  font-size: 24px;
  color: var(--gray-400);
  padding: 8px 0;
}

/* Tech Stack */
.tech-stack { max-width: 700px; margin: 0 auto; }
.tech-stack h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}
.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tech-item {
  background: var(--gray-50);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.tech-item strong {
  display: block;
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.tech-item span {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

/* ---- PHONE MOCKUPS ---- */
.demo-screens {
  display: flex;
  gap: 32px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}
.phone-mock { text-align: center; }
.phone-frame {
  width: 260px;
  height: 520px;
  background: var(--dark-surface);
  border-radius: 36px;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}
.phone-notch {
  width: 100px;
  height: 24px;
  background: var(--dark-surface);
  border-radius: 0 0 16px 16px;
  margin: 0 auto 8px;
  position: relative;
  z-index: 2;
}
.phone-screen {
  background: #F8F9FA;
  border-radius: 24px;
  height: calc(100% - 32px);
  overflow: hidden;
  padding: 16px;
}
.screen-label {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

/* Mock UI elements */
.mock-header {
  font-size: 28px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 4px;
}
.mock-header-sm {
  font-size: 16px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 12px;
}
.mock-subtitle {
  font-size: 11px;
  color: var(--gray-400);
  margin-bottom: 16px;
}
.mock-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.mock-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.mock-btn-primary {
  background: var(--red);
  color: white;
}
.mock-btn-outline {
  border: 2px solid var(--red);
  color: var(--red);
}
.mock-empty {
  text-align: center;
  padding: 30px 0;
}
.mock-empty-icon { font-size: 40px; margin-bottom: 8px; }
.mock-empty-title { font-size: 14px; font-weight: 700; color: var(--dark); }
.mock-empty-sub { font-size: 11px; color: var(--gray-400); }
.mock-image-area {
  background: var(--gray-200);
  border-radius: 10px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.mock-doc-icon { font-size: 32px; }
.mock-scanning {
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
  margin-top: 4px;
}
.mock-section { margin-bottom: 12px; }
.mock-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.mock-text-lines { display: flex; flex-direction: column; gap: 6px; }
.mock-line {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
}
.w45 { width: 45%; }
.w50 { width: 50%; }
.w60 { width: 60%; }
.w70 { width: 70%; }
.w80 { width: 80%; }
.w85 { width: 85%; }
.w90 { width: 90%; }
.mock-analysis-card {
  background: white;
  border-radius: 10px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--dark);
  border: 1px solid var(--gray-200);
}
.mock-analysis-card strong { color: var(--blue); }
.mock-answer {
  background: white;
  border-radius: 10px;
  padding: 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--gray-800);
}
.mock-input-row {
  display: flex;
  gap: 6px;
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
}
.mock-input {
  flex: 1;
  background: var(--gray-100);
  border-radius: 16px;
  padding: 8px 12px;
  font-size: 10px;
  color: var(--gray-400);
}
.mock-send {
  background: var(--red);
  color: white;
  border-radius: 16px;
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 600;
}

/* ---- DOCUMENT TYPES ---- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.doc-card {
  text-align: center;
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 24px 16px;
  transition: all 0.3s;
  border: 1px solid transparent;
}
.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--red);
}
.doc-icon { font-size: 36px; margin-bottom: 12px; }
.doc-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.doc-card p { font-size: 12px; color: var(--gray-600); }

/* ---- CTA ---- */
.section-cta {
  background: linear-gradient(135deg, var(--red) 0%, var(--blue) 100%);
  color: var(--white);
  text-align: center;
  padding: 80px 0;
}
.section-cta h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  margin-bottom: 12px;
}
.section-cta p {
  font-size: 17px;
  opacity: 0.85;
  margin-bottom: 32px;
}
.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
}
.cta-install code {
  display: inline-block;
  background: rgba(0,0,0,0.2);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.9);
}

/* ---- FOOTER ---- */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.6);
  padding: 48px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand .logo-text { color: var(--white); }
.footer-tagline {
  font-size: 13px;
  margin-left: 12px;
  opacity: 0.6;
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }
.footer-copy { font-size: 12px; opacity: 0.4; }

/* ---- ANIMATIONS ---- */
.animate-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.step.animate-in { transition-delay: calc(var(--i, 0) * 0.15s); }
.step:nth-child(1) { --i: 0; }
.step:nth-child(2) { --i: 1; }
.step:nth-child(3) { --i: 2; }

.feature-card.animate-in { transition-delay: calc(var(--i, 0) * 0.1s); }
.feature-card:nth-child(1) { --i: 0; }
.feature-card:nth-child(2) { --i: 1; }
.feature-card:nth-child(3) { --i: 2; }
.feature-card:nth-child(4) { --i: 3; }
.feature-card:nth-child(5) { --i: 4; }
.feature-card:nth-child(6) { --i: 5; }

.phone-mock.animate-in { transition-delay: calc(var(--i, 0) * 0.2s); }
.phone-mock:nth-child(1) { --i: 0; }
.phone-mock:nth-child(2) { --i: 1; }
.phone-mock:nth-child(3) { --i: 2; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .doc-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 20px; }
  .mobile-toggle { display: flex; z-index: 101; }

  .hero { min-height: auto; padding: 120px 0 60px; }
  .hero h1 { font-size: 32px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-stats { gap: 24px; }

  .features-grid { grid-template-columns: 1fr; }
  .demo-screens { flex-direction: column; align-items: center; }
  .doc-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .arch-boxes { flex-direction: column; }
  .cta-actions { flex-direction: column; align-items: center; }
}
