/* Gruzel.net - Improved Styles */
/* Modern CSS improvements while preserving beloved hover effects */

:root {
  --maxw: 1050px;
  --hdr: 70px;
  
  /* New color system based on the VHS/CRT logos */
  --crt-bg: #0A0A0A;
  --crt-blue: #3d9cff;
  --crt-yellow: #ffff55;
  --crt-text-primary: #EAEAEA;
  --crt-text-secondary: #b0b0b0;
  --crt-border: #3d9cff;

  /* Light theme colors - Authentic Kodak brand palette */
  --light-bg-primary: #ebe4d1; /* Deeper warm film stock background */
  --light-bg-secondary: #f6f1e4; /* Rich cream film emulsion */
  --light-text-primary: #2c1810; /* Deep coffee brown text */
  --light-text-secondary: #5d3a1a; /* Rich chocolate brown */
  --light-border: #c4a373; /* Warm golden brown borders */
  --light-accent: #8b4513; /* Deep saddle brown accent */
  --light-amber: #b8860b; /* Dark golden rod - more authentic */
  --kodak-gold: #b8860b; /* Deeper Kodak gold */
  --film-orange: #cd7f32; /* Bronze film tone */
  --sepia-warm: #d2b48c; /* Rich tan - vintage warmth */
  --film-brown: #704214; /* Deep film brown for contrast */
  /* Authentic Kodak brand colors - More muted, vintage tones */
  --kodak-yellow: #E6C547; /* More muted Kodak yellow */
  --kodak-red: #B91C3C; /* Deeper, less saturated Kodak red */
  --kodak-orange: #D2691E; /* Softer orange accent */

  /* Default Theme: Dark/CRT */
  --primary-blue: var(--crt-blue);
  --primary-blue-hover: #66b3ff;
  --accent-yellow: var(--crt-yellow);
  --accent-yellow-hover: #ffff88;
  
  --text-primary: var(--crt-text-primary);
  --text-secondary: var(--crt-text-secondary);
  --text-muted: #888;
  --bg-primary: var(--crt-bg);
  --bg-secondary: #1c1c1c;
  --border-light: var(--crt-border);
  --shadow-light: rgba(0, 0, 0, 0.2);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --shadow-hover: rgba(0, 0, 0, 0.6);
  
  /* Enhanced transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.25s ease;
  --transition-slow: 0.35s ease;
  
  /* Improved typography scale */
  --font-body: "Apple II", "Courier New", monospace;
  --font-display: "Chicago", "Apple II", "Courier New", monospace;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  
  /* Better spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Enhanced border radius */
  --radius-sm: 4px; /* Sharper edges for retro feel */
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Retro Apple II aesthetic enhancements */
  --retro-scan-line: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 0, 0.03) 2px,
    rgba(0, 255, 0, 0.03) 4px
  );
  --apple-beige: #F2F2CC; /* Classic Apple beige */
  --apple-gray: #C0C0C0; /* Classic Mac gray */
  --amber-glow: 0 0 20px rgba(255, 140, 0, 0.3);
}

/* Light mode improvements - Authentic Kodak brand aesthetic */
body.theme-light {
  --text-primary: var(--light-text-primary);
  --text-secondary: var(--light-text-secondary);
  --text-muted: var(--film-brown); /* Deep film brown for better contrast */
  --bg-primary: var(--light-bg-primary);
  --bg-secondary: var(--light-bg-secondary);
  --border-light: var(--light-border);
  --shadow-light: rgba(44, 24, 16, 0.12); /* Deeper film-toned shadows */
  --shadow-medium: rgba(44, 24, 16, 0.20);
  --shadow-hover: rgba(44, 24, 16, 0.30);
  
  /* Light mode specific colors - Authentic Kodak brand */
  --primary-blue: var(--kodak-red); /* Use Kodak red instead of blue */
  --primary-blue-hover: var(--kodak-orange);
  --accent-yellow: var(--kodak-yellow); /* Bright Kodak yellow */
  --accent-yellow-hover: var(--kodak-orange);
  
  /* Better text readability in light mode */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Reset and base improvements */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  touch-action: pan-y;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  padding-bottom: 25vh;
  scroll-padding-top: var(--hdr);
  transition: background-color var(--transition-medium), color var(--transition-medium);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); /* Better text shadow for readability */
  position: relative;
}

