@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&family=Bebas+Neue&display=swap");

@view-transition { navigation: auto; }

*,
*::after,
*::before {
  box-sizing: border-box;
}

/* Performance optimizations */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  touch-action: pan-y;
}

:root {
  font-size: 16px;
  --color-text: #ffffff;
  --color-text-secondary: #a0a0a0;
  --color-bg: #0a0a0a;
  --color-link: #ffffff;
  --color-link-hover: #ffffff;
  --color-accent: #3b82f6;
  --color-accent-glow: rgba(59, 130, 246, 0.3);
  --color-secondary: #31a2d0;
  --color-secondary-glow: rgba(20, 184, 166, 0.3);

  --font-primary: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-name: "Bebas Neue", sans-serif;
}

body {
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100dvh; /* Dynamic viewport height for mobile address bar handling */
  overflow: hidden;
  font-weight: 400;
  letter-spacing: -0.01em;
  cursor: none;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.01) 2px,
    rgba(255, 255, 255, 0.01) 4px
  );
  pointer-events: none;
  z-index: 9998;
  opacity: 0.5;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(59, 130, 246, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(139, 92, 246, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 1;
}

/* Custom Cursor - Magnetic Effect */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  mix-blend-mode: screen;
  left: 0;
  top: 0;
}

.cursor--active {
  opacity: 1;
}

.cursor--hover {
  background: #fff;
  box-shadow: 0 0 20px var(--color-accent);
}

.cursor__follower {
  position: fixed;
  width: 30px;
  height: 30px;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 70%
  );
  left: 0;
  top: 0;
}

.cursor__follower--active {
  opacity: 1;
}

.cursor__follower--hover {
  width: 50px;
  height: 50px;
  border-color: rgba(255, 255, 255, 0.45);
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 70%
  );
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

@media (pointer: coarse) {
  body {
    cursor: auto;
  }
  .cursor,
  .cursor__follower {
    display: none !important;
  }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  body {
    cursor: auto;
  }

  .cursor,
  .cursor__follower {
    display: none !important;
  }
}

/* Page Loader */
.js .loading::before,
.js .loading::after {
  content: "";
  position: fixed;
  z-index: 1000;
}

.js .loading::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
}

.js .loading::after {
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: loaderAnim 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: 0 0 40px var(--color-accent-glow);
}

@keyframes loaderAnim {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

a {
  text-decoration: none;
  color: var(--color-link);
  outline: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

a:hover {
  color: var(--color-accent);
}

a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover::after {
  width: 100%;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.unbutton {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.unbutton:focus {
  outline: none;
}

/* Frame/Navigation */
.frame {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh; /* Dynamic viewport height for mobile address bar handling */
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "title . demos"
    ". . ."
    "links . nav";
  z-index: 100;
  pointer-events: none;
}

/* Only interactive elements should capture clicks */
.frame a,
.frame button {
  pointer-events: auto;
}

.frame__title {
  grid-area: title;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.frame__title-main {
  font-family: var(--font-name);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 400;
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 0.85;
  text-transform: uppercase;
}

.frame__title-main strong {
  font-weight: 400;
  background: linear-gradient(135deg, var(--color-accent) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  letter-spacing: 0.02em;
  font-size: 1em;
}

.frame__subtitle {
  font-size: 0.625rem;
  font-weight: 600;
  color: rgba(
    255,
    255,
    255,
    0.7
  ); /* Increased from secondary color for better contrast */
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0;
  opacity: 0.85; /* Increased from 0.5 for better readability */
  padding-left: 1px;
  position: relative;
}

.frame__subtitle::before {
  content: "";
  position: absolute;
  left: 0;
  top: -0.375rem;
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, var(--color-accent) 0%, transparent 100%);
}

.frame__links {
  grid-area: links;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.frame__link {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.frame__back,
.frame__prev {
  display: none;
}

.frame__demos {
  grid-area: demos;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* About Link - Inline with PROJECTS */
.frame__about-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  margin-right: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  opacity: 0.6;
}

.frame__about-link::after {
  display: none;
}

.frame__about-link:hover {
  color: var(--color-text);
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.05);
}

.frame__about-link--active {
  opacity: 1;
  color: var(--color-accent);
  background: rgba(59, 130, 246, 0.1);
}

/* Projects Link - Similar to About Link */
.frame__projects-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  opacity: 0.6;
  cursor: pointer;
}

.frame__projects-link::after {
  display: none;
}

.frame__projects-link:hover {
  color: var(--color-text);
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.05);
}

/* Contact Link - Hidden on desktop, shown on tablet/mobile */
.frame__contact-link {
  display: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  opacity: 0.3;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

.frame__contact-link::after {
  display: none;
}

.frame__contact-link:hover {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.05);
}

.frame__contact-link--active {
  opacity: 1;
  color: var(--color-accent);
  background: rgba(59, 130, 246, 0.1);
}

.frame__contact-link svg {
  width: 16px;
  height: 16px;
}

.frame__demos span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

a.frame__demo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  opacity: 0.3;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

a.frame__demo::after {
  display: none;
}

a.frame__demo:hover {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.05);
}

a.frame__demo--current {
  opacity: 1;
  color: var(--color-accent);
  background: rgba(59, 130, 246, 0.1);
}

/* Slides */
.slides {
  width: 100%;
  height: 100dvh; /* Dynamic viewport height for mobile address bar handling */
  overflow: hidden;
  display: grid;
  grid-template-rows: 100%;
  grid-template-columns: 100%;
  place-items: center;
}

.slide {
  width: 100%;
  height: 100%;
  grid-area: 1 / 1 / -1 / -1;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  will-change: transform, opacity;
}

.slide--current {
  pointer-events: auto;
  opacity: 1;
}

.slide__img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform, opacity, filter;
  position: relative;
  transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide__category-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.slide__gallery-btn {
  display: flex;
  align-items: center;
  text-transform: uppercase;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.slide__gallery-btn--mobile {
  display: none;
}

.slide__gallery-btn:hover {
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.slide__gallery-btn:active {
  transform: scale(0.98);
}

.slide__gallery-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.slide__gallery-btn-text {
  font-family: var(--font-primary);
}

.slide__img::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(10, 10, 10, 0.7) 0%,
    rgba(10, 10, 10, 0.4) 100%
  );
  z-index: 1;
}

.slide__img::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 30% 50%,
    rgba(59, 130, 246, 0.15) 0%,
    transparent 50%
  );
  z-index: 2;
}

.slide__content {
  position: absolute;
  bottom: clamp(10rem, 18vw, 10rem);
  left: clamp(2rem, 8vw, 6rem);
  z-index: 10;
  max-width: 700px;
}

.slide__category {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 4px;
  backdrop-filter: blur(10px);
}

.slide__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.slide__description {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 400;
  margin: 0 0 2rem 0;
  opacity: 1;
  line-height: 1.6;
  color: #d0d0d0;
  max-width: 500px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide__meta {
  display: flex;
  gap: 2rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.slide__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.slide__meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}

.slide__meta-value {
  font-weight: 500;
  color: var(--color-text);
}

.deco {
  width: 100%;
  height: 100%;
  grid-area: 1 / 1 / -1 / -1;
  pointer-events: none;
  position: relative;
  opacity: 0;
  background: var(--color-bg);
  will-change: transform, opacity;
}

/* Navigation */
.slides-nav {
  grid-area: nav;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-self: end;
}

.slides-nav::before {
  content: "NAVIGATE";
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  margin-right: 1rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Mobile swipe indicator - not needed since nav is hidden */

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.slides-nav__item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: var(--color-text);
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.25rem;
  font-weight: 700;
}

.slides-nav__item:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--color-accent-glow);
}

