/* ========================================
   PANENKA CREATIVES - SHARED STYLES
   Consolidated CSS for multi-page website
   ======================================== */

/* ----------------------------------------
   CSS VARIABLES
   ---------------------------------------- */
:root {
  /* Card system (index.html) */
  --card-width: 260px;
  --card-height: 360px;
  --row-gap: 15px;
  
  /* Brand Colors */
  --neon-yellow: #E2F64E;
  --neon-pink: #FE31EE;
  --bg-dark: #050505;
  --bg-card: #111;
  
  /* Dynamic Accent Color (default: neon pink) */
  --accent-color: #FE31EE;
  
  /* Easing */
  --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.05);
  --ease-smooth: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Responsive card sizes */
@media (min-width: 768px) {
  :root {
    --card-width: 280px;
    --card-height: 400px;
    --row-gap: 30px;
  }
}

@media (min-width: 1440px) {
  :root {
    --card-width: 320px;
    --card-height: 450px;
    --row-gap: 40px;
  }
}

/* Enlarge cards when gallery is open */

/* Mobile: 20% larger (260×360 → 312×432) */
@media (max-width: 767px) {
  body.gallery-open {
    --card-width: 312px;
    --card-height: 432px;
  }
}

/* Tablet: 20% larger (280×400 → 336×480) */
@media (min-width: 768px) and (max-width: 1024px) {
  body.gallery-open {
    --card-width: 336px;
    --card-height: 480px;
  }
}

/* Desktop */
@media (min-width: 1025px) {
  body.gallery-open {
    --card-width: 420px;
    --card-height: 600px;
  }
}

@media (min-width: 1440px) {
  body.gallery-open {
    --card-width: 480px;
    --card-height: 675px;
  }
}

/* ----------------------------------------
   BASE STYLES
   ---------------------------------------- */
html {
  overflow-x: hidden;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: transparent;
  overflow-x: hidden;
}

body.gallery-open {
  overflow: hidden;
}

/* ----------------------------------------
   TYPOGRAPHY
   ---------------------------------------- */

/* Headings - Outfit 900 italic uppercase */
h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
}

h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
}

/* Spans and other text inherit Space Grotesk from body */
span, p, a, li, td, th, label, input, textarea, button {
  font-family: 'Space Grotesk', sans-serif;
}

.font-serif-custom {
  font-family: 'Instrument Serif', serif;
}

.font-outfit {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
}

.font-geist-mono {
  font-family: 'Geist Mono', monospace;
}

.font-google-sans-flex {
  font-family: 'Segoe UI Symbol', sans-serif;
}

.font-space-grotesk {
  font-family: 'Space Grotesk', sans-serif;
}

/* ----------------------------------------
   UTILITY CLASSES
   ---------------------------------------- */
