/**
 * Page-specific styles for index.html (Timeline page)
 * Extracted from inline <style> block for better organization
 */

/* Page-specific: overflow hidden for video background */
body {
  overflow: hidden;
}

/* ==========================================
   INTRO OVERLAY
   ========================================== */
.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 500; /* Use Constants.Z_INDEX.INTRO_OVERLAY */
  transition: opacity 0.8s ease;
}

.intro-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.intro-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-darken {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
}

.intro-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.intro-logo {
  position: absolute;
  top: 0;
  left: 0;
  height: var(--header-height, 72px);
  padding: 0 40px;
  display: flex;
  align-items: center;
  z-index: 10;
}

.intro-logo img {
  height: 24px;
  width: 24px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .intro-logo {
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .intro-logo {
    padding: 0 16px;
  }
  .intro-logo img {
    height: 22px;
    width: 22px;
  }
}

.intro-tagline {
  font-size: clamp(24px, 5vw, 48px);
  font-weight: 300;
  text-align: center;
  line-height: 1.3;
  max-width: 800px;
  opacity: 0;
  transform: translateY(20px);
  animation: introFadeInUp 1.5s ease forwards;
  animation-delay: 0.3s;
}

.intro-tagline span {
  display: block;
}

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

.intro-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  opacity: 0;
  animation: introFadeInUp 1s ease forwards;
  animation-delay: 1.2s; /* Use Constants.TIMING.INTRO_ANIMATION_DELAY */
  cursor: pointer;
}

.intro-timeline:hover .intro-timeline-line {
  background: rgba(255, 255, 255, 0.5);
}

.intro-timeline-year {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.05em;
}

.intro-timeline-line {
  width: 50px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  transition: background 0.3s ease;
}

.intro-timeline-line::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0%, #4ade80 100%);
  animation: introTimeline 1.9s linear forwards; /* Use Constants.TIMING.INTRO_TIMELINE_DURATION */
  animation-delay: 1.2s; /* Use Constants.TIMING.INTRO_ANIMATION_DELAY */
}

@keyframes introTimeline {
  to {
    width: 100%;
  }
}

/* ==========================================
   TERMINAL SCREEN CONTAINER
   ========================================== */

/* Video layer: see VIDEO BACKGROUND section below */

/* Terminal container - positioned by screen-position.js to overlay monitor screen */
.screen-container {
  position: fixed;
  z-index: 50; /* Use Constants.Z_INDEX.TERMINAL */
  /* Hidden until video ends */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  overflow: hidden;
  transform-origin: 0 0; /* needed for matrix3d from top-left */
}

.screen-container.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile screens (iOS, Android) - fallback only, JS handles positioning */
.screen-container.mobile {
  top: 50%;
  left: 50%;
  width: 252px;
  aspect-ratio: 9 / 16;
  transform: translate(-50%, -50%);
  transform-origin: center center;
}

/* Terminal iframe fills the container */
.screen-container .terminal-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* ==========================================
   VIDEO BACKGROUND
   ========================================== */

/* Video background layer */
.video-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0; /* Use Constants.Z_INDEX.BACKGROUND */
  background: #000 url('videos/c64-firstframe.jpg?v=1768929351') center/cover no-repeat;
  transform-style: preserve-3d;
  perspective: 1200px;
}

.video-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

#intro-video {
  z-index: 2; /* Use Constants.Z_INDEX.VIDEO_PLAYING */
  transition: opacity 0.5s ease;
}

#loop-video {
  z-index: 1; /* Use Constants.Z_INDEX.VIDEO_LAYER */
}

/* Page-specific: transparent header background for video page */
.header {
  background: transparent;
  backdrop-filter: none;
}

/* ==========================================
   SIDE ERA NAVIGATION ARROWS
   ========================================== */
.era-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  opacity: 0;
  pointer-events: none;
}

.era-nav.visible {
  opacity: 1;
  pointer-events: auto;
}

.era-nav--prev {
  left: 20px;
}

.era-nav--next {
  right: 20px;
}

.era-nav svg {
  width: 22px;
  height: 22px;
}

.era-nav:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}

.era-nav:active {
  transform: translateY(-50%) scale(0.95);
}

/* Hide side arrows on mobile (swipe gestures work instead) */
@media (max-width: 768px) {
  .era-nav {
    display: none;
  }
}

/* Keyboard hints */
.keyboard-hint {
  position: fixed;
  bottom: 16px;
  right: 40px;
  z-index: 100; /* Use Constants.Z_INDEX.HEADER */
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  font-weight: 500;
}

.keyboard-hint kbd {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 0 2px;
  font-family: 'Space Grotesk', sans-serif;
}

/* Page-specific: hide keyboard hint on mobile */
@media (max-width: 768px) {
  .keyboard-hint {
    display: none;
  }
}

/* Reduced motion: skip intro animations */
@media (prefers-reduced-motion: reduce) {
  .intro-overlay { transition: none; }
  .intro-tagline { animation: none; opacity: 1; transform: none; }
  .intro-timeline { animation: none; opacity: 1; }
  .intro-timeline-line::after { animation: none; width: 100%; }
  .screen-container { transition: none; }
}
