/* V47 */


/*FADE TIMING*/
:root {
  --nav-element-opacity: 0.2;
  --nav-element-opacity-hover: 1;
  --modal-text-opacity: 0.4;
  --nav-fade-duration: 1s;
  --nav-fade-easing: ease;
  --overlay-fade-duration: 0.28s;
  --overlay-content-fade-duration: 0.32s;
  --overlay-fade-easing: cubic-bezier(0.22, 1, 0.36, 1);
}


@font-face {
  font-family: 'Neue Haas Unica';
  src: url('fonts/neue_haas/NeueHaasUnica-Regular.woff2') format('woff2'),
      url('fonts/neue_haas/NeueHaasUnica-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Haas Unica';
  src: url('fonts/neue_haas/NeueHaasUnica-Italic.woff2') format('woff2'),
      url('fonts/neue_haas/NeueHaasUnica-Italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Haas Unica';
  src: url('fonts/neue_haas/NeueHaasUnica-Medium.woff2') format('woff2'),
      url('fonts/neue_haas/NeueHaasUnica-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Haas Unica';
  src: url('fonts/neue_haas/NeueHaasUnica-MediumItalic.woff2') format('woff2'),
      url('fonts/neue_haas/NeueHaasUnica-MediumItalic.woff') format('woff');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'DinPro';
  src: url('fonts/dinpro/DINPro-Medium.woff2') format('woff2'),
      url('fonts/dinpro/DINPro-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

html {
  background: #fff;
}

html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}
*, *::before, *::after {
  box-sizing: inherit;
}
h1, h2, h3, h4, h5, h6, p, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

a {
  all: unset;
  cursor: pointer;
}

a:hover,
.lang-switcher button:hover {
  color: #fb0000;
}

::selection {
  background: #fb0000;
  color: #fff;
}

::-moz-selection {
  background: #fb0000;
  color: #fff;
}


body {
  cursor: default;
  margin: 0;
  background: #fff;
  color: #111;
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 500;
  font-size: 16px;
}

/* Block scrolling when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Lock page scroll while About layer is open */
body.about-open {
  overflow: hidden;
  overscroll-behavior: none;
}

/* Keep language switcher above About overlay (without forcing opacity). */
body.about-open #lang-switcher {
  z-index: 500;
  pointer-events: auto;
}

/* iOS Safari URL bar translucency: hide underlying content when overlays are open */
body.modal-open #projects-section,
body.modal-open #footer-section,
body.about-open #projects-section,
body.about-open #footer-section {
  opacity: 0;
}


/* Unified nav fade transitions */
#lang-switcher,
#copyright-section,
.switcher-bar,
#modal-close,
#about-close,
#about-open-button,
#lang-switcher-modal,
#modal-info,
.project-nav {
  transition: opacity var(--nav-fade-duration) var(--nav-fade-easing);
}

/* Unified UI fade-away on idle (all devices, all sections) */
body.ui-idle #lang-switcher,
body.ui-idle #lang-switcher-modal,
body.ui-idle #about-open-button,
body.ui-idle .switcher-bar,
body.ui-idle #project-modal.visible #modal-close,
body.ui-idle #about-modal.visible #about-close,
body.ui-idle .project-nav,
body.ui-idle #modal-info {
  opacity: 0 !important;
}



/* White bar at bottom for switchers */
.switcher-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100px;
  background: white;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
}

/* Hide white bar when modal is open */
body.modal-open .switcher-bar {
  opacity: 0;
}

#lang-switcher {
  background-color: none;
  padding: 0px;
  border-radius: 10px;
  position: fixed;
  right: 2rem;
  bottom: 1.5rem;
  margin: 0;
  z-index: 100;
}

.lang-switcher {
  background: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  opacity: 1;
}

#lang-switcher-modal {
  position: fixed;
  right: 2rem;
  bottom: 1.5rem;
  margin: 0;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
}

body.modal-open #lang-switcher-modal {
  opacity: 1;
  pointer-events: auto;
}

