/* =================== Global Styles =================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Open Sans', sans-serif;
  background-color: #2A2A2A;
  color: #fff;
  overflow-x: hidden;
  overflow-y: overlay;
}
a { text-decoration: none; color: inherit; }

/* =================== Film Grain Video Overlay =================== */
/* Film grain video used in the splash screen background */
#filmgrain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.1; /* very subtle grain effect */
  will-change: transform; /* Optimize for animation */
}

/* =================== Background Effects =================== */
.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.background-grain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.03;
}



/* =================== Main Content =================== */
#main-content {
  display: none;
  opacity: 0;
  transition: opacity 1s ease;
  will-change: opacity;
}

.name-trigger {
  cursor: pointer;
  transition: color 0.3s ease;
}

.name-trigger:hover {
  color: #fff !important;
}

/* =================== Splash Screen =================== */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #2A2A2A;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 1s ease;
}
.splash-text {
  font-family: 'Bebas Neue', cursive;
  text-align: center;
  opacity: 0;
}
#splash-title {
  text-transform: uppercase;
}
#splash-name {
  text-transform: uppercase;
}

/* Loading Animation */
.loading-indicator {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
  animation-delay: 3s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-circle {
  width: 100%;
  height: 100%;
  position: relative;
}

.loading-circle:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite, wobble 3s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes wobble {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(0.8); }
}
/* Company name */
#splash-title {
  font-size: 48px;
  animation: fadeIn 1s forwards;
}
/* "Presents" text */
#splash-presents {
  font-family: 'Great Vibes', cursive;
  font-size: 42px;
  animation: fadeIn 1s forwards;
  animation-delay: 1.5s;
  opacity: 0;
  margin-top: 12px;
  letter-spacing: 1px;
}
/* Your name */
#splash-name {
  font-size: 60px;
  animation: fadeIn 1s forwards;
  animation-delay: 3s;
  opacity: 0;
  margin-top: 12px;
}
@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}
@keyframes scaleUp {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* Add will-change to elements that use animations */
.splash-text, .panel, .timeline-item {
  will-change: transform, opacity;
}

/* =================== Main Landing Page =================== */
#main-content {
  display: none;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 1s ease;
}
/* Header as a narrow dark banner with video running behind */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  padding: 0 30px;
  background: #000;
  z-index: 500;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#header-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 840px;
  transform: translate(calc(-50% + 288px), calc(-50% + 55px));
  opacity: 0.5;
  z-index: 1;
}

.grain-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

#header-grain {
  position: absolute;
  top: -60%;
  left: 0;
  width: 100%;
  height: 160%;
  object-fit: cover;
  opacity: .25;
  mix-blend-mode: overlay;
  filter: contrast(120%) brightness(120%);
  z-index: 2;
  -webkit-mask-image: linear-gradient(to right, 
    rgba(0,0,0,1) 0%, 
    rgba(0,0,0,1) 45%, 
    rgba(0,0,0,0) 65%,
    rgba(0,0,0,1) 85%, 
    rgba(0,0,0,1) 100%
  );
  mask-image: linear-gradient(to right, 
    rgba(0,0,0,1) 0%, 
    rgba(0,0,0,1) 45%, 
    rgba(0,0,0,0) 65%,
    rgba(0,0,0,1) 85%, 
    rgba(0,0,0,1) 100%
  );
}



.header-content {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
}
.header .logo-text {
  font-family: 'Bebas Neue', cursive;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  color: #ffffff;
}

.header .separator {
  color: #666;
  margin: 0 15px 0 5px;
  font-weight: 100;
  transform: translateY(-3px);
  position: relative;
}
.header .sub-text {
  font-family: 'Bebas Neue', cursive;
  font-size: 21px;
  color: #ffffff;
  line-height: 1;
  margin-left: 1px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 0 0 1px rgba(0,0,0,0.1);
}

.refresh-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  cursor: pointer;
  outline: none;
}

