/* ===== Portfolio Hero ===== */
.portfolio-hero {
  position: relative;
  width: 100%;
  height: auto;
  min-height: auto;
  background-image: linear-gradient(to bottom, rgba(255, 181, 120, 0.074), rgba(255, 159, 90, 0.074)), url('../images/showreel_thumbnail.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 3rem 2rem;
}

.portfolio-hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 181, 120, 0.281), rgba(0, 0, 0, 0.65));
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  animation: heroFadeIn 1s ease-out;
}

.hero-title {
  font-family: "Mallians", serif;
  font-style: italic;
  font-size: clamp(3.5rem, 8vw, 6rem);
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  line-height: 1.1;
  margin-bottom: 1rem;
  font-weight: 400;
}

.hero-subtitle {
  font-family: "Grift", serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 3rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.hero-scroll-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  color: #fff;
  transition: all 0.3s ease;
  animation: bounce 2s infinite;
  cursor: pointer;
}

.hero-scroll-indicator:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-3px);
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ===== Project Banner ===== */
.project-banner {
  position: relative;
  width: 100%;
  min-height: 8vh;
  padding: 3rem 0;
  margin: 4rem 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-banner .banner-bg {
  position: absolute;
  inset: 0;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.project-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 12, 10, 0.6), rgba(30, 20, 15, 0.75));
  z-index: 1;
}

.project-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to right, rgba(15, 10, 6, 0.85), rgba(15, 10, 6, 0) 45%);
}

.project-banner.reverse::after {
  background: linear-gradient(to left, rgba(15, 10, 6, 0.85), rgba(15, 10, 6, 0) 45%);
}

.project-content {
  position: relative;
  z-index: 2;
  width: min(100% - 2rem, var(--container-max, 1100px));
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f7e8d7;
  font-family: "Grift", serif;
}

.project-banner.reverse .project-content {
  flex-direction: row-reverse;
  text-align: right;
}

/* New Project Inner Wrapper */
.project-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.project-banner.reverse .project-inner { flex-direction: row-reverse; }

