/* ============================================
   EVAN GOVEDAS PORTFOLIO - Main Stylesheet
   Cinematic Dark Theme
   ============================================ */

/* CSS Variables */
:root {
  /* Colors - UPDATED FOR WCAG AA COMPLIANCE */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-card: #151515;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;  /* Was #999999, now 7:1 contrast */
  --text-muted: #8a8a8a;       /* Was #666666, now 4.5:1 contrast */
  --accent: #FF6600;
  --accent-dark: #cc5200;
  --accent-light: #ff8533;
  --accent-glow: rgba(255, 102, 0, 0.4);
  --accent-subtle: rgba(255, 102, 0, 0.08);
  --border-color: #3a3a3a;     /* Was #2a2a2a, slightly lighter */

  /* Typography */
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Outfit', sans-serif;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Spacing — fluid scaling */
  --nav-height: 80px;
  --container-width: min(1200px, 90vw);
  --section-padding: clamp(50px, 4vw + 20px, 100px);

  /* Device Detection (default to desktop) */
  --is-touch-device: 0;
  --is-desktop-device: 1;
}

/* Pointer Media Queries - More accurate than window size */
/* Touch devices (mobile/tablet) - coarse pointer, no hover */
@media (hover: none) and (pointer: coarse) {
  :root {
    --is-touch-device: 1;
    --is-desktop-device: 0;
  }
}

/* Desktop devices - fine pointer, hover support */
@media (hover: hover) and (pointer: fine) {
  :root {
    --is-touch-device: 0;
    --is-desktop-device: 1;
  }
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

/* Lenis Recommended CSS */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* cursor: none; -- REMOVED, JS will add class */
}

/* Only hide cursor when JS has loaded and custom cursor is active */
body.custom-cursor-active {
  cursor: none;
}

body.custom-cursor-active a,
body.custom-cursor-active button,
body.custom-cursor-active .project-card,
body.custom-cursor-active .filter-btn,
body.custom-cursor-active .submit-btn,
body.custom-cursor-active .nav-logo,
body.custom-cursor-active .nav-toggle,
body.custom-cursor-active .sort-select,
body.custom-cursor-active .form-group input,
body.custom-cursor-active .form-group textarea {
  cursor: none !important;
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 100000;
  pointer-events: none;
  transition: 
    background-color 0.1s ease-out, 
    border-color 0.1s ease-out, 
    transform 0.1s ease-out,
    width 0.1s ease-out,
    height 0.1s ease-out;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background-color: white;
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 1px solid white;
}

.cursor-dot.active {
  background-color: var(--accent-dark);
  width: 8px;
  height: 8px;
}

.cursor-outline.active {
  border-color: var(--accent-dark);
  background-color: transparent;
  width: 36px;
  height: 36px;
}

.cursor-dot.clicking,
.cursor-outline.clicking {
  transform: translate(-50%, -50%) scale(0.9);
}

/* ============================================
   FOCUS INDICATORS (Accessibility)
   ============================================ */

/* Global focus outline for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Remove default outline since we're using :focus-visible */
:focus:not(:focus-visible) {
  outline: none;
}

/* Specific component focus styles */
.nav-link:focus-visible {
  outline-offset: 6px;
}

.project-card:focus-visible {
  outline-offset: 4px;
  transform: scale(1.02);
}

.filter-btn:focus-visible,
.submit-btn:focus-visible {
  outline-offset: 4px;
}

.form-group input:focus-visible,
.form-group textarea:focus-visible {
  outline: none; /* Already has box-shadow focus state */
  box-shadow: 0 0 0 3px var(--accent-glow), inset 0 0 20px rgba(255, 102, 0, 0.1);
}

.skill-item:focus-visible {
  outline-offset: 4px;
  transform: scale(1.05);
}

/* Skip link for keyboard users */
.skip-link {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg-primary);
  padding: 12px 24px;
  font-weight: 600;
  z-index: 100001;
  transition: top 0.3s ease;
  text-decoration: none;
}

.skip-link:focus {
  top: 20px;
}