.lang-switcher button {
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 500;
  font-size: 16px;
  padding: 0;
  border: none;
  background: none;
  color: #aaa;
  opacity: 1;
  cursor: pointer;
  /*transition: color 0.15s;*/
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lang-switcher button.active {
  color: #fb0000;      
  cursor: default;
  opacity: 1;
}

.lang-switcher button:hover {
  color: #fb0000 !important;
  opacity: 1;
}

.lang-switcher:hover button:not(:hover) {
  color: #aaa;
  opacity: 1;
}



#modal-close,
#about-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s ease, opacity var(--nav-fade-duration) var(--nav-fade-easing);
  opacity: 0;
  color: #aaa;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  pointer-events: auto;
  touch-action: manipulation;
}

#modal-close svg,
#about-close svg {
  width: 100%;
  height: 100%;
  display: block;
}

#project-modal.visible #modal-close {
  opacity: 1;
}


body.ui-idle #project-modal {
  cursor: none !important;
}

body.ui-idle #project-modal.left-cursor,
body.ui-idle #project-modal.right-cursor {
  cursor: none !important;
}

#modal-close:hover,
#about-close:hover {
  color: #fb0000;
}




/* THUMBNAIL GRID */
.project-thumbnail-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
}

.project-thumbnail {
  position: absolute;
  top: -1px;
  left: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  object-fit: cover;
  background: #eee;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  pointer-events: none;
  display: block;
}

.project-thumbnail-container:hover .project-thumbnail,
.project-thumbnail-container:focus-visible .project-thumbnail {
  transform: scale(1.06);
}

#projects-section {
  min-height: 100vh;
  width: 100vw;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  transition: opacity var(--overlay-fade-duration) var(--overlay-fade-easing);
}

#copyright-section {
  width: 100%;
  padding: 0;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  box-sizing: border-box;
}

#copyright-text {
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #000;
  letter-spacing: 0.04em;
  opacity: 1;
}

#project-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-gap: 0px;
  padding: 0px;
  justify-content: center;
  margin-top: 0;
}



/* FOOTER — about trigger */
#footer-section {
  width: 100%;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  position: relative;
  background: #fff;
  z-index: 20;
  transition: opacity var(--overlay-fade-duration) var(--overlay-fade-easing);
}

#about-open-button {
  position: fixed;
  left: 2rem;
  bottom: 1.5rem;
  z-index: 100;
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: #aaa;
  opacity: 1;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease, opacity var(--nav-fade-duration) var(--nav-fade-easing);
}

#about-open-button:hover {
  color: #fb0000;
  opacity: 1;
}

/* ABOUT — fullscreen overlay with modal fade */
#about-modal {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,1);
  display: flex;
  flex-direction: column;
  z-index: 390;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--overlay-fade-duration) var(--overlay-fade-easing);
  will-change: opacity;
}

#about-modal.hidden {
  display: flex;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#about-modal.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

#about-modal.visible #about-close {
  opacity: 1;
}

#about-modal-body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 2rem 2rem 1.5rem 2rem;
  opacity: 0;
  transition: opacity var(--overlay-content-fade-duration) var(--overlay-fade-easing);
}

#about-modal.visible #about-modal-body {
  opacity: 1;
}

.about-modal-inner {
  max-width: calc(800px - 2.5em);
  font-size: 16px;
  color: #111;
  font-family: 'Neue Haas Unica', sans-serif;
  white-space: normal;
}

.about-modal-footer {
  max-width: calc(800px - 2.5em);
  font-size: 16px;
  line-height: 1.15;
  color: #111;
  font-family: 'Neue Haas Unica', sans-serif;
  white-space: normal;
  margin-top: auto;
  padding-top: 3rem;
}

