/* ============================================================
   layout.css — Page structure & section layouts
   ============================================================ */

/* ----------------------------------------------------------------
   HEADER
   ---------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2xl);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-brand {
  font-weight: 300;
  font-size: 1.4em;
  letter-spacing: 0.05em;
  color: #fff;
  user-select: none;
}

.header-nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9em;
  transition: color var(--transition-fast);
  position: relative;
  padding: 4px 0;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: #fff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: #fff;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-label {
  font-size: 0.8em;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------
   HERO
   ---------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
  background: linear-gradient(180deg, #0a0a0a 0%, #0f0f15 100%);
  text-align: center;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.hero-title {
  font-size: 3.5em;
  font-weight: 200;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  color: #fff;
}

.hero-subtitle {
  font-size: 1.2em;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 48px;
  letter-spacing: 0.05em;
}

.hero-video-container {
  max-width: 800px;
  width: 90%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-glow);
  background: #000;
}

.hero-video-container video {
  width: 100%;
  display: block;
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-top: 48px;
}

/* ----------------------------------------------------------------
   SECTIONS — shared
   ---------------------------------------------------------------- */
.section {
  padding: var(--space-3xl) var(--space-2xl);
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.8em;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

/* ----------------------------------------------------------------
   GALLERY
   ---------------------------------------------------------------- */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-xl);
  overflow-x: auto;
  padding-bottom: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------------
   INTERACTIVE
   ---------------------------------------------------------------- */
.interactive-section {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-xl);
  min-height: 600px;
}

@media (max-width: 768px) {
  .interactive-section {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static !important;
    max-height: none !important;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .sidebar-item {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--border-subtle);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  align-self: start;
}

.sidebar-item {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9em;
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--bg-card);
  color: #fff;
  border-left: 2px solid #fff;
}

/* ---- Panel main ---- */
.panel-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.panel-title {
  font-size: 1.5em;
  font-weight: 400;
}

.panel-description {
  color: var(--text-secondary);
  font-size: 0.95em;
}

/* ---- Examples row ---- */
.examples-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.examples-row .example-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.examples-row .example-thumb:hover {
  opacity: 1;
}

.examples-row .example-thumb.active {
  opacity: 1;
  border-color: var(--border-strong);
}

/* ---- Controls + Output grid ---- */
.panel-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

@media (max-width: 900px) {
  .panel-content {
    grid-template-columns: 1fr;
  }
}

.controls-area {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.output-area {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */
.footer {
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85em;
  border-top: 1px solid var(--border-subtle);
}

/* ----------------------------------------------------------------
   Responsive fine-tuning
   ---------------------------------------------------------------- */
@media (max-width: 640px) {
  .header {
    padding: 0 var(--space-md);
  }

  .header-nav {
    gap: 16px;
  }

  .hero-title {
    font-size: 2.2em;
  }

  .hero-subtitle {
    font-size: 1em;
  }

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

  .section {
    padding: var(--space-2xl) var(--space-md);
  }
}
