:root {
  --text-color: #ffffff;
  --bg-color: #111111;
  --overlay-bg: rgba(0, 0, 0, 0.95);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* ================= Header / Nav ================= */

header {
  position: relative;
  width: 100%;
  background-color: black;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem 1.5rem;
}

.title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-align: center;
  color: white;
}

nav {
  margin-top: 0.5rem;
  display: flex;
  gap: 2.5rem;
  font-size: 0.95rem;
}

nav a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}
nav a:hover { opacity: 0.7; }

.menu-toggle {
  display: none;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.menu-toggle div {
  width: 26px;
  height: 2px;
  background-color: var(--text-color);
}

/* ================= Overlay Menu ================= */

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--overlay-bg);
  color: white;
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  gap: 2rem;
  animation: fadeIn 0.3s ease forwards;
}
.overlay.active { display: flex; }

.overlay a { color: white; text-decoration: none; }

.overlay .close-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  font-size: 1.5rem;
  cursor: pointer;
}

.instagram-icon {
  width: 20px;
  height: 20px;
  fill: white;
}

.fade-in {
  opacity: 0;
  animation: fadeInText 0.7s ease-out forwards;
  animation-delay: 0.4s;
}

/* ================= Hero ================= */

.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: black;
  padding: 0;
  margin: 0;
  overflow: hidden;
}
.hero img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-width: 100vw;
  margin: 0;
  cursor: pointer; /* opens gallery */
}

/* ================= Thumbnails (carousel) ================= */

#thumbnails {
  display: grid;
  gap: 2rem;
  padding: 2rem 3rem;
  justify-items: center;
  justify-content: center;
}

#thumbnail-carousel-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 1rem 0;
}

#thumbnail-carousel {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 1rem;
  padding: 0 2rem;
}
#thumbnail-carousel::-webkit-scrollbar { display: none; }

.thumb-container {
  flex: 0 0 auto;
  width: clamp(80px, 20vw, 160px);
  aspect-ratio: 4 / 5;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 3s ease-in-out;
}
.thumb-container img:hover { transform: scale(1.35) !important; }

/* Reveal controlled by JS-added .loaded (prevents random pops) */
#thumbnail-carousel .thumb-container img {
  animation: none !important;          /* kill any legacy keyframe fades */
  opacity: 0;                          /* start hidden */
  transform: translateY(4px);
  transition: opacity 320ms ease, transform 320ms ease;
  will-change: opacity, transform;
  background: transparent;
}
#thumbnail-carousel .thumb-container img.loaded {
  opacity: 1;
  transform: translateY(0);
}

.thumb-container, .thumb-container img { pointer-events: auto !important; }

/* Arrows for the thumbnail carousel */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  z-index: 5;
}
.carousel-arrow.left  { left: 0.5rem; }
.carousel-arrow.right { right: 0.5rem; }

/* ================= Fullscreen Viewer ================= */

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  z-index: 100;
}

#fullscreenViewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  flex-direction: column;
  overflow: hidden;

  /* Fade in/out controlled by .visible (JS toggles class) */
  opacity: 0;
  transition: opacity 300ms ease;
}
#fullscreenViewer.visible { opacity: 1; }

/* Stage for fullscreen image */
.fullscreen-image-wrapper {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3rem; /* space for arrows */
  overflow: hidden;
}

/* We only need a transition here; JS drives the opacity inline */
#fullscreenImage {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 350ms ease;  /* crossfade timing */
  will-change: opacity;
}

/* Side arrows for fullscreen */
.fullscreen-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: white;
  cursor: pointer;
  z-index: 10;
}
.fullscreen-arrow.left  { left: 1rem; }
.fullscreen-arrow.right { right: 1rem; }

/* ================= Keyframes (general) ================= */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInText {
  to { opacity: 1; }
}
@keyframes fadeZoomIn {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: none; }
}
/* (kept for other pages if needed; not used by thumbnails anymore) */
@keyframes fadeInOnly {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ================= Footer / About / Work (unchanged) ================= */

footer {
  font-family: 'Inter', sans-serif;
  text-align: center;
  padding: 2rem 1rem 2rem;
  font-size: 0.85rem;
  color: #aaa;
  background-color: black;
  width: 100%;
}

.about {
  padding: 3rem 2rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
  line-height: 1.8;
  font-family: 'Inter', sans-serif;
}
.about > * { margin-bottom: 2.5rem; }

.about h1, .about h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  margin-bottom: 1rem;
  color: white;
}