/* Subtle retro scan line effect for dark mode */
body:not(.theme-light)::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--retro-scan-line);
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

/* Light mode gets authentic Super 8 film texture */
body.theme-light::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    /* More subtle film grain effect */
    radial-gradient(circle at 25% 25%, rgba(230, 197, 71, 0.015) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(185, 28, 60, 0.01) 0%, transparent 50%),
    /* Very subtle Kodak film base */
    linear-gradient(180deg, rgba(230, 197, 71, 0.01) 0%, rgba(112, 66, 20, 0.008) 100%);
  pointer-events: none;
  z-index: 1;
  /* Even more subtle aging effect */
  filter: contrast(1.005) brightness(0.995);
}

/* Accessibility utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-blue);
  color: white;
  padding: 8px;
  border-radius: 4px;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* Enhanced typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-md) 0;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p {
  margin: 0 0 var(--space-md) 0;
  color: var(--text-secondary);
}

/* Enhanced header with backdrop blur */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--crt-border);
  transition: all var(--transition-medium);
  will-change: background-color, backdrop-filter;
}

body.theme-light header {
  background: rgba(235, 228, 209, 0.92); /* Deeper film stock with more opacity */
  border-bottom-color: var(--light-border);
  box-shadow: 0 2px 8px rgba(44, 24, 16, 0.15); /* Stronger shadow for depth */
  /* Authentic Kodak red accent stripe */
  border-bottom: 3px solid var(--kodak-red);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Base navigation styles - applies to all screen sizes */
nav {
  height: var(--hdr);
  width: 100%;
}

/* Enhanced navigation - Desktop only */
@media (min-width: 769px) {
  nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
  }

  .nav-links,
  .nav-controls,
  nav > div {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
  }
}

nav a {
  display: flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  position: relative;
  /* Better text readability */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

nav a:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

body.theme-dark nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.theme-light nav a:hover {
  background: rgba(230, 197, 71, 0.08); /* More muted Kodak yellow hover */
  color: var(--film-brown); /* Darker text for better contrast */
  /* Subtle Kodak-style glow */
  text-shadow: 0 0 2px rgba(230, 197, 71, 0.3);
}

nav a.active-nav {
  /* Removed blue highlighting feature */
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
  font-weight: 600;
}

/* Enhanced logo */
.logo-link {
  display: flex !important;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary) !important;
  text-decoration: none;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  transition: transform var(--transition-medium);
}

.logo-link:hover .logo-img {
  transform: scale(1.05) rotate(2deg);
}

/* Enhanced theme toggle - Custom Gruzel Lamp design */
.theme-toggle {
  background: none !important; /* Complete background removal */
  border: none !important; /* Remove all borders */
  font-size: 1.2rem;
  padding: 0 !important; /* Remove all padding that could show background */
  margin: 0 !important;
  border-radius: 0 !important; /* Remove border radius */
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: auto !important; /* Let it size to content */
  height: auto !important;
  /* Ensure no visible background anywhere */
  box-shadow: none !important;
  outline: none !important;
  /* Remove any default button styling */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* Make completely invisible except for the image */
  background-color: transparent !important;
  background-image: none !important;
}

.theme-toggle img {
  width: 32px; /* Larger lamp icon */
  height: 32px;
  transition: all var(--transition-fast);
  background: transparent !important;
  object-fit: contain;
  padding: 0;
  margin: 0;
  /* Ensure the image is visible and not replaced */
  display: block !important;
  opacity: 0.85;
  /* Ensure no borders or outlines on the image */
  border: none !important;
  outline: none !important;
}

/* Theme-specific lamp styling */
.theme-toggle[data-theme="dark"] img {
  opacity: 0.7; /* Dimmer on dark mode */
  filter: brightness(0.8); /* Darker for visibility against dark background */
}

