/* =============================================
   CSS VARIABLES & RESET
   ============================================= */
:root {
  --bg: #0a0a0f;
  --bg-panel: #111118;
  --bg-panel-hover: #16161f;
  --border: rgba(255, 255, 255, 0.07);
  --border-active: rgba(255, 200, 80, 0.4);
  --text-primary: #f0efe8;
  --text-secondary: #8a8a9a;
  --text-muted: #4a4a5a;
  --accent: #f5c842;
  --accent-dim: rgba(245, 200, 66, 0.12);
  --accent-glow: rgba(245, 200, 66, 0.25);
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --font-display: 'Sans-Serif';
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius: 12px;
  --radius-lg: 20px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =============================================
   BACKGROUND
   ============================================= */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(245, 200, 66, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* =============================================
   HEADER
   ============================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(10, 10, 15, 0.85);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  font-size: 1.3rem;
  color: var(--accent);
}

.logo-accent {
  color: var(--accent);
}

.btn-subscribe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #0a0a0f;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: 100px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

.btn-subscribe:hover {
  background: #ffd84d;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 2rem 60px;
  max-width: 800px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-active);
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
  animation: fadeInDown 0.6s ease both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  animation: fadeInDown 0.6s 0.1s ease both;
}

.hero-title-accent {
  color: var(--accent);
  position: relative;
  display: inline-block;
}

.hero-title-accent::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.4;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.7;
  animation: fadeInDown 0.6s 0.2s ease both;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  animation: fadeInDown 0.6s 0.3s ease both;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 32px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* =============================================
   DEMO SECTION
   ============================================= */
.demo-section {
  position: relative;
  z-index: 1;
  padding: 0 2rem 80px;
}

.demo-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 0;
  align-items: start;
}

/* =============================================
   PANELS
   ============================================= */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  transition: border-color 0.3s ease;
}

.panel:hover {
  border-color: rgba(255,255,255,0.12);
}

.panel-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* =============================================
   SAMPLE BUTTONS
   ============================================= */
.samples-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.samples-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.sample-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sample-btn:hover {
  border-color: var(--border-active);
  color: var(--accent);
  background: var(--accent-dim);
}

.sample-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* =============================================
   DROP ZONE
   ============================================= */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.01);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.dropzone-icon {
  color: var(--text-muted);
  margin-bottom: 14px;
  transition: color 0.2s ease;
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  color: var(--accent);
}

.dropzone-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.dropzone-subtext {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.btn-upload {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-upload:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =============================================
   PREVIEW
   ============================================= */
.preview-area {
  position: relative;
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.preview-area img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #0d0d15;
  display: block;
}

.btn-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.btn-clear:hover {
  color: var(--red);
  border-color: var(--red);
}

/* =============================================
   PARSE BUTTON
   ============================================= */
.btn-parse {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.btn-parse:hover:not(:disabled) {
  background: #ffd84d;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-parse:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.btn-parse.loading {
  opacity: 0.7;
  cursor: wait;
}

.btn-parse-arrow {
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.btn-parse:hover:not(:disabled) .btn-parse-arrow {
  transform: translateX(4px);
}

/* =============================================
   ERROR MESSAGE
   ============================================= */
.error-msg {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--red-dim);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--red);
  font-family: var(--font-mono);
}

/* =============================================
   PANEL ARROW (CONNECTOR)
   ============================================= */
.panel-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 120px;
}

.arrow-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.arrow-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.arrow-dot:nth-child(2) { animation-delay: 0.3s; }
.arrow-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes pulse-dot {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50% { opacity: 0.8; transform: scale(1.2); }
}

/* =============================================
   OUTPUT PANEL
   ============================================= */
.output-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 12px;
}

.idle-icon {
  font-family: var(--font-mono);
  font-size: 3rem;
  color: var(--text-muted);
  opacity: 0.4;
}

.idle-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Loading */
.output-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 20px;
}

.loader-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 36px;
}

.loader-bars span {
  display: block;
  width: 6px;
  background: var(--accent);
  border-radius: 3px;
  animation: bar-bounce 1s ease-in-out infinite;
}