@media (max-width: 760px) {
  .project-inner,
  .project-banner.reverse .project-inner,
  .project-content,
  .project-banner.reverse .project-content {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

.text-box {
  background: transparent;
  border-radius: var(--radius-lg, 20px);
  padding: 0 2rem 1.5rem;
  max-width: 700px;
  position: relative;
  z-index: 2;
}

.text-box .dropdown-toggle { margin-bottom: 2rem; }

.text-box h2 {
  font-family: "Grift", serif;
  font-size: clamp(2.9rem, 5.8vw, 4.3rem);
  color: #fff;
  font-weight: 900;
  margin-bottom: 0.6rem;
  line-height: 1;
}

/* ===== Project Tags ===== */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  align-items: center;
}
.project-banner.reverse .project-tags { justify-content: flex-end; }

.tag {
  display: inline-block;
  padding: 0.2em 0.95em;
  border-radius: var(--radius-pill, 999px);
  font-size: 0.92em;
  font-family: "Grift", sans-serif;
  font-weight: 600;
  color: #fff;
  background: #b48c6e;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.13));
  transition: opacity 0.16s, transform 0.16s;
  opacity: 0.93;
}
.tag:hover { opacity: 1; transform: translateY(-2px) scale(1.04); }
.tag-video { background: #723a11; }
.tag-events { background: #ea5561; }
.tag-social { background: #2bb3ec; }
.tag-branding { background: #e84f6a; }
.tag-photo { background: #00b67c; }
.tag-web { background: #f7f9ff; }
.tag-brand { background: #8d5c3f; }

/* Ghosted logo */
.logo-overlay {
  position: absolute;
  top: 50%;
  right: 3rem;
  transform: translateY(-50%);
  opacity: 0.35;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: soft-light;
  filter: brightness(1.1);
}
.logo-overlay img { width: 220px; }
.project-banner.reverse .logo-overlay { left: 3rem; right: auto; }

/* Dropdown toggle button - Enhanced visibility */
.dropdown-toggle {
  background: linear-gradient(135deg, rgba(242, 120, 36, 0.9), rgba(242, 120, 36, 0.7));
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 1rem 2.2rem;
  border-radius: var(--radius-xl, 40px);
  font-weight: 900;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Grift", serif;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(242, 120, 36, 0.3);
  position: relative;
  overflow: hidden;
}

.dropdown-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.dropdown-toggle:hover::before {
  width: 300px;
  height: 300px;
}

.dropdown-toggle:hover {
  background: linear-gradient(135deg, rgba(242, 120, 36, 1), rgba(242, 120, 36, 0.85));
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(242, 120, 36, 0.5);
}

.dropdown-toggle:active {
  transform: translateY(0) scale(0.98);
}

/* ===== Dropdown Panel ===== */
.dropdown-panel {
  max-height: 0;
  overflow: hidden;
  background: linear-gradient(to bottom, #ffffff, #fafaf9);
  color: #5a4630;
  transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 6rem;
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
}
.project-banner.active .dropdown-panel {
  max-height: 1200px;
  box-shadow: 0 -30px 40px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
  padding: 3rem 0;
}

.panel-section {
  width: min(100% - 2rem, var(--container-max, 1100px));
  margin: 0 auto 4rem;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 2.5rem 0;
}
.panel-section.reverse { flex-direction: row-reverse; }

.panel-section:last-child {
  margin-bottom: 0;
}

.panel-section img {
  width: 50%;
  border-radius: var(--radius-md, 16px);
  box-shadow: var(--shadow-md, 0 8px 20px rgba(0,0,0,0.1));
  object-fit: cover;
}

.panel-text { flex: 1; }
.panel-text h3 {
  font-family: "Grift", serif;
  font-size: 1.8rem;
  color: #323232;
  margin-bottom: 1rem;
}
.panel-text p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #141414;
  font-family: "Grift", sans-serif;
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .portfolio-hero {
    height: auto;
    min-height: auto;
    background-attachment: scroll;
    padding: 2rem 1rem;
  }

  .hero-title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.2rem);
    margin-bottom: 2rem;
  }

  .hero-scroll-indicator {
    width: 44px;
    height: 44px;
  }

  .project-banner {
    padding: 2rem 0;
    margin: 2rem 0 0 0;
  }

  .project-banner .text-box,
  .project-banner.reverse .text-box {
    padding: 1.5rem;
    text-align: left;
  }

  .dropdown-toggle {
    padding: 0.9rem 1.8rem;
    font-size: 1rem;
    min-width: 160px;
    min-height: 48px;
  }

  .panel-section,
  .panel-section.reverse {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    padding: 2rem 0;
    margin-bottom: 2rem;
  }

  .panel-section img { width: 100%; }

  .project-banner .tag {
    font-size: 0.75em;
    padding: 0.35em 0.85em;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
  }

  .logo-overlay {
    top: 1rem;
    right: 1rem;
    opacity: 0.25;
  }

  .project-banner.reverse .logo-overlay {
    left: 1rem;
    right: auto;
  }

  .logo-overlay img { width: 70px; }

  .text-box h2 {
    font-size: clamp(2rem, 7vw, 3rem);
  }

  .text-box p {
    font-size: 1rem;
    line-height: 1.6;
  }
}

/* === Mobile overrides for reversed banners: right-align content === */
@media (max-width: 760px) {
  /* Make the reversed banner's content align to the right on mobile */
  .project-banner.reverse .project-content {
    align-items: flex-end;
    text-align: right;
  }

  /* Right-align everything inside the text box */
  .project-banner.reverse .text-box {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  /* Keep category tags right aligned */
  .project-banner.reverse .project-tags {
    justify-content: flex-end;
  }

  /* Ensure the CTA button sits on the right edge */
  .project-banner.reverse .dropdown-toggle {
    align-self: flex-end;
  }
}

/* ===== Reveal Animation Support ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.slide-left {
  transform: translateX(-50px) translateY(0);
}

.reveal.slide-left.is-visible {
  transform: translateX(0) translateY(0);
}

.reveal.slide-right {
  transform: translateX(50px) translateY(0);
}

.reveal.slide-right.is-visible {
  transform: translateX(0) translateY(0);
}

.reveal.scale-in {
  transform: scale(0.9);
}

.reveal.scale-in.is-visible {
  transform: scale(1);
}

/* ===== Portfolio Intro Section ===== */
.portfolio-intro {
  background: linear-gradient(to bottom right, var(--color-bg-light, #f6f5f3), var(--color-bg-medium, #ebe8e5));
  padding: 40px 0 20px;
  text-align: center;
  margin-bottom: 50px;
  color: var(--color-primary, #1c1208);
}
.intro-container { width: min(100% - 3rem, var(--container-max, 1100px)); margin-inline: auto; }
.intro-text h2 {
  font-family: "Grift", serif;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  color: #2b1d0f;
  margin-bottom: 1.2rem;
}
.intro-text p {
  font-family: "Grift", sans-serif;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #3b2a18;
  max-width: 850px;
  margin: 0 auto 3rem;
}

/* Service cards */
.service-cards {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.service-cards::-webkit-scrollbar { display: none; }

.service-card {
  position: relative;
  width: 320px;
  height: 120px;
  border-radius: var(--radius-sm, 14px);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  box-shadow: var(--shadow-sm, 0 4px 16px rgba(0,0,0,0.2));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover { 
  transform: translateY(1px); 
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.25)); 
}
.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30,20,10,0.8), rgba(120,60,20,0.65));
  border-radius: var(--radius-sm, 14px);
  z-index: 1;
}
.service-card .tag {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  font-size: 0.85rem;
  padding: 0.25rem 0.9rem;
  border-radius: var(--radius-pill, 999px);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,0.25));
  z-index: 2;
}
.tag-video { background: var(--color-accent, #f27824) !important; }
.tag-events { background: #ea5561 !important; }
.tag-social { background: #38860d !important; }
.tag-brand { background: #8d5c3f !important; }
.tag-photo { background: #d48c00 !important; }
.tag-web { background: #44547d !important; }

@media (max-width: 600px) {
  .service-cards { flex-wrap: wrap; justify-content: left; gap: 0.6rem; }
  .service-card { width: calc(33.3% - 0.6rem); height: 70px !important; }
  .service-card .tag {
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 0.7rem;
    padding: 0.25rem 0.7rem;
  }
}

/* ===== Video Panels ===== */
.panel-video {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 9/16;
  margin: 0 auto;
  border-radius: var(--radius-md, 18px);
  overflow: hidden;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.25));
}
.panel-video video { width: 100%; height: 100%; object-fit: cover; }

.panel-video.landscape {
  flex: 1;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md, 16px);
  overflow: hidden;
  display: flex;
}
.panel-video.landscape video,
.panel-video.landscape iframe {
  width: 100%; height: 100%; object-fit: cover; border: 0;
}

@media (max-width: 760px) {
  .panel-section .panel-video.landscape {
    flex: none; width: 100%; margin-top: 1rem;
  }
  .panel-video.landscape video,
  .panel-video.landscape iframe { height: auto; aspect-ratio: 16/9; }
}

/* ==== DGR Section ==== */
.panel-section.dgr-section { flex-direction: row-reverse; }
@media (max-width: 760px) {
  .panel-section.dgr-section { 
    flex-direction: column !important; 
    text-align: center; 
    align-items: center;
    gap: 1rem; /* FIX: Added gap here too */
  }
}

/* ==== Dundee Section ==== */
.dundee-section {
  border-radius: var(--radius-md, 18px);
  padding: 2rem 0;
  display: flex;
  width: min(100% - 2rem, var(--container-max, 1100px));
  margin: 0 auto;
  align-items: flex-start;
  justify-content: center;
  gap: 3rem;
}
.dundee-section .panel-text { flex: 1; padding-left: 2rem; }
.dundee-section .panel-video {
  max-width: 350px;
  aspect-ratio: 9/16;
  border-radius: var(--radius-md, 16px);
  overflow: hidden;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.25));
}

@media (min-width: 761px) {
  .dundee-section { flex-direction: row-reverse; justify-content: center; max-width: 1000px; }
}
@media (max-width: 760px) {
  .dundee-section { 
    flex-direction: column; 
    text-align: center; 
    padding: 2rem 1rem; 
    align-items: center;
    gap: 1rem; /* FIX: Consistent gap */
  }
  .dundee-section .panel-text { padding-left: 0; }
  .dundee-section .panel-video { max-width: 260px; margin-bottom: 1.5rem; }
}

/* Dundee Video Carousel */
.video-carousel {
  position: relative;
  overflow: hidden;
  width: 350px;
  aspect-ratio: 9/16;
  border-radius: var(--radius-md, 16px);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.25));
  flex-shrink: 0;
}
.carousel-track { display: flex; transition: transform 0.6s ease; height: 100%; }
.carousel-track .panel-video { min-width: 100%; height: 100%; }
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  border-radius: 50%;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.carousel-btn:hover { background: rgba(0,0,0,0.7); transform: translateY(-50%) scale(1.1); }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

.carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  z-index: 3;
}

.carousel-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  position: relative;
}

.carousel-dots .dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.carousel-dots .dot.is-active::before {
  background: #f17824;
  width: 12px;
  height: 12px;
  box-shadow: 0 2px 8px rgba(241, 120, 36, 0.6);
}

@media (max-width: 760px) {
  .video-carousel { width: min(92vw, 380px); margin: 0 auto 1rem; }
  .carousel-track .panel-video video { object-fit: cover; }
  .carousel-btn {
    min-width: 48px;
    min-height: 48px;
    font-size: 1.5rem;
  }
}

/* ==== Skinny's Story & Style ==== */
.panel-section.story-style { 
  flex-direction: row-reverse; 
  background: transparent !important; 
  box-shadow: none !important; 
}
.panel-section.story-style .panel-text { flex: 1; padding: 20px; }
.panel-section.story-style img,
.panel-section.story-style iframe,
.panel-section.story-style video {
  flex: 1; 
  max-width: 100%; 
  border-radius: var(--radius-sm, 12px); 
  background: none !important; 
  box-shadow: none !important;
}
@media (max-width: 760px) {
  .panel-section.story-style { 
    flex-direction: column; 
    text-align: center;
    gap: 1rem; /* FIX: Added gap */
  }
  .panel-section.story-style .panel-text { order: 2; padding: 1rem 0; }
  .panel-section.story-style img,
  .panel-section.story-style iframe,
  .panel-section.story-style video { order: 1; width: 100%; }
}

/* === Mobile dropdown fixes === */
@media (max-width: 760px) {
  .project-banner.active + .dropdown-panel { 
    max-height: 9999px !important; 
    overflow: visible !important; 
  }
  .dropdown-panel .panel-section { 
    flex-direction: column !important; 
    align-items: center; 
    text-align: center; 
    gap: 1rem; /* FIX: Consistent gap everywhere */
    padding: 1rem 0; 
  }
  .dropdown-panel .panel-text { text-align: center !important; }
}