.texture-overlay {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

.ease-spring {
  transition: all 0.8s var(--ease-spring);
}

/* ----------------------------------------
   ACCENT COLOR UTILITIES
   Dynamic color that can be changed via JS
   ---------------------------------------- */
.text-accent {
  color: var(--accent-color);
}

.bg-accent {
  background-color: var(--accent-color);
}

.border-accent {
  border-color: var(--accent-color);
}

.selection-accent::selection {
  background-color: var(--accent-color);
  color: black;
}

.selection-accent *::selection {
  background-color: var(--accent-color);
  color: black;
}

.hover\:text-accent:hover {
  color: var(--accent-color);
}

.hover\:bg-accent:hover {
  background-color: var(--accent-color);
}

.hover\:border-accent:hover {
  border-color: var(--accent-color);
}

.group:hover .group-hover\:bg-accent {
  background-color: var(--accent-color);
}

.group:hover .group-hover\:border-accent {
  border-color: var(--accent-color);
}

/* Named group hover for text-accent (e.g., group/item) */
.group\/item:hover .group-hover\/item\:text-accent {
  color: var(--accent-color);
}

/* Shadow glow effect using accent color */
.shadow-accent {
  box-shadow: 0 0 120px color-mix(in srgb, var(--accent-color) 30%, transparent);
}

/* ----------------------------------------
   SCROLL REVEAL ANIMATIONS
   ---------------------------------------- */
.reveal-text {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(10px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-text.in-view {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Animation delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* ----------------------------------------
   OVERLAY ENTER ANIMATIONS
   ---------------------------------------- */
@keyframes enter-up {
  0% {
    opacity: 0.001;
    transform: translateY(40px) scale(0.98);
    filter: blur(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.animate-enter {
  animation: enter-up 1.1s var(--ease-out-quart) both;
}

.reveal-waiting {
  opacity: 0.001;
}

/* ----------------------------------------
   MARQUEE ANIMATION
   ---------------------------------------- */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  animation: marquee 30s linear infinite;
  display: flex;
  flex-shrink: 0;
}

/* ----------------------------------------
   CUSTOM SCROLLBAR
   ---------------------------------------- */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* ----------------------------------------
   SVG PATH TRANSITIONS (About page)
   ---------------------------------------- */
.logo-path {
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), fill 0.6s ease;
}

/* ----------------------------------------
   DIFFERENCE SECTION SCROLL ACTIVATION
   ---------------------------------------- */
/* When list has an active item, fade non-active items */
#difference-list.has-active .difference-item:not(.is-active) {
  opacity: 0.4;
}

/* Active item styles */
.difference-item.is-active {
  opacity: 1 !important;
}

/* Active item - show description */
.difference-item.is-active .difference-description {
  opacity: 1;
  transform: translateX(0);
}

/* Active item - accent color on title */
.difference-item.is-active .difference-title {
  color: var(--accent-color);
}

/* Active item - lighter number */
.difference-item.is-active .difference-number {
  color: #d4d4d4;
}

/* Active item - show arrow */
.difference-item.is-active .difference-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile: Disable scroll-based activation (descriptions always visible) */
@media (max-width: 767px) {
  #difference-list.has-active .difference-item:not(.is-active) {
    opacity: 1;
  }
}

/* ----------------------------------------
   GALLERY TRACK (Index page)
   ---------------------------------------- */
#gallery-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform;
}

.gallery-open #gallery-track {
  pointer-events: auto;
}

/* Smooth closing animation for gallery track */
.gallery-closing #gallery-track {
  transition: transform 0.8s var(--ease-smooth) !important;
  transform: translateX(0px) !important;
}

/* ----------------------------------------
   CARD SYSTEM (Index page)
   ---------------------------------------- */
.card {
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  left: 50%;
  top: 50%;
  margin-left: calc(var(--card-width) * -0.5);
  margin-top: calc(var(--card-height) * -0.5);
  transition: 
    transform 0.8s var(--ease-smooth),
    left 0.8s var(--ease-smooth),
    width 0.8s var(--ease-smooth),
    height 0.8s var(--ease-smooth),
    margin 0.8s var(--ease-smooth),
    opacity 0.5s ease;
  transform-origin: center center;
  will-change: transform, left, width, height, margin, opacity;
  z-index: 10;
  pointer-events: auto;
}

/* ----------------------------------------
   HERO ENTRY ANIMATION
   Cards fly in from outside the viewport
   ---------------------------------------- */

/* Disable transitions during entry animation to prevent conflicts */
.card.hero-entry-waiting,
.card.hero-entry-animate {
  transition: none !important;
}

/* Initial state - cards hidden off-screen before animation */
.card.hero-entry-waiting {
  opacity: 0;
  transform: var(--entry-start-transform) !important;
}

/* Each card flies in from a different direction */
.card[data-index="0"].hero-entry-waiting {
  --entry-start-transform: translateX(-120vw) translateY(-50vh) rotate(-45deg) scale(0.6);
}
.card[data-index="1"].hero-entry-waiting {
  --entry-start-transform: translateX(-80vw) translateY(60vh) rotate(-30deg) scale(0.6);
}
.card[data-index="2"].hero-entry-waiting {
  --entry-start-transform: translateY(-100vh) rotate(15deg) scale(0.6);
}
.card[data-index="3"].hero-entry-waiting {
  --entry-start-transform: translateX(80vw) translateY(50vh) rotate(35deg) scale(0.6);
}
.card[data-index="4"].hero-entry-waiting {
  --entry-start-transform: translateX(100vw) translateY(-40vh) rotate(25deg) scale(0.6);
}

/* Animation keyframes - different for each card direction */
@keyframes hero-card-entry-0 {
  0% {
    opacity: 0;
    transform: translateX(-120vw) translateY(-50vh) rotate(-45deg) scale(0.6);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(-8deg) translate(-15px, 5px);
  }
}

@keyframes hero-card-entry-1 {
  0% {
    opacity: 0;
    transform: translateX(-80vw) translateY(60vh) rotate(-30deg) scale(0.6);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(-4deg) translate(-5px, -5px);
  }
}