/* Page Wrapper */
.page-wrapper {
  opacity: 1;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3vw, 40px);
  z-index: 1000;
  background: transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-logo:hover {
  color: var(--accent-light);
  text-shadow: 0 0 20px var(--accent-glow);
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out-expo);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Effects Toggle */
.nav-controls {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 40px;
}

.effects-toggle-container {
  display: none;
}

.effects-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.effects-toggle-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.effects-toggle-label:hover .effects-toggle-text {
  color: var(--text-primary);
}

.effects-toggle-checkbox {
  display: none;
}

.effects-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.effects-toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.effects-toggle-checkbox:checked + .effects-toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.effects-toggle-checkbox:checked + .effects-toggle-slider::before {
  transform: translateX(20px);
  background: var(--bg-primary);
}

.effects-toggle-label:hover .effects-toggle-slider {
  border-color: var(--accent);
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--section-padding) clamp(20px, 3vw, 40px);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 102, 0, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(255, 102, 0, 0.05) 0%, transparent 40%),
    radial-gradient(ellipse at center, transparent 0%, var(--bg-primary) 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 102, 0, 0.03) 0%, transparent 70%);
  pointer-events: none;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--container-width);
  width: 100%;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 10rem);
  letter-spacing: 0.2em;
  line-height: 1;
  margin-bottom: 20px;
  user-select: none;
  -webkit-user-select: none;
  
  /* Metallic Spotlight Effect */
  color: #333; /* Fallback */
  background: radial-gradient(
    circle 450px at var(--x, 50%) var(--y, 50%),
    #ffffff 0%,
    #e0e0e0 10%,
    #a0a0a0 25%,
    #606060 50%,
    #2a2a2a 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
  user-select: none;
  -webkit-user-select: none;
}

.hero-subtitle::before,
.hero-subtitle::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.hero-subtitle::before {
  right: calc(100% + 20px);
  background: linear-gradient(90deg, transparent, var(--accent));
}

.hero-subtitle::after {
  left: calc(100% + 20px);
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* ============================================
   DEMO REEL - Spotlight Reveal Effect
   ============================================ */
.hero-reel {
  margin-top: 60px;
  width: 100%;
  max-width: var(--container-width);
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}

.hero-reel::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 50%, var(--accent-dark) 100%);
  border-radius: 10px;
  z-index: -1;
  opacity: 0.6;
}

.demo-reel-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 8px;
}

/* Blurred video layer */
.demo-reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(30px) brightness(0.4);
  pointer-events: none;
}

/* Clear video layer (revealed by spotlight) */
.demo-reel-video-clear {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  /* Feathered spotlight using radial gradient mask */
  -webkit-mask-image: radial-gradient(circle 0px at 50% 50%, black 0%, black 50%, transparent 100%);
  mask-image: radial-gradient(circle 0px at 50% 50%, black 0%, black 50%, transparent 100%);
  transition: opacity 0.2s ease;
}

/* Opacity is now controlled by JS for extended interaction zone */

/* Overlay text */
.demo-reel-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.demo-reel-text {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 5rem);
  letter-spacing: 0.3em;
  color: var(--text-primary);
  text-transform: uppercase;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
  transition: opacity 0.3s ease;
}

/* Text blur mask - this will be positioned via JS */
.demo-reel-text-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 11;
  /* Feathered spotlight using radial gradient mask */
  -webkit-mask-image: radial-gradient(circle 0px at 50% 50%, black 0%, black 50%, transparent 100%);
  mask-image: radial-gradient(circle 0px at 50% 50%, black 0%, black 50%, transparent 100%);
}

.demo-reel-text-mask .demo-reel-text {
  filter: blur(20px);
  opacity: 0.3;
}

/* Play hint */
.demo-reel-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 12;
}

.demo-reel-container:hover .demo-reel-hint {
  opacity: 1;
}

/* ============================================
   DEMO REEL - Fullscreen Expanded State
   ============================================ */

/* New class for FLIP animation */
.hero-reel.is-animating {
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1) !important;
  will-change: transform;
}

