@font-face {
    font-family: 'Neue Machina';
    src: url('photography/css/font/NeueMachina-Bold.eot');
    src: local('Neue Machina Bold'), local('NeueMachina-Bold'),
        url('photography/css/font/NeueMachina-Bold.eot?#iefix') format('embedded-opentype'),
        url('photography/css/font/NeueMachina-Bold.woff2') format('woff2'),
        url('photography/css/font/NeueMachina-Bold.woff') format('woff'),
        url('photography/css/font/NeueMachina-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Neue Machina';
    src: url('photography/css/font/NeueMachina-Medium.eot');
    src: local('Neue Machina Medium'), local('NeueMachina-Medium'),
        url('photography/css/font/NeueMachina-Medium.eot?#iefix') format('embedded-opentype'),
        url('photography/css/font/NeueMachina-Medium.woff2') format('woff2'),
        url('photography/css/font/NeueMachina-Medium.woff') format('woff'),
        url('photography/css/font/NeueMachina-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Neue Machina';
    src: url('photography/css/font/NeueMachina-Regular.eot');
    src: local('Neue Machina Regular'), local('NeueMachina-Regular'),
        url('photography/css/font/NeueMachina-Regular.eot?#iefix') format('embedded-opentype'),
        url('photography/css/font/NeueMachina-Regular.woff2') format('woff2'),
        url('photography/css/font/NeueMachina-Regular.woff') format('woff'),
        url('photography/css/font/NeueMachina-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
  --bg-color-light: #f5f5f5;
  --bg-color-dark: #121212;
  --text-color-light: #282828;
  --text-color-dark: #ffffff;
}

html[data-theme="dark"] {
  --bg-color-light: #1c1c1e;
  --bg-color-dark: #000000;
  --text-color-light: #f5f5f5;
  --text-color-dark: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color-light);
  color: var(--text-color-light);
  font-family: 'Neue Machina', sans-serif;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

.portal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  /* Lifted higher above mid-screen */
  transform: translateY(-14vh);
}

.portal-link {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color-light);
  text-decoration: none;
  display: inline-block;
  padding: 0.5rem 1rem;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              color 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, color, opacity;
}

.portal-footer {
  position: absolute;
  bottom: 40px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.05em;
  opacity: 0.4;
  color: var(--text-color-light);
  transition: color 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

/* Theme Switcher */
.theme-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 2px;
  transition: background 0.3s ease;
}

html[data-theme="dark"] .theme-switcher {
  background: rgba(255, 255, 255, 0.1);
}

.theme-switcher button {
  background: transparent;
  border: none;
  border-radius: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color-light);
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.4;
}

.theme-switcher button svg {
  width: 16px;
  height: 16px;
}

.theme-switcher button:hover {
  opacity: 0.8;
}

.theme-switcher button.active {
  opacity: 1;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  color: #111;
}

html[data-theme="dark"] .theme-switcher button.active {
  background: #333333;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  color: #fff;
}

/* Hover effects */
body.hovered-active .portal-footer {
  opacity: 1;
}

/* Base link scaling */
.portal-link.active-link {
  transform: scale(3);
  font-weight: 900;
}

/* Non-active links get blurred */
body.hovered-active .portal-link:not(.active-link) {
  opacity: 0.15;
  filter: blur(1.5px);
  transform: scale(0.9);
}