/* Links inside about modal */
.about-modal-inner a,
.about-modal-footer a {
  all: unset;
  cursor: pointer;
  color: #111;
  opacity: 1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.about-modal-inner a:hover,
.about-modal-footer a:hover {
  color: #fb0000;
  opacity: 1;
}

.about-contact-arrow {
  font-family: 'DinPro', 'Neue Haas Unica', sans-serif;
  font-weight: 700;
  font-size: 0.86em;
  line-height: 1;
  display: inline-block;
  position: relative;
  top: -0.08em;
  margin-right: 0.08em;
}

.about-modal-inner a.about-contact-link,
.about-modal-footer a.about-contact-link {
  color: #aaa;
  opacity: 1;
  text-transform: uppercase;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.about-modal-inner a.about-contact-link:hover,
.about-modal-footer a.about-contact-link:hover {
  color: #fb0000 !important;
  opacity: 1;
}

/* Smaller text for bio / copyright block */
.about-small {
  font-size: inherit;
  font-weight: 400;
}

.about-copyright {
  font-weight: 500;
  font-size: 14px;
  color: #000;
  opacity: 1;
}

/* Desktop: about text takes half of horizontal space */
@media (min-width: 901px) {
  .about-modal-inner {
    max-width: calc(50vw - 2.5em);
  }
  
  .about-modal-footer {
    max-width: calc(50vw - 2.5em);
  }
}

#section-button {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 200;
  font-family: 'Neue Haas Unica', sans-serif;
  font-weight: 500;
  font-size: 20px;
  color: #aaa;
  background: none;
  border: none;
  transition: color 0.15s;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.04em;
}


#about-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem;
  overflow-y: auto;
  cursor: default;

  transform: translateY(100%);
  opacity: 0;
  /*transition: transform 1s cubic-bezier(0,.75,.38,.99), opacity 1s cubic-bezier(0,.75,.38,.99);*/
  pointer-events: none;
}

#about-content .cr {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  font-size: 14px;
}

#about-content h2 {
  font-size: 1.6em;
  font-weight: bold;
  margin-top: 2.5em;
  margin-bottom: 0.7em;
  font-family: inherit;
}



/* EXPANDED PROJ VIEW */

#project-modal {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 400;
  
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--overlay-fade-duration) var(--overlay-fade-easing);
  --cursor-x: 50vw;
  --cursor-y: 50vh;
}

#project-modal.hidden {
  display: block;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#project-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

#project-modal.visible ~ #section-button {
  display: none;
}

#modal-info {
  position: fixed;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 120;
  margin: 0;
  background: none;
  display: block;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  font-family: 'Neue Haas Unica', sans-serif;
  font-size: 14px;
  line-height: 1;
  color: #fb0000;
  top: 50%;
  bottom: auto;
}

#modal-info.visible {
  opacity: 1;
}

#modal-title {
  font-weight: 400;
  font-style: italic;
  margin: 0;
  display: inline;
}

#modal-description {
  font-weight: 400;
  margin: 0;
  display: inline;
}

#modal-title::after {
  content: ' ';
}



#modal-carousel-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  transform: translateY(-4vh);
  opacity: 0;
  transition: opacity var(--overlay-content-fade-duration) var(--overlay-fade-easing);
}

#project-modal.visible #modal-carousel-container {
  opacity: 1;
}

#modal-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  width: 300%; /* Will accommodate 3 projects at once */
}

.project-slide {
  flex: 0 0 33.333%; /* Each slide takes up 1/3 of the track width */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  box-sizing: border-box;
}

.project-slide img {
  max-width: 70vw;
  max-height: 70vh;
  border-radius: 0;
  background: #eee;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.project-slide video {
  max-width: 70vw;
  max-height: 70vh;
  border-radius: 0;
  background: transparent;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Old project slide cursors removed */




/* Modal rendered navigation cursors */
#project-modal.left-cursor,
#project-modal.right-cursor {
  cursor: none !important;
}

#project-modal.left-cursor::after,
#project-modal.right-cursor::after {
  content: '';
  position: fixed;
  left: calc(var(--cursor-x) - 11px);
  top: calc(var(--cursor-y) - 11px);
  width: 22px;
  height: 22px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  pointer-events: none;
  z-index: 450;
  opacity: 1;
  transition: opacity var(--nav-fade-duration) var(--nav-fade-easing);
}

#project-modal.left-cursor::after {
  background-image: url('svg/efe_arrow_1_left.svg');
}

#project-modal.right-cursor::after {
  background-image: url('svg/efe_arrow_1_right.svg');
}

body.ui-idle #project-modal.left-cursor::after,
body.ui-idle #project-modal.right-cursor::after {
  opacity: 0;
}



/* ============================================
   MOBILE (portrait & landscape shared rules)
   ============================================ */

