.rubik-glitch-regular {
  font-family: "Rubik Glitch", system-ui;
  font-weight: 400;
  font-style: normal;
}


/* Timeline close (X) button styles */
#timeline-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1400;
  line-height: 1;
  transition: color 0.2s, opacity 0.2s;
  opacity: 0.9;
}

#timeline-close:hover {
  opacity: 1;
  color: #ffffff;
}

/* Hamburger menu styles */
#timeline-hamburger {
  position: fixed;
  top: 2.2rem;
  right: 2.2rem;
  width: 48px;
  height: 48px;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  cursor: pointer;
  background: none;
  transition: background 0.2s;
}

#timeline-hamburger span {
  display: block;
  width: 26px;
  height: 4px;
  margin: 3px 0;
  background: #fff;
  border-radius: 2px;
  transition: 0.2s;
}
#timeline-hamburger {
  display: none;
}

/* Timeline overlay styles */
#timeline-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1300;
  display: none;
  flex-direction: column;
  transition: opacity 0.4s;
  overflow-y: auto;
}
#timeline-overlay.active {
  display: flex;
}
#timeline-header {
  color: #ffffff;
  font-size: 2.3rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-family: "Host Grotesk", sans-serif;
  margin-top: 10.5rem;
  padding-top: 1.5rem;
  margin-left: 2.2rem;
  user-select: none;
}
/* Timeline close (X) button styles */
#timeline-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1400;
  line-height: 1;
  transition: color 0.2s, opacity 0.2s;
  opacity: 0.9;
}

#timeline-close:hover {
  opacity: 1;
  color: #ffffff;
}

/* Hamburger menu styles */
#timeline-hamburger {
  position: fixed;
  top: 2.2rem;
  right: 2.2rem;
  width: 48px;
  height: 48px;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  cursor: pointer;
  background: none;
  transition: background 0.2s;
}

#timeline-hamburger span {
  display: block;
  width: 26px;
  height: 4px;
  margin: 3px 0;
  background: #fff;
  border-radius: 2px;
  transition: 0.2s;
}
#timeline-hamburger {
  display: none;
}

/* Timeline overlay styles */
#timeline-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1300;
  display: none;
  flex-direction: column;
  transition: opacity 0.4s;
}
#timeline-overlay.active {
  display: flex;
}
#timeline-header {
  color: #ffffff;
  font-size: 2.3rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-family: "Host Grotesk", sans-serif;
  margin-top: 3.5rem;
  margin-left: 2.2rem;
  user-select: none;
}

/* Vertical timeline container */
#vertical-timeline-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 3rem 2rem;
  margin-top: 1rem;
}

/* Custom scrollbar for timeline */
#vertical-timeline-container::-webkit-scrollbar {
  width: 8px;
}

#vertical-timeline-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

#vertical-timeline-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

#vertical-timeline-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

#vertical-timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 100%;
  padding: 2rem 0;
}

/* Main vertical line */
.timeline-vertical-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: white;
  transform: translateX(-50%);
}

/* Timeline event */
.timeline-event {
  position: relative;
  margin: 4rem 0;
  opacity: 1;
  transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

.timeline-event.hidden {
  opacity: 0;
  transform: translateY(20px);
}

.timeline-event.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Branch line */
.timeline-branch {
  position: absolute;
  top: 50%;
  width: 60px;
  height: 2px;
  background: white;
  transform: translateY(-50%);
}

.timeline-event.left .timeline-branch {
  right: 50%;
  margin-right: 1px;
}

.timeline-event.right .timeline-branch {
  left: 50%;
  margin-left: 1px;
}

/* Circle at end of branch */
.timeline-circle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 50%;
  background: transparent;
  transform: translateY(-50%);
}

.timeline-event.left .timeline-circle {
  right: 50%;
  margin-right: 60px;
}

.timeline-event.right .timeline-circle {
  left: 50%;
  margin-left: 60px;
}

/* Content positioning */
.timeline-content {
  width: calc(50% - 80px);
  font-family: "Host Grotesk", sans-serif;
}

.timeline-event.left .timeline-content {
  margin-left: 0;
  margin-right: auto;
  text-align: right;
  padding-right: 2rem;
}

.timeline-event.right .timeline-content {
  margin-left: auto;
  margin-right: 0;
  text-align: left;
  padding-left: 2rem;
}

/* Year styling */
.timeline-year {
  font-size: 0.9rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

/* Title styling */
.timeline-title {
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.8rem;
  letter-spacing: 0.03em;
}

/* Description styling (no highlight) */
.timeline-description {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.02em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .timeline-content {
    width: calc(50% - 60px);
  }
  
  .timeline-event.left .timeline-content {
    padding-right: 1rem;
  }
  
  .timeline-event.right .timeline-content {
    padding-left: 1rem;
  }
  
  .timeline-title {
    font-size: 1.1rem;
  }
  
  .timeline-description {
    font-size: 0.85rem;
  }
}

/* Starter screen overlay styles */
#starter-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}

#starter-svg-container {
  width: 100vw;
}