/* Hide overlays during animation */
.hero-reel.is-animating .demo-reel-video-clear,
.hero-reel.is-animating .demo-reel-overlay,
.hero-reel.is-animating .demo-reel-text-mask,
.hero-reel.is-animating .demo-reel-hint {
  opacity: 0;
  pointer-events: none;
}

/* Fully expanded state */
.hero-reel.expanded {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  z-index: 10000;
  background: var(--bg-primary);
  border-radius: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-reel.expanded::before {
  display: none;
}

.hero-reel.expanded .demo-reel-container {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
}

.hero-reel.expanded .demo-reel-video {
  filter: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-reel.expanded .demo-reel-video-clear,
.hero-reel.expanded .demo-reel-overlay,
.hero-reel.expanded .demo-reel-text-mask,
.hero-reel.expanded .demo-reel-hint {
  display: none;
}

/* Close button */
.demo-reel-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
  opacity: 0;
}

.hero-reel.expanded .demo-reel-close {
  display: flex;
}

.hero-reel.expanded .demo-reel-close.visible {
  opacity: 1;
}

.demo-reel-close:hover {
  background: var(--accent);
  transform: scale(1.1);
}

.demo-reel-close svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-primary);
  stroke-width: 2;
}

/* Video controls in expanded mode */
.hero-reel.expanded .demo-reel-video {
  cursor: default;
}

/* Collapsing state handled by JS inline styles */

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio {
  padding: var(--section-padding) clamp(20px, 3vw, 40px);
  max-width: var(--container-width);
  width: 100%;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}

.portfolio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
  flex-wrap: wrap;
  gap: 30px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.15em;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 2px;
}

/* Filter Buttons */
.portfolio-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 30px;
}

.filter-group, .sort-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.control-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sort-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 15px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.sort-select:hover, .sort-select:focus {
  border-color: var(--accent);
  color: var(--text-primary);
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.filter-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Maximum 3 columns on all screen sizes */
  gap: clamp(15px, 2vw + 5px, 40px);
  align-items: start;
  perspective: 1500px;
  width: 100%;
  box-sizing: border-box;
}

.project-card {
  --default-aspect: 4 / 3;
  --natural-aspect: var(--default-aspect);
  --expand-duration: 1.4s;

  position: relative;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  z-index: 1;
  transform-style: preserve-3d;
  /* Perspective moved back to JS transform string for pronounced effect */
  /* Enhanced Hover Effects */
  --card-glow: rgba(255, 102, 0, 0);
  box-shadow: 0 10px 40px -10px var(--card-glow);
  transition: transform 0.4s var(--ease-out-expo),
              box-shadow 0.4s var(--ease-out-expo),
              opacity 0.3s ease;
}

.project-card:hover {
  z-index: 100;
  --card-glow: rgba(255, 102, 0, 0.3);
}

/* Filter animation classes */
.project-card.filtering-out {
  opacity: 0;
}

.project-card.filtering-in {
  opacity: 1;
}

/* Orange border glow on hover - Only for devices that support hover */
@media (hover: hover) {
  .project-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 50%, var(--accent) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: -1;
    pointer-events: none;
  }

  .project-card:hover::before {
    opacity: 0.8;
  }
}

.project-card.hidden {
  display: none;
}

/* Inner container - height is controlled by JS for smooth animation */
.project-card-inner {
  position: relative;
  border-radius: 8px;
  width: 100%;
  /* JS sets explicit height on desktop; aspect-ratio is the CSS fallback for mobile/tablet */
  aspect-ratio: var(--default-aspect);
  overflow: hidden; /* This occludes the text sliding in from the bottom */
  transform-style: preserve-3d;
}

/* Image container for proper centering */
.project-card-image-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Clips the image itself */
  border-radius: 8px;
  transform-style: preserve-3d;
  z-index: 1;
}

.project-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s var(--ease-out-expo),
              filter 0.4s ease;
  transform: translateZ(-10px) scale(1.05);
}