.slides-nav__item:active {
  transform: scale(0.95);
}

/* Progress Indicator */
.progress {
  position: fixed;
  bottom: clamp(1.5rem, 4vw, 3rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 0.5rem;
  pointer-events: none;
}

.progress__item {
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress__item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scaleY(1.5);
}

.progress__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--color-accent);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress__item--active::before {
  width: 100%;
}

.progress__item--active {
  background: rgba(255, 255, 255, 0.15);
}

/* Responsive Design */

/* Safe area support for devices with notches */
@supports (padding: max(0px)) {
  .frame {
    padding-left: max(clamp(1.5rem, 4vw, 3rem), env(safe-area-inset-left));
    padding-right: max(clamp(1.5rem, 4vw, 3rem), env(safe-area-inset-right));
    padding-top: max(clamp(1.5rem, 4vw, 3rem), env(safe-area-inset-top));
    padding-bottom: max(clamp(1.5rem, 4vw, 3rem), env(safe-area-inset-bottom));
  }

  .slide__content {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .progress {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Mobile (Portrait) */
@media screen and (max-width: 480px) {
  :root {
    font-size: 14px;
  }

  .frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "title"
      ".";
    padding: 1rem;
    gap: 1rem;
  }

  .frame__title {
    gap: 0.375rem;
  }

  .frame__title-main {
    font-size: 2.25rem;
    letter-spacing: 0.02em;
    line-height: 0.85;
  }

  .frame__title-main strong {
    font-size: 1em;
    letter-spacing: 0.02em;
  }

  .frame__subtitle {
    font-size: 0.625rem;
    letter-spacing: 0.15em;
    opacity: 0.85; /* Increased from 0.5 for better contrast */
    color: rgba(255, 255, 255, 0.85); /* More explicit high contrast color */
  }

  .frame__links {
    display: none;
  }

  .frame__demos {
    display: none;
  }

  .frame__about-link,
  .frame__projects-link {
    display: none;
  }

  .slide__content {
    bottom: 1.618rem;
    left: 1rem;
    right: 1rem;
    max-width: none;
  }

  .slide__category-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 1rem;
  }

  .slide__category {
    font-size: 0.8rem;
    padding: 0.4375rem 0.875rem;
  }

  .slide__gallery-btn--desktop {
    display: none;
  }

  .slide__gallery-btn--mobile {
    display: flex;
    font-size: 0.8rem;
    color: var(--color-text);
    gap: 7px;
    padding: 12px 16px;
    margin: 2.272rem 0 0 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    width: 100%; /* Full width on mobile */
    justify-content: center; /* Center content */
  }

  .slide__gallery-btn svg {
    width: 15px;
    height: 15px;
  }

  .slide__title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }

  .slide__description {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
    color: #e5e5e5;
    opacity: 1;
  }

  .slide__meta {
    flex-direction: column;
    gap: 1rem;
  }

  .slide__meta-item {
    gap: 0.125rem;
  }

  .slide__meta-label {
    font-size: 0.625rem;
  }

  .slide__meta-value {
    font-size: 0.875rem;
  }

  .slides-nav {
    display: none;
  }

  .progress {
    bottom: auto;
    left: auto;
    right: 0.618rem;
    top: 1.5rem;
    transform: none;
    flex-direction: column;
    gap: 0.5rem;
  }

  .progress__item {
    width: 3px;
    height: 32px;
    pointer-events: auto;
    position: relative;
  }

  .progress__item::after {
    content: "";
    position: absolute;
    top: -8px;
    left: -6px;
    right: -6px;
    bottom: -8px;
  }

  .progress__item:hover {
    transform: scaleX(1.5);
  }
}