.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  margin-top: 0;
}
.stats-grid ul {
  list-style: none;
  padding: 0;
  color: #ccc;
  font-size: 0.95rem;
}
.stats-grid li {
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
}
.stats-grid li strong { min-width: 140px; }

.contact-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  margin-top: 3rem;
}
.contact-line a {
  color: white;
  text-decoration: underline;
}

.email-icon { width: 20px; height: 20px; fill: white; }

.about-photos {
  display: flex;
  gap: 1rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.about-photos img {
  width: 100%;
  max-width: 380px;
  border-radius: 6px;
  object-fit: cover;
  justify-content: center;
}

.about .about-photos:first-of-type {
  margin-top: 0;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}
.about .about-photos:first-of-type img {
  max-width: 100%;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

a { color: white; text-decoration: none; }
a:hover { text-decoration: underline; }

.about-top, .about-bottom {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
  padding: 0 1rem;
}
.about-text, .about-info {
  font-size: 1rem;
  text-align: left;
  line-height: 1.6;
}

/* Mobile defaults */
.about-photo-left, .about-photo-right { width: 100%; }
.about-photo-left img, .about-photo-right img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

/* Desktop layout */
@media (min-width: 768px) {
  nav { /* hidden on mobile; shown ≥768px by default */ }
  .about-top, .about-bottom {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
    gap: 2rem;
  }
  .about-photo-left, .about-photo-right, .about-text, .about-info {
    flex: 1;
    display: flex;
  }
  .about-photo-left, .about-photo-right {
    align-items: stretch;
    justify-content: center;
  }
  .about-photo-left img, .about-photo-right img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
  }
  .about-text, .about-info {
    flex-direction: column;
    justify-content: center;
    padding: 0 1rem;
  }
}

/* Digitals (unchanged) */
.digitals-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  height: 90vh;
  max-height: 90vh;
  overflow: hidden;
  background: black;
}
.digitals-wrapper {
  position: relative;
  max-width: 85vw;
  max-height: 90vh;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3rem;
  overflow: hidden;
}
.digitals-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease;
  display: block;
  position: absolute;
  border-radius: 0;
}
.digitals-img.active { opacity: 1; z-index: 2; }
.digitals-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  background: none;
  border: none;
  color: white;
  z-index: 10;
  cursor: pointer;
  padding: 0;
}
.digitals-arrow.left  { left: 1rem; }
.digitals-arrow.right { right: 1rem; }

/* Work */
.work-section {
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}
.work-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  text-align: center;
  margin: 2rem 0 1.5rem;
}
.full-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
#work-carousel-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 0;
  background: transparent;
}
#work-carousel {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 1rem;
  padding: 0 1rem;
}
#work-carousel::-webkit-scrollbar { display: none; }
.work-clients {
  margin: 3rem auto;
  padding: 0 1rem;
  text-align: center;
}
.work-clients h2 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}
.work-clients-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem 2rem;
  max-width: 1000px;
  text-align: center;
}
.work-clients-grid li {
  margin: 0.25rem 0;
  line-height: 1.6;
}

/* ================= Media Queries ================= */

@media (max-width: 900px) {
  .work-clients-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
  }
}

@media (max-width: 768px) {
  nav { display: none; }
  .menu-toggle { display: flex; }
  .title { text-align: center; }
  #thumbnails {
    grid-template-columns: repeat(2, 1fr);
    padding: 0.5rem !important;
    gap: 0.5rem;
  }
  .thumb-container { width: 200px; }
  .carousel-arrow {
    font-size: 1.5rem;
    padding: 0.2rem 0.6rem;
  }
  #thumbnail-carousel { padding: 0 1rem; }

  .fullscreen-arrow.left  { left: 0rem; }
  .fullscreen-arrow.right { right: 0rem; }
  .fullscreen-image-wrapper { padding: 0 0.5rem; }

  .work-section { padding: 0 0.6rem; }
  .work-title { font-size: 1.5rem; margin-top: 1.5rem; }
}

@media (min-width: 769px) {
  #thumbnails { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

@media (min-width: 1024px) {
  #thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* ================= Accessibility: Reduce Motion ================= */

@media (prefers-reduced-motion: reduce) {
  #thumbnail-carousel .thumb-container img,
  #fullscreenViewer,
  #fullscreenImage {
    transition-duration: 120ms; /* gentler instead of disabling */
  }
}