.loader-bars span:nth-child(1) { animation-delay: 0s; }
.loader-bars span:nth-child(2) { animation-delay: 0.1s; }
.loader-bars span:nth-child(3) { animation-delay: 0.2s; }
.loader-bars span:nth-child(4) { animation-delay: 0.3s; }
.loader-bars span:nth-child(5) { animation-delay: 0.4s; }

@keyframes bar-bounce {
  0%, 100% { height: 8px; opacity: 0.3; }
  50% { height: 32px; opacity: 1; }
}

.loading-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

/* Result */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.result-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 4px 12px;
  border-radius: 100px;
}

.result-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Result Cards */
.result-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.result-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  animation: slideIn 0.3s ease both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-key {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-top: 2px;
  min-width: 100px;
}

.card-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.card-value.highlight {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.line-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}

.line-items-list li {
  font-size: 0.83rem;
  color: var(--text-secondary);
}

/* JSON Block */
.json-block {
  background: #07070d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  overflow: auto;
  max-height: 220px;
  position: relative;
}

.btn-copy-json {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 1;
}

.btn-copy-json:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-copy-json.copied {
  border-color: #22c55e;
  color: #22c55e;
}

.json-block pre {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: pre;
  line-height: 1.7;
}

/* CTA */
.result-cta {
  background: var(--accent-dim);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
}

.cta-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.btn-cta {
  display: inline-block;
  background: var(--accent);
  color: #0a0a0f;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-cta:hover {
  background: #ffd84d;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* =============================================
   HOW IT WORKS
   ============================================= */
.how-section {
  position: relative;
  z-index: 1;
  padding: 60px 2rem 80px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.how-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
  color: var(--text-primary);
}

.how-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.step-content h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.step-content p {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 200px;
  margin: 0 auto;
}

.how-connector {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  flex-shrink: 0;
  margin-bottom: 40px;
  opacity: 0.4;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 24px 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   MOBILE STICKY CTA
   ============================================= */
.mobile-sticky-cta {
  display: none;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .demo-container {
    /* minmax(0,1fr) prevents the track from expanding beyond the viewport */
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-arrow {
    flex-direction: row;
    padding-top: 0;
    padding: 12px 0;
    justify-content: center;
  }

  .arrow-track {
    flex-direction: row;
  }

  .how-steps {
    flex-direction: column;
    gap: 24px;
  }

  .how-connector {
    width: 1px;
    height: 30px;
    background: linear-gradient(180deg, var(--accent), transparent);
    margin: 0;
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .stat {
    padding: 0 16px;
  }

  .stat-num {
    font-size: 1.4rem;
  }

  .header-inner {
    padding: 0 1rem;
  }

  .btn-subscribe {
    font-size: 0.78rem;
    padding: 7px 14px;
  }

  /* Sticky CTA bar */
  .mobile-sticky-cta {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-active);
    padding: 10px 16px 14px;
    text-align: center;
  }

  .mobile-sticky-btn {
    display: block;
    background: var(--accent);
    color: #0a0a0f;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
  }

  /* Prevent page content from hiding behind sticky bar */
  body {
    padding-bottom: 72px;
  }

  /* Reduce horizontal padding so panels have more breathing room */
  .demo-section {
    padding: 0 1rem 80px;
  }

  /* Panels fill the constrained column; section padding provides the side inset */
  .panel {
    width: 100%;
  }

  .hero{
    margin: 0 auto;
  }
}

/* =============================================
   EMAIL CAPTURE
   ============================================= */
.notify-section {
  position: relative;
  z-index: 1;
  padding: 2.5rem 2rem;
  text-align: center;
}

.notify-label {
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.notify-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.notify-input {
  font-family: var(--font-mono);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  width: 280px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.notify-input:focus {
  border-color: var(--border-active);
}

.notify-input::placeholder {
  color: var(--text-muted);
}

.notify-btn {
  background: var(--accent);
  color: #0a0a0f;
  font-family: var(--font-body);
  font-weight: 700;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.notify-btn:hover {
  background: #ffd84d;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.notify-success {
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.92rem;
  margin-top: 0.5rem;
}
