/* Base Theme (Dark by Default) */
:root {
  --bg-color: #000000;
  --text-color: #ffffff;
  --accent-color: #888888;
  --nav-bg: rgba(0, 0, 0, 0.95);
  --menu-bg: rgba(0, 0, 0, 0.98);
  --showreel-bg: #0a0a0a;
  --video-bg: #111111;
  /* Toggle Switch Colors - Dark Mode */
  --switch-bg: #1a1a1e;
  --slider-bg: #2d2e3e;
  --icon-sun: #666666;
  --icon-moon: #ffffff;
}

/* Light Theme Overrides */
body.light-theme {
  --bg-color: #ffffff;
  --text-color: #000000;
  --accent-color: #555555;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --menu-bg: rgba(255, 255, 255, 0.98);
  --showreel-bg: #f0f0f0;
  --video-bg: #eeeeee;
  /* Toggle Switch Colors - Light Mode */
  --switch-bg: #f3f4f8;
  --slider-bg: #e2e6f0;
  --icon-sun: #000000;
  --icon-moon: #8b92a5;
}

* {
  box-sizing: border-box;
}

/* Prevents layout jumping when scrollbar appears/disappears */
html {
  overflow-y: scroll; 
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Playfair Display', serif;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.8rem 5%;
  position: sticky;
  top: 0;
  background-color: var(--nav-bg);
  z-index: 100;
  height: 90px;
  transition: background-color 0.4s ease;
}

.logo {
  font-size: 2rem;
  font-style: italic;
  cursor: pointer;
  line-height: 1.1;
  z-index: 102;
}

.logo span {
  font-size: 0.8rem;
  font-style: normal;
  letter-spacing: 3px;
  color: var(--accent-color);
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
}

.nav-links li {
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.nav-links li:hover {
  color: var(--accent-color);
}

/* ==========================================
   CUSTOM THEME TOGGLE SWITCH
   ========================================== */
.theme-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 76px;
  height: 38px;
  background-color: var(--switch-bg);
  border-radius: 50px;
  padding: 0 10px;
  cursor: pointer;
  transition: background-color 0.4s ease;
}

.theme-switch svg {
  width: 18px;
  height: 18px;
  z-index: 2;
  transition: stroke 0.4s ease;
}

.icon-sun { stroke: var(--icon-sun); }
.icon-moon { stroke: var(--icon-moon); }

.switch-slider {
  position: absolute;
  top: 4px;
  left: 38px; 
  width: 34px;
  height: 30px;
  background-color: var(--slider-bg);
  border-radius: 50px;
  transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), background-color 0.4s ease, left 0.4s ease;
  z-index: 1;
}

body.light-theme .switch-slider {
  left: 4px; 
}

/* Hamburger Icon */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  cursor: pointer;
  z-index: 102;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-color);
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Tab Content */
.tab-content {
  display: none;
  padding: 2rem 5% 5rem 5%;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Single-Page Viewport Lock */
.single-page-tab {
  height: calc(100dvh - 90px);
  min-height: unset;
  padding: 1rem 5% 2rem 5%;
  overflow: hidden;
}

#home.single-page-tab.active {
  display: flex;
  flex-direction: column;
}

.showreel-container {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  background: var(--showreel-bg);
  overflow: hidden;
  transition: background-color 0.4s ease;
}

.showreel-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; 
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.showreel-img.active { opacity: 1; }

#contact.single-page-tab.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-card {
  position: relative; /* BUG FIX: Anchors absolute mobile image properly to stop resize jump */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.2rem;
  margin: 0;
  width: 100%;
  height: 100%;
}

.contact-img {
  height: 65vh; /* UPGRADED: Much larger image on laptop */
  width: auto;
  max-width: 450px; /* UPGRADED: Allows wider rendering on desktop */
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 2px;
  filter: grayscale(100%);
}

.contact-info h2 { margin: 0 0 0.5rem 0; }
.contact-info a {
  display: inline-block;
  font-size: 1.1rem;
  color: var(--accent-color);
  margin-top: 0.4rem;
}
.contact-info a:hover { color: var(--text-color); }

.insta-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ig-icon { margin-bottom: 2px; }

/* Ads Grids */
.shorts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 750px;
  margin: 0 auto 3.5rem auto;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem 2rem;
}

@media (min-width: 768px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .video-grid { grid-template-columns: repeat(3, 1fr); } }

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--video-bg);
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.4s ease;
}

.video-wrapper.short-format {
  aspect-ratio: 9 / 16;
  max-width: 360px;
  margin: 0 auto;
}

.video-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s;
}

