/* AFMS — Dark Neon · Glassmorphism · Futuristic */
:root {
  --bg: #06060e;
  --bg2: #0d0d1a;
  --bg3: #12122a;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(0, 255, 200, 0.15);
  --cyan: #00ffe0;
  --cyan-dim: rgba(0, 255, 224, 0.15);
  --green: #39ff14;
  --green-dim: rgba(57, 255, 20, 0.12);
  --red: #ff2d5b;
  --text: #c8d6e5;
  --text-dim: #5a6a7a;
  --text-bright: #ffffff;
  --mono: 'Share Tech Mono', monospace;
  --display: 'Orbitron', sans-serif;
  --body: 'Inter', sans-serif;
  --glow-cyan: 0 0 10px rgba(0, 255, 224, 0.6), 0 0 30px rgba(0, 255, 224, 0.2);
  --glow-green: 0 0 10px rgba(57, 255, 20, 0.6), 0 0 30px rgba(57, 255, 20, 0.2);
  --radius: 8px;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.07) 2px, rgba(0, 0, 0, 0.07) 4px);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--cyan-dim);
  border-radius: 3px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 64px;
  background: rgba(6, 6, 14, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--panel-border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
}

.nav-bracket {
  color: var(--cyan);
  font-size: 1.3rem;
}

.nav-title {
  color: var(--text-bright);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
}

.nav-sub {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  display: none;
}

@media (min-width: 768px) {
  .nav-sub {
    display: block;
  }
}

.github-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--cyan);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 1px;
  background: var(--cyan-dim);
  transition: var(--transition);
}

.github-btn:hover {
  background: rgba(0, 255, 224, 0.25);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 80px;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0, 255, 224, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 224, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 60% 50%, black 30%, transparent 80%);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 2px;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.6s 0.2s forwards;
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--text-bright);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.6s 0.4s forwards;
}

.neon-green {
  color: var(--green);
  text-shadow: var(--glow-green);
}

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.glitch::before {
  color: var(--cyan);
  animation: glitch1 3s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch::after {
  color: var(--red);
  animation: glitch2 3s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch1 {

  0%,
  95%,
  100% {
    transform: translate(0);
    opacity: 0;
  }

  96% {
    transform: translate(-3px, 2px);
    opacity: 0.7;
  }

  97% {
    transform: translate(3px, -2px);
    opacity: 0.7;
  }
}

@keyframes glitch2 {

  0%,
  92%,
  100% {
    transform: translate(0);
    opacity: 0;
  }

  93% {
    transform: translate(3px, 1px);
    opacity: 0.6;
  }

  94% {
    transform: translate(-2px, -1px);
    opacity: 0.6;
  }
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 480px;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 0.6s 0.6s forwards;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s 0.8s forwards;
}

.hero-video-wrap {
  position: relative;
  z-index: 2;
  opacity: 0;
  animation: fadeUp 0.6s 0.5s forwards;
}

.video-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg3);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 255, 224, 0.08);
}
.demo-video {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 0 40px rgba(0, 255, 224, 0.08);
    background: var(--bg3);
    position: relative;
    right: 30px;
    bottom: 10px;
}
.video-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cyan-dim), transparent 60%);
}

.video-inner {
  text-align: center;
  z-index: 1;
  color: var(--text-dim);
}

.video-icon {
  font-size: 3rem;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  margin-bottom: 12px;
  display: block;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--cyan);
  color: var(--bg);
  border: none;
}

.btn-primary:hover {
  box-shadow: var(--glow-cyan);
  background: #00ffee;
}

.btn-primary.large {
  padding: 16px 36px;
  font-size: 0.85rem;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--panel-border);
}

.btn-ghost:hover {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

section {
  padding: 80px;
}

.section-header {
  margin-bottom: 48px;
}

.section-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 10px;
}

.section-header h2 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 2px;
}

.pipeline-section {
  background: var(--bg2);
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
}

.pipeline-card {
  position: relative;
  padding: 32px 24px;
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pipeline-card.last {
  border-right: none;
}

.card-letter {
  font-family: var(--display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.card-body h3 {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--text-bright);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.card-tech {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--green);
  margin-bottom: 8px;
}

.card-body p {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.card-arrow {
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cyan);
  font-size: 1.4rem;
}

.components-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.comp-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
}

.comp-card:hover {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  transform: translateY(-4px);
}

.comp-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.comp-card h4 {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--text-bright);
  letter-spacing: 2px;
}