.project-card:hover .project-card-image {
  filter: brightness(1.1) contrast(1.05);
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.8) 0%,
    rgba(10, 10, 10, 0.4) 30%,
    transparent 60%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(12px, 1.5vw + 5px, 25px);
  opacity: 1;
  transition: background 0.4s var(--ease-out-expo);
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 2;
}

.project-card:hover .project-card-overlay {
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.95) 0%,
    rgba(10, 10, 10, 0.7) 50%,
    transparent 100%
  );
}

.project-card-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 0.8rem + 1.2vw, 2rem);
  letter-spacing: 0.1em;
  margin-bottom: 0;
  transition: color 0.4s ease;
  transform: translateZ(20px); /* Always slightly ahead of the rest of the content */
  transform-style: preserve-3d;
}

.project-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.project-card-role {
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card-year {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.4s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  /* Removed :hover filter and transform, handled by proximity/base styles */
  transform: translateY(var(--reveal-offset, 0)) translateZ(15px);
  will-change: transform;
  transform-style: preserve-3d;
  pointer-events: auto;
}

/* Removed hover specific reveals since they are now proximity-driven */

/* ============================================
   SECTION SCROLL EFFECTS
   ============================================ */

section {
  position: relative;
}

/* Subtle parallax-like depth */
.hero {
  transform-style: preserve-3d;
}

/* Section dividers with gradient fade */
.work::before,
.about::before,
.contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(
    to bottom,
    var(--bg-primary) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Smooth background transitions */
.about {
  background: linear-gradient(
    180deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 50%,
    var(--bg-primary) 100%
  );
}

/* ============================================
   PROJECT PAGE
   ============================================ */
.project-hero {
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  padding: var(--section-padding) clamp(20px, 3vw, 40px);
  position: relative;
  background-size: cover;
  background-position: center;
}

.project-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-primary) 0%, transparent 60%);
}

.project-hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--container-width);
  width: fit-content;
  min-width: 300px;
  margin: 0;
  padding: 40px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.project-hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 7rem);
  letter-spacing: 0.15em;
  margin-bottom: 20px;
}

.project-meta {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.project-meta-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.project-meta-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.project-meta-value {
  color: var(--text-primary);
  font-size: 1rem;
}

.project-content {
  padding: var(--section-padding) clamp(20px, 3vw, 40px);
  max-width: var(--container-width);
  margin: 0 auto;
  box-sizing: border-box;
}

.project-description {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 60px;
}

.project-video {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 60px;
}

.project-video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  margin-bottom: 60px;
}

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