@keyframes hero-card-entry-2 {
  0% {
    opacity: 0;
    transform: translateY(-100vh) rotate(15deg) scale(0.6);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(2deg) translate(5px, 5px);
  }
}

@keyframes hero-card-entry-3 {
  0% {
    opacity: 0;
    transform: translateX(80vw) translateY(50vh) rotate(35deg) scale(0.6);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(6deg) translate(10px, -5px);
  }
}

@keyframes hero-card-entry-4 {
  0% {
    opacity: 0;
    transform: translateX(100vw) translateY(-40vh) rotate(25deg) scale(0.6);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(-2deg) translate(0px, 0px);
  }
}

/* Apply animations with staggered delays */
/* Using 'both' fill-mode to apply initial state during delay and keep final state */
/* Cards start after 1s delay so hero text is visible first */
.card.hero-entry-animate {
  visibility: visible !important;
}
.card.hero-entry-animate[data-index="0"] {
  animation: hero-card-entry-0 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 1000ms;
}
.card.hero-entry-animate[data-index="1"] {
  animation: hero-card-entry-1 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 1080ms;
}
.card.hero-entry-animate[data-index="2"] {
  animation: hero-card-entry-2 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 1160ms;
}
.card.hero-entry-animate[data-index="3"] {
  animation: hero-card-entry-3 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 1240ms;
}
.card.hero-entry-animate[data-index="4"] {
  animation: hero-card-entry-4 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 1320ms;
}

/* Hero content entry animation */
@keyframes hero-content-entry {
  0% {
    opacity: 0;
    transform: scale(0.92);
    filter: blur(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

#hero-content.hero-content-waiting {
  opacity: 0;
}

#hero-content.hero-content-animate {
  animation: hero-content-entry 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 200ms;
}

.gallery-open .card {
  top: 50%;
  margin-top: calc(var(--card-height) * -0.5);
  transform: rotate(0deg) !important;
}

.gallery-open .card:nth-child(1) { left: calc(50% - (var(--card-width) * 2) - (var(--row-gap) * 2)); }
.gallery-open .card:nth-child(2) { left: calc(50% - var(--card-width) - var(--row-gap)); }
.gallery-open .card:nth-child(3) { left: 50%; }
.gallery-open .card:nth-child(4) { left: calc(50% + var(--card-width) + var(--row-gap)); }
.gallery-open .card:nth-child(5) { left: calc(50% + (var(--card-width) * 2) + (var(--row-gap) * 2)); }

/* Mobile/Tablet card layout - horizontal row with touch scroll */
@media (max-width: 1024px) {
  /* Cards animate horizontally just like desktop */
  .gallery-open .card {
    top: 50%;
    margin-top: calc(var(--card-height) * -0.5);
    transform: rotate(0deg) !important;
  }
  
  /* Position cards in a horizontal row - centered around middle card */
  .gallery-open .card:nth-child(1) { left: calc(50% - (var(--card-width) * 2) - (var(--row-gap) * 2)); }
  .gallery-open .card:nth-child(2) { left: calc(50% - var(--card-width) - var(--row-gap)); }
  .gallery-open .card:nth-child(3) { left: 50%; }
  .gallery-open .card:nth-child(4) { left: calc(50% + var(--card-width) + var(--row-gap)); }
  .gallery-open .card:nth-child(5) { left: calc(50% + (var(--card-width) * 2) + (var(--row-gap) * 2)); }
  
  /* Hide scroll zones and nav arrows on touch devices */
  .scroll-zone, .nav-arrow { display: none !important; }
  
  /* Grab cursor for drag-to-scroll */
  .gallery-open #card-system {
    cursor: grab;
  }
  
  .gallery-open #card-system:active {
    cursor: grabbing;
  }
}

/* Hero scroll effect styles */
#hero-content {
  will-change: transform, filter, opacity;
  transform-origin: center center;
}

/* Smooth transition when gallery opens */
.gallery-open #hero-content {
  transition: transform 0.7s var(--ease-smooth), 
              filter 0.7s var(--ease-smooth), 
              opacity 0.7s var(--ease-smooth);
}

/* Card scroll animations - each card animates individually */
#gallery-track .card {
  will-change: transform, filter, opacity;
}

.gallery-open #hero-content {
  opacity: 0.1;
  filter: blur(8px);
  transform: scale(0.95);
}

/* ----------------------------------------
   SCROLL ZONES (Index page)
   ---------------------------------------- */