.video-wrapper:hover img {
  transform: scale(1.02);
  opacity: 0.8;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: white;
  background: transparent;
  border: none;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-info { margin-top: 1rem; text-align: center; }
.video-brand { font-size: 1.2rem; font-weight: 600; margin: 0; letter-spacing: 1px; }
.video-campaign { font-size: 1rem; color: var(--accent-color); margin: 0.3rem 0 0 0; font-style: italic; }
a { text-decoration: none; color: inherit; }

/* Narrative Toggle */
.toggle-container {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 3rem;
}

.toggle-btn {
  background: transparent;
  color: var(--accent-color);
  border: none;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  cursor: pointer;
  padding-bottom: 5px;
  transition: color 0.3s;
}

.toggle-btn.active {
  color: var(--text-color);
  border-bottom: 1px solid var(--text-color);
}

/* ==========================================
   SLIDESHOW COMPONENTS (Narrative Tabs)
   ========================================== */
.slideshow-list {
  display: flex;
  flex-direction: column;
  gap: 5rem; 
}

.slideshow-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.slideshow-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--video-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 15px;
  transition: background-color 0.4s ease;
}

.main-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Arrows */
.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 45px;
  height: 45px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s, transform 0.2s;
  user-select: none;
}

.slide-btn svg {
  width: 20px;
  height: 20px;
}

.slide-btn:hover { background-color: rgba(0, 0, 0, 0.9); transform: translateY(-50%) scale(1.05); }
.slide-btn.prev { left: 15px; }
.slide-btn.next { right: 15px; }

/* Thumbnails */
.slideshow-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) transparent;
  scroll-behavior: smooth;
}

.slideshow-thumbnails::-webkit-scrollbar { height: 6px; }
.slideshow-thumbnails::-webkit-scrollbar-track { background: transparent; }
.slideshow-thumbnails::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
  border-radius: 10px;
}

.thumb-img {
  height: 80px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.35;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  border-radius: 2px;
  flex-shrink: 0;
}

.thumb-img:hover { opacity: 0.8; }
.thumb-img.active {
  opacity: 1;
  border-color: var(--text-color);
}

/* Info & Links */
.slideshow-info {
  text-align: center;
  margin-top: 1rem;
}

.slideshow-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.8rem 0;
  letter-spacing: 1px;
}

.slideshow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  color: var(--text-color);
  text-decoration: underline;
  text-decoration-color: var(--accent-color);
  text-underline-offset: 4px;
  transition: color 0.3s;
}

.slideshow-link svg {
  width: 22px;
  height: 22px;
}

.slideshow-link:hover { color: var(--accent-color); }

/* ==========================================
   MOBILE SCREEN OPTIMIZATIONS (Max Width 768px)
   ========================================== */
@media (max-width: 768px) {
  nav { padding: 1.2rem 5%; height: 70px; }
  .logo { font-size: 1.3rem; }
  .logo span { font-size: 0.65rem; letter-spacing: 2px; }
  
  .hamburger { display: flex; }

  /* UPDATED TOP-DOWN MOBILE MENU (Grid for alignment) */
  .nav-links {
    position: absolute;
    top: -500px; 
    left: 0;
    width: 100%;
    height: auto;
    background-color: var(--nav-bg);
    display: grid;
    grid-template-columns: 1fr auto; 
    grid-template-rows: auto auto auto;
    row-gap: 1.5rem;
    padding: 2rem 5%;
    transition: top 0.4s ease-in-out, background-color 0.4s ease;
    z-index: -1;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); 
  }

  .nav-links.active { top: 70px; }
  
  .nav-links li { 
    font-size: 1.1rem; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    font-weight: 600;
  }

  /* Assign Menu Items to Grid Coordinates */
  .nav-links li:nth-child(1) { grid-column: 1; grid-row: 1; align-self: center; }
  .nav-links li:nth-child(2) { grid-column: 1; grid-row: 2; align-self: center; }
  .nav-links li:nth-child(3) { grid-column: 1; grid-row: 3; align-self: center; }
  
  /* Pin Theme Toggle to Row 1, Column 2 */
  .nav-links li:nth-child(4) { 
    grid-column: 2; 
    grid-row: 1; 
    align-self: center;
    justify-self: end;
  }

  .theme-switch {
    transform: scale(0.82);
    transform-origin: right center;
  }

  .single-page-tab {
    height: calc(100dvh - 70px);
    padding: 0.5rem 5% 1rem 5%;
  }

  .showreel-img {
    object-position: 25% center; 
  }

  .shorts-grid { grid-template-columns: 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
  .video-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  #contact.single-page-tab.active { padding: 0; }
  .contact-card { justify-content: flex-end; }

  .contact-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: unset;
    border-radius: 0;
    z-index: 1;
    object-position: center 15%; 
  }

  .contact-info {
    position: relative;
    z-index: 2;
    background-color: var(--bg-color);
    color: var(--text-color);
    width: 85%;
    margin: 0 auto 2.5rem auto;
    padding: 1.8rem;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transition: background-color 0.4s ease, color 0.4s ease;
  }

  /* Mobile Slideshow Adjustments */
  .thumb-img { height: 55px; }
  .slide-btn { width: 35px; height: 35px; }
  .slide-btn svg { width: 16px; height: 16px; }
  .slideshow-title { font-size: 1.2rem; }
}