.refresh-button:hover {
  opacity: 0.9;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* =================== Timeline Resume =================== */
.timeline-section {
  padding: 0 40px 60px;
  position: relative;
  overflow: hidden;
  margin-top: 0;
}

.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  width: 2px;
  background: #444;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Timeline line movement for right-side items */
.timeline:has(.timeline-item:nth-child(even) .timeline-content.active)::before {
  transform: translateX(calc(-50% - 135px));
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Timeline line movement for left-side items */
.timeline:has(.timeline-item:nth-child(odd) .timeline-content.active)::before {
  transform: translateX(calc(-50% + 130px));
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

/* Move opposite side items when any item is active */
.timeline:has(.timeline-content.active) .timeline-item:nth-child(odd) {
  transform: translateX(0);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline:has(.timeline-content.active) .timeline-item:nth-child(even) {
  transform: translateX(0);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Move all left-side items when right-side is active */
.timeline:has(.timeline-item:nth-child(even) .timeline-content.active) .timeline-item:nth-child(odd) {
  transform: translateX(-130px);
}

/* Move all right-side items when left-side is active */
.timeline:has(.timeline-item:nth-child(odd) .timeline-content.active) .timeline-item:nth-child(even) {
  transform: translateX(130px);
}

.timeline-item.shift-left {
  transform: translateX(-160px);
}

.timeline-item.shift-right {
  transform: translateX(160px);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}




.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-content {
  padding: 20px;
  background: #333;
  border-radius: 8px;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  color: #ffffff;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  width: 100%;
  height: 140px; /* Set explicit height for banner state */
  overflow: hidden;
  will-change: transform, width, height, background;
}

/* Left side banners expand from left */
.timeline-item:nth-child(odd) .timeline-content {
  transform-origin: left center;
}

/* Right side banners expand from right */
.timeline-item:nth-child(even) .timeline-content {
  transform-origin: right center;
}

/* Move content with the timeline */
.timeline-item {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Left side animations */
.timeline-item:nth-child(odd):has(.timeline-content.active) ~ .timeline-item,
.timeline-item:nth-child(odd):has(.timeline-content.active) {
  transform: translateX(130px);
}

.timeline-item:nth-child(odd):has(.timeline-content.active) .timeline-date,
.timeline-item:nth-child(odd):has(.timeline-content.active) ~ .timeline-item .timeline-date {
  transform: translateX(130px);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item:nth-child(odd):has(.timeline-content.active) .timeline-dot,
.timeline-item:nth-child(odd):has(.timeline-content.active) ~ .timeline-item .timeline-dot {
  transform: translateX(120px);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Right side animations */
.timeline-item:nth-child(even):has(.timeline-content.active) ~ .timeline-item {
  transform: translateX(-130px);
}

.timeline-item:nth-child(even):has(.timeline-content.active) .timeline-date,
.timeline-item:nth-child(even):has(.timeline-content.active) ~ .timeline-item .timeline-date {
  transform: translateX(-130px);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item:nth-child(even):has(.timeline-content.active) .timeline-dot,
.timeline-item:nth-child(even):has(.timeline-content.active) ~ .timeline-item .timeline-dot {
  transform: translateX(-130px);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Timeline line movement for right-side items */
.timeline-item:nth-child(even):has(.timeline-content.active) ~ .timeline::before {
  transform: translateX(-185px);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Keep the content aligned with timeline */
.timeline-content {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Left side content movement */
.timeline-item:nth-child(odd):has(.timeline-content.active) ~ .timeline-item .timeline-content {
  transform: translateX(130px);
}

/* Right side content movement */
.timeline-item:nth-child(even):has(.timeline-content.active) ~ .timeline-item .timeline-content {
  transform: translateX(-130px);
}

/* Ensure right side items stay aligned */
.timeline-item:nth-child(even) .timeline-content {
  margin-left: auto;
  position: relative;
  right: 0;
}

.timeline-content h3,
.timeline-content p {
  position: relative;
  z-index: 4;
  transition: opacity 0.3s ease;
  will-change: opacity;
  backface-visibility: hidden;
}

.timeline-content.active h3,
.timeline-content.active p {
  opacity: 0;
}

.timeline-content:not(.active) h3,
.timeline-content:not(.active) p {
  opacity: 1 !important;
}

/* Base active state */
.timeline-content.active {
  width: 640px;
  height: 360px; /* Explicit 16:9 height for 640px width */
  background: #000;
  z-index: 100;
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Right side active state - adjust position to expand from right edge */
.timeline-item:nth-child(even) .timeline-content.active {
  transform: translateX(-135px); /* Fine-tuned position */
  margin-left: auto; /* Ensure it stays aligned to the right */
  right: 0; /* Lock to right edge */
}

/* Ensure smooth transition back to banner state */
.timeline-content:not(.active) {
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}



.timeline-content video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.timeline-content.active video {
  opacity: 1;
  pointer-events: all;
}

.timeline-video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-video-container {
  width: 90%;
  max-width: 1280px;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  transform-origin: center center;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}



.timeline-video-overlay.active .timeline-video-container {
  transform: scale(1);
  opacity: 1;
}

.timeline-video-player {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timeline-video-overlay.active .timeline-video-player {
  opacity: 1;
}

.timeline-video-overlay.active {
  opacity: 1;
  visibility: visible;
}

.timeline-video-overlay.active .timeline-video-container {
  transform: scale(1);
}

.timeline-video-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.timeline-video-close:hover {
  opacity: 1;
}

.timeline-content:hover {
  background: #444;
  transform: scale(1.02);
}

.timeline-content h3 {
  margin: 0 0 10px;
  font-family: 'Bebas Neue', cursive;
  font-size: 24px;
  color: #fff;
}

.timeline-content p {
  margin: 0;
  font-size: 14px;
  color: #ccc;
}

.timeline-content {
  position: relative;
  background: black;
  overflow: hidden;
}

.timeline-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.timeline-content.active::before {
  opacity: 1;
  transition-delay: 0.7s; /* Start fading to black near the end of expansion */
}

.timeline-content {
  position: relative;
  background: black;
  overflow: hidden;
}

.timeline-content .timeline-banner-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: hidden;
}

.timeline-content {
  position: relative;
  background: black;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.timeline-content .timeline-banner {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 4px;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  transform-origin: center center;
  object-fit: cover;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease;
}

.timeline-content.active .timeline-banner {
  transform: scale(1.15);  /* Reduced scale for more subtle expansion */
  opacity: 0;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease;
  transition-delay: 0s, 0.7s; /* Delay the fade out until near end of expansion */
  pointer-events: none;
}

.timeline-content video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  transition-delay: 0.3s; /* Start fading in after black background is visible */
  z-index: 1;
}

.timeline-content.active video {
  opacity: 1;
  z-index: 3; /* Ensure video is on top when active */
}

.timeline-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.timeline-content.active::before {
  opacity: 1;
}

.timeline-content .timeline-details {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  font-style: italic;
}

/* Timeline Categories */
.timeline-categories {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin: 40px 0 20px;
  position: relative;
}

.timeline-category {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 10px 20px;
  position: relative;
  transition: color 0.3s;
}

.timeline-category.active {
  color: #fff;
}

.timeline-category::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-50%);
  transition: width 0.3s;
}

.timeline-category:hover::before,
.timeline-category.active::before {
  width: 100%;
}

.resume-btn {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 10px 20px;
  position: relative;
  transition: color 0.3s;
}

.resume-btn:hover {
  color: #fff;
}

.resume-btn::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-50%);
  transition: width 0.3s;
}

.resume-btn:hover::before {
  width: 100%;
}

/* Timeline Tree Animation */
@keyframes drawTreeLine {
  from {
    height: 0;
  }
  to {
    height: 100%;
  }
}

@keyframes popItem {
  from {
    opacity: 0;
    transform: translateX(var(--pop-direction));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline {
  transition: opacity 0.3s ease;
}

.timeline.switching {
  opacity: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 0; /* Start with 0 height */
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  transform: translateX(-50%);
  transform-origin: top;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item:has(.timeline-content.active) ~ .timeline::before,
.timeline-item:has(.timeline-content.active) ~ .timeline-item::before {
  transform: translate(calc(-50% + 120px));
}

.timeline.animate::before {
  height: 100%;
}

.timeline-item {
  opacity: 0;
  animation: popItem 0.8s ease forwards;
  animation-delay: calc(var(--item-index) * 0.2s + 1s);
}

.timeline-item:nth-child(odd) {
  --pop-direction: -50px;
}

.timeline-item:nth-child(even) {
  --pop-direction: 50px;
}

@keyframes drawLine {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: #666;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.timeline-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  height: 1px;
  width: 200px;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scaleX(0);
}

/* Left-pointing line */
.timeline-item:nth-child(odd) .timeline-dot::before {
  right: 100%;
  transform-origin: right;
  background: linear-gradient(to left, rgba(255,255,255,0.3), transparent);
}

/* Right-pointing line */
.timeline-item:nth-child(even) .timeline-dot::before {
  left: 100%;
  transform-origin: left;
  background: linear-gradient(to right, rgba(255,255,255,0.3), transparent);
}

.timeline-dot:hover::before {
  transform: scaleX(1);
}

.timeline-date {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13.4px;
  color: #888;
  font-style: italic;
  white-space: nowrap;
}

.timeline-item:nth-child(odd) .timeline-date {
  left: calc(100% + 60px);
  text-align: left;
  width: 350px;
}

.timeline-item:nth-child(even) .timeline-date {
  right: calc(100% + 60px);
  text-align: right;
  width: 350px;
}

/* Logo Styling */
#logo-container {
  position: fixed;
  top: 22px;
  right: 20px;
  z-index: 999;
  width: 120px;
}

.logo-contact-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(0);
  transition: transform 0.3s ease-in-out;
}

#logo {
  width: 60px;
  height: auto;
  opacity: 0;
  animation: fadeInLogo 1s ease-in-out 2s forwards;
  cursor: pointer;
}

.contact-link {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 1px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease-in-out;
}

#logo-container:hover .contact-link {
  opacity: 0.85;
  transform: translateX(0);
}

@keyframes fadeInLogo {
  from { opacity: 0; }
  to { opacity: 0.85; }
}

/* Contact Modal Styling */
.contact-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.contact-modal.active {
  display: block;
}

.contact-modal-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.contact-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 20px 30px;
  border-radius: 8px;
  border: 1px solid rgba(76, 175, 80, 0.3);
  width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  opacity: 0;
  transition: all 0.3s ease-out;
}

.contact-modal.active .contact-modal-content {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.contact-modal-content p {
  color: #fff;
  font-size: 14px;
  margin: 0;
  text-align: center;
}

.contact-modal-content .email-link {
  color: rgba(76, 175, 80, 0.8);
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s ease;
}

.contact-modal-content .email-link:hover {
  color: rgba(76, 175, 80, 1);
}

/* Film Grain Effect */
#film-grain-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
}

#film-grain {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bokeh Effect */
#bokeh-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.bokeh-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 165, 0, 0.15), rgba(255, 255, 255, 0.1), transparent);
  filter: blur(3px);
  transform: translate(var(--start-x), var(--start-y));
  opacity: var(--opacity);
  animation: floatParticle var(--duration) ease-in-out var(--delay) forwards;
}

@keyframes floatParticle {
  to {
    transform: translate(var(--end-x), var(--end-y));
  }
}






.timeline-item:nth-child(odd) .timeline-dot {
  right: -48px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item:has(.timeline-content.active) .timeline-dot,
.timeline-item:has(.timeline-content.active) ~ .timeline-item .timeline-dot {
  transform: translate(120px, -50%);
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -48px;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.shift-left .timeline-dot {
  left: calc(-48px - 160px);
}

.timeline-item.shift-right .timeline-dot {
  right: calc(-48px - 160px);
}

.timeline-item:hover .timeline-dot {
  background: #fff;
  transform: translateY(-50%) scale(1.2);
}



/* =================== Dynamic Tall Panels =================== */
.panels-container {
  position: relative;
  margin: 120px 0 20px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  cursor: grab;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  user-select: none;
}

.panels-container {
  cursor: grab;
}

.panels-container.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.panels-wrapper {
  display: flex;
  min-width: 100%;
}

.nav-panels {
  display: inline-flex;
  margin-left: 384px; /* 4 inches */
  padding-right: calc(50vw - 204px);
  animation: initialSlide 2.5s cubic-bezier(0.2, 0.82, 0.2, 0.99) forwards;
  animation-delay: 0.2s;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes initialSlide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-800px);
  }
}

.panels-container {
  width: 100%;
  overflow: hidden;
  cursor: grab;
}

.panels-wrapper {
  overflow-x: auto;
  width: 100%;
  padding: 20px 40px;
  -ms-overflow-style: none;
  scrollbar-width: none;
  user-select: none;
}

.panels-container.dragging {
  cursor: grabbing;
}

.panels-wrapper::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.panels-container.grabbing {
  cursor: grabbing;
  user-select: none;
}

.nav-panels {
  display: inline-flex;
  transition: transform 0.5s ease;
  height: 400px;
  gap: 20px;
  padding: 0 20px;
}

.panels-wrapper {
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.panel {
  flex: 0 0 204px;
  background-color: #444;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  height: 100%;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.panel:not(.active):hover {
  transform: scale(1.02);
}

.panel:not(.active):hover .panel-content {
  /* Make sure panel content stays visible during hover */
  opacity: 1;
}

.panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.8));
  pointer-events: none;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.panel.active::after {
  opacity: 0;
  /* Ensure gradient is completely disabled for active panels */
  background: none;
  z-index: -1;
}

.padding-panel {
  background-color: #333;
  opacity: 0.5;
}

/* Resume Button */
.resume-button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2em;
  padding: 0 15px;
  transition: color 0.3s ease;
}

.resume-button:hover {
  color: #a0a0a0;
}

/* Resume Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #2A2A2A;
  margin: 5% auto;
  width: 80%;
  max-width: 1000px;
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  animation: modalFadeIn 0.3s;
}

/* Resume Styles */
.resume-container {
  padding: 2rem;
  color: #fff;
  max-width: 1200px;
  margin: 0 auto;
}

.resume-header {
  text-align: center;
  margin-bottom: 2rem;
}

.resume-header h1 {
  font-size: 2.5rem;
  margin: 0;
  color: #fff;
}

.resume-header h2 {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0.5rem 0;
}

.contact-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  color: rgba(255, 255, 255, 0.7);
}

.resume-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 2rem 0;
}

.experience-section h3 {
  color: #fff;
  margin-bottom: 1.5rem;
}

.credits-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.credit-item {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  gap: 1rem;
  align-items: center;
}

.show {
  font-weight: bold;
}

.network {
  color: rgba(255, 255, 255, 0.7);
}

.role {
  color: rgba(255, 255, 255, 0.9);
}

.imdb-button {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: block;
  margin: 0 auto;
}

.imdb-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.other-section {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.other-section p {
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.references {
  margin-top: 1rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.6);
}

.awards {
  text-align: center;
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 20px;
  text-align: right;
}

.close {
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: #a0a0a0;
}

.resume-container {
  display: flex;
  padding: 40px;
  gap: 40px;
}

.resume-left-column {
  flex: 1;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding-right: 40px;
}

.resume-right-column {
  flex: 2;
}

.resume-container h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3em;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #fff, #a0a0a0);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.resume-container h2 {
  font-family: 'Bebas Neue', sans-serif;
  color: #a0a0a0;
  margin-bottom: 20px;
  font-size: 1.8em;
}

.resume-container h3 {
  color: #808080;
  margin-bottom: 30px;
  font-weight: normal;
}

.resume-container ul {
  list-style: none;
}

.resume-container li {
  margin-bottom: 15px;
  color: #fff;
  position: relative;
  padding-left: 20px;
}

.resume-container li:before {
  content: '•';
  position: absolute;
  left: 0;
  color: #a0a0a0;
}

.experience-item {
  margin-bottom: 25px;
}

.experience-item h4 {
  color: #fff;
  margin-bottom: 5px;
}

.experience-item p {
  color: #808080;
}

.padding-panel .panel-content {
  color: #666;
}
.panel.active {
  flex: 0 0 640px; /* 16:9 ratio based on height */
}
.panel:not(.active) {
  flex: 0 0 204px;
}
.panel .panel-content {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-family: 'Bebas Neue', cursive;
}



/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0,0,0,0.8);
  padding: 20px;
}