.scroll-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 15%;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-open .scroll-zone {
  pointer-events: auto;
}

.scroll-zone.right { right: 0; transform: scaleX(-1); }
.scroll-zone.left { left: 0; }

/* ----------------------------------------
   GRADIENT BLUR WRAPPER
   ---------------------------------------- */
.gradient-blur-wrapper {
  pointer-events: none;
  z-index: 25;
}

/* ----------------------------------------
   NAVBAR DARK OVERLAY (Footer visibility)
   ---------------------------------------- */
.navbar-dark-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.7) 40%,
    rgba(0, 0, 0, 0.4) 70%,
    rgba(0, 0, 0, 0) 100%
  );
  /* Extend beyond navbar bounds for smooth coverage */
  margin: -24px -24px 0 -24px;
  padding: 24px 24px 40px 24px;
  height: calc(100% + 60px);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
  .navbar-dark-overlay {
    margin: -32px -48px 0 -48px;
    padding: 32px 48px 50px 48px;
    height: calc(100% + 70px);
  }
}

/* ----------------------------------------
   TOP PROGRESSIVE BLUR (Navbar)
   ---------------------------------------- */
.gradient-blur {
  position: fixed;
  z-index: 45;
  inset: 0 0 auto 0;
  height: 140px;
  pointer-events: none;
}

.gradient-blur > div,
.gradient-blur::before,
.gradient-blur::after {
  position: absolute;
  inset: 0;
}

.gradient-blur::before {
  content: "";
  z-index: 1;
  backdrop-filter: blur(0.5px);
  -webkit-backdrop-filter: blur(0.5px);
  mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 1) 12.5%,
      rgba(0, 0, 0, 1) 25%,
      rgba(0, 0, 0, 0) 37.5%);
  -webkit-mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 1) 12.5%,
      rgba(0, 0, 0, 1) 25%,
      rgba(0, 0, 0, 0) 37.5%);
}

.gradient-blur > div:nth-of-type(1) {
  z-index: 2;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 12.5%,
      rgba(0, 0, 0, 1) 25%,
      rgba(0, 0, 0, 1) 37.5%,
      rgba(0, 0, 0, 0) 50%);
  -webkit-mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 12.5%,
      rgba(0, 0, 0, 1) 25%,
      rgba(0, 0, 0, 1) 37.5%,
      rgba(0, 0, 0, 0) 50%);
}

.gradient-blur > div:nth-of-type(2) {
  z-index: 3;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 25%,
      rgba(0, 0, 0, 1) 37.5%,
      rgba(0, 0, 0, 1) 50%,
      rgba(0, 0, 0, 0) 62.5%);
  -webkit-mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 25%,
      rgba(0, 0, 0, 1) 37.5%,
      rgba(0, 0, 0, 1) 50%,
      rgba(0, 0, 0, 0) 62.5%);
}

.gradient-blur > div:nth-of-type(3) {
  z-index: 4;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 37.5%,
      rgba(0, 0, 0, 1) 50%,
      rgba(0, 0, 0, 1) 62.5%,
      rgba(0, 0, 0, 0) 75%);
  -webkit-mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 37.5%,
      rgba(0, 0, 0, 1) 50%,
      rgba(0, 0, 0, 1) 62.5%,
      rgba(0, 0, 0, 0) 75%);
}

.gradient-blur > div:nth-of-type(4) {
  z-index: 5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 50%,
      rgba(0, 0, 0, 1) 62.5%,
      rgba(0, 0, 0, 1) 75%,
      rgba(0, 0, 0, 0) 87.5%);
  -webkit-mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 50%,
      rgba(0, 0, 0, 1) 62.5%,
      rgba(0, 0, 0, 1) 75%,
      rgba(0, 0, 0, 0) 87.5%);
}

.gradient-blur > div:nth-of-type(5) {
  z-index: 6;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 62.5%,
      rgba(0, 0, 0, 1) 75%,
      rgba(0, 0, 0, 1) 87.5%,
      rgba(0, 0, 0, 0) 100%);
  -webkit-mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 62.5%,
      rgba(0, 0, 0, 1) 75%,
      rgba(0, 0, 0, 1) 87.5%,
      rgba(0, 0, 0, 0) 100%);
}

.gradient-blur > div:nth-of-type(6) {
  z-index: 7;
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 75%,
      rgba(0, 0, 0, 1) 87.5%,
      rgba(0, 0, 0, 1) 100%);
  -webkit-mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 75%,
      rgba(0, 0, 0, 1) 87.5%,
      rgba(0, 0, 0, 1) 100%);
}