@media (max-width: 900px) {
  #project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  #about-open-button {
    left: 1rem;
    bottom: 1rem;
  }
  
  #lang-switcher {
    right: 1rem;
    bottom: 1rem;
  }
  
  #lang-switcher-modal {
    right: 1rem;
    bottom: 1rem;
  }
  
  .switcher-bar {
    height: 3rem;
  }
  
  #footer-section {
    padding: 1rem;
  }
  
  #about-modal-body {
    padding: 1rem;
  }

  /* Preserve original wrap width in About on mobile */
  .about-modal-inner,
  .about-modal-footer {
    padding-right: 4rem;
  }
  
  #copyright-section {
    padding: 0;
  }

  /* Mobile carousel - images perfectly centered and fitting screen */
  #project-modal {
    overflow: visible !important; /* Allow adjacent slides to peek during swipe */
    touch-action: none; /* Prevent browser pull-to-refresh / bounce during swipe-down */
    overscroll-behavior: contain;
  }
  
  body.modal-open {
    overflow: hidden; /* Prevent body scroll when modal is open */
    overscroll-behavior: none;
  }
  
  #modal-carousel-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transform: none;
    overflow: visible !important; /* Allow adjacent slides to be visible during swipe */
    position: relative;
  }
  
  #modal-carousel-track {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  }
  
  .project-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
  }
  
  .project-slide img,
  .project-slide video {
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 22rem);
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    margin-bottom: 2rem;
  }
  
  #modal-close {
    top: 1.25rem;
    right: 1rem;
    z-index: 1000;
    pointer-events: auto;
    touch-action: manipulation;
  }

  /* About close aligns with About content inset on mobile. */
  #about-close {
    top: 1rem;
    right: 1rem;
  }
  
  #modal-info {
    max-width: clamp(12rem, 60vw, 18rem);
    width: auto;
    position: fixed;
    bottom: 1rem; /* align with language switcher */
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
  }
  
  #modal-info.visible {
    opacity: 1;
  }
  
  #modal-title,
  #modal-description {
    display: block;
    width: 100%;
  }
}


/* ============================================
   MOBILE LANDSCAPE overrides
   ============================================ */

@media (max-width: 900px) and (orientation: landscape) {
  /* 6 columns instead of 3 so two rows fit on screen */
  #project-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  /* More vertical room for modal media in landscape, but keep
     enough padding for the description and UI elements */
  .project-slide img,
  .project-slide video {
    max-height: calc(100vh - 8rem);
  }
  
  /* Compact the modal info text for the shorter viewport */
  #modal-info {
    bottom: 0.5rem;
    font-size: 12px;
  }
  
  #modal-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  /* Keep About close aligned with About text inset in landscape too. */
  #about-close {
    top: 1rem;
    right: 1rem;
  }
  
  #lang-switcher {
    bottom: 0.5rem;
    right: 0.75rem;
  }

  #about-open-button {
    bottom: 0.5rem;
    left: 0.75rem;
  }
  
  #lang-switcher-modal {
    bottom: 0.5rem;
    right: 0.75rem;
  }
  
  /* Mobile landscape: about text takes 2/3 of horizontal space */
  #footer-section {
    padding-bottom: 0.5rem;
  }
  
  .about-modal-inner {
    max-width: calc(66.666vw - 2.5em);
  }
  
  .about-modal-footer {
    max-width: calc(66.666vw - 2.5em);
  }
}


/* POPUP LOADER SYSTEM */
#popup-container {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.7s ease;
  cursor: pointer;
  will-change: opacity;
}

#popup-container.hidden {
  opacity: 0;
  pointer-events: none;
}

#popup-content {
  width: 33.33vh;
  height: 33.33vh;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

#popup-content.popup-expanded {
  width: 50vh;
  height: 50vh;
}

#popup-content img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  visibility: hidden;
  touch-action: manipulation;
  background: #fff;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  cursor: pointer;
}

#popup-content img.popup-frame-active {
  visibility: visible;
}

body.popup-active {
  overflow: hidden;
}

body.popup-active #projects-section,
body.popup-active #footer-section,
body.popup-active #about-modal,
body.popup-active #lang-switcher {
  opacity: 0;
}