/* Mobile (Landscape) & Small Tablets */
@media screen and (min-width: 481px) and (max-width: 768px) {
  .frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "title"
      ".";
    padding: 1.5rem;
  }

  .frame__links {
    display: none;
  }

  .frame__demos {
    display: none;
  }

  .frame__about-link,
  .frame__projects-link {
    display: none;
  }

  .slide__content {
    bottom: 2.75rem;
    left: 1.5rem;
    right: 1.5rem;
    max-width: none;
  }

  .slide__category-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1.25rem;
  }

  .slide__category {
    font-size: 0.75rem;
  }

  .slide__gallery-btn--desktop {
    display: none;
  }

  .slide__gallery-btn--mobile {
    display: flex;
    font-size: 0.75rem;
    padding: 12px 16px;
    margin: 2.272rem 0 0 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    width: 100%; /* Full width on mobile */
    justify-content: center; /* Center content */
  }

  .slide__title {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
  }

  .slide__description {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    line-height: 1.65;
    color: #e0e0e0;
    opacity: 1;
  }

  .slide__meta {
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .slides-nav {
    display: none;
  }

  .progress {
    bottom: auto;
    left: auto;
    right: 0.618rem;
    top: 1.5rem;
    transform: none;
    flex-direction: column;
    gap: 0.5rem;
  }

  .progress__item {
    width: 3px;
    height: 32px;
    pointer-events: auto;
    position: relative;
  }

  .progress__item::after {
    content: "";
    position: absolute;
    top: -8px;
    left: -6px;
    right: -6px;
    bottom: -8px;
  }

  .progress__item:hover {
    transform: scaleX(1.5);
  }
}

/* Tablets */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  a.frame__demo {
    margin-right: 0.5rem;
  }

  .frame__contact-link {
    margin-right: 0.5rem;
  }

  .frame {
    padding: 2rem;
  }

  .frame__title-main {
    font-size: 2.25rem;
    letter-spacing: 0.02em;
  }

  .frame__title-main strong {
    font-size: 1em;
    letter-spacing: 0.02em;
  }

  /* Vertical navigation on right side - same starting position as horizontal */
  .frame__demos {
    padding-top: 2.272rem;
    margin-right: -2.272rem;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
  }

  .frame__demos span {
    margin-right: 1.272rem;
  }

  a.frame__demo,
  .frame__contact-link,
  .frame__about-link,
  .frame__projects-link {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hide desktop navigation elements */
  .frame__links {
    display: none;
  }

  .slides-nav {
    display: none;
  }

  /* Show and align contact link in nav */
  .frame__contact-link {
    display: flex;
  }

  /* Adjust hover label position to account for vertical nav */
  .frame__demo::before {
    margin-right: -1.618rem;
  }

  .slide__content {
    bottom: 9rem;
    left: 3rem;
    right: 3rem;
    max-width: 600px;
  }

  .slide__title {
    font-size: 3rem;
  }

  .slide__description {
    font-size: 1.25rem;
    line-height: 1.65;
  }
}

/* Large Tablets & Small Desktops */
@media screen and (min-width: 1025px) and (max-width: 1366px) {
  .slide__content {
    bottom: 10rem;
    left: 4rem;
  }
}

/* Dot matrix hover tooltip */
.frame__demo::before {
  content: attr(data-title);
  position: fixed;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1.5rem, 4vw, 3rem);
  background: rgba(59, 130, 246, 0.1);
  color: rgb(255, 255, 255);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-family: "Doto", monospace;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10000;
  isolation: isolate;
}

.frame__demo:hover::before {
  opacity: 1 !important;
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  a::after {
    display: none;
  }

  a.frame__demo:hover {
    background: rgba(59, 130, 246, 0.1);
  }

  .slides-nav__item:hover {
    transform: none;
  }

  /* Increase tap targets */
  a,
  button {
    min-width: 44px;
    min-height: 44px;
  }

  /* Better touch feedback */
  a:active,
  button:active {
    opacity: 0.7;
    transform: scale(0.97);
  }

  /* Improve button visibility on mobile */
  .slides-nav__item {
    background: rgba(255, 255, 255, 0.1);
    border-width: 2px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }

  a.frame__demo--current {
    box-shadow: 0 0 20px var(--color-accent-glow);
  }

  /* Prevent double-tap zoom */
  a,
  button {
    touch-action: manipulation;
  }
}