.gradient-blur::after {
  content: "";
  z-index: 8;
  backdrop-filter: blur(64px);
  -webkit-backdrop-filter: blur(64px);
  mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 87.5%,
      rgba(0, 0, 0, 1) 100%);
  -webkit-mask: linear-gradient(to top,
      rgba(0, 0, 0, 0) 87.5%,
      rgba(0, 0, 0, 1) 100%);
}

/* ----------------------------------------
   MANIFESTO SECTION SCROLL ANIMATIONS
   ---------------------------------------- */

/* Desktop: First column is 150% of the others (1.5fr vs 1fr) */
@media (min-width: 1024px) {
  #manifesto-section > .grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

.column-fill {
  z-index: 1;
  will-change: transform;
}

.column-content {
  will-change: transform;
}

/* Remove fixed transition to allow JS to drive smooth scroll position */
.manifesto-column .column-fill,
.manifesto-column .column-content {
  transition: none;
}

/* Disable parallax on tablet and mobile for better performance */
@media (max-width: 1023px) {
  .manifesto-column .column-fill {
    transform: translateY(0%) !important;
  }
  
  .manifesto-column .column-content {
    transform: translateY(0%) !important;
  }
}

/* ----------------------------------------
   MOSAIC SCROLL REVEAL TRANSITION
   ---------------------------------------- */
#mosaic-grid {
  display: grid;
  grid-template-columns: repeat(var(--mosaic-cols, 20), 1fr);
  grid-template-rows: repeat(var(--mosaic-rows, 15), 1fr);
}

.mosaic-cell {
  background-color: #050505;
  opacity: 1;
  will-change: opacity;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mosaic-cell.revealed {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.0, 0, 0.2, 1);
}

/* Responsive grid density */
@media (max-width: 640px) {
  #mosaic-grid {
    --mosaic-cols: 12;
    --mosaic-rows: 20;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  #mosaic-grid {
    --mosaic-cols: 16;
    --mosaic-rows: 12;
  }
}

@media (min-width: 1025px) {
  #mosaic-grid {
    --mosaic-cols: 24;
    --mosaic-rows: 15;
  }
}

@media (min-width: 1440px) {
  #mosaic-grid {
    --mosaic-cols: 32;
    --mosaic-rows: 18;
  }
}

/* ----------------------------------------
   FOOTER BENTO GRID
   Responsive layout for footer blocks
   ---------------------------------------- */

/* Grid area assignments */
.bento-est { grid-area: est; }
.bento-bold { grid-area: bold; }
.bento-star { grid-area: star; }
.bento-social { 
  grid-area: social;
  grid-template-rows: 1fr 1fr;
}
.bento-cta { grid-area: cta; }

/* Mobile first (< 480px): Small blocks on top, CTA big, social 2x2 at end */
.bento-grid {
  grid-template-columns: 1fr 1fr !important;
  grid-template-areas:
    "est    star"
    "bold   bold"
    "cta    cta"
    "social social" !important;
}

.bento-cta { min-height: 320px; }

/* Ensure social stays as 2x2 grid on mobile/tablet */
@media (max-width: 1023px) {
  .bento-social {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    min-height: 200px;
  }
}

/* Small screens (480px - 639px): Book a call on separate row */
@media (min-width: 480px) {
  .bento-grid {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "est    star"
      "bold   bold"
      "cta    cta"
      "social social" !important;
  }
  
  .bento-cta { min-height: 340px; }
}

/* Tablet (640px - 767px): Book a call on separate row */
@media (min-width: 640px) {
  .bento-grid {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "est    star"
      "bold   bold"
      "cta    cta"
      "social social" !important;
  }
  
  .bento-cta { min-height: 360px; }
  
  .bento-social {
    min-height: 180px;
  }
}

/* Medium tablet (768px - 1023px): Book a call on separate row */
@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "est    star"
      "bold   bold"
      "cta    cta"
      "social social" !important;
  }
  
  .bento-cta { min-height: 380px; }
}

/* Desktop (1024px - 1279px): Balanced bento - original layout */
@media (min-width: 1024px) {
  .bento-grid {
    grid-template-columns: 1fr 2.5fr 1fr !important;
    grid-template-areas:
      "est    bold   star"
      "social cta    cta" !important;
  }
  
  .bento-cta { min-height: 100%; }
  
  .bento-social {
    min-height: auto;
  }
}

