:root {
  /* Consolidate and organize variables */
  /* Colors */
  --bg: #f5f5f5;
  --bg-dark: #181818;
  --card-bg: #fff;
  --text: #111;
  --border: #ddd;
  --link: #0070f3;
  
  /* Spacing */
  --gap: 1rem;
  --gap-sm: calc(var(--gap) * 0.5);
  --gap-lg: calc(var(--gap) * 2);
  
  /* Sizing */
  --radius: 16px;
  --box-size: 260px;
  --header-height: 80px;
  
  /* Shadows */
  --shadow-main: rgba(0,0,0,.18);
  --shadow-sub: rgba(0,0,0,.10);
  --shadow-card: 0 12px 28px 0 var(--shadow-main), 0 1.5px 6px 0 var(--shadow-sub);
  
  /* Typography */
  --font-stack: "Inter", system-ui, sans-serif;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ----------  System-dark fallback ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--bg-dark);
    --card-bg: #222;
    --accent: #fff;
    --text: #fff;
    --border: #333;
    --link: #4eaaff;
    --shadow-main: rgba(255,255,255,.18);
    --shadow-sub:  rgba(255,255,255,.10);
    --lightbox-bg: rgba(18, 18, 18, 0.95); /* Dark theme lightbox background */
  }
}

/* ----------  Manual overrides (win over all) ---------- */
:root[data-theme="light"] {
    --bg: #f5f5f5;
    --card-bg: #fff;
    --accent: #111;
    --text: #111;
    --border: #ddd;
    --link: #0070f3;
    --shadow-main: rgba(0,0,0,.18);
    --shadow-sub:  rgba(0,0,0,.10);
    --gap: 1rem;
    --radius: 16px;
    --font-stack: "Inter", system-ui, sans-serif;
    --box-size: 260px;
    --lightbox-bg: rgba(245, 245, 245, 0.9); /* Light theme lightbox background */
  }       /* same values as the base block */ 
:root[data-theme="dark"]  {         /* same values as the @media block */ 
    --bg: #181818;
    --card-bg: #222;
    --accent: #fff;
    --text: #fff;
    --border: #222;
    --link: #4eaaff;
    --shadow-main: rgba(255,255,255,.18);
    --shadow-sub:  rgba(255,255,255,.10);
    --lightbox-bg: rgba(18, 18, 18, 0.95); /* Dark theme lightbox background */
  }
/* High-contrast remains unchanged */
:root[data-theme="high-contrast"] {
  --bg: var(--bg-dark); --card-bg:#fff; --accent:#ff0; --text:#fff;
}

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

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-stack);
  background: var(--bg);
  color: var(--text);
}

/* ======= Header ======= */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap) calc(var(--gap) * 1.5);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1002;
  background: rgba(255, 255, 255, 0.8); /* Semi-transparent background */
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); /* Safari support */
  transition: background 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dark theme header */
