@font-face {
  font-family: 'AvantGardeStd';
  src: url('../fonts/ITCAvantGardeStd-Bk.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap
}

@font-face {
  font-family: 'AvantGardeStd';
  src: url('../fonts/ITCAvantGardeStd-BkObl.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap
}

@font-face {
  font-family: 'AvantGardeStd';
  src: url('../fonts/ITCAvantGardeStd-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap
}

@font-face {
  font-family: 'AvantGardeStd';
  src: url('../fonts/ITCAvantGardeStd-BoldObl.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap
}

:root {
  --font-body: 'AvantGardeStd', 'Futura', 'Century Gothic', 'Segoe UI', sans-serif;
  --font-heading: 'AvantGardeStd', 'Futura', 'Century Gothic', 'Segoe UI', sans-serif;
  --bg-color: #101010;
  --text-primary: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 400ms;
  --white: #F8FAFF;
  --blue: #3A86FF;
  --gold: #FFBE0B;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

a,
button,
.project-card,
.nav-btn,
input,
textarea,
.submit-btn {
  cursor: none !important;
}

/* Restore cursor in full screen */
*:fullscreen,
*:-webkit-full-screen,
*:fullscreen * {
  cursor: auto !important;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 60px;
  background-color: var(--bg-color);
}

.project-detail .topbar {
  padding: 40px 60px;
  background: transparent;
  pointer-events: none;
}

.project-detail .topbar .nav-btn {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  backdrop-filter: blur(4px);
}

.logo {
  width: 60px;
  height: auto;
  display: block;
  z-index: 102;
  /* Ensure logo stays above mobile menu */
  position: relative;
}

.logo img {
  width: 100%;
  height: auto;
  display: block;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 60px;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-size: 24px;
  font-weight: 700;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav-link:hover {
  opacity: 1;
}

/* RainbowCascadeNav Styles */
.rcn-link {
  position: relative;
  display: inline-block;
  text-decoration: none;
  /* Ensure no overflow clipping if we want them to pop out */
  overflow: visible;
}

.rcn-measure {
  opacity: 0;
  pointer-events: none;
}

.rcn-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.rcn-top {
  z-index: 10;
  position: absolute;
  /* Ensure top layer handles interactions */
  pointer-events: auto;
}

/* Hamburger Menu */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: transparent;
  border: none;
  padding: 0;
  z-index: 102;
  /* Above mobile menu */
  cursor: pointer;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  transform-origin: center;
}

.hamburger-btn.active .hamburger-line:first-child {
  transform: translateY(9px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:last-child {
  transform: translateY(-9px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background-color: var(--bg-color);
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.mobile-nav-link {
  font-size: 40px;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(20px);
  display: block;
  transition: opacity 0.3s, color 0.3s;
}

.mobile-menu.active .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}

/* Stagger delay for mobile links */
.mobile-menu.active .mobile-nav-link:nth-child(1) {
  transition-delay: 0.1s;
}

.mobile-menu.active .mobile-nav-link:nth-child(2) {
  transition-delay: 0.2s;
}

.mobile-menu.active .mobile-nav-link:nth-child(3) {
  transition-delay: 0.3s;
}


@media (max-width: 768px) {
  .topbar {
    padding: 30px 24px;
  }

  .desktop-nav {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }
}

/* Grid Layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  min-height: 100vh;
  gap: 20px;
  padding: 160px 60px 60px;
}

.project-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s var(--ease);
  border-radius: 12px;
}

.project-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
  transform: scale(var(--base-scale, 1));
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: background-color 0.4s var(--ease), opacity 0.4s var(--ease);
  border-radius: 12px;
}

.project-title {
  font-weight: 700;
  text-transform: none;
  transform: translateY(20px);
  transition: transform 0.4s var(--ease), font-size 0.4s var(--ease);
  text-align: center;
  padding: 0 20px;
  width: 100%;
  line-height: 1.1;
  font-size: 40px;
  user-select: none;
  /* Prevent accidental selection */
}

.project-card:hover .project-thumb {
  transform: scale(calc(var(--base-scale, 1) * 1.05));
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-card:hover .project-title {
  transform: translateY(0);
  font-size: 44px;
  /* Slightly bigger on hover */
}

/* Project Detail View */
/* Project Detail View */
.project-detail {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  /* Let clicks pass through when inactive */
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background-color: #050505;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

/* Fade out grid when project is open */
.grid-container {
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

body.project-open .grid-container {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.detail-slider {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
  /* Optimize for Firefox */
  scrollbar-width: thin;
  scrollbar-color: #fff rgba(255, 255, 255, 0.1);
}

.detail-slider::-webkit-scrollbar {
  width: 6px;
}

.detail-slider::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin: 4px;
}

.detail-slider::-webkit-scrollbar-thumb {
  background: #fff;
  border-radius: 3px;
}

.detail-slider::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.8);
}

.project-detail.active {
  pointer-events: auto;
}

.project-detail.active .detail-backdrop {
  opacity: 1;
}

.project-detail.active .detail-slider {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.detail-content {
  max-width: 1200px;
  margin: 120px auto 60px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 40px;
  /* Consistent vertical gap between sections */
  align-items: start;
}

/* Embed wrapper for cursor tracking */
.embed-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.embed-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: none;
  background: transparent;
}

.embed-overlay.hidden {
  display: none;
}

.video-container {
  grid-column: 1 / -1;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.source-selector-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.project-info {
  grid-column: 3 / 11;
  /* Center with 8 columns */
  text-align: center;
  margin-bottom: 0;
  /* Let grid gap handle spacing */
}

@media (max-width: 768px) {
  .project-info {
    grid-column: 1 / -1;
  }
}

.project-info h1 {
  font-size: 48px;
  margin-bottom: 16px;
}

.project-info p {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* About Page Styles - Restored */
.about-container {
  max-width: 1200px;
  margin: 160px auto;
  padding: 0 60px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 80px;
  align-items: center;
}

.profile-img {
  width: 100%;
  max-width: 450px;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.about-text h1 {
  font-size: 64px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 24px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

/* Gallery Styles */
.gallery-grid {
  grid-column: 1 / -1;
  /* Full width */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: auto;
  /* Allow rows to adapt to content height */
  gap: 20px;
  grid-auto-flow: dense;
  width: 100%;
}

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

.project-role {
  font-size: 18px;
  color: #888;
  margin-bottom: 20px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gallery-item {
  width: 100%;
  height: 300px;
  /* Default height for standard tiles */
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.03);
}

/* No Hover Effect */
.gallery-item.no-hover:hover img,
.gallery-item.no-hover:hover video {
  transform: none;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 12px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-caption {
  opacity: 1;
}

.gallery-item.no-crop {
  height: auto;
  /* Adapt to content height */
  min-height: 0;
  background: #1a1a1a;
}

/* Transparent Background for specific items */
.gallery-item.row-span-2 {
  grid-row: span 2;
  height: 100%;
  /* Ensure tall items fill the grid area */
}

.gallery-item.h-400 {
  height: 400px;
}

.gallery-item.transparent-bg {
  background: transparent !important;
}

.gallery-item.no-crop img,
.gallery-item.no-crop video {
  object-fit: contain;
  position: relative;
  height: auto;
  max-height: 80vh;
}

.gallery-item.always-show-caption .gallery-caption {
  opacity: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.span-full {
  grid-column: 1 / -1;
}

.row-span-2 {
  grid-row: span 2;
}

.gallery-item.row-span-2 {
  height: 100%;
  /* Ensure tall items fill the grid area */
}

.gallery-text {
  grid-column: 1 / -1;
  font-size: 18px;
  line-height: 1.6;
  color: #ccc;
  max-width: 800px;
  margin: 0 auto;
}

.about-motion-wrapper {
  display: inline-block;
  position: relative;
  white-space: nowrap;
  vertical-align: bottom;
  /* Align with text baseline */
}

#stack {
  position: relative;
  display: inline-block;
}

.motion-layer {
  display: inline-block;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
  /* Ensure no extra height */
}

/* Layer styles are handled in JS for dynamic stacking */

.letter {
  display: inline-block;
  will-change: transform;
}

.about-subhead {
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-weight: 400;
}

.about-text p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 18px;
  margin-bottom: 24px;
  max-width: 90%;
  /* Prevent lines from getting too long */
}

.flag-icon {
  height: 24px;
  /* Larger size */
  width: auto;
  vertical-align: -5px;
  display: inline-block;
  margin: 0 4px;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.social-links {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.social-links a {
  font-size: 24px;
  opacity: 0.7;
  transition: opacity 0.2s;
  border-bottom: none;
}

.social-links a:hover {
  opacity: 1;
}

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

  .about-container {
    grid-template-columns: 1fr;
  }

  .project-info h1 {
    font-size: 32px;
  }

  /* Ensure close button is accessible on mobile */
  .project-detail .topbar {
    display: none;
  }

  /* Ensure main navbar is visible and accessible on mobile */
  .topbar {
    z-index: 201;
    background-color: var(--bg-color);
  }

  .project-detail .topbar .nav-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    width: 44px;
    height: 44px;
  }

  /* Mobile Project Detail Layout */
  .detail-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 120px;
    padding: 0 20px;
  }

  .video-container,
  .project-info,
  .gallery-text,
  .gallery-item,
  .span-full,
  .row-span-2 {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100%;
    max-width: 100%;
  }

  .project-info {
    text-align: left;
    padding: 0;
  }

  .gallery-item {
    height: auto !important;
    min-height: 200px;
  }

  .gallery-item.h-400 {
    height: 300px !important;
  }

  .gallery-item img,
  .gallery-item video {
    object-fit: cover;
    height: auto;
    max-height: 500px;
  }

  .gallery-item.no-crop img,
  .gallery-item.no-crop video,
  .gallery-item video {
    object-fit: contain !important;
    height: auto !important;
    max-height: 80vh;
  }

  /* Reset fixed height classes on mobile */
  .gallery-item.h-400 {
    height: auto !important;
  }

  /* Hide custom cursor on mobile */
  .custom-cursor {
    display: none !important;
  }

  * {
    cursor: auto !important;
  }
}

/* Contact Page - Material Design 3 */
.contact-container {
  max-width: 700px;
  margin: 140px auto 60px;
  padding: 0 24px;
}

.contact-header {
  text-align: center;
  margin-bottom: 48px;
}

.contact-header h1 {
  font-size: 56px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: #F8FAFF;
  letter-spacing: -0.02em;
}

.contact-header p {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.contact-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 28px;
  padding: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Expressive Material Design 3 Outlined Fields */
.form-field {
  position: relative;
  display: flex;
  flex-direction: column;
}

.form-field input,
.form-field textarea {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 18px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  position: relative;
  z-index: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-field label {
  position: absolute;
  left: 18px;
  top: 18px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  font-weight: 500;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  padding: 0 6px;
  z-index: 2;
}

.form-field .field-outline {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bold focused states */
.form-field input:focus~label,
.form-field textarea:focus~label,
.form-field input:not(:placeholder-shown)~label,
.form-field textarea:not(:placeholder-shown)~label {
  top: -12px;
  left: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  background: var(--bg-color);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.form-field input:focus~.field-outline,
.form-field textarea:focus~.field-outline {
  border-color: rgba(255, 255, 255, 0.5);
  border-width: 2px;
}

.form-field input:not(:placeholder-shown)~.field-outline,
.form-field textarea:not(:placeholder-shown)~.field-outline {
  border-color: rgba(255, 255, 255, 0.4);
}

/* Monotone Button */
.submit-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  padding: 20px 40px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 1;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.05);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.submit-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 40px rgba(255, 255, 255, 0.2);
}

.submit-btn:hover::before {
  opacity: 1;
}

.submit-btn:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 5px 20px rgba(255, 255, 255, 0.1);
}

.submit-btn i {
  font-size: 14px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-btn:hover i {
  transform: translateX(6px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .contact-container {
    margin: 80px auto 40px;
  }

  .contact-header h1 {
    font-size: 40px;
  }

  .contact-header p {
    font-size: 16px;
  }

  .contact-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .contact-form {
    gap: 24px;
  }

  .submit-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Section Transitions */
section {
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.section-hidden {
  display: none;
  opacity: 0;
  transform: translateY(20px);
}

.section-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: fadeIn 0.4s var(--ease) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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



/* Custom Cursor */
.custom-cursor {
  position: fixed;
  width: 36px;
  height: 36px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
}

.custom-cursor-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.95);
  mix-blend-mode: difference;
  box-shadow: none;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.cursor-active .custom-cursor-inner {
  mix-blend-mode: difference;
  opacity: 1;
}

/* Intro Video Overlay */
.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}

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

.intro-video {
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
}

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

::-webkit-scrollbar-track {
  background: transparent;
  margin-right: 20px;
}

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

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

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

/* Custom Video Player */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 auto 32px;
  padding-bottom: 0;
  height: auto;
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.native-video-player {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.source-selector-container {
  margin-bottom: 20px;
  text-align: right;
}

.source-selector {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.source-selector:hover {
  background: rgba(255, 255, 255, 0.2);
}

.source-selector option {
  background: #000;
  color: #fff;
}

.carousel-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  padding: 6px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
}

.carousel-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.carousel-label {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

/* Plyr overrides */
.plyr {
  --plyr-color-main: #000000;
  --plyr-video-controls-background: transparent;
  --plyr-video-control-color: #ffffff;
  --plyr-video-control-color-hover: #ffffff;
  --plyr-range-track-background: rgba(255, 255, 255, 0.32);
  --plyr-range-fill-background: #000000;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.plyr__controls {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%);
  padding: 10px 16px;
}

.plyr__control {
  box-shadow: none;
}

.plyr__control--overlaid {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.plyr__menu__container {
  background: #0f0f0f;
  border-color: rgba(255, 255, 255, 0.12);
}

.plyr::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 85%, rgba(0, 0, 0, 0.7) 100%);
  opacity: 0;
  transition: opacity 160ms ease;
}

.plyr--full-ui:hover::after,
.plyr--full-ui:focus-within::after,
.plyr--full-ui.plyr--paused::after {
  opacity: 1;
}

.plyr--hide-controls::after {
  opacity: 0 !important;
}

/* Lightbox Styles */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.lightbox-content {
  position: relative;
  z-index: 2001;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  z-index: 2002;
  transition: transform 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.1);
}

/* Hide unused media in lightbox */
#lightbox-img.hidden,
#lightbox-video.hidden {
  display: none;
}

/* Increase Plyr play button size on desktop */
@media (min-width: 769px) {
  .plyr__control--overlaid {
    padding: 40px;
  }

  .plyr__control--overlaid svg {
    width: 40px;
    height: 40px;
  }
}

/* Contact Form Status */
.form-status {
  margin-top: 16px;
  font-size: 14px;
  min-height: 20px;
  transition: color 0.3s ease;
}

.form-status.success {
  color: #4CAF50;
  /* Green */
}

.form-status.error {
  color: #FF5252;
  /* Red */
}

/* Ensure Plyr fullscreen fallback covers everything */
.plyr--fullscreen-fallback {
  z-index: 9999 !important;
}
/* Skeleton Loading */
.gallery-item {
  background: #1a1a1a;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.gallery-item.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: translateX(-100%);
  animation: skeleton-loading 1.5s infinite;
  z-index: 1;
}

@keyframes skeleton-loading {
  100% { transform: translateX(100%); }
}

.gallery-item img,
.gallery-item video {
  opacity: 0;
  transition: opacity 0.4s ease;
  display: block;
}

.gallery-item.loaded img,
.gallery-item.loaded video {
  opacity: 1;
}

