/* =========================================
   CSS VARIABLES & RESET
   ========================================= */
:root {
  /* UI Design Palette */
  --primary: #BEBA1F;
  --primary-rgb: 190, 186, 31;
  --primary-hover: #dcd824;
  --secondary: #04df44;
  --secondary-rgb: 4, 223, 68;
  --accent: #534137;
  --accent-rgb: 83, 65, 55;
  
  /* Backgrounds */
  --background: #FFFFFF;
  --background-alt: #F4F4F4;
  --surface: #FAFAFA;
  
  /* Text */
  --text-primary: #000000;
  --text-secondary: #333333;
  --text-muted: #666666;
  
  /* Borders */
  --border: #E5E5E5;
  
  /* Typography */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Outfit', sans-serif;
  
  /* Spacing */
  --header-height: 80px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  width: 100%;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  word-break: break-word;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: 1rem;
}

/* =========================================
   SECTION STYLING - MANDATORY
   ========================================= */
section {
  padding: 5rem 2rem;
  position: relative;
}

section:nth-child(odd) {
  background-color: var(--background);
}

section:nth-child(even) {
  background-color: var(--background-alt);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* =========================================
   COMPONENTS (Buttons, Cards)
   ========================================= */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-heading);
  font-size: 1rem;
  border-radius: 0px; /* Brutalist style */
}

.btn-primary {
  background-color: var(--primary);
  color: #000; /* Black text on Gold for contrast */
  border: 2px solid var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:disabled {
  background-color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 2px solid var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--text-primary);
  color: var(--background);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* Brutalist Cards */
.card, .step-card, .feature-card, .testimonial-card, .benefit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  /* Brutalist touch */
  border-radius: 0px; 
}

.card:hover, .step-card:hover, .feature-card:hover, .testimonial-card:hover, .benefit-card:hover {
  transform: translateY(-5px);
  box-shadow: 4px 4px 0px var(--accent); /* Offset shadow for brutalist feel */
  border-color: var(--text-primary);
}

/* =========================================
   HEADER
   ========================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav a {
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--primary);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

.mobile-cta {
  display: none;
}

/* =========================================
   HERO SECTION (Grid Scanner)
   ========================================= */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center; /* Center horizontally */
  padding-top: var(--header-height);
  position: relative;
  overflow: hidden;
}

/* Image Background */
.hero-bg-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Grid Scanner Animation Overlay */
.hero-bg-animation {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: 
      linear-gradient(90deg, transparent 98%, rgba(var(--secondary-rgb), 0.2) 100%), /* Secondary Green */
      linear-gradient(0deg, transparent 98%, rgba(var(--secondary-rgb), 0.2) 100%);
  background-size: 60px 60px;
  opacity: 0.4;
  animation: gridMove 10s linear infinite;
}

.scan-line {
  position: absolute;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  box-shadow: 0 0 10px var(--secondary);
  animation: scan 4s ease-in-out infinite;
  z-index: 2;
}

@keyframes gridMove { 
  to { background-position: 60px 60px; } 
}
@keyframes scan { 
  0% { top: 0; opacity: 0; } 
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 100%; opacity: 0; } 
}

/* Dark Overlay for readability */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 40%, rgba(255,255,255,0.2) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 1fr; /* Split screen layout */
  gap: 4rem;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

/* Highlight bar under headline */
.hero-content h1::after {
  content: '';
  display: block;
  width: 100px;
  height: 8px;
  background: var(--primary);
  margin-top: 1rem;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* =========================================
   PLAYGROUND (Lab Interface)
   ========================================= */
#playground {
  background-color: var(--background);
}

.playground-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.playground-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 4px; /* Slight radius */
}

.panel-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.panel-header h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Upload Zone */
.upload-zone {
  height: 350px;
  border: 2px dashed var(--accent); /* Accent Brown dashed border */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  background: #fff;
  overflow: hidden;
}

.upload-zone:hover {
  border-color: var(--secondary); /* Green on hover */
  background: rgba(4, 223, 68, 0.05);
}

.upload-placeholder {
  text-align: center;
  pointer-events: none;
}

.upload-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.upload-text {
  font-weight: 500;
}

.upload-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
}

#preview-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  background: #fff;
}

.hidden {
  display: none !important;
}

/* Result Display */
.result-display {
  height: 350px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--text-primary); /* Technical feel */
}

.result-placeholder {
  text-align: center;
  color: #666;
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

#result-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Loading */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  z-index: 10;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(var(--primary-rgb), 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.playground-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.playground-actions .btn {
  flex: 1;
}

/* =========================================
   HOW TO USE (Film Strip)
   ========================================= */
#how-to-use {
  background-color: var(--background-alt);
  overflow: hidden;
}