@media (prefers-color-scheme: dark) {
  header {
    background: rgba(34, 34, 34, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

:root[data-theme="dark"] header {
  background: rgba(34, 34, 34, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] header {
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Header Controls Container */
.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Resume Download Button */
.resume-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border: 2px solid var(--text);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.resume-btn:hover {
  background: var(--text);
  color: var(--card-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.resume-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .resume-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    gap: 0.4rem;
  }
  
  .resume-btn svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .resume-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0;
    min-width: 40px;
    justify-content: center;
  }
  
  .resume-btn svg {
    width: 18px;
    height: 18px;
  }
  
  /* Hide text on very small screens, show only icon */
  .resume-btn::after {
    content: "";
  }
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1003;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 3px;
}

/* Hamburger Animation */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

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

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

/* Desktop Navigation */
nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

nav ul {
  list-style: none;
  display: flex;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  justify-content: center;
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

nav a:hover { 
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.1);
}

/* Add current page styling to main navigation */
nav a.current {
  background: var(--text); /* Use theme text color for background */
  color: var(--card-bg); /* Use theme background color for text */
  cursor: default;
}

nav a.current:hover {
  opacity: 1; /* Keep current items fully visible */
  background: var(--text); /* Maintain background on hover */
  color: var(--card-bg); /* Keep text color */
}

/* Dark mode hover effect */
@media (prefers-color-scheme: dark) {
  nav a:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

:root[data-theme="dark"] nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] nav a:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  
  nav {
    position: fixed;
    top: 0;
    right: -100%; /* Initially hidden off-screen */
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9); /* Semi-transparent background */
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2); /* Safari support */
    padding: 6rem 2rem 2rem 2rem;
    transition: right 0.3s ease;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    transform: none;
    z-index: 1001; /* Make sure it's above other content */
    border-left: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  /* Dark theme mobile nav */
  @media (prefers-color-scheme: dark) {
    nav {
      background: rgba(34, 34, 34, 0.9);
      border-left: 1px solid rgba(255, 255, 255, 0.1);
    }
  }
  
  :root[data-theme="dark"] nav {
    background: rgba(34, 34, 34, 0.9) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  
  :root[data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.9) !important;
    border-left: 1px solid rgba(0, 0, 0, 0.1) !important;
  }
  
  nav.active {
    right: 0; /* Slide in when active */
  }
  
  nav ul {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  nav a {
    display: block;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
  }
  
  nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
  }
  
  /* Dark mode mobile nav links */
  @media (prefers-color-scheme: dark) {
    nav a {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    nav a:hover {
      background: rgba(255, 255, 255, 0.2);
    }
  }
  
  :root[data-theme="dark"] nav a {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
  }
  
  :root[data-theme="dark"] nav a:hover {
    background: rgba(255, 255, 255, 0.2) !important;
  }
  
  :root[data-theme="light"] nav a {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
  }
  
  :root[data-theme="light"] nav a:hover {
    background: rgba(0, 0, 0, 0.1) !important;
  }
  
  /* Hide desktop positioning on mobile */
  nav {
    left: auto !important;
    transform: none !important;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo img {
  height: 32px;
  width: auto;
}

.portfolio-content {
  position: relative;
  z-index: 2;
  margin-top: 100vh;
  background: var(--bg);
}

.portfolio-content .container {
  margin-top: 0;
  min-height: 0;
}

.container {
  max-width: 1400px;   /* Adjust as needed */
  margin: 0 auto;
  width: 100%;
  padding-left: var(--gap);
  padding-right: var(--gap);
  position: relative;
  /* The following properties will now only apply to the first container if it's not in .portfolio-content */
  z-index: 2; 
  margin-top: 100vh; 
  background: var(--bg); 
  min-height: 100vh; 
}

/* ======= Grid ======= */
.grid {                           /* ⬇︎ bigger boxes */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--box-size), 1fr));
  grid-auto-rows: var(--box-size);
  gap: var(--gap);
  padding: var(--gap);
  perspective: 1000px;
}

/* Keyframes for pop-in */
@keyframes pop {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* New pop-in animation */
@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.50) translateY(24px);
    filter: blur(2px);
  }
  85% {
    transform: scale(1.05) translateY(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

/* Span helpers */
.span-2x2 { grid-column: span 2; grid-row: span 2; }
.span-2x1 { grid-column: span 2; }
.span-1x2 { grid-row: span 2; }

/* ======= Responsive Grid Layout ======= */
/* Large screens */
@media (min-width: 1200px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: calc(var(--box-size) - 40px); /* 220 px */
  }
}

/* Medium screens */
@media (min-width: 800px) and (max-width: 1199px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: calc(var(--box-size) - 40px); /* 220 px */
  }
}

/* Phones – single column */
@media (max-width: 800px) {
  .grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .card,
  .span-2x2,
  .span-2x1,
  .span-1x2 {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    /* Remove min-height to let images determine card height */
    /* min-height: 260px; */
  }
}

/* ======= Footer ======= */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--gap) * 2) var(--gap);
  font-size: 0.875rem;
  gap: 1rem;
  background: var(--bg);
}