.project-tools {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.tool-tag {
  background: var(--bg-tertiary);
  padding: 8px 16px;
  border-radius: 2px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 40px;
  transition: gap 0.3s ease;
}

.back-link:hover {
  gap: 15px;
}

/* Project Page Additional Styles */
.project-tagline {
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.project-hero-contain {
  background-size: contain;
  background-repeat: no-repeat;
}

.project-description-section,
.project-video-section,
.project-tools-section {
  margin-bottom: 60px;
}

.project-description-section h2,
.project-video-section h3,
.project-tools-section h3,
.project-custom-section h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.project-section-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.project-section-header h2 {
  margin-bottom: 0;
}

.project-section-header .project-links-grid {
  margin-left: auto;
}

.project-video {
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.project-links-grid {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.project-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 14px 24px;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.project-link-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

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

.coming-soon {
  color: var(--text-muted);
  font-style: italic;
}

/* Credits Section */
.project-credits {
  margin-bottom: 60px;
}

.credits-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 30px;
}

.credits-list li {
  color: var(--text-primary);
  font-size: 1.1rem;
}

.credit-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

/* Custom Sections */
.project-custom-section {
  margin-bottom: 60px;
  width: 100%; /* Default width */
  margin-left: auto;
  margin-right: auto;
}

/* Width options */
.section-w-33 { width: 33.333%; }
.section-w-50 { width: 50%; }
.section-w-75 { width: 75%; }
.section-w-100 { width: 100%; }

/* Alignment options */
.section-align-left { margin-left: 0; margin-right: auto; text-align: left; }
.section-align-center { margin-left: auto; margin-right: auto; text-align: center; }
.section-align-right { margin-left: auto; margin-right: 0; text-align: right; }

/* Ensure content scales correctly within aligned sections */
.section-align-center .project-section-list,
.section-align-center .project-section-figure {
  display: inline-block;
  text-align: left;
}

.section-align-right .project-section-list,
.section-align-right .project-section-figure {
  display: inline-block;
  text-align: left;
}

.project-section-figure {
  margin: 0;
}

.project-section-image {
  width: 100%;
  border-radius: 4px;
  display: block;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.project-section-image:hover {
  transform: scale(1.01);
}

/* Lightbox Styles */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.lightbox-overlay.active .lightbox-content {
  transform: scale(1);
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  display: block;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
  line-height: 1;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: var(--accent);
}

.project-section-caption {
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  margin-top: 12px;
  font-style: italic;
}

.project-section-list {
  padding-left: 1.5em;
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1.8;
}

.project-section-list li + li {
  margin-top: 8px;
}

/* Project Navigation */
.project-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
}

.project-nav-link {
  text-decoration: none;
  transition: transform 0.3s ease;
}

.project-nav-link:hover {
  transform: translateX(5px);
}

.project-nav-link.prev:hover {
  transform: translateX(-5px);
}

.project-nav-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.project-nav-title {
  display: block;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
}

.project-nav-link.next {
  text-align: right;
}

/* Archive Page Styles */
.archive-hero {
    min-height: 40vh;
}

.archive-footer-nav {
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 40px 80px;
    text-align: center;
    box-sizing: border-box;
}

.view-all-container .social-btn {
    padding: 15px 40px;
}

/* Archive Page & Effects Disabled - Full poster aspect ratio, no card expansion */
.archive-page .project-grid,
.effects-disabled .project-grid {
    perspective: none;
}

.archive-page .project-card,
.effects-disabled .project-card {
  /* Disable 3D transforms on archive cards */
  transform: none !important;
}

.archive-page .project-card:hover,
.effects-disabled .project-card:hover {
  /* Simple hover effect without tilt */
  transform: translateY(-4px) !important;
  box-shadow: 0 15px 50px -10px rgba(255, 102, 0, 0.3);
}

.archive-page .project-card-inner,
.effects-disabled .project-card-inner {
  /* Allow cards to use natural image aspect ratio */
  aspect-ratio: unset !important;
  height: auto !important;
}

.archive-page .project-card-image-wrapper,
.effects-disabled .project-card-image-wrapper {
  position: relative;
}

.archive-page .project-card-image,
.effects-disabled .project-card-image {
  /* Display image at its natural size */
  height: auto;
  transform: none !important;
}

.archive-page .project-card::before,
.effects-disabled .project-card::before {
  /* Disable border glow animation */
  display: none;
}

/* Show all content by default on archive page and when effects disabled */
.archive-page .project-card-title,
.effects-disabled .project-card-title {
  color: var(--text-primary) !important;
  transform: none !important;
}

.archive-page .project-card-role,
.archive-page .project-card-year,
.archive-page .project-card-description,
.effects-disabled .project-card-role,
.effects-disabled .project-card-year,
.effects-disabled .project-card-description {
  opacity: 1 !important;
}

.archive-page .project-card-content,
.effects-disabled .project-card-content {
  /* Remove all transforms - content visible by default */
  transform: none !important;
  filter: none !important;
}

.archive-page .project-card-overlay,
.effects-disabled .project-card-overlay {
  /* Darker overlay so text is always readable */
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.95) 0%,
    rgba(10, 10, 10, 0.7) 50%,
    transparent 100%
  ) !important;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
  padding: var(--section-padding) clamp(20px, 3vw, 40px);
  max-width: var(--container-width);
  width: 100%;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}

.about::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 80px;
  align-items: start;
}

.about-image-wrapper {
  position: relative;
}

.about-image-wrapper::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: -20px;
  bottom: -20px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  opacity: 0.4;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.about-image-wrapper:hover::before {
  opacity: 0.7;
  transform: translate(-5px, -5px);
}