/* Large desktop (1280px - 1439px): Wider center */
@media (min-width: 1280px) {
  .bento-grid {
    grid-template-columns: 1fr 3fr 1fr !important;
    grid-template-areas:
      "est    bold   star"
      "social cta    cta" !important;
  }
}

/* Extra large (>= 1440px): Max proportions */
@media (min-width: 1440px) {
  .bento-grid {
    grid-template-columns: 1fr 3.5fr 1fr !important;
    grid-template-areas:
      "est    bold   star"
      "social cta    cta" !important;
  }
}

/* ----------------------------------------
   WAVE TEXT ANIMATION (Footer "Book a call")
   Letters fly out top, return from bottom
   ---------------------------------------- */
.wave-text {
  overflow: hidden;
  display: inline-flex;
}

.wave-letter {
  display: inline-block;
}

/* Wave animation keyframes - hover in (up and back from below) */
@keyframes wave-out-in {
  0% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-120%);
  }
  41% {
    transform: translateY(120%);
  }
  100% {
    transform: translateY(0);
  }
}

/* Wave animation keyframes - hover out (down and back from above) */
@keyframes wave-out-in-reverse {
  0% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(120%);
  }
  41% {
    transform: translateY(-120%);
  }
  100% {
    transform: translateY(0);
  }
}

/* Trigger enter animation on hover */
.bento-bold.wave-hover .wave-letter {
  animation: wave-out-in 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: calc(var(--i) * 0.04s);
}

/* Trigger leave animation on mouse out */
.bento-bold.wave-leave .wave-letter {
  animation: wave-out-in-reverse 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: calc(var(--i) * 0.04s);
}

/* ----------------------------------------
   PROJECT OVERLAY CLOSE BUTTON
   Fixed close button for case study view
   ---------------------------------------- */
#project-close-btn {
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.3s ease;
}

/* ----------------------------------------
   MOBILE MENU STYLES
   Fullscreen navigation for mobile/tablet
   ---------------------------------------- */

/* Hamburger Menu Toggle */
#mobile-menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: -8px;
}

#mobile-menu-toggle .menu-bar {
  display: block;
  background-color: white;
}

#mobile-menu-toggle.is-active .menu-bar:first-child {
  transform: translateY(5px) rotate(45deg);
}

#mobile-menu-toggle.is-active .menu-bar:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

/* Mobile Menu Container - Window Blind Effect */
.mobile-menu {
  z-index: 9998 !important;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.2s cubic-bezier(0.65, 0, 0.35, 1);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

.mobile-menu.is-open {
  clip-path: inset(0 0 0 0);
}

.mobile-menu.is-closing {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Backdrop solid background */
.mobile-menu-backdrop {
  background: rgba(5, 5, 5, 0.88);
}

/* Content stays centered, revealed by clip */
.mobile-menu-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* Mobile nav links styling */
.mobile-nav-link {
  font-style: italic;
  display: block;
  text-align: center;
  will-change: transform, opacity;
}

.mobile-nav-link:hover {
  transform: scale(1.02);
}

/* Mobile menu footer */
.mobile-menu-footer {
  will-change: transform, opacity;
}

/* Ensure proper z-index layering */
.mobile-menu.is-open {
  pointer-events: auto;
}

/* Mobile Color Picker */
.mobile-color-picker {
  padding: 16px 0;
}

.mobile-color-swatch {
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mobile-color-swatch:active {
  transform: scale(0.95);
}

/* Nav container - constrain width on larger screens */
.mobile-nav-container {
  max-width: 100%;
  container-type: inline-size;
}

/* Nav links - fluid sizing based on container */
.mobile-nav-link {
  font-size: 16cqw;
}

@media (min-width: 1025px) {
  .mobile-nav-container {
    max-width: 1000px;
  }
  
  .mobile-menu-content {
    padding-left: 4rem;
    padding-right: 4rem;
  }
  
  .mobile-menu-footer {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 0 2rem;
  }
}

/* Tablet landscape specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
  .mobile-menu-content {
    padding-top: 6rem;
    padding-bottom: 2rem;
  }
  
  .mobile-nav-link {
    font-size: 9vw;
  }
  
  .mobile-menu-footer {
    margin-top: 1rem;
    gap: 0.75rem;
  }
  
  .mobile-color-picker {
    padding: 8px 0;
  }
  
  .mobile-color-swatch {
    width: 2rem;
    height: 2rem;
  }
}