footer .footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

footer a {
  color: var(--link);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  transition: all 0.3s ease;
}

footer a:hover {
  opacity: 0.7;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.05);
}

/* Responsive footer */
@media (max-width: 600px) {
  footer {
    padding: var(--gap);
  }
  
  footer .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  footer a {
    padding: 0.5rem 1rem;
  }
}
.mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text);
  border: 2px solid var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: 44px;
}

.mode-toggle:hover {
  background: var(--text);
  color: var(--card-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mode-toggle:focus { 
  outline: 2px solid var(--accent); 
}

.mode-toggle .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Mobile adjustments for mode toggle */
@media (max-width: 768px) {
  .mode-toggle {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
  }
  
  .mode-toggle .icon {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .mode-toggle {
    padding: 0.4rem 0.6rem;
    min-width: 40px;
  }
  
  .mode-toggle .icon {
    width: 18px;
    height: 18px;
  }
}

/* ======= Main Content Styles ======= */
main {
  padding-top: 80px; /* Adjust to your header height */
}

.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.125em;
}

/* ——— Pop‑in scenes ——— */
.scene {
  perspective: 1000px;
  width: 100%;
  height: 100%;
  display: flex;
  opacity: 0;
  pointer-events: none;
  animation: none;
  /* ↓ NEW: per‑card stagger delay  */
  --delay: 0ms;
  animation-delay: var(--delay);
  will-change: opacity, transform;
}

.scene.visible {
  opacity: 1;
  pointer-events: auto;
  animation: pop-in 0.18s cubic-bezier(.22,1,.36,1);
}

/* ——— Cards ——— */
.card, .photo-item {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10);
  transition: 
    transform .12s ease-out,
    box-shadow 0.18s cubic-bezier(.4,0,.2,1);
  will-change: transform, box-shadow;
  user-select: none;
  position: relative;
  transform-style: preserve-3d; /* Allow 3D transforms for tilt */
}

.card.pressed {
  /* Smaller, sharper shadow, slightly closer to card */
  box-shadow: 0 0px 1px 1px rgba(0,0,0,0.08), 0 0px 0px 0 rgba(0,0,0,0.12);
  transform: translateY(6px) scale(0.96) !important;
  transition: 
    transform .08s,
    box-shadow 0.18s cubic-bezier(.4,0,.2,1);
}

.card:hover {
  background: rgba(255,255,255,0.7);
  color: #111;
  transition: background 0.5s cubic-bezier(.4,0,.2,1), color 0.5s cubic-bezier(.4,0,.2,1), transform .12s ease-out;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.card:hover img {
  mix-blend-mode: lighten;
  transition: mix-blend-mode 0.5s cubic-bezier(.4,0,.2,1);
}

.card-title {
  position: absolute;
  left: 0; right: 0;
  padding: 1rem 0.5rem;
  color: #111;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.4,0,.2,1);
  z-index: 2;
}

.card:hover .card-title {
  opacity: 1;
  transform: translateY(0);
}

/* ======= Reduced Motion Accessibility ======= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .scene,
  .scene.visible {
    animation: none !important;
    opacity: 1 !important;
  }

  .card,
  .card.pressed,
  .card:hover {
    transition: none !important;
  }

  .card-title {
    transition: none !important;
  }

  .card {
    transform: none !important;
  }
}

/* About page styling - centered in viewport */
.about-hero {
  min-height: calc(100vh - 80px); /* Full viewport minus header height */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: left;
  margin-top: 80px; /* Push down by header height */
}

.about-flex {
  display: flex;
  align-items: center;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.about-img {
  flex: 0 0 350px;
  width: 400px;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10);
}

.about-content {
  flex: 1 1 400px;
  min-width: 300px;
  text-align: left;
}

.about-content h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  text-align: left;
}

.about-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.about-content .cta-buttons {
  margin-top: 2rem;
  justify-content: flex-start; /* Align to left instead of center */
}

/* Override main padding for about page */
body:not(.index-page) main {
  padding-top: 0; /* Remove default padding since we handle it in .about-hero */
}

@media (max-width: 900px) {
  .about-hero {
    min-height: calc(100vh - 80px);
    padding: 1.5rem;
  }
  
  .about-flex {
    flex-direction: column;
    text-align: left;
    gap: 2rem;
  }
  
  .about-content {
    text-align: left;
  }
  
  .about-content h1 {
    text-align: left;
  }
  
  .about-content .cta-buttons {
    justify-content: center; /* Center on mobile */
  }
  
  .about-img {
    width: 100%;
    max-width: 600px;
    height: auto;
  }
}

@media (max-width: 600px) {
  .about-hero {
    min-height: calc(100vh - 80px);
    padding: 1rem;
  }
  
  .about-img {
    max-width: none;
  }
}

/* Modern masonry photo grid for photos.html - CORRECTED CSS COLUMNS */
.photo-grid {
  column-count: 4;
  column-gap: 1.5rem;
  padding: 1rem;
  max-width: 1600px;
  margin: 0 auto;
}

.photo-grid .scene {
  display: inline-block; /* Changed from block to inline-block */
  width: 100%;
  margin-bottom: 1.5rem;
  break-inside: avoid;
}

.photo-item {
  background: #ffffff70;
  border-radius: var(--radius); /* Use CSS variable instead of hardcoded 12px */
  box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10); /* Match main cards */
  overflow: hidden;
  width: 100%;
  height: auto;
}