.comp-card p {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--green);
}

.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--panel-border), transparent);
  margin: 0 80px;
}

.try-section {
  background: var(--bg);
}

.try-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.output-area {
  min-height: 320px;
  border: 1px dashed var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.output-placeholder {
  text-align: center;
  color: var(--text-dim);
  padding: 40px;
}

.output-results {
  width: 100%;
  padding: 32px;
}

.result-images {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.result-img-wrap {
  flex: 1;
  min-width: 200px;
}

.result-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--cyan);
  letter-spacing: 2px;
  margin-bottom: 8px;
  display: block;
}

.result-img-wrap img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--bg3);
}

.result-arrow-v {
  font-size: 2rem;
  color: var(--cyan);
}

.result-data {
  background: var(--bg3);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  line-height: 1.8;
}

.footer {
  padding: 32px 80px;
  border-top: 1px solid var(--panel-border);
  background: var(--bg2);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--display);
  color: var(--cyan);
  font-size: 0.9rem;
  letter-spacing: 3px;
}

.footer-text {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  flex: 1;
}

.footer-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan);
  text-decoration: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 14, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 40px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.modal-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.modal-option {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 24px;
  transition: var(--transition);
  cursor: pointer;
}

.modal-option:hover,
.modal-option.active-opt {
  border-color: var(--cyan);
  background: var(--cyan-dim);
}

.option-icon {
  font-size: 1.8rem;
}

/* Sample grid container - scrollable */
.sample-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 12px;
}

.sample-grid::-webkit-scrollbar {
  width: 4px;
}

.sample-grid::-webkit-scrollbar-track {
  background: var(--bg3);
  border-radius: 4px;
}

.sample-grid::-webkit-scrollbar-thumb {
  background: var(--cyan);
  border-radius: 4px;
}

.sample-thumb {
  background: var(--bg3);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.thumb-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin-bottom: 6px;
  border: 1px solid var(--panel-border);
}

.thumb-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.thumb-desc {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-thumb.active {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: var(--glow-cyan);
}

.sample-thumb.active .thumb-img {
  border-color: var(--cyan);
}

.sample-thumb:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.upload-label {
  display: block;
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  padding: 24px 12px;
  text-align: center;
  cursor: pointer;
  margin-top: 10px;
}

/* .camera-area {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg3);
  aspect-ratio: 4/3;
  margin: 10px 0;
}

#cameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
} */

.camera-area {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  background: #000;  /* Black background instead of var(--bg3) */
  aspect-ratio: 4/3;
  margin: 10px 0;
}

#cameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;  /* hidden until stream is active */
  background: #000;
}
.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--panel-border);
  flex-wrap: wrap;
}

.input-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  flex: 1;
}

.input-preview-wrap img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--cyan);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 14, 0.5);
  z-index: 150;
  backdrop-filter: blur(4px);
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 90vw);
  height: 100vh;
  background: var(--bg2);
  border-left: 1px solid var(--panel-border);
  z-index: 160;
  padding: 48px 32px;
  overflow-y: auto;
  transform: translateX(0);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.sidebar-title {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--cyan);
  letter-spacing: 3px;
  margin-bottom: 32px;
}

.sidebar-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-steps li {
  display: flex;
  gap: 20px;
}

.step-num {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.sidebar-tip {
  margin-top: 36px;
  background: var(--green-dim);
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 10px;
  padding: 20px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 14, 0.92);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.loading-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.spinner {
  width: 64px;
  height: 64px;
  border: 3px solid var(--panel-border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.lstep.active {
  color: var(--green);
  text-shadow: var(--glow-green);
}

.hidden {
  display: none !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 60px 40px;
  }

  .pipeline-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card-arrow {
    display: none;
  }

  .components-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-options {
    grid-template-columns: 1fr;
  }

  section {
    padding: 60px 40px;
  }

  .divider {
    margin: 0 40px;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0 20px;
  }

  .hero {
    padding: 48px 20px;
  }

  section {
    padding: 48px 20px;
  }

  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  .components-grid {
    grid-template-columns: 1fr;
  }

  .divider {
    margin: 0 20px;
  }

  .footer {
    padding: 24px 20px;
  }
}