/* Photography Hover: Light Theme Specifics */
body.hover-photography .portal-link.active-link {
  color: #ffffff;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Remove text-shadow in dark theme for Photography */
html[data-theme="dark"] body.hover-photography .portal-link.active-link {
  color: #ffffff;
  text-shadow: none;
}

/* Projects Hover: Theme-aware */
/* In light mode, it inherits the dark text color. In dark mode, it inherits the white text color. */
html[data-theme="dark"] body.hover-projects .portal-link {
  color: rgba(255, 255, 255, 0.4);
}
html[data-theme="dark"] body.hover-projects .portal-link.active-link {
  color: #fff;
}
html[data-theme="dark"] body.hover-projects .portal-footer {
  color: #fff;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
  .portal-container {
    transform: translateY(-10vh);
    gap: 1.2rem;
  }
  
  .portal-link {
    font-size: 16px;
  }
  
  /* Slightly adjust scale on mobile to prevent overflow/clipping issues */
  .portal-link:hover {
    transform: scale(1.35);
  }

  .portal-footer {
    bottom: 24px;
    font-size: 11px;
  }
}



/* Projects LED Grid Canvas */
.projects-led-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Animated Monochrome Noise */
.noise-overlay {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: -4;
  background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="3.5" numOctaves="3" stitchTiles="stitch"/%3E%3CfeColorMatrix type="saturate" values="0"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
  background-size: 200px 200px;
  background-repeat: repeat;
  opacity: 0.05;
  transition: opacity 0.8s ease;
  animation: noiseAnimation 0.4s infinite steps(1);
}

@keyframes noiseAnimation {
  0% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0); }
  70% { transform: translate(0, 15%); }
  80% { transform: translate(-20%, 0); }
  90% { transform: translate(20%, 15%); }
  100% { transform: translate(5%, 0); }
}

html[data-theme="dark"] .noise-overlay {
  opacity: 0.06;
}

body.hovered-active .noise-overlay {
  opacity: 0;
}

.projects-led-grid.active {
  opacity: 1;
}

/* Instantly hide LED dots when switching to photography hover */
body.hover-photography .projects-led-grid {
  opacity: 0 !important;
  transition: none !important;
}

/* Hover Gallery styling */
.hover-gallery {
  position: fixed;
  top: 50vh;
  left: 50vw;
  transform: translate(-50%, -50%) scale(var(--zoom-scale, 0.4));
  z-index: -1;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.8s ease;
  will-change: transform, opacity;
}

.hover-gallery.active {
  opacity: 1;
}

/* Uniform columns — each column holds a MIX of H and V photos */
.gallery-column {
  /* width and margin-top are now set dynamically in JS */
  display: flex;
  flex-direction: column;
  gap: 16px;
  will-change: transform;
}

/* Parallax: controlled dynamically by classes from JS */
.hover-gallery.active .scroll-Fast { animation: scrollFast 20s ease-in-out infinite alternate; }
.hover-gallery.active .scroll-Medium { animation: scrollMedium 20s ease-in-out infinite alternate; }
.hover-gallery.active .scroll-Slow { animation: scrollSlow 20s ease-in-out infinite alternate; }
.hover-gallery.active .scroll-VerySlow { animation: scrollVerySlow 20s ease-in-out infinite alternate; }

@keyframes scrollVerySlow {
  0% { transform: translateY(3vh); }
  100% { transform: translateY(-3vh); }
}
@keyframes scrollSlow {
  0% { transform: translateY(6vh); }
  100% { transform: translateY(-6vh); }
}
@keyframes scrollMedium {
  0% { transform: translateY(10vh); }
  100% { transform: translateY(-10vh); }
}
@keyframes scrollFast {
  0% { transform: translateY(16vh); }
  100% { transform: translateY(-16vh); }
}

.gallery-item {
  flex-shrink: 0;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.hover-gallery.active .gallery-item {
  opacity: 0.85;
  transform: translateY(0);
  pointer-events: auto;
}

/* Horizontal photos: short and wide (3:2) */
.gallery-item.size-horizontal {
  aspect-ratio: 3 / 2;
}

/* Vertical photos: tall and narrow (2:3) */
.gallery-item.size-vertical {
  aspect-ratio: 2 / 3;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(15%) brightness(0.95);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); /* Light shadow for light theme */
  transition: filter 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
  will-change: filter, transform;
}

.gallery-img.is-loading {
  filter: blur(20px) grayscale(15%) brightness(0.95);
  transform: scale(1.1);
}

html[data-theme="dark"] .gallery-img {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); /* Darker shadow for dark theme */
}

.gallery-img:hover {
  opacity: 1;
  filter: grayscale(0%) brightness(1.1);
}

@media (max-width: 768px) {
  .hover-gallery {
    gap: 8px;
  }
  .gallery-column {
    flex: 0 0 40vw;
    gap: 8px;
  }
  .gallery-img {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  }
}