.photo-grid .card {
  border-radius: var(--radius); /* Use CSS variable instead of hardcoded 12px */
  box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10); /* Match main cards */
  overflow: hidden;
  width: 100%;
  height: auto;
  display: block;
  transition: 
    background 0.5s cubic-bezier(.4,0,.2,1),
    transform .12s ease-out,
    box-shadow 0.18s cubic-bezier(.4,0,.2,1);
  /* Start with completely transparent background */
  background: transparent;
}

.photo-grid .card:hover {
  background: rgba(255,255,255,0.7);
}

.photo-grid .card img {
  width: 100%;
  height: auto;
  display: block;
  transition: mix-blend-mode 0.5s cubic-bezier(.4,0,.2,1);
}

.photo-grid .card:hover img {
  mix-blend-mode: lighten;
}

/* Responsive adjustments for the grid */
@media (max-width: 1200px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}
@media (max-width: 800px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}
@media (max-width: 500px) {
  .photo-grid {
    grid-template-columns: 1fr;
  }
}

/* ======= Contact Form ======= */
.contact-hero {
  min-height: calc(100vh - 80px); /* Full viewport minus header height */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  margin-top: 80px; /* Push content below fixed header */
  box-sizing: border-box;
}

.contact-form {
  max-width: 800px; /* Increased width for embedded form */
  width: 100%;
  text-align: center;
}

.contact-form h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  text-align: center;
}

.contact-form p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

/* ClickUp embedded form styling */
.clickup-embed {
  min-height: 600px; /* Set minimum height for the form */
  border-radius: var(--radius); /* Match your site's border radius */
  border: 0px solid var(--border) !important; /* Use your theme border color */
  background: transparent !important;
  overflow: hidden;
  box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10); /* Match main cards */
}

#contactForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

#contactForm label {
  font-weight: 600;
  color: var(--text);
}

#contactForm input,
#contactForm textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font-stack);
  font-size: 1rem;
  box-sizing: border-box;
}

#contactForm textarea {
  min-height: 120px;
  resize: vertical;
}

#contactForm button {
  padding: 1rem 2rem;
  border-radius: var(--radius);
  border: none;
  background: #cc3333;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  margin-top: 1rem;
}

#contactForm button:hover {
  transform: translateY(-2px);
  background: #a72929;
  box-shadow: 0 8px 24px rgba(204, 51, 51, 0.4);
}

#form-status {
  text-align: center;
  margin-top: 1rem;
  font-weight: 500;
  min-height: 1.2em;
}