.about-image {
  width: 100%;
  border-radius: 4px;
  position: relative;
  z-index: 1;
  transition: transform 0.5s var(--ease-out-expo);
}

.about-image.effect-rotate {
  animation: portraitRotate 0.5s var(--ease-out-expo);
}

.about-image.effect-pulse {
  animation: portraitPulse 0.5s var(--ease-out-expo);
}

.about-image.effect-shake {
  animation: portraitShake 0.5s var(--ease-out-expo);
}

@keyframes portraitRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes portraitPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes portraitShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(10px); }
  75% { transform: translateX(-5px); }
}

.about-content h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.15em;
  margin-bottom: 30px;
  position: relative;
  display: inline-block;
}

.about-content h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 2px;
}

.about-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.skills-list {
  display: flex;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
              border-color 0.4s ease, 
              box-shadow 0.4s ease;
  will-change: transform;
  position: relative;
  z-index: 1;
}

.skill-item:hover {
  z-index: 2;
  background: var(--bg-secondary); /* Keep background stable */
}

.skill-item img {
  width: 28px;
  height: 28px;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

.skill-item span {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.skill-item:hover span {
  color: var(--text-primary);
}

.about-social-links {
  margin-top: 30px;
  display: flex;
  gap: 15px;
}

.social-btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.social-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-2px);
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact {
  padding: var(--section-padding) clamp(20px, 3vw, 40px);
  max-width: var(--container-width);
  margin: 0 auto;
  text-align: center;
  position: relative;
  box-sizing: border-box;
}

.contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.contact h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.15em;
  margin-bottom: 30px;
  position: relative;
  display: inline-block;
}

.contact h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-dark));
  border-radius: 2px;
}

.contact-intro {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 50px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 15px 20px;
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: 2px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  background: var(--accent);
  border: none;
  color: var(--bg-primary);
  padding: 18px 40px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-top: 10px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.submit-btn:active {
  transform: translateY(0);
}

/* Form success/error messages */
.form-status {
  padding: 15px 20px;
  border-radius: 2px;
  margin-top: 20px;
  display: none;
  font-size: 0.9rem;
}

.form-status.success {
  display: block;
  background: rgba(0, 200, 100, 0.1);
  border: 1px solid rgba(0, 200, 100, 0.3);
  color: #00c864;
}

.form-status.error {
  display: block;
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: #ff6464;
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 40px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  max-width: var(--container-width);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 30px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

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

/* ============================================
   PAGE ENTRANCE ANIMATIONS
   ============================================ */

/* Base state for animated elements */
.animate-entrance {
  opacity: 0;
  transform: translateY(30px);
}

/* Animated state */
.animate-entrance.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}

/* Stagger delays */
.animate-entrance.delay-1 { transition-delay: 0.1s; }
.animate-entrance.delay-2 { transition-delay: 0.2s; }
.animate-entrance.delay-3 { transition-delay: 0.3s; }
.animate-entrance.delay-4 { transition-delay: 0.4s; }
.animate-entrance.delay-5 { transition-delay: 0.5s; }
.animate-entrance.delay-6 { transition-delay: 0.6s; }

/* Hero specific animations */
.hero-title.animate-entrance {
  transform: translateY(50px) scale(0.95);
}

.hero-title.animate-entrance.visible {
  transform: translateY(0) scale(1);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
}

.hero-subtitle.animate-entrance {
  transform: translateY(20px);
}

/* Scroll indicator special animation */
.scroll-indicator.animate-entrance.visible {
  animation: fadeInBounce 0.6s var(--ease-out-expo) 0.8s forwards;
}

 @keyframes fadeInBounce {
  0% { opacity: 0; transform: translateY(-10px); }
  60% { opacity: 1; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SCROLL-TRIGGERED REVEALS
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Reveal variations */
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease-out-expo),
              transform 0.4s var(--ease-out-expo);
}

.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }


/* ============================================
   DEPTH SCROLL EFFECT
   ============================================ */
.depth-section {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
  will-change: opacity, transform;
}

.depth-section.in-view {
  opacity: 1;
  transform: none;
}