#starter-svg-container img {
  width: 100%;
  height: auto;
  display: block;
}

#starter-press-key {
  color: #fff;
  font-size: 2.2rem;
  font-family: 'Rubik Glitch', systems-ui;
  text-align: center;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 12px #000, 0 0 8px #222;
  opacity: 0.85;
  background: rgba(0,0,0,0.2);
  border-radius: 1rem;
  padding: 1rem 2.5rem;
  margin-top: 1.5rem;
  user-select: none;
}

/* Flash transition overlay */
#flash-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease-out;
}

#flash-transition.flashing {
  animation: flashTransition 2s ease-in-out forwards;
}

@keyframes flashTransition {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Remove browser defaults */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden; /* prevents scrolling */
}

/* Three.js canvas */
canvas {
  display: block; /* removes inline spacing */
}

/* Help button styles */
#help-button {
  position: fixed;
  top: 2.2rem;
  left: 2.2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: none;
  color: #fff;
  font-size: 1.8rem;
  font-weight: bold;
  font-family: "Host Grotesk", sans-serif;
  cursor: pointer;
  z-index: 1200;
  display: none; /* Hidden initially, shown after starter screen */
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#help-button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

/* Scene Timeline styles */
#scene-timeline {
  position: fixed;
  top: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: none; /* Hidden initially, shown after starter screen */
  z-index: 1200;
  width: 500px; /* Longer timeline */
  height: 20px; /* Container height for absolute positioning */
}

.timeline-background {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%);
  z-index: 1;
}

.timeline-point {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: none;
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.timeline-point.completed {
  background: #fff;
}

.timeline-point.active {
  background: #fff;
  transform: translate(-50%, -50%) scale(1.3);
}

/* Progress indicator ball */
#timeline-progress {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #fff;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.3s ease;
  z-index: 4; /* Above timeline points */
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Help overlay styles */
#help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
}

#help-overlay.active {
  display: flex;
}

#help-content {
  position: relative;
  background: none;
  padding: 2.5rem;
  max-width: 500px;
  color: #ffffff;
  font-family: "Host Grotesk", sans-serif;
  font-weight: 400;
}

#help-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  opacity: 0.9;
}

#help-close:hover {
  opacity: 1;
  transform: scale(1.1);
  color: #ffffff;
}

#help-content h2 {
  margin: 0 0 1.5rem 0;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-align: left;
  color: #ffffff;
}

.help-instructions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.help-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  background: none;
  border: none;
}

.help-item strong {
  font-size: 1.2rem;
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.help-item p {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
}

.help-note {
  text-align: left;
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin: 1rem 0 0 0;
  font-style: italic;
}

/* Subtitle styles */
#subtitle-container {
  position: fixed;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  width: auto;
  padding: 1rem 2rem;
  
  /* Host Grotesk font styling */
  font-family: "Host Grotesk", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  
  /* White text */
  color: #ffffff;
  font-size: 1rem;
  
  /* Increased line spacing to separate black highlights between lines */
  line-height: 1.6;
  text-align: center;
  z-index: 1000;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
}

.highlight { 
  background-color: black;
  border-radius: 5px;
  padding: 0.1rem 0.5rem;
  color: white;
  
  /* Each line gets its own background box when text wraps */
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Ensure italics work inside highlights */
.highlight em,
#subtitle-container em {
  font-style: italic;
}

.subtitle-visible {
  opacity: 1;
}

.subtitle-hidden {
  opacity: 0;
}

/* Responsive subtitle sizing */
@media (max-width: 768px) {
  #subtitle-container {
    max-width: 90%;
    font-size: 1.1rem;
    padding: 1.2rem 1.8rem;
    bottom: 60px;
  }
}

/* Rotation limit fog overlays */
.rotation-limit-overlay {
  position: fixed;
  top: 0;
  width: 50%;
  height: 100%;
  pointer-events: none;
  z-index: 900;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

#rotation-limit-left {
  right: 0;
  background: radial-gradient(ellipse 80% 150% at right center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 30%, transparent 60%);
}

#rotation-limit-right {
  left: 0;
  background: radial-gradient(ellipse 80% 150% at left center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 30%, transparent 60%);
}

/* Memory text container - styled like subtitles */
#memory-text-container {
  position: fixed;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  width: auto;
  padding: 1rem 2rem;
  
  /* Host Grotesk font styling */
  font-family: "Host Grotesk", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  
  /* Black text (for white background) */
  color: #000000;
  font-size: 1rem;
  
  /* Increased line spacing to separate highlights between lines */
  line-height: 1.6;
  text-align: center;
  z-index: 1100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.highlight-inverse { 
  background-color: white;
  border-radius: 5px;
  padding: 0.1rem 0.5rem;
  color: black !important;
  display: inline;
  
  /* Each line gets its own background box when text wraps */
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

#memory-text-container.visible {
  opacity: 1;
}

/* Responsive memory text sizing */
@media (max-width: 768px) {
  #memory-text-container {
    max-width: 90%;
    font-size: 1.1rem;
    padding: 1.2rem 1.8rem;
    bottom: 60px;
  }
}