/* Contact page specific styling */
body.contact-page {
  height: auto;
  overflow: auto;
}

body.contact-page main {
  height: auto;
  display: block;
  padding-top: 0; /* Remove default padding since we handle it in .contact-hero */
}

body.contact-page footer {
  position: static;
  background: var(--bg);
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
}

body.contact-page footer a {
  color: var(--link);
  text-decoration: none;
  margin: 0 0.5rem;
}

body.contact-page footer a:hover {
  opacity: 0.7;
  color: var(--accent);
}

@media (max-width: 900px) {
  .contact-hero {
    min-height: calc(100vh - 80px);
    padding: 1.5rem;
    margin-top: 80px;
  }
  
  .contact-form {
    max-width: 100%;
  }
  
  .clickup-embed {
    min-height: 500px; /* Smaller height on mobile */
  }
}

@media (max-width: 600px) {
  .contact-hero {
    min-height: calc(100vh - 80px);
    padding: 1rem;
    margin-top: 80px;
  }
  
  .contact-form h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 0.75rem;
  }
  
  .contact-form p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .clickup-embed {
    min-height: 450px; /* Even smaller height on very small screens */
  }
}

/* Main page title styling */
.mainTitle {
  text-align: center;
  padding: 2rem 1rem 3rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: fixed; /* Fixed positioning */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1; /* Behind the portfolio content */
  transition: opacity 0.5s ease-out;
}

.mainTitle h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 0.5rem;
}

.mainTitle p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.8;
}

/* Call-to-action buttons */
.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.cta-primary {
  padding: 1rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  display: inline-block;
  background: #cc3333; /* Red background */
  color: #fff; /* White text for contrast */
  box-shadow: 0 4px 16px rgba(204, 51, 51, 0.3); /* Red-tinted shadow */
}

.cta-primary:hover {
  transform: translateY(-2px);
  background: #a72929; /* Slightly darker red on hover */
  box-shadow: 0 8px 24px rgba(204, 51, 51, 0.4); /* Stronger red shadow on hover */
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  opacity: 0.7;
  cursor: pointer;
  transition: all 0.3s ease;
}

.scroll-indicator:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.scroll-indicator span {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.arrow-down {
  animation: bounce 2s infinite;
}

.arrow-down svg {
  width: 24px;
  height: 24px;
}

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

@media (max-width: 600px) {
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  .cta-primary {
    width: 100%;
    max-width: 280px;
  }
}

/* Remove extra padding for photos page main */
.photo-page main {
  padding-top: 80px !important; /* Match the header height exactly */
}

/* Modern masonry photo grid for photos.html - USING CSS GRID */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 1px; /* A small base unit for the JS to calculate spans */
  gap: 1.5rem;
  padding: 1rem;
  max-width: 1600px;
  margin: 0 auto;
}

.photo-grid .scene {
  width: 100%;
  /* The grid-row-end will be set by JavaScript to create the masonry effect */
}

.photo-grid .card {
  border-radius: var(--radius); /* Use CSS variable instead of hardcoded 12px */
  box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10); /* Match main cards */
  overflow: hidden;
  width: 100%;
  height: auto;
  display: block;
}

.photo-grid .card img,
.photo-item img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 500px) {
  .photo-grid {
    grid-template-columns: 1fr;
  }
}

/* ======= Lightbox Photo Viewer ======= */
body.lightbox-active {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--lightbox-bg); /* Use the theme variable */
  backdrop-filter: blur(8px);
  z-index: 2000; /* Increased z-index to be above the header (z-index: 1002) */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox-container {
  display: flex;
  flex-direction: row-reverse; /* This moves the thumbnails to the right */
  width: 95%;
  height: 90%;
  max-width: 1800px;
  gap: 1rem;
}