/* Landscape Orientation Warning for Small Devices */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .slide__content {
    bottom: 4rem;
    max-height: calc(100dvh - 8rem); /* Use dynamic viewport height */
    overflow-y: auto;
  }

  .slide__meta {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .progress {
    bottom: auto;
    left: auto;
    right: 0.618rem;
    top: 1.5rem;
    transform: none;
    flex-direction: column;
    gap: 0.5rem;
  }

  .progress__item {
    width: 3px;
    height: 32px;
    pointer-events: auto;
    position: relative;
  }

  .progress__item::after {
    content: "";
    position: absolute;
    top: -8px;
    left: -6px;
    right: -6px;
    bottom: -8px;
  }

  .progress__item:hover {
    transform: scaleX(1.5);
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide__category,
.slide__gallery-btn,
.slide__title,
.slide__description,
.slide__meta {
  opacity: 0;
  transform: translateY(30px);
}

.slide--current .slide__category {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.7s forwards;
}

.slide--current .slide__gallery-btn {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.7s forwards;
}

.slide--current .slide__title {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

.slide--current .slide__description {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}

.slide--current .slide__meta {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1s forwards;
}

/* ===========================
   Gallery Modal
   =========================== */

.gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.gallery-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal--active .gallery-modal__overlay {
  opacity: 1;
  backdrop-filter: blur(12px);
}

.gallery-modal__container {
  position: relative;
  width: 100%;
  max-width: 1600px;
  height: 100%;
  max-height: 100%;
  background: rgba(20, 20, 20, 0.98);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95) translateY(20px);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.gallery-modal--active .gallery-modal__container {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.gallery-modal__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.gallery-modal__close::before,
.gallery-modal__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #fff;
  margin: -1px 0 0 -9px;
}

.gallery-modal__close::before {
  transform: rotate(45deg);
}

.gallery-modal__close::after {
  transform: rotate(-45deg);
}

.gallery-modal__content {
  flex: 1 1 auto;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 60px 40px 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  min-height: 0;
  height: 0;
}

.gallery-modal__content::-webkit-scrollbar {
  width: 8px;
}

.gallery-modal__content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.gallery-modal__header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal--active .gallery-modal__header {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.gallery-modal__category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  display: block;
  margin-bottom: 8px;
}

.gallery-modal__title {
  font-size: 2rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
}

.gallery-modal__description {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 800px;
}

.gallery-modal__content-block {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 16px;
  opacity: 1;
  transform: translateY(0);
}

.gallery-modal__content-block--justify-end {
  justify-content: flex-end;
}

.gallery-modal--active .gallery-modal__content-block {
  opacity: 1;
  transform: translateY(0);
}

.gallery-modal__content-block--full {
  grid-column: span 12;
}

.gallery-modal__content-block--half {
  grid-column: span 6;
}

.gallery-modal__content-block--third {
  grid-column: span 4;
}

.gallery-modal__content-block--two-thirds {
  grid-column: span 8;
}

.gallery-modal__content-block--quarter {
  grid-column: span 3;
}

.gallery-modal__content-title {
  font-size: 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-modal__content-title-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.gallery-modal__content-title-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.gallery-modal__content-text {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}

.gallery-modal__content-block--two-thirds .gallery-modal__content-text {
  max-width: calc((100% - 7 * 24px) / 8 * 6 + 5 * 24px);
}

.gallery-modal__content-block--half .gallery-modal__content-text {
  max-width: 100%;
}

.gallery-modal__content-text p {
  margin: 0 0 16px;
}

.gallery-modal__content-text p:last-child {
  margin-bottom: 0;
}

.gallery-modal__download-link-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

.gallery-modal__download-link-image:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
}

.gallery-modal__download-link-image:hover .gallery-modal__download-image {
  transform: scale(1.05);
}

.gallery-modal__download-link-image--has-image {
  background: transparent;
  border: none;
}

.gallery-modal__download-link-image--has-image:hover {
  background: rgba(0, 0, 0, 0.2);
}

.gallery-modal__download-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.8;
}

.gallery-modal__download-text {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  opacity: 0.9;
}

.gallery-modal__download-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.gallery-modal__download-icon-svg,
.gallery-modal__download-text-mobile {
  display: none;
}

.gallery-modal__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  row-gap: 40px;
  margin-top: 40px;
}

.gallery-modal__images {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: 40px;
}

/* Default to full width if no layout specified */
.gallery-modal__image-item {
  grid-column: span 12;
}

/* Image Layout Options - these override the default */
.gallery-modal__image-item--full {
  grid-column: span 12;
}

.gallery-modal__image-item--half {
  grid-column: span 6;
}

.gallery-modal__image-item--third {
  grid-column: span 4;
}

.gallery-modal__image-item--two-thirds {
  grid-column: span 8;
}

.gallery-modal__image-item--quarter {
  grid-column: span 3;
}

/* Row spanning support */
.gallery-modal__image-item--row-span-2 {
  grid-row: span 2;
}

.gallery-modal__image-item--row-span-3 {
  grid-row: span 3;
}

.gallery-modal__image-item--tight-top {
  margin-top: -12px;
}

/* Reduce spacing between images 2 and 3 by half - only for BNY project stacked layout */
.gallery-modal__grid[data-project-id="project5"]
  .gallery-modal__image-item[data-image-number="3"] {
  margin-top: -24px;
}

/* Reduce spacing between images 2 and 3 by half - only for BlackCalc project stacked layout */
.gallery-modal__grid[data-project-id="project4"]
  .gallery-modal__image-item[data-image-number="4"] {
  margin-top: -24px;
}

/* Base image item styles */
.gallery-modal__image-item {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0);
}

.gallery-modal--active .gallery-modal__image-item {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive adjustments */

.gallery-modal__image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 62.5%; /* 16:10 aspect ratio */
  overflow: hidden;
  background: rgba(10, 10, 10, 0.3);
  border-radius: 12px;
}

.gallery-modal__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal__image-item:hover .gallery-modal__image {
  transform: scale(1.05);
}

/* Logo styling - centered, contained, reasonable size */
.gallery-modal__image-item--logo .gallery-modal__image-wrapper {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.gallery-modal__image-item--logo .gallery-modal__image {
  position: relative;
  width: auto;
  height: auto;
  max-width: 400px;
  max-height: 200px;
  object-fit: contain;
}

.gallery-modal__image-item--logo:hover .gallery-modal__image {
  transform: none;
}

/* Portrait orientation - for tall images like YouTube Shorts */
.gallery-modal__image-item--portrait .gallery-modal__image-wrapper {
  padding-bottom: 177.78%; /* 9:16 aspect ratio for portrait */
}

.gallery-modal__image-item--portrait .gallery-modal__image {
  object-fit: cover;
}

/* Contain fit - shows full image by shrinking to fit with blurred background */
.gallery-modal__image-item--contain .gallery-modal__image-wrapper {
  position: relative;
  overflow: hidden;
}

.gallery-modal__image-bg-blur {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  filter: blur(7px) brightness(0.9);
  z-index: 1;
}

.gallery-modal__image-item--contain .gallery-modal__image {
  object-fit: contain;
  z-index: 2;
}

.gallery-modal__image-item--contain .gallery-modal__image-number {
  z-index: 3;
}

.gallery-modal__image-item--contain:hover .gallery-modal__image {
  transform: none;
}

/* Fit width - shows full image width, maintains container height, no background */
.gallery-modal__image-item--fit-width .gallery-modal__image {
  object-fit: contain;
}

.gallery-modal__image-item--fit-width:hover .gallery-modal__image {
  transform: none;
}

/* Align bottom - aligns image to bottom of grid cell */
.gallery-modal__image-item--align-bottom {
  align-self: end;
}

/* Horizontal divider - reuses header divider style */
.gallery-modal__divider {
  grid-column: span 12;
  margin: 48px 0 32px;
  padding-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Third divider wrapper - full width container */
.gallery-modal__divider-third-wrapper {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .gallery-modal__divider {
    margin: 32px 0 24px;
  }
}

/* Article preview cards */
.gallery-modal__article-item {
  grid-column: span 12;
}

.gallery-modal__article-item--half {
  grid-column: span 6;
}

.gallery-modal__article-item--third {
  grid-column: span 4;
}

.gallery-modal__article-item--two-thirds {
  grid-column: span 8;
}

.gallery-modal__article-item--horizontal {
  grid-column: span 12;
}

.gallery-modal__article-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.05) 0%,
    rgba(139, 92, 246, 0.05) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 320px;
}