/* Smooth interpolation handled by JS, but provide CSS fallback */
@media (prefers-reduced-motion: reduce) {
  .depth-section {
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   FILM GRAIN OVERLAY
   ============================================ */
.film-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .film-grain {
    display: none;
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
  .project-card {
    --default-aspect: 1 / 1;
  }

  /* Tablet: Hide role and description - show title and year */
  .project-card-role,
  .project-card-description {
    display: none !important;
  }

  /* Keep year visible on tablet */
  .project-card-year {
    display: block !important;
  }

  .project-card-info {
    display: flex !important;
    justify-content: flex-end !important;
  }

  /* Archive page: also hide role/description but show year on tablet */
  .archive-page .project-card-role,
  .archive-page .project-card-description {
    display: none !important;
  }

  .archive-page .project-card-year {
    display: block !important;
  }

  .archive-page .project-card-info {
    display: flex !important;
    justify-content: flex-end !important;
  }

  /* Effects disabled: also hide role/description but show year on tablet */
  .effects-disabled .project-card-role,
  .effects-disabled .project-card-description {
    display: none !important;
  }

  .effects-disabled .project-card-year {
    display: block !important;
  }

  .effects-disabled .project-card-info {
    display: flex !important;
    justify-content: flex-end !important;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .about-image-wrapper {
    max-width: 400px;
  }

  /* Hide "View More" button on tablet */
  .view-more-btn {
    display: none !important;
  }

  /* Disable custom cursor on tablets and mobile */
  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }

  body,
  a, button, .project-card, .filter-btn, .submit-btn, .nav-logo, .nav-toggle, .sort-select, .form-group input, .form-group textarea {
    cursor: auto !important;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 70px;
    --container-width: 100%; /* Full width on phones, padding handles spacing */
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background: var(--bg-primary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-links.active {
    opacity: 1;
    visibility: visible;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-controls {
    position: absolute;
    right: 70px;
  }

  .effects-toggle-text {
    display: none;
  }

  .effects-toggle-container {
    display: none;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card {
    --default-aspect: 1 / 1;
  }

  /* Hide "View More" button on mobile */
  .view-more-btn {
    display: none !important;
  }

  /* Mobile: Darker overlay for readability */
  .project-card-overlay {
    background: linear-gradient(
      to top,
      rgba(10, 10, 10, 0.95) 0%,
      rgba(10, 10, 10, 0.7) 40%,
      transparent 70%
    ) !important;
  }

  .project-card-content {
    /* Ensure content stays at bottom */
    margin-top: auto;
  }

  /* Hide role and description on mobile - show title and year */
  .project-card-role,
  .project-card-description {
    display: none !important;
  }

  /* Keep year visible on mobile */
  .project-card-year {
    display: block !important;
  }

  .project-card-info {
    display: flex !important;
    justify-content: flex-end !important;
  }

  /* Archive page: also hide role/description but show year on mobile */
  .archive-page .project-card-role,
  .archive-page .project-card-description {
    display: none !important;
  }

  .archive-page .project-card-year {
    display: block !important;
  }

  .archive-page .project-card-info {
    display: flex !important;
    justify-content: flex-end !important;
  }

  /* Effects disabled: also hide role/description but show year on mobile */
  .effects-disabled .project-card-role,
  .effects-disabled .project-card-description {
    display: none !important;
  }

  .effects-disabled .project-card-year {
    display: block !important;
  }

  .effects-disabled .project-card-info {
    display: flex !important;
    justify-content: flex-end !important;
  }

  /* Touch devices: tilt is disabled via JS (checking for touch support) */

  .project-meta {
    gap: 20px;
  }

  .project-hero {
    min-height: 80vh;
    align-items: center;
  }

  .project-hero-content {
    width: 100%;
    margin: 120px 0 0 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .filter-buttons {
    width: 100%;
  }

  .filter-btn {
    flex: 1;
    text-align: center;
    padding: 12px 10px;
    font-size: 0.75rem;
  }

  .hero-reel {
    width: 90%;
    margin-top: 40px;
  }

  .demo-reel-text {
    font-size: 1.5rem;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