/* Vertical Thumbnails */
.lightbox-thumbnails {
  flex: 0 0 140px;
  height: 100%;
  overflow-y: auto;
  /* Add padding to allow first/last items to be centered */
  padding-top: 40vh;
  padding-bottom: 40vh;
  box-sizing: border-box; /* Ensures padding is included in the element's total height */
  
  /* Hide scrollbar for IE, Edge and Firefox */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.lightbox-thumbnails::-webkit-scrollbar {
  display: none;
}

.lightbox-thumbnails img {
  width: 100%;
  height: auto;
  border-radius: var(--radius); /* Use the same radius as cards */
  margin-bottom: 1rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: 2px solid transparent;
  /* REMOVED: scroll-snap-align property */
}

.lightbox-thumbnails img:hover {
  opacity: 0.75;
  transform: scale(1.05);
}

.lightbox-thumbnails img.active {
  opacity: 1;
  border-color: #fff;
}

/* Main Image Display */
.lightbox-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100%;
}

.lightbox-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius); /* Use the same radius as cards */
}

/* Controls (Close, Next, Prev) */
.lightbox-btn {
  position: absolute;
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  font-size: clamp(2rem, 6vw, 3rem);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  z-index: 1001;
  padding: 0 1.5rem;
  opacity: 0.5;
}

.lightbox-btn:hover {
  opacity: 1;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  background: rgba(30, 30, 30, 0.5);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  opacity: 1;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-next, .lightbox-prev {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1rem;
}

.lightbox-prev {
  left: 1rem;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 800px) {
  .lightbox-container {
    flex-direction: column-reverse;
    height: 95%;
  }
  
  .lightbox-thumbnails {
    flex: 0 0 80px;
    height: 80px;
    width: 100%;
    overflow-y: hidden;
    overflow-x: auto;
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  .lightbox-thumbnails img {
    height: 100%;
    width: auto;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  
  .lightbox-main {
    height: calc(100% - 100px);
  }
  
  .lightbox-prev, .lightbox-next {
    bottom: 100px;
    top: auto;
    transform: none;
    z-index: 1002;
  }
  
  .lightbox-prev {
    left: 1rem;
  }
  
  .lightbox-next {
    right: 1rem;
  }
  
  /* Make buttons more prominent on mobile */
  .lightbox-btn {
    width: 48px;
    height: 48px;
    font-size: 1.8rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%; /* ADD THIS LINE - keeps buttons round on mobile */
  }
  
  .lightbox-btn:hover {
    background: rgba(0, 0, 0, 0.9);
  }
}

@media (max-width: 480px) {
  .lightbox-thumbnails {
    padding: 0 1rem; /* Even less padding on very small screens */
  }
  
  .lightbox-prev, .lightbox-next {
    bottom: 110px; /* More space from thumbnails */
  }
}

/* ======= Project Pages ======= */
.project-page main {
  padding-top: 80px;
}

.project-hero {
  text-align: center;
  padding: 4rem 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project-hero h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
  margin-bottom: 1rem;
  font-weight: 700;
}

.project-hero p {
  font-size: 1.3rem;
  opacity: 0.8;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Project Video Section - Regular Looping Video */
.project-video {
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10);
  background: #000;
}

.video-container video {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive adjustments for project video */
@media (max-width: 900px) {
  .project-video {
    padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .project-video {
    padding: 1rem;
  }
}

/* Project Gallery Grid */
.project-gallery {
  padding: 2rem;
}

/* Full-width Quote Block */
.quote-block-full-width {
  background-color: var(--bg);
  color: var(--text);
  padding: 2.5rem 0 1.25rem;
  text-align: center;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quote-slider {
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.quote-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.quote-item {
  flex: 0 0 100%;
  box-sizing: border-box;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quote-block-full-width blockquote {
  margin: 0 auto 1rem auto;
}

.quote-block-full-width blockquote p {
  margin: 0 auto 1rem auto;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1rem, 3vw, 1.5rem);
  line-height: 1.6;
  max-width: clamp(300px, 70vw, 800px);
  /* Prevent widows and orphans */
  widows: 3;
  orphans: 3;
  /* Alternative approach using text balancing (newer browsers) */
  text-wrap: balance;
}

/* For better support, you can also use this for quote footers */
.quote-block-full-width blockquote footer {
  font-style: normal;
  font-size: clamp(0.7rem, 2vw, 1rem);
  opacity: 0.7;
  max-width: clamp(300px, 80vw, 800px);
  margin: 0 auto;
  widows: 3;
  orphans: 3;
}

/* Quote Navigation */
.quote-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text);
  font-size: clamp(2rem, 6vw, 3rem);
  cursor: pointer;
  padding: 0 1.5rem;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.quote-nav:hover {
  opacity: 1;
}

.quote-prev {
  left: 1rem;
}

.quote-next {
  right: 1rem;
}

/* Quote Navigation Dots */
.quote-dots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  z-index: 10;
}

.quote-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.quote-dot:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.quote-dot.active {
  background: var(--text);
  opacity: 1;
}

@media (max-width: 600px) {
  .quote-dots {
    gap: 0.5rem;
    margin-top: 1.5rem;
  }
  
  .quote-dot {
    width: 10px;
    height: 10px;
  }
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), box-shadow 0.3s cubic-bezier(.4,0,.2,1);
  /* Remove any height or aspect-ratio constraints */
  height: fit-content;
}

/*.project-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px 0 rgba(0,0,0,0.25), 0 4px 12px 0 rgba(0,0,0,0.15);
}*/

.project-item img {
  width: 100%;
  height: auto; /* Let the image determine its own height */
  display: block;
  /* Remove object-fit: cover to preserve natural proportions */
}

/* Featured Project Section */
.project-featured {
  padding: 3rem 2rem;
  display: flex;
  justify-content: center;
}

.featured-item {
  max-width: 1200px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10);
}

.featured-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Project Footer Navigation - Glass Morphism Style to Match Header */
.project-footer {
  margin-top: 3rem;
  width: 100%;
  box-sizing: border-box;
  clear: both;
  transition: background 0.3s, backdrop-filter 0.3s;
}

.project-footer ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 items per row = 2 rows for 8 items */
  gap: 1rem;
  max-width: 1200px;
}

.project-footer li {
  display: flex;
}

.project-footer a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  /* Remove background and border - no shape until hover */
  background: transparent;
  border: none;
}

.project-footer a:hover {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.1);
}