.gallery-modal__article-item--horizontal .gallery-modal__article-link {
  flex-direction: row;
  min-height: 240px;
  max-width: 900px;
  margin: 0 auto;
}

.gallery-modal__article-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-accent) 0%,
    rgba(139, 92, 246, 1) 100%
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal__article-link:hover {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.08) 0%,
    rgba(139, 92, 246, 0.08) 100%
  );
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.gallery-modal__article-link:hover::before {
  transform: scaleX(1);
}

.gallery-modal__article-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  margin-bottom: 24px;
  border-radius: 8px;
}

.gallery-modal__article-item--horizontal .gallery-modal__article-cover {
  width: 320px;
  height: 100%;
  margin-bottom: 0;
  border-radius: 0;
  flex-shrink: 0;
}

.gallery-modal__article-content {
  padding: 0 32px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gallery-modal__article-item--horizontal .gallery-modal__article-content {
  padding: 32px 40px;
  justify-content: center;
}

.gallery-modal__article-platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.gallery-modal__article-platform svg {
  width: 16px;
  height: 16px;
}

.gallery-modal__article-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
  margin: 0 0 12px;
}

.gallery-modal__article-description {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0 0 20px;
  flex: 1;
}

.gallery-modal__article-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  transition: gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal__article-link:hover .gallery-modal__article-cta {
  gap: 12px;
}

.gallery-modal__article-cta svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .gallery-modal__article-item--half,
  .gallery-modal__article-item--third,
  .gallery-modal__article-item--two-thirds,
  .gallery-modal__article-item--horizontal {
    grid-column: span 12;
  }

  .gallery-modal__article-link {
    min-height: 280px;
  }

  .gallery-modal__article-item--horizontal .gallery-modal__article-link {
    flex-direction: column;
    min-height: 320px;
  }

  .gallery-modal__article-item--horizontal .gallery-modal__article-cover {
    width: 100%;
    height: 180px;
    margin-bottom: 24px;
  }

  .gallery-modal__article-item--horizontal .gallery-modal__article-content {
    padding: 0 24px 24px;
  }

  .gallery-modal__article-content {
    padding: 0 24px 24px;
  }

  .gallery-modal__article-cover {
    height: 160px;
  }

  .gallery-modal__article-title {
    font-size: 1.125rem;
  }
}

/* External link card (compact) */
.gallery-modal__external-link-item {
  grid-column: span 12;
}

.gallery-modal__external-link-item--half {
  grid-column: span 6;
}

.gallery-modal__external-link-item--third {
  grid-column: span 4;
}

.gallery-modal__external-link-item--two-thirds {
  grid-column: span 8;
}

.gallery-modal__external-link {
  display: block;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.gallery-modal__external-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(59, 130, 246, 0.8) 0%,
    rgba(139, 92, 246, 0.8) 100%
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal__external-link:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.gallery-modal__external-link:hover::before {
  transform: scaleX(1);
}

.gallery-modal__external-link-content {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-modal__external-link-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gallery-modal__external-link-platform {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.5);
}

.gallery-modal__external-link-platform svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.gallery-modal__external-link-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  margin: 0;
}

.gallery-modal__external-link-description {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: 0;
  opacity: 0.85;
}

.gallery-modal__external-link-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(59, 130, 246, 0.9);
  transition: gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 4px;
}

.gallery-modal__external-link:hover .gallery-modal__external-link-cta {
  gap: 10px;
  color: rgba(59, 130, 246, 1);
}

.gallery-modal__external-link-cta svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  .gallery-modal__external-link-item--half,
  .gallery-modal__external-link-item--third,
  .gallery-modal__external-link-item--two-thirds {
    grid-column: span 12;
  }

  .gallery-modal__external-link-content {
    padding: 20px 24px;
  }

  .gallery-modal__external-link-title {
    font-size: 1rem;
  }

  .gallery-modal__external-link-description {
    font-size: 0.8125rem;
  }
}

/* Clickable image link styling */
.gallery-modal__image-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.gallery-modal__image-link:hover {
  opacity: 0.9;
}

