/* ============================================
   FALCON SEGMENTATION ANALYZER
   Desert-themed dark UI with glassmorphism
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
  /* Class colors */
  --class-background: #000000;
  --class-trees: #228B22;
  --class-lush-bushes: #00FF00;
  --class-dry-grass: #D2B48C;
  --class-dry-bushes: #8B5A2B;
  --class-ground-clutter: #808000;
  --class-logs: #8B4513;
  --class-rocks: #808080;
  --class-landscape: #A0522D;
  --class-sky: #87CEEB;

  /* Theme */
  --bg-primary: #0c0a09;
  --bg-secondary: #1c1917;
  --bg-card: rgba(28, 25, 23, 0.6);
  --surface: #292524;
  --border: rgba(245, 158, 11, 0.15);
  --text-primary: #fafaf9;
  --text-secondary: #a8a29e;
  --text-muted: #78716c;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.25);
  --gradient-start: #f59e0b;
  --gradient-end: #ef4444;

  /* Spacing */
  --nav-height: 72px;
  --section-padding: 100px;
  --container-max: 1200px;
  --radius: 16px;
  --radius-sm: 8px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: 'Outfit', 'Inter', sans-serif;
  line-height: 1.2;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Glass Card ---- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-color: rgba(245, 158, 11, 0.3);
}

/* ---- Scroll Animations ---- */
.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   NAVIGATION
   ============================================ */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(12, 10, 9, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

#main-nav.scrolled {
  background: rgba(12, 10, 9, 0.95);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.logo-icon {
  font-size: 1.6rem;
}

.logo-accent {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-link {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(245, 158, 11, 0.1);
}

.nav-link.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 24px 60px;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 158, 11, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 69, 19, 0.08), transparent),
    var(--bg-primary);
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-particles .particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float 6s ease-in-out infinite;
}

@keyframes particle-float {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    opacity: 0;
    transform: translateY(-20vh) scale(1);
  }
}

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

.hero-badge {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  margin-bottom: 40px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--accent-hover));
  color: #0c0a09;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.4);
}

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

.btn-secondary:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}

/* Class Legend Strip */
.class-legend-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 60px;
  position: relative;
  z-index: 2;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s ease;
}

.legend-item:hover {
  border-color: var(--class-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--class-color);
  flex-shrink: 0;
}

/* ============================================
   SECTIONS (Shared)
   ============================================ */
.section {
  padding: var(--section-padding) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
}

/* ============================================
   GALLERY
   ============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.gallery-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(245, 158, 11, 0.3);
}

.gallery-card-images {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  cursor: col-resize;
}

.gallery-card-images img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card-images .mask-img {
  clip-path: inset(0 0 0 50%);
  transition: clip-path 0.1s linear;
}

.gallery-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--accent);
  z-index: 5;
  cursor: col-resize;
  transition: left 0.1s linear;
}

.gallery-slider::after {
  content: '⟷';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  color: #0c0a09;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gallery-card-label {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.gallery-card-label span:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

.gallery-placeholder {
  text-align: center;
  padding: 80px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.gallery-placeholder .placeholder-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.gallery-placeholder h3 {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.gallery-placeholder code {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}


/* ============================================
   DASHBOARD
   ============================================ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  padding: 28px 24px;
  text-align: center;
}

.metric-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Improvement Summary Section */
.improvement-section {
  padding: 32px;
  margin-bottom: 40px;
}

.improvement-section h3 {
  font-size: 1.15rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}

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

.improvement-card {
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.improvement-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.improvement-values {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.improvement-old {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.2);
}

.improvement-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.improvement-new {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.improvement-delta {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-block;
}

.delta-up {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.delta-down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Breakdown change column */
.breakdown-change {
  font-size: 0.75rem;
  font-weight: 600;
  width: 70px;
  text-align: right;
  flex-shrink: 0;
}

.breakdown-change .delta-up {
  background: none;
  border: none;
  padding: 0;
}

.breakdown-change .delta-down {
  background: none;
  border: none;
  padding: 0;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.chart-card {
  padding: 28px;
}

.chart-card h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.chart-wrapper {
  position: relative;
  height: 300px;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Class Breakdown */
.class-breakdown {
  padding: 32px;
}

.class-breakdown h3 {
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.breakdown-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.breakdown-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
  width: 110px;
  flex-shrink: 0;
}

.breakdown-bar {
  flex: 1;
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1.2s ease;
}

.breakdown-value {
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 42px;
  text-align: right;
  flex-shrink: 0;
}

/* ============================================
   FAILURE CASE ANALYSIS
   ============================================ */
.failure-section {
  margin-top: 50px;
}

.failure-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.failure-card {
  padding: 28px;
}

.failure-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.failure-icon {
  font-size: 1.5rem;
}

.failure-card h4 {
  font-size: 1.05rem;
  color: var(--text-primary);
}

.failure-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.failure-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.failure-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.failure-name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.failure-iou {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #ef4444;
}

.failure-iou.success-iou {
  color: #22c55e;
}

.failure-reason {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 12px 8px;
  line-height: 1.5;
  border-left: 2px solid rgba(239, 68, 68, 0.3);
  margin-left: 14px;
}

.success-card .failure-item {
  border-color: rgba(34, 197, 94, 0.1);
}

/* Root Cause Analysis */
.analysis-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analysis-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.analysis-bullet {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 2px;
}

.analysis-item strong {
  font-size: 0.95rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}

.analysis-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Gallery Comparison Labels */
.comparison-labels {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
}

.label-r1 {
  color: var(--text-muted);
}

.label-r2 {
  color: var(--accent);
  font-weight: 600;
}

.single-image img {
  position: relative;
}

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.about-card {
  padding: 32px 28px;
}

.about-card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.about-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.about-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tech-badge {
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
}


/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  :root {
    --section-padding: 60px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(12, 10, 9, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-stats {
    gap: 24px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

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

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

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

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

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


  .class-legend-strip {
    gap: 6px;
  }

  .legend-item {
    font-size: 0.7rem;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    letter-spacing: -1px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }

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