/* ==========================================================================
   X-Image Landing Page — Stylesheet
   A dark, minimal, single-page static site.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens (CSS Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-bg:             #0a0a0a;
  --color-text-primary:   #e5e5e5;
  --color-text-secondary: #a0a0a0;
  --color-accent:         #3b82f6;
  --color-code-bg:        #1a1a1a;
  --color-border:         #222222;
  --color-card-bg:        #111111;

  /* Typography */
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                "Helvetica Neue", Arial, sans-serif;
  --font-mono:  "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;

  /* Spacing */
  --section-padding:   100px;
  --container-max:     1200px;
  --container-padding: 24px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* --------------------------------------------------------------------------
   2. Container
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* --------------------------------------------------------------------------
   3. Section Spacing
   -------------------------------------------------------------------------- */
section {
  padding: var(--section-padding) 0;
}

/* --------------------------------------------------------------------------
   4. Hero
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding-top: 120px;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero .tagline {
  font-size: 1.5rem;
  color: var(--color-text-secondary);
  margin-top: 16px;
}

.hero .subline {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 16px auto 0;
}

.hero-links {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
}

.hero-links a {
  color: var(--color-accent);
  text-decoration: none;
}

.hero-links a:hover {
  text-decoration: underline;
}

.hero-image {
  margin-top: 64px;
  position: relative;
  overflow: hidden;
  max-height: 400px;
}

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

.hero-image::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. Install Command Box
   -------------------------------------------------------------------------- */
.install-cmd {
  display: flex;
  align-items: center;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px 20px;
  max-width: 560px;
  margin: 32px auto 0;
}

.install-cmd code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-text-primary);
  flex: 1;
  white-space: nowrap;
  overflow-x: auto;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 8px;
  margin-left: 12px;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

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

.copy-btn svg {
  width: 20px;
  height: 20px;
}

/* --------------------------------------------------------------------------
   6. Gallery Section
   -------------------------------------------------------------------------- */
.gallery-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 48px;
}

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

.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.gallery img:hover {
  transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   7. Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  margin-top: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 700px;
  text-align: center;
  word-break: break-word;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 16px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* --------------------------------------------------------------------------
   8. Features
   -------------------------------------------------------------------------- */
.features-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 48px;
}

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

.feature-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
  transition: transform 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
}

.feature-icon {
  margin-bottom: 16px;
  color: var(--color-accent);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--color-text-primary);
}

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

/* --------------------------------------------------------------------------
   9. Benchmarks
   -------------------------------------------------------------------------- */
.benchmarks-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 48px;
}

.stat-grid {
  display: flex;
  justify-content: center;
  gap: 64px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--color-text-primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  max-width: 180px;
  display: block;
}

.leaderboard-img {
  max-width: 800px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   10. Capabilities
   -------------------------------------------------------------------------- */
.capabilities-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 48px;
}

.capabilities-img {
  width: 100%;
  border-radius: 12px;
}

/* --------------------------------------------------------------------------
   11. CTA
   -------------------------------------------------------------------------- */
.cta-section {
  text-align: center;
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 32px;
}

.cta-section .requirements {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
  text-align: center;
}

.footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
  margin: 0 16px;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--color-text-primary);
}

.footer span {
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   13. Scroll Fade-In Animation
   -------------------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s, transform 0.6s;
}

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

/* ==========================================================================
   Responsive — Tablet (640px – 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --section-padding: 80px;
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Responsive — Mobile (<640px)
   ========================================================================== */
@media (max-width: 639px) {
  :root {
    --section-padding: 60px;
  }

  .hero {
    padding-top: 80px;
  }

  .hero .tagline {
    font-size: 1.25rem;
  }

  .hero .subline {
    font-size: 1rem;
  }

  .hero-links {
    flex-direction: column;
    gap: 12px;
  }

  .hero-image {
    margin-top: 40px;
  }

  .install-cmd {
    padding: 12px 16px;
  }

  .install-cmd code {
    font-size: 0.85rem;
  }

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

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

  .stat-grid {
    gap: 32px;
  }
}