.steps-grid {
  display: flex;
  overflow-x: auto;
  gap: 2rem;
  padding-bottom: 2rem;
  /* Scroll snap for mobile */
  scroll-snap-type: x mandatory;
}

/* Connecting line logic via pseudo element on grid container not ideal for flex, 
   so we style cards to look like film frames */
.step-card {
  flex: 1;
  min-width: 300px;
  border: 2px solid var(--text-primary); /* Film strip border */
  background: var(--background);
  position: relative;
  border-radius: 0;
  scroll-snap-align: start;
}

/* Film holes decoration top/bottom */
.step-card::before, .step-card::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px;
  height: 10px;
  background-image: linear-gradient(90deg, var(--text-primary) 50%, transparent 50%);
  background-size: 20px 10px;
  opacity: 0.2;
}
.step-card::before { top: 5px; }
.step-card::after { bottom: 5px; }

.step-number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary); /* Gold */
  margin-bottom: 1rem;
  line-height: 1;
}

.step-icon {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 1rem;
}

/* =========================================
   FEATURES (2x2 Grid)
   ========================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

/* Glitch effect on hover */
.feature-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 var(--accent);
}

.feature-icon {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 1.5rem;
}

/* =========================================
   GALLERY (Bento Grid)
   ========================================= */
.gallery-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 300px;
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0px;
  border: 1px solid var(--border);
}

/* Featured item spans 2 cols */
.gallery-item.featured {
  grid-column: span 2;
  grid-row: span 2; /* 600px height + gap */
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* =========================================
   BENEFITS (Masonry style look)
   ========================================= */
#why-use {
  background-color: var(--background-alt);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.benefit-card {
  border-left: 4px solid var(--primary);
  background: var(--surface);
}

.benefit-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* =========================================
   TESTIMONIALS (Production Logs)
   ========================================= */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.testimonial-card {
  background: var(--background-alt); /* Log card style */
  border: 1px solid var(--border);
  font-family: monospace; /* Data entry feel */
  position: relative;
  border-left: 2px solid var(--accent); /* Stamp line */
}

.quote-mark {
  font-size: 2rem;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: 1rem;
}

.review-text {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.reviewer-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px dashed var(--border);
  padding-top: 1rem;
}

.reviewer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 0; /* Square for brutalist/log feel */
  border: 1px solid var(--text-primary);
}

.reviewer-name {
  display: block;
  font-weight: 700;
  color: var(--text-primary);
}

.reviewer-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================================
   FAQ (Technical Accordion)
   ========================================= */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  background: var(--surface);
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
}

.faq-item.active {
  border-left-color: var(--primary); /* Gold highlight */
}

.faq-question {
  width: 100%;
  padding: 1.5rem;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--secondary); /* Green plus */
  transition: transform 0.3s;
}

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

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding-bottom: 1.5rem;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
  background: var(--surface);
  padding: 4rem 2rem 2rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}

.footer-column h4 {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.footer-column a {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-column a:hover {
  color: var(--secondary); /* Tech green hover */
  padding-left: 5px; /* Slight movement */
}

.footer-bottom {
  max-width: 1280px;
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Status indicator */
.footer-bottom::after {
  content: 'System Status: Online ●';
  color: var(--secondary);
  font-family: monospace;
  font-size: 0.8rem;
}

/* =========================================
   RESPONSIVE QUERIES
   ========================================= */

/* Tablet (max 1024px) */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-content h1::after {
    margin: 1rem auto;
  }
  
  .hero-description {
    margin: 0 auto 2.5rem;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .playground-grid {
    grid-template-columns: 1fr;
  }
  
  .upload-zone, .result-display {
    height: 300px;
  }
  
  .gallery-bento {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-item.featured {
    grid-column: span 2;
    grid-row: span 1;
  }
  
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {
  /* Header */
  .menu-toggle { display: block; }
  .desktop-cta { display: none; }
  
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    flex-direction: column;
  }
  
  nav.active { display: flex; }
  
  nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .mobile-cta { display: block; width: 100%; }
  .mobile-cta .btn { width: 100%; }

  /* Hero */
  .hero { padding-top: 100px; }
  .hero h1 { font-size: 2.5rem; }
  
  /* Grids to Single Column */
  .features-grid, 
  .testimonials-grid, 
  .benefits-grid, 
  .footer-content {
    grid-template-columns: 1fr;
  }
  
  .gallery-bento {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
  }
  
  .gallery-item.featured {
    grid-column: span 1;
  }
  
  /* Steps */
  .steps-grid {
    flex-direction: column;
  }
  
  .step-card {
    min-width: 100%;
  }
  
  /* Footer */
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
  }
}