.theme-toggle[data-theme="light"] img {
  opacity: 0.9; /* Brighter on light mode */
  filter: brightness(1.2); /* Brighter for visibility against light background */
}

.theme-toggle:hover {
  /* Only transform, no background changes */
  transform: scale(1.1);
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.theme-toggle:hover img {
  opacity: 1; /* Full opacity on hover */
  transform: scale(1.05);
}

body.theme-dark .theme-toggle:hover {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

body.theme-dark .theme-toggle:hover img {
  opacity: 0.9;
  filter: brightness(1.0); /* Slightly brighter on hover in dark mode */
}

body.theme-light .theme-toggle:hover {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

body.theme-light .theme-toggle:hover img {
  opacity: 1;
  filter: brightness(1.4); /* Much brighter on hover in light mode */
}

/* Enhanced auth buttons */
.auth-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.auth-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.auth-btn:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 108, 255, 0.25);
}

/* Light mode specific button styling */
body.theme-light .auth-btn {
  background: var(--sepia-warm);
  border-color: var(--light-border);
  color: var(--light-text-primary);
  /* Subtle film texture */
  background-image: linear-gradient(135deg, rgba(218, 165, 32, 0.05) 0%, rgba(210, 105, 30, 0.03) 100%);
}

body.theme-light .auth-btn:hover {
  background: var(--kodak-red);
  border-color: var(--kodak-red);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Enhanced hero section */
.hero {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border-light);
  padding: calc(var(--hdr) + var(--space-2xl)) 0 var(--space-2xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(42, 108, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(255, 107, 53, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

body.theme-dark .hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
}

body.theme-light .hero {
  background: linear-gradient(135deg, var(--sepia-warm) 0%, var(--light-bg-secondary) 100%);
  border-bottom-color: var(--kodak-yellow);
  /* More subtle Kodak brand depth */
  box-shadow: inset 0 0 100px rgba(230, 197, 71, 0.04);
}

body.theme-light .hero::before {
  background: 
    /* More muted Kodak yellow and red tints */
    radial-gradient(circle at 30% 20%, rgba(230, 197, 71, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(185, 28, 60, 0.02) 0%, transparent 50%),
    /* Subtle vignette effect */
    radial-gradient(ellipse at center, transparent 30%, rgba(44, 24, 16, 0.02) 100%);
}

.hero .inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.hero h1 {
  margin-bottom: var(--space-md);
  color: var(--crt-yellow);
  text-shadow: 2px 2px 0px var(--crt-blue), 0 0 15px rgba(255, 255, 85, 0.5);
  letter-spacing: 0.1em;
  /* Enhanced retro CRT glow effect */
  filter: drop-shadow(0 0 10px rgba(255, 255, 85, 0.3));
}

/* Light mode hero title - More muted Kodak brand aesthetic */
body.theme-light .hero h1 {
  color: var(--film-brown); /* Deeper brown for better contrast */
  text-shadow: 
    2px 2px 0px var(--kodak-yellow), 
    0 0 8px rgba(230, 197, 71, 0.3),
    0 0 15px rgba(185, 28, 60, 0.15);
  filter: drop-shadow(0 0 4px rgba(185, 28, 60, 0.2));
  /* More subtle Kodak brand glow */
  -webkit-text-stroke: 1px rgba(230, 197, 71, 0.15);
}

.lead {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-weight: 400;
}

/* Enhanced CTA button */
.cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--primary-blue);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all var(--transition-medium);
  box-shadow: 0 4px 14px rgba(42, 108, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.cta:hover::before {
  left: 100%;
}

.cta:hover {
  background: var(--primary-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(42, 108, 255, 0.4);
}

/* Light mode CTA styling - More muted Kodak brand aesthetic */
body.theme-light .cta {
  background: linear-gradient(45deg, var(--kodak-yellow) 0%, var(--kodak-red) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(185, 28, 60, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  /* More subtle border */
  border: 2px solid rgba(255, 255, 255, 0.15);
}

body.theme-light .cta:hover {
  background: linear-gradient(45deg, var(--kodak-red) 0%, var(--kodak-orange) 100%);
  box-shadow: 0 8px 25px rgba(185, 28, 60, 0.25);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Enhanced sections */
section {
  padding: var(--space-2xl) 0;
}

section .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Enhanced gallery and cards - PRESERVING BELOVED HOVER EFFECTS */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 4px 12px var(--shadow-medium), inset 0 0 15px rgba(61, 156, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

/* Enhanced text readability in cards */
.card h2, .card h3, .card h4, .card p, .card span {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.card:hover {
  /* Removed translateY to fix jumping - now just enhances shadows and border */
  box-shadow: 0 8px 25px var(--shadow-hover), inset 0 0 25px rgba(61, 156, 255, 0.2);
  border-color: var(--primary-blue-hover);
}

/* Light mode specific card styling - More muted Kodak brand aesthetic */
body.theme-light .card {
  background: var(--light-bg-secondary);
  border-color: var(--light-border);
  box-shadow: 0 4px 12px var(--shadow-medium), inset 0 0 15px rgba(230, 197, 71, 0.03);
  /* More muted Kodak yellow border */
  border: 2px solid var(--kodak-yellow);
  background-image: linear-gradient(135deg, rgba(230, 197, 71, 0.02) 0%, rgba(185, 28, 60, 0.01) 100%);
}

body.theme-light .card:hover {
  box-shadow: 0 8px 25px var(--shadow-hover), inset 0 0 25px rgba(230, 197, 71, 0.06);
  border-color: var(--kodak-red);
  /* More subtle highlight glow */
  background-image: linear-gradient(135deg, rgba(230, 197, 71, 0.04) 0%, rgba(185, 28, 60, 0.02) 100%);
}

/* Removed jumping card animations */

/* PRESERVING BELOVED PHOTO HOVER EFFECTS - EXACTLY AS ORIGINAL */
.photo-card a {
  display: block;
  text-decoration: none;
  /* Removed jumping animation */
}

.photo-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
  /* EXACT SAME BELOVED HOVER EFFECTS AS ORIGINAL */
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  /* Subtle retro border effect */
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Light mode photo styling - Authentic Kodak brand aesthetic */
body.theme-light .photo-card img {
  border-color: var(--kodak-yellow);
  /* Authentic Kodak film characteristic look */
  filter: sepia(0.15) contrast(1.08) brightness(0.95) saturate(1.15);
  /* Authentic Kodak yellow frame effect */
  border: 3px solid var(--kodak-yellow);
  box-shadow: 
    inset 0 0 0 2px var(--light-bg-secondary),
    0 3px 12px rgba(44, 24, 16, 0.18);
}

/* EXACT SAME HOVER EFFECT YOU LOVE */
.photo-card a:hover img {
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(0,0,0,.1);
}

.caption {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

/* Latest image special handling - MUCH BIGGER but safe margins */
#latest .photo-card img {
  aspect-ratio: auto; /* Don't force aspect ratio */
  object-fit: contain; /* Prevent cropping, show full image */
  max-height: 80vh; /* Slightly smaller to be safe */
  max-width: 80vw; /* Safe margin - won't overflow */
  width: auto; /* Let it size naturally */
  height: auto; /* Let it size naturally */
  display: block;
  margin: 0 auto; /* Center the image */
  /* CRITICAL: Keep the smooth transition for beloved hover effects */
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#latest .photo-card {
  max-width: none; /* Remove width restrictions */
  width: auto; /* Let it size naturally */
  display: block; /* Use block layout to preserve figure/figcaption flow */
  margin: 0 auto; /* Center the photo card */
  text-align: center; /* Center content within */
}

#latest .gallery {
  justify-items: center; /* Center the large image */
  max-width: 90vw; /* Allow gallery to be wide but not edge-to-edge */
  margin: 0 auto; /* Center the gallery */
  width: 100%; /* Take full width */
  display: block; /* Use block layout to preserve normal flow */
  text-align: center; /* Center align content */
}

/* Override section constraints for latest to allow much bigger images */
#latest .inner {
  max-width: 100vw; /* Use full viewport width */
  padding: 0 var(--space-md); /* Adequate padding to prevent edge touching */
  text-align: center; /* Center align all content */
}

/* Ensure hover effects work with gallery wrapper */
#latest .gallery .photo-card a:hover img {
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(0,0,0,.1);
}

/* Make sure ALL photo-card images have smooth transitions */
.photo-card img,
#latest .photo-card img,
#latest .gallery .photo-card img {
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}

/* PRESERVING BELOVED VIDEO HOVER EFFECTS - EXACTLY AS ORIGINAL */
.video-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.video-card {
  margin: 0;
  /* Removed jumping animation */
}

.video-thumb {
  display: block;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px var(--shadow-medium);
  aspect-ratio: 16 / 9;
  background: #000;
  /* Removed jumping transition */
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* KEEPING THE BELOVED VIDEO HOVER EFFECTS EXACTLY AS ORIGINAL */
  transition: transform .2s ease, filter .2s ease !important;
}

/* PRESERVING THE EXACT VIDEO HOVER EFFECT YOU LOVE */
.video-thumb:hover img {
  transform: scale(1.05);
  filter: brightness(0.8);
}

/* PRESERVING THE EXACT PLAY BUTTON HOVER EFFECT - NOW WITH SMOOTH TRANSITION */
.video-thumb:hover .play-button {
  background: rgba(0,0,0,0.75);
  transform: translate(-50%, -50%) scale(1.1); /* Back to original 1.1 scale */
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1); /* Explicit starting scale */
  width: 60px;
  height: 42px;
  background: rgba(0,0,0,.6);
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Force smooth transitions with !important to override any conflicts */
  transition: all 0.2s ease !important;
  border: 2px solid rgba(255, 255, 255, 0.3);
  /* Performance optimizations for smooth animation */
  will-change: transform, background, box-shadow;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  /* Explicit starting state for all hover properties */
  box-shadow: none;
}

.play-button::after {
  content: '▶';
  color: white;
  font-size: 20px;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.video-caption {
  margin-top: var(--space-sm);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Enhanced back to top button */
.to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  background: var(--primary-blue);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(42, 108, 255, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-medium);
  z-index: 50;
}

.to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--primary-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(42, 108, 255, 0.4);
}

/* Enhanced footer */
footer {
  border-top: 1px solid var(--border-light);
  padding: var(--space-xl) 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* PRESERVING ALL LIGHTBOX FUNCTIONALITY EXACTLY AS IS */
#lightbox {
  position: fixed;
  inset: 0;
  background: #000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  overflow: hidden;
  touch-action: none;
  cursor: pointer;
  transition: none;
  -webkit-tap-highlight-color: transparent;
}

#lightbox *, .lb-nav, .lb-close, .lb-download {
  -webkit-tap-highlight-color: transparent;
}

#lightbox.lb-hidden { display: none; }

#lightbox-img,
#lightbox-img-fader {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: calc(100vw - 100px);
  max-height: calc(100vh - 40px);
  object-fit: contain;
  transform-origin: center;
  will-change: transform, opacity;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1000;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 300ms ease-in-out, transform 150ms ease-out !important;
}

#lightbox-img-fader {
  z-index: 1001;
  pointer-events: none;
  opacity: 0;
}

#lightbox.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  z-index: 1;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.lb-close, .lb-nav, .lb-download {
  position: absolute;
  z-index: 1010;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lb-close {
  top: 16px;
  left: 16px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
}

.lb-close:hover {
  background: rgba(0,0,0,0.8);
  transform: scale(1.05);
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  width: 48px;
  height: 80px;
  font-size: 24px;
  font-weight: bold;
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-nav:hover {
  background: rgba(0,0,0,0.8);
  transform: translateY(-50%) scale(1.1);
}

.lb-nav.lb-prev { left: 16px; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.lb-nav.lb-next { right: 16px; border-radius: var(--radius-md) 0 0 var(--radius-md); }

.lb-download {
  bottom: 16px;
  right: 16px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
}

.lb-download:hover {
  background: rgba(0,0,0,0.8);
  transform: scale(1.05);
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
  .wrap {
    padding: 0 var(--space-md);
  }
  
  .gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    -webkit-overflow-scrolling: touch;
  }
  
  .gallery .photo-card {
    flex: 0 0 85%;
    scroll-snap-align: start;
    max-width: 320px;
  }
  
  /* Override for latest section - keep it big and centered on mobile */
  #latest .gallery .photo-card {
    flex: none; /* Don't use flex sizing */
    max-width: none; /* Remove mobile size restriction */
    width: auto; /* Let it size naturally */
    display: block; /* Use block layout for proper figure/figcaption flow */
    margin: 0 auto; /* Center the photo card */
  }
  
  #latest .gallery {
    display: block; /* Use block layout */
    text-align: center; /* Center align content */
    overflow: visible; /* Allow normal flow */
  }
  
  #latest .inner {
    padding: 0 var(--space-md); /* Adequate padding on mobile */
    text-align: center; /* Center align content */
  }
  
  .hero {
    padding: 75px 0 var(--space-xl);
  }
  
  .to-top {
    bottom: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 520px) {
  .logo-link span { display: none; }
  
  /* Remove conflicting nav styles - handled by inline CSS grid */
  
  #latest .photo-card img {
    max-width: 80vw; /* Safe margin to prevent edge overflow */
    max-height: 70vh; /* Good size but manageable on mobile */
    width: auto;
    aspect-ratio: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto; /* Center on mobile */
    /* CRITICAL: Keep smooth transitions on mobile too */
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  
  .lb-nav {
    width: 40px;
    height: 50px;
    font-size: 20px;
  }
  
  .lb-download {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

/* Remove tap highlights for interactive elements */
button,
a,
.auth-btn,
.theme-toggle,
.to-top,
nav a,
.photo-card a,
.photo-card a img,
a.lightbox-trigger,
a.lightbox-trigger img,
input[type="button"],
input[type="submit"],
[role="button"],
[tabindex] {
  -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* Additional explicit rule to remove the blue tap highlight on WebKit-based mobile browsers
   and remove default outlines for targeted interactive controls. */
button,
a,
[role="button"],
input[type="submit"],
input[type="button"],
.your-custom-button-class {
  -webkit-tap-highlight-color: transparent;
  outline: none; /* Also good practice to remove the outline that can appear */
}

/* Performance optimizations */
img, video {
  will-change: transform;
}

.photo-card img,
.video-thumb img {
  contain: layout style paint;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus indicators */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-light: #000;
    --shadow-light: rgba(0, 0, 0, 0.2);
  }
  
  body.theme-dark {
    --border-light: #fff;
    --shadow-light: rgba(255, 255, 255, 0.2);
  }
}

/* Additional visual polish - Enhanced retro styling */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.inner h2 {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.inner h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-yellow));
  border-radius: 2px;
  /* Retro pixelated effect */
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Light mode heading underline - Kodak brand style */
body.theme-light .inner h2::after {
  background: linear-gradient(90deg, var(--kodak-yellow), var(--kodak-red));
  height: 4px; /* Slightly thicker for brand strip effect */
  box-shadow: 0 1px 3px rgba(220, 20, 60, 0.3);
}

/* Retro dotted borders for special elements */
.retro-border {
  border: 2px dashed var(--border-light);
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    var(--border-light) 2px,
    var(--border-light) 4px
  );
  padding: var(--space-md);
  border-radius: var(--radius-sm);
}

/* Apple II inspired monospace text areas */
.retro-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--bg-secondary);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  color: var(--crt-yellow);
  text-shadow: 0 0 3px currentColor;
}

body.theme-light .retro-text {
  background: var(--apple-beige);
  color: var(--light-text-primary);
  text-shadow: none;
  border-color: var(--light-border);
}

/* Ensure original lightbox behavior is maintained */
#lightbox.loading { background: #000 !important; }
#lightbox > #lightbox-img,
#lightbox > #lightbox-img-fader {
  background: transparent !important;
  transition: opacity 240ms ease, transform 60ms ease-out !important;
  will-change: opacity, transform;
}