.modal-content {
  background-color: #2A2A2A;
  margin: 0 auto;
  border-radius: 15px;
  width: 90%;
  max-width: 1200px;
  height: calc(100% - 40px);
  position: relative;
  overflow: hidden;
}

#resume-content {
  height: 100%;
}

#resume-content iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border: none;
  background: #2A2A2A;
}

.panel-content {
  color: #fff;
  z-index: 10;
  opacity: 0; /* Start with opacity 0 */
  transition: opacity 0.5s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* About Modal specific fixes */
#aboutModal .modal-content {
  height: 90vh;
  max-height: 90vh;
  width: 90%;
  max-width: 1200px;
  margin: 2vh auto;
  overflow: hidden;
}

#about-content {
  height: 100%;
  width: 100%;
}

#about-content iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
  background-color: #2A2A2A;
}

/* Panel content visibility states */
.panel:not(.animating) .panel-content {
  opacity: 1; /* Show content for panels not being animated */
}

.panel.animating .panel-content {
  opacity: 0; /* Hide during animation */
}

.panel.animation-complete .panel-content {
  opacity: 1; /* Show after animation completes */
  transition: opacity 0.4s ease-in; /* Smooth fade in */
}

.panel.playing .panel-content {
  opacity: 0;
}

.panel.playing:hover .panel-content {
  opacity: 1;
}
.panel .panel-title,
.panel-subtitle,
.timeline-item h3,
.timeline-item h4 {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.02em;
  font-weight: normal;
}
.panel .panel-subtitle {
  font-size: 16px;
  margin-top: 4px;
  opacity: 0.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.panel .panel-subtitle:nth-last-child(2) {
  font-size: 15px;
  opacity: 0.75;
  margin-top: 2px;
}
.panel .panel-subtitle:last-child {
  font-size: 13px;
  opacity: 0.65;
  margin-top: 1px;
}

.panel .video-player {
  position: absolute;
  top: -3.5%;
  left: -1%;
  width: 102%;
  height: 107%;
  object-fit: cover;
  background: #000;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
  image-rendering: -webkit-optimize-contrast;
  -webkit-transform: translate3d(0,0,0);
  filter: none;
  opacity: 1;
}

.panel.active .video-player {
  cursor: pointer;
  filter: none;
  opacity: 1;
}

.panel:not(.active) .video-player::-webkit-media-controls {
  display: none !important;
}

.panel.active .video-player::-webkit-media-controls {
  margin-right: -16px;
  margin-left: 16px;
}

/* Timeline item specific styles */
.timeline-content[data-video*="lego-masters"] {
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0.95) 100%), url('../assets/images/LEGO_BANNER.jpg');
  background-size: cover;
  background-position: center;
}

/* Individual control positioning */
.panel.active .video-player::-webkit-media-controls-play-button {
  margin-left: 150px; /* Move play button right */
}

.panel.active .video-player::-webkit-media-controls-timeline {
  margin-left: 170px;
  margin-right: 16px;
}

.panel.active .video-player::-webkit-media-controls-volume-slider {
  margin-right: 10px; /* Space before volume slider */
}

/* About modal styling */
.about-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: hidden;
}

.about-modal-content {
    position: relative;
    width: 90%;
    height: 90%;
    margin: 2% auto;
    background-color: #0d0d0d;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.about-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 35px;
    color: #f2f2f2;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #e50914;
}

/* Make sure the scrollbar appears in the iframe */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0d0d0d;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