.project-footer a.current {
  background: var(--text); /* Use theme text color for background */
  color: var(--card-bg); /* Use theme background color for text */
  cursor: default;
}

.project-footer a.current:hover {
  opacity: 1; /* Keep current items fully visible */
  background: var(--text); /* Maintain background on hover */
  color: var(--card-bg); /* Keep text color */
}

/* Dark mode hover effect */
@media (prefers-color-scheme: dark) {
  .project-footer a:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

:root[data-theme="dark"] .project-footer a:hover {
  background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] .project-footer a:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .project-footer ul {
    grid-template-columns: repeat(2, 1fr); /* 2 items per row on mobile */
    gap: 0.75rem;
  }
  
  .project-footer a {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .project-footer {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .project-footer ul {
    grid-template-columns: 1fr; /* Single column on very small screens */
  }
  
  .project-footer a {
    padding: 1rem;
  }
}

/* Project page layout */
.project-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Project Gallery Lightbox Support */
.project-gallery .scene,
.project-featured .scene {
    width: 100%;
    height: fit-content;
}

.project-gallery .card,
.project-featured .card {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 12px 28px 0 rgba(0,0,0,0.18), 0 1.5px 6px 0 rgba(0,0,0,0.10);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1), box-shadow 0.3s cubic-bezier(.4,0,.2,1);
}

.project-gallery .card:hover,
.project-featured .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px 0 rgba(0,0,0,0.25), 0 4px 12px 0 rgba(0,0,0,0.15);
}

.project-gallery .card img,
.project-featured .card img {
    width: 100%;
    height: auto;
    display: block;
}

/* Ensure featured items maintain their styling */
.project-featured .scene {
    max-width: 1200px;
    margin: 0 auto;
}