.gallery-modal__image-link::after {
  content: "↗";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.gallery-modal__image-item:hover .gallery-modal__image-link::after {
  opacity: 1;
}

.gallery-modal__image-caption {
  padding: 12px 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.gallery-modal__image-number {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  background: rgba(10, 10, 10, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-modal__image-item:hover .gallery-modal__image-number {
  opacity: 1;
}

/* Trivia/Did You Know Styles */
.gallery-modal__trivia {
  grid-column: span 12;
  padding: 16px 0;
  margin: 0;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal--active .gallery-modal__trivia {
  opacity: 1;
  transform: translateY(0);
}

.gallery-modal--active .gallery-modal__trivia:nth-of-type(1) {
  transition-delay: 0.4s;
}

.gallery-modal--active .gallery-modal__trivia:nth-of-type(2) {
  transition-delay: 0.5s;
}

.gallery-modal--active .gallery-modal__trivia:nth-of-type(3) {
  transition-delay: 0.6s;
}

.gallery-modal__trivia-content {
  display: flex;
  gap: 40px;
  align-items: center;
  justify-content: center;
}

.gallery-modal__trivia-image-wrapper {
  flex-shrink: 0;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
}

.gallery-modal__trivia-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.gallery-modal__trivia-text {
  flex: 1;
  max-width: calc((100vw - 32px - 11 * 24px) / 12 * 6);
}

.gallery-modal__trivia-title {
  font-size: 1.272rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 16px;
  color: var(--color-secondary);
}

.gallery-modal__trivia-description {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.gallery-modal__trivia-divider {
  grid-column: 5 / span 4;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 24px 0;
  padding: 0;
}

.gallery-modal__trivia--half {
  grid-column: span 6;
}

.gallery-modal__trivia--third {
  grid-column: span 4;
}

.gallery-modal__trivia--two-thirds {
  grid-column: span 8;
}

.gallery-modal__trivia--full {
  grid-column: span 12;
}

/* Video Styles */
.gallery-modal__video-item {
  grid-column: span 12;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(30px);
}

.gallery-modal--active .gallery-modal__video-item {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal--active .gallery-modal__video-item:nth-child(1) {
  transition-delay: 0.3s;
}

.gallery-modal--active .gallery-modal__video-item:nth-child(2) {
  transition-delay: 0.4s;
}

.gallery-modal--active .gallery-modal__video-item:nth-child(3) {
  transition-delay: 0.5s;
}

.gallery-modal--active .gallery-modal__video-item:nth-child(4) {
  transition-delay: 0.6s;
}

/* Video Layout Options */
.gallery-modal__video-item--full {
  grid-column: span 12;
}

.gallery-modal__video-item--half {
  grid-column: span 6;
}

.gallery-modal__video-item--third {
  grid-column: span 4;
}

.gallery-modal__video-item--two-thirds {
  grid-column: span 8;
}

.gallery-modal__video-item--quarter {
  grid-column: span 3;
}

.gallery-modal__video-wrapper {
  position: relative;
  width: 100%;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.gallery-modal__video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio for YouTube videos */
  height: 0;
}

.gallery-modal__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

.gallery-modal__video-caption {
  padding: 12px 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

/* Audio Styles - Custom Player */
.gallery-modal__audio-item {
  grid-column: span 12;
  position: relative;
  overflow: visible;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(30px);
  padding-top: 0;
}

.gallery-modal--active .gallery-modal__audio-item {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Audio Layout Options */
.gallery-modal__audio-item--full {
  grid-column: span 12;
}

.gallery-modal__audio-item--half {
  grid-column: span 6;
}

.gallery-modal__audio-item--third {
  grid-column: span 4;
}

.gallery-modal__audio-item--two-thirds {
  grid-column: span 8;
}

.gallery-modal__audio-item--quarter {
  grid-column: span 3;
}

.gallery-modal__audio-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.gallery-modal__audio-wrapper:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* Loading State */
.custom-audio-player__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.custom-audio-player__loading-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.custom-audio-player__loading-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

.custom-audio-player__loading-text {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Custom Audio Player */
.custom-audio-player {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.custom-audio-player__play-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
}

.custom-audio-player__play-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.custom-audio-player__play-btn:active {
  transform: scale(0.98);
}

.custom-audio-player__play-icon,
.custom-audio-player__pause-icon {
  width: 20px;
  height: 20px;
  color: inherit;
}

.custom-audio-player__play-icon {
  transform: translateX(1px);
}

.custom-audio-player__progress-container {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0 4px;
  margin: 0 -4px;
}

.custom-audio-player__progress-bar {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: visible;
}

.custom-audio-player__progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.8)
  );
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.custom-audio-player__progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.custom-audio-player__progress-container:hover
  .custom-audio-player__progress-handle {
  transform: translate(-50%, -50%) scale(1);
}

.custom-audio-player__progress-container:active
  .custom-audio-player__progress-handle {
  transform: translate(-50%, -50%) scale(1.2);
}

.custom-audio-player__time {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  min-width: 85px;
}

.custom-audio-player__separator {
  color: rgba(255, 255, 255, 0.3);
}

.gallery-modal__audio-caption {
  padding: 14px 0 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Mobile Audio Styles */
@media (max-width: 768px) {
  .gallery-modal__audio-item--half,
  .gallery-modal__audio-item--third,
  .gallery-modal__audio-item--two-thirds,
  .gallery-modal__audio-item--quarter {
    grid-column: span 12;
  }

  .gallery-modal__content-block--justify-end {
    justify-content: flex-start;
  }

  .gallery-modal__audio-wrapper {
    padding: 20px 24px;
    border-radius: 14px;
  }

  .custom-audio-player {
    gap: 14px;
  }

  .custom-audio-player__play-btn {
    width: 44px;
    height: 44px;
  }

  .custom-audio-player__play-icon,
  .custom-audio-player__pause-icon {
    width: 18px;
    height: 18px;
  }

  .custom-audio-player__progress-container {
    height: 44px;
    padding: 0 6px;
    margin: 0 -6px;
  }

  .custom-audio-player__progress-bar {
    height: 6px;
  }

  .custom-audio-player__progress-handle {
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%) scale(1);
  }

  .custom-audio-player__time {
    font-size: 0.75rem;
    min-width: 80px;
  }

  .gallery-modal__audio-caption {
    font-size: 0.8125rem;
    padding-top: 12px;
  }
}

/* Tablet styles for audio */
@media (min-width: 769px) and (max-width: 1024px) {
  .gallery-modal__audio-item--half,
  .gallery-modal__audio-item--third,
  .gallery-modal__audio-item--two-thirds,
  .gallery-modal__audio-item--quarter {
    grid-column: span 12;
  }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Grid layout adjustments - same as mobile */
  .gallery-modal__content-block--half,
  .gallery-modal__content-block--third,
  .gallery-modal__content-block--two-thirds,
  .gallery-modal__content-block--quarter {
    grid-column: span 12;
  }

  .gallery-modal__image-item--half,
  .gallery-modal__image-item--third,
  .gallery-modal__image-item--two-thirds,
  .gallery-modal__image-item--quarter {
    grid-column: span 12;
  }

  .gallery-modal__video-item--half,
  .gallery-modal__video-item--third,
  .gallery-modal__video-item--two-thirds,
  .gallery-modal__video-item--quarter {
    grid-column: span 12;
  }

  .gallery-modal__trivia--half,
  .gallery-modal__trivia--third,
  .gallery-modal__trivia--two-thirds {
    grid-column: span 12;
  }

  .gallery-modal__trivia-content {
    flex-direction: column;
    gap: 24px;
  }

  .gallery-modal__trivia-image-wrapper {
    width: 240px;
    height: 240px;
  }

  .gallery-modal__trivia-text {
    max-width: 100%;
  }

  .gallery-modal__content-block--two-thirds .gallery-modal__content-text {
    max-width: 100%;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  /* Grid layout adjustments */
  .gallery-modal__content-block--half,
  .gallery-modal__content-block--third,
  .gallery-modal__content-block--two-thirds,
  .gallery-modal__content-block--quarter {
    grid-column: span 12;
  }

  .gallery-modal__image-item--half,
  .gallery-modal__image-item--third,
  .gallery-modal__image-item--two-thirds,
  .gallery-modal__image-item--quarter {
    grid-column: span 12;
  }

  .gallery-modal__image-wrapper {
    border-radius: 4px;
  }

  .gallery-modal__video-item--half,
  .gallery-modal__video-item--third,
  .gallery-modal__video-item--two-thirds,
  .gallery-modal__video-item--quarter {
    grid-column: span 12;
  }

  .gallery-modal__trivia--half,
  .gallery-modal__trivia--third,
  .gallery-modal__trivia--two-thirds {
    grid-column: span 12;
  }

  .gallery-modal__trivia {
    padding: 16px 0;
  }

  .gallery-modal__trivia-content {
    flex-direction: column;
    gap: 24px;
    align-items: center;
  }

  .gallery-modal__trivia-image-wrapper {
    width: 200px;
    height: 200px;
    order: -1;
  }

  .gallery-modal__trivia-text {
    max-width: 100%;
    order: 1;
  }

  /* Download button on mobile - matches View Projects button style */
  .gallery-modal__image-wrapper:has(.gallery-modal__download-link-image) {
    padding-bottom: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
  }

  .gallery-modal__download-link-image {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 400px;
    height: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 14px 20px !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    font-family: var(--font-primary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    text-decoration: none !important;
    overflow: visible !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .gallery-modal__download-link-image--has-image {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
  }

  .gallery-modal__download-link-image:hover {
    transform: none !important;
    background: rgba(255, 255, 255, 0.08) !important;
  }

  .gallery-modal__download-link-image:active {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    transform: scale(0.98) !important;
  }

  .gallery-modal__download-image {
    display: none !important;
  }

  .gallery-modal__download-icon-svg {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    flex-shrink: 0 !important;
    color: rgba(255, 255, 255, 0.95) !important;
  }

  .gallery-modal__download-text-mobile {
    display: inline-block !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    white-space: normal !important;
    line-height: 1.2 !important;
    text-align: center !important;
    flex: 0 1 auto !important;
  }

  /* Modal container */
  .gallery-modal {
    padding: 0;
  }

  .gallery-modal__container {
    border-radius: 0;
  }

  .gallery-modal__content {
    padding: 60px 16px 16px;
  }

  /* Typography */
  .gallery-modal__title {
    font-size: 2.272rem;
    margin: 1.272rem 0 1.272rem 0;
  }

  .gallery-modal__description {
    font-size: 1.618rem;
    line-height: 2.272rem;
  }

  .gallery-modal__content-title {
    font-size: 1.618rem;
  }

  .gallery-modal__content-text {
    font-size: 0.9375rem;
  }

  .gallery-modal__content-block--two-thirds .gallery-modal__content-text {
    max-width: 100%;
  }

  /* Controls */
  .gallery-modal__close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }

  /* Spacing */
  .gallery-modal__images {
    gap: 16px;
  }

  .gallery-modal__grid {
    gap: 20px;
    margin-top: 24px;
  }
}

/* ============================================
   CLIENT LOGOS SLIDE
   ============================================ */

.slide--clients {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  position: relative;
  overflow: hidden;
}

.slide--clients::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 30% 50%,
      rgba(59, 130, 246, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 30%,
      rgba(139, 92, 246, 0.06) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.slide__clients-content {
  width: 100%;
  max-width: 1100px;
  padding: 4.5rem 2rem 2rem 2rem;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.slide__clients-header {
  text-align: center;
  max-width: 600px;
}

.slide__clients-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.618rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.slide__clients-subtitle {
  font-family: var(--font-primary);
  font-size: clamp(0.75rem, 1.5vw, 0.9375rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.slide__clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
  width: 100%;
  max-width: 920px;
  padding: 0.5rem;
}

.slide__client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  aspect-ratio: 16 / 9;
}

.slide__client-logo--image {
  padding: 0;
  position: relative;
  overflow: hidden;
}

.slide__client-logo:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.slide__client-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: brightness(0.9) contrast(1.1);
  transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide__client-logo--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide__client-logo:hover img {
  filter: brightness(1) contrast(1);
}

/* View Projects Button */
.slide__clients-view-projects {
  display: none;
}

@media (max-width: 768px) {
  .slide__clients-view-projects {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 400px;
    padding: 14px 20px;
    margin: 1rem 0 0 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
  }

  .slide__clients-view-projects:active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(0.98);
  }

  .slide__clients-view-projects svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
}

/* Animation for when slide becomes current */
.slide__clients-header,
.slide__clients-grid {
  flex-shrink: 0;
}

.slide__clients-title,
.slide__clients-subtitle,
.slide__clients-view-projects {
  opacity: 0;
}

.slide__clients-grid {
  opacity: 1;
}

.slide__client-logo {
  opacity: 0;
}

.slide--current.slide--clients .slide__clients-title {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.slide--current.slide--clients .slide__clients-subtitle {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

.slide--current.slide--clients .slide__clients-grid {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}

.slide--current.slide--clients .slide__clients-view-projects {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.3s forwards;
}

.slide--current.slide--clients .slide__client-logo {
  animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide--current.slide--clients.slide--transitioned .slide__clients-title {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.7s forwards;
}

.slide--current.slide--clients.slide--transitioned .slide__clients-subtitle {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

.slide--current.slide--clients.slide--transitioned .slide__clients-grid {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
}

.slide--current.slide--clients.slide--transitioned
  .slide__clients-view-projects {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.8s forwards;
}

.slide--current.slide--clients .slide__client-logo:nth-child(1) {
  animation-delay: 0.5s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(2) {
  animation-delay: 0.55s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(3) {
  animation-delay: 0.6s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(4) {
  animation-delay: 0.65s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(5) {
  animation-delay: 0.7s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(6) {
  animation-delay: 0.75s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(7) {
  animation-delay: 0.8s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(8) {
  animation-delay: 0.85s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(9) {
  animation-delay: 0.9s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(10) {
  animation-delay: 0.95s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(11) {
  animation-delay: 1s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(12) {
  animation-delay: 1.05s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(13) {
  animation-delay: 1.1s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(14) {
  animation-delay: 1.15s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(15) {
  animation-delay: 1.2s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(16) {
  animation-delay: 1.25s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(17) {
  animation-delay: 1.3s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(18) {
  animation-delay: 1.35s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(19) {
  animation-delay: 1.4s;
}
.slide--current.slide--clients .slide__client-logo:nth-child(20) {
  animation-delay: 1.45s;
}

.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(1) {
  animation-delay: 1s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(2) {
  animation-delay: 1.05s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(3) {
  animation-delay: 1.1s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(4) {
  animation-delay: 1.15s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(5) {
  animation-delay: 1.2s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(6) {
  animation-delay: 1.25s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(7) {
  animation-delay: 1.3s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(8) {
  animation-delay: 1.35s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(9) {
  animation-delay: 1.4s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(10) {
  animation-delay: 1.45s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(11) {
  animation-delay: 1.5s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(12) {
  animation-delay: 1.55s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(13) {
  animation-delay: 1.6s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(14) {
  animation-delay: 1.65s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(15) {
  animation-delay: 1.7s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(16) {
  animation-delay: 1.75s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(17) {
  animation-delay: 1.8s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(18) {
  animation-delay: 1.85s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(19) {
  animation-delay: 1.9s;
}
.slide--current.slide--clients.slide--transitioned
  .slide__client-logo:nth-child(20) {
  animation-delay: 1.95s;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
  .slide--clients {
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    scroll-behavior: smooth;
    display: block !important;
    place-items: unset !important;
    touch-action: pan-y; /* Allow vertical scrolling */
  }

  .slide--clients.slide--transitioning {
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: auto;
  }

  .slide--clients::-webkit-scrollbar {
    width: 4px;
  }

  .slide--clients::-webkit-scrollbar-track {
    background: transparent;
  }

  .slide--clients::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
  }

  .slide__clients-content {
    padding: calc(env(safe-area-inset-top) + 0rem) 1rem
      calc(env(safe-area-inset-bottom) + 1.5rem) 1rem;
    gap: 3.272rem;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    pointer-events: auto; /* Ensure touch events work */
  }

  .slide__clients-content::before {
    content: "";
    display: block;
    height: 0;
    width: 100%;
    flex-shrink: 0;
  }

  .slide__clients-header {
    max-width: 100%;
    padding: 0 0.5rem;
    flex-shrink: 0;
  }

  .slide__clients-title {
    font-size: clamp(1.125rem, 6vw, 1.618rem);
    margin: 5rem 0 0.618rem 0;
  }

  .slide__clients-subtitle {
    font-size: clamp(0.6875rem, 3.5vw, 0.875rem);
    line-height: 1.4;
  }

  .slide__clients-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    padding: 0 0.25rem;
    flex-shrink: 0;
    width: 100%;
    will-change: auto;
  }

  .slide__client-logo {
    padding: 0.875rem;
    aspect-ratio: 16 / 10;
    contain: layout style paint;
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .slide--clients {
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    scroll-behavior: smooth;
    display: block !important;
    place-items: unset !important;
  }

  .slide--clients.slide--transitioning {
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: auto;
  }

  .slide--clients::-webkit-scrollbar {
    width: 4px;
  }

  .slide--clients::-webkit-scrollbar-track {
    background: transparent;
  }

  .slide--clients::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
  }

  .slide__clients-content {
    padding: 8rem 2rem 10rem 2rem;
    gap: 2.5rem;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    pointer-events: auto;
  }

  .slide__clients-content::before {
    content: "";
    display: block;
    height: 0;
    width: 100%;
    flex-shrink: 0;
  }

  .slide__clients-header {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .slide__clients-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 0;
    flex-shrink: 0;
    width: 100%;
  }
}

/* Mobile Contact Slide - Art Museum Style */
.slide--contact {
  display: none;
}

@media (max-width: 1024px) {
  .slide--contact {
    display: grid;
    background: #8b1e1e;
  }

  .slide__contact-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8rem 2rem 3rem;
    z-index: 10;
  }

  .slide__contact-header {
    margin-bottom: 1.272rem;
  }

  .slide__contact-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin: 0 0 1.272rem;
    letter-spacing: -0.02em;
    color: #fff;
  }

  .slide__contact-subtitle {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    max-width: 280px;
    margin: 0;
  }

  .slide__contact-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 2rem 0;
  }

  .slide__contact-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
  }

  .slide__contact-link:first-child {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .slide__contact-link:active {
    color: #fff;
    padding-left: 8px;
    border-color: rgba(255, 255, 255, 0.3);
  }

  .slide__contact-link-arrow {
    font-size: 1.5rem;
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .slide__contact-link:active .slide__contact-link-arrow {
    opacity: 1;
    transform: translateX(4px);
  }

  .slide__contact-footer {
    margin-top: auto;
    padding-top: 2rem;
  }

  .slide__contact-credit {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
  }

  .slide__contact-title,
  .slide__contact-subtitle,
  .slide__contact-links,
  .slide__contact-footer {
    opacity: 0;
    transform: translateY(30px);
  }

  .slide--current.slide--contact .slide__contact-title {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.7s forwards;
  }

  .slide--current.slide--contact .slide__contact-subtitle {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
  }

  .slide--current.slide--contact .slide__contact-links {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.9s forwards;
  }

  .slide--current.slide--contact .slide__contact-footer {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1s forwards;
  }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .gallery-modal {
    padding: 12px;
  }
}

/* Click Ripple Effect */
.ripple {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.12) 0%,
    rgba(59, 130, 246, 0.06) 20%,
    transparent 50%
  );
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple-animation 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ripple-animation {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}
