/* FONTS */
@font-face {
  font-family: "Favorit Bold";
  src: url("fonts/ABCFavoritEdu-Bold.woff2") format("woff2"),
    url("fonts/ABCFavoritEdu-Bold.woff") format("woff");
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: "Favorit Regular";
  src: url("fonts/ABCFavoritEdu-Regular.woff2") format("woff2"),
    url("fonts/ABCFavoritEdu-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  background: white;
}

/* Header + Last Project Button */
.header {
  position: fixed;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Favorit Bold", serif;
  font-size: 18px;
  margin: 0;
  z-index: 1000;
  background: none;
  color: black;
  text-align: center;
}

.header a {
  text-decoration: none;
  color: inherit;
}

.header__last-project {
  display: none;
  background: none;
  border: none;
  font: inherit;
  color: black;
  text-transform: uppercase;
}

.side-button {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Favorit Bold", sans-serif;
  font-size: 18px;
  background: #d9d9d9;
  color: rgb(0, 0, 0);
  border: none;
  border-radius: 20px;
  padding: 2px;
  width: 275px;
  white-space: nowrap;
  z-index: 1000;
  box-sizing: border-box;
}

a.side-button {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  text-align: center;
}

.header__last-project {
  transition: transform 0.2s ease;
}

.header__last-project:hover {
  transform: translateY(+2px);
}

.side-button--left {
  left: 10px;
}

.side-button--right {
  right: 10px;
}

h2 {
  margin: 0;
}

a {
  color: black;
  text-underline-offset: 3px;
}

section {
  width: 100%;
  height: 100dvh;
  position: relative;
}

.project__infos-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 570px);
  max-height: 28.5px;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.project__infos-inner.active {
  max-height: 100%;
}

.project__infos-inner.active > p {
  opacity: 1;
}

.project__title {
  font-family: "Favorit Bold", sans-serif;
  font-size: 18px;
  background: rgba(34, 34, 34, 1);
  color: white;
  border-radius: 20px;
  padding: 2px;
  text-align: center;
  white-space: nowrap;
  position: relative;
  z-index: 1001;
  box-shadow: none !important;
  isolation: isolate;
}

.project__description {
  font-family: "Favorit Regular", sans-serif;
  margin: 0;
  line-height: 1.4;
  font-size: 18px;
  text-align: center;
  color: black;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 100000;
  position: relative;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.15);
}

/* Projektinhalt */
.project__content {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  height: 100dvh;
}

.project__content::-webkit-scrollbar {
  height: 0px;
}

.project__content-img {
  flex: 0 0 100vw;
  height: 100dvh;
}

.project__content-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project__next {
  text-decoration: none;
  position: fixed;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  z-index: 999;
  border: none;
  background: none;
  font-family: "Favorit Bold", serif;
  font-size: 18px;
  color: black;
  text-transform: uppercase;
  transition: transform 0.2s ease;
}

.project__next:hover {
  transform: translateX(-50%) translateY(-2px);
}

/* Cursor */
body {
  cursor: none;
}

#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: difference;
  transform: translate(-9999px, -9999px);
}

#cursor::before,
#cursor::after {
  content: "";
  position: absolute;
  background: white;
  transition: width 0.18s ease, height 0.18s ease;
}

#cursor::before {
  width: 3px;
  height: 16px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#cursor::after {
  width: 16px;
  height: 3px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#cursor.click {
  animation: cursor-click 0.2s ease;
}

@keyframes cursor-click {
  0% {
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(1);
  }
  50% {
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.6);
  }
  100% {
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(1);
  }
}

#cursor.hover-title::before {
  height: 22px;
}
#cursor.hover-title::after {
  width: 22px;
}

#back-button {
  text-align: center;
}

@media (max-width: 1000px) {
  .side-button--left,
  .side-button--right {
    display: none !important;
  }
}

/* Standard-Cursor deaktivieren */
html,
body,
a,
button,
input,
textarea,
select,
label,
[role="button"],
[type="button"],
[type="submit"] {
  cursor: none !important;
}

/* ============================================================
   RESPONSIVE DESIGN – unter 1200px (feste Schriftgrößen)
   ============================================================ */
@media (max-width: 1200px) {
  html,
  body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
  }

  main {
    display: flex;
    flex-direction: column;
  }

  section.project {
    position: relative;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .project__content {
    display: block;
    width: 100%;
    height: 100%;
  }
  .project__content-img,
  .project__content-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .header {
    position: fixed;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Favorit Bold", sans-serif;
    font-size: 18px; /* feste Größe */
    color: black;
    background: none;
    text-align: center;
    z-index: 1000;
    margin: 0;
    padding: 0;
  }

  .header__title {
    display: inline;
  }
  .header__last-project {
    display: none !important;
  }

  .header__title {
    white-space: nowrap;
    display: inline-block;
    width: max-content;
  }

  .project__infos {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
  }

  .project__infos-inner {
    pointer-events: all;
    width: 99%;
    text-align: center;
  }

  .project__title {
    font-family: "Favorit Bold", sans-serif;
    font-size: 18px;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(34, 34, 34, 1);
    color: white;
    text-align: center;
    width: 99%;
    margin: 0 auto;
    white-space: nowrap;
    box-sizing: border-box;
  }

  .project__description {
    font-family: "Favorit Regular", sans-serif;
    font-size: 18px;
    line-height: 1.4;
    text-align: center;
    color: black;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 20px;
    width: 99%;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
    position: relative;
    top: 0;
  }

  .project__infos-inner.active .project__description {
    opacity: 1;
  }

  .project__next,
  .side-button--left,
  .side-button--right {
    display: none !important;
  }

  #cursor {
    display: block;
  }
}

/* ============================================================
   ABOUT-SEITE – über 1200px
   ============================================================ */
@media (min-width: 1201px) {
  html,
  body {
    overflow-x: hidden;
  }

  .project-about {
    position: relative;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .project-about .project__infos {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    z-index: 50;
  }

  .project-about .project__infos-inner {
    position: relative;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: calc(100% - 2 * (275px + 10px));
    max-width: none;
    opacity: 1;
    visibility: visible;
  }

  .project-about .project__title {
    display: block;
    width: 100%;
    border-radius: 20px;
    background: rgba(34, 34, 34, 1);
    color: white;
    padding: 2px 10px;
    font-family: "Favorit Bold", sans-serif;
    text-align: center;
    white-space: nowrap;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .project-about .project__description {
    display: block;
    width: 100%;
    margin: 0 auto;
    margin-top: 0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: black;
    font-family: "Favorit Regular", sans-serif;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
  }
}

/* ============================================================
   UNSICHTBARE, STABILE SCROLLBARS AUF DER GESAMTEN WEBSITE
   ============================================================ */
html {
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar {
  display: none;
}
body {
  overflow-x: hidden;
}

/* ============================================================
   MOBILE ABOUT-LINK – sichtbar nur unter 1200px
   ============================================================ */
@media (max-width: 1200px) {
  .mobile-about-link {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Favorit Bold", sans-serif;
    font-size: 18px;
    text-decoration: none;
    color: black;
    background: none;
    border: none;
    text-transform: uppercase;
    z-index: 1000;
  }

  .mobile-about-link:hover {
    text-decoration: underline;
  }

  .header {
    position: fixed;
    top: 0; /* ← war 5px, jetzt exakt bündig mit dem oberen Rand */
    left: 50%;
    transform: translateX(-50%);
    font-family: "Favorit Bold", sans-serif;
    font-size: 18px;
    color: black;
    background: none;
    text-align: center;
    z-index: 1000;
    margin: 0;
    padding: 0; /* ← verhindert zusätzliches vertikales Verschieben */
    line-height: 1; /* ← stabilisiert vertikale Ausrichtung */
  }

  /* Korrigiert Header-Abstand nur auf der ABOUT-Seite */
  @media (max-width: 1200px) {
    body.about-page .header {
      top: 5px; /* leicht nach unten versetzt */
    }
  }
}

/* ============================================================
   KEINE SCROLLBARS UNTER 1200px (aber weiterhin scrollen möglich)
   ============================================================ */
@media (max-width: 1200px) {
  html,
  body {
    overflow: auto; /* erlaubt Scrollen */
    scrollbar-width: none; /* Firefox: keine Scrollbar */
    -ms-overflow-style: none; /* IE/Edge Legacy */
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none; /* Chrome / Safari / Edge: unsichtbar */
  }

  /* Falls in Containern horizontale Scrollbars vorkommen (z. B. project__content) */
  .project__content::-webkit-scrollbar {
    display: none;
  }
}

/* ============================================================
   MOBILE BACK-LINK – nur unter 1200px sichtbar (kein Hover-Unterstrich)
   ============================================================ */
@media (max-width: 1200px) {
  .mobile-back-text {
    position: fixed;
    bottom: 5px; /* gleicher Abstand wie Header oben */
    left: 50%;
    transform: translateX(-50%);
    font-family: "Favorit Bold", sans-serif;
    font-size: 18px;
    text-decoration: none;
    color: black;
    background: none;
    border: none;
    text-transform: uppercase;
    z-index: 1000;
  }

  .mobile-back-text:hover {
    text-decoration: none;
  }

  /* HOME-Button (Desktop-Version) auf Mobile ausblenden */
  .project__next {
    display: none !important;
  }
}

/* ============================================================
   DESKTOP: HOME-Button normal sichtbar, kein Back-Text
   ============================================================ */
@media (min-width: 1201px) {
  .mobile-back-text {
    display: none !important;
  }
}

@media (max-width: 1200px) {
  .project__infos-inner.open {
    top: 5px !important;
    transform: translate(-50%, 0) !important;
    transition: top 0.5s ease, transform 0.5s ease;
  }

  .project__infos-inner.open .project__description {
    opacity: 1 !important;
  }

  .project__content.open {
    display: block;
    height: auto !important;
    overflow: visible !important;
  }

  .project__content.open .project__content-img {
    height: auto;
  }

  .project__content.open .project__content-img img {
    width: 100%;
    height: auto;
    display: block;
  }
}

@media (max-width: 1200px) {
  .project__infos-inner.open {
    top: 5px !important;
    transform: translate(-50%, 0) !important;
    transition: top 0.4s ease, transform 0.4s ease;
  }

  .project__infos-inner.open .project__description {
    opacity: 1 !important;
    max-height: 100%;
    transition: opacity 0.6s ease;
  }

  .project__content.open {
    display: block;
    height: auto !important;
    overflow: visible !important;
  }

  .project__content.open .project__content-img {
    height: auto;
  }

  .project__content.open .project__content-img img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* Pfeil im Balken */
  .project__title {
    position: relative;
    padding-left: 25px !important;
  }

  .project__title::before {
    content: "←";
    position: absolute;
    left: 8px;
    top: 1px;
    font-family: "Favorit Bold", sans-serif;
    color: white;
    display: none;
  }

  .project__infos-inner.open .project__title::before {
    display: inline;
  }
}

/* Mobile: offenes Projekt darf wachsen & scrollen */
@media (max-width: 1200px) {
  section.project.open {
    height: auto !important;
    min-height: 100dvh;
    overflow: visible !important;
  }

  .project__infos-inner.open {
    top: 5px !important;
    transform: translate(-50%, 0) !important;
    transition: top 0.35s ease, transform 0.35s ease;
  }

  .project__infos-inner.open .project__description {
    opacity: 1 !important;
  }

  .project__content.open {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .project__content.open .project__content-img {
    height: auto !important;
  }

  .project__content.open .project__content-img img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
}

/* ============================================================
   ABOUT-BUTTON – nur unter 1200px unten mittig sichtbar
   ============================================================ */
.mobile-about {
  display: none;
}

@media (max-width: 1200px) {
  .mobile-about {
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Favorit Bold", sans-serif;
    font-size: 18px;
    color: black;
    background: none;
    text-decoration: none;
    z-index: 1000;
    white-space: nowrap;
    text-transform: uppercase;
  }

  .mobile-about:hover {
    text-decoration: none;
  }
}

/* ============================================================
   MOBILE: Hover-Animation für MICHEL DOMEISEN (nach unten)
   und BACK (nach oben) – analog zur Desktop-Bewegung
   ============================================================ */
@media (max-width: 1200px) {
  .header,
  .mobile-back-text {
    transition: transform 0.2s ease;
  }

  /* MICHEL DOMEISEN: bewegt sich leicht nach unten */
  .header:hover {
    transform: translateX(-50%) translateY(+2px);
  }

  /* BACK: bewegt sich leicht nach oben */
  .mobile-back-text:hover {
    transform: translateX(-50%) translateY(-2px);
  }
}

/* ============================================================
   MOBILE: Kleines Plus-Symbol rechts im Balken (Landingpage)
   ============================================================ */
@media (max-width: 1200px) {
  .project__title::after {
    content: "+";
    position: absolute;
    right: 12px;
    top: 0;
    font-family: "Favorit Bold", sans-serif;
    color: white;
    transition: opacity 0.2s ease;
  }

  /* Plus verschwindet, wenn Projekt geöffnet ist */
  .project__infos-inner.open .project__title::after {
    opacity: 0;
  }
}

@media (max-width: 1200px) {
  body.about-page .project__title::after {
    content: none !important;
  }
}

/* ============================================================
   MOBILE ABOUT-TEXT – nur unter 1200px sichtbar
   ============================================================ */
@media (max-width: 1199px) {
  .mobile-about-text {
    position: fixed;
    bottom: 5px; /* exakt gleicher Abstand wie BACK */
    left: 50%;
    transform: translateX(-50%);
    font-family: "Favorit Bold", sans-serif;
    font-size: 18px; /* exakt gleiche Größe wie BACK, NEXT, MICHEL DOMEISEN */
    color: black;
    background: none;
    border: none;
    text-decoration: none;
    text-transform: uppercase;
    z-index: 1000;
    transition: transform 0.2s ease; /* gleiche Animation */
  }

  .mobile-about-text:hover {
    transform: translateX(-50%) translateY(-2px);
  }
}

/* ============================================================
   DESKTOP (>=1200px): ABOUT-TEXT komplett ausblenden
   ============================================================ */
@media (min-width: 1200px) {
  .mobile-about-text {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media (max-width: 768px) {
  #cursor {
    display: none !important;
  }
  html,
  body,
  a,
  button,
  input,
  textarea,
  select,
  label {
    cursor: auto !important; /* Standard-Cursor aktiv */
  }
}

/* ============================================================
   MOBILE <768px – Mehr Abstand für Header & Footer-Buttons
   ============================================================ */
@media (max-width: 768px) {
  /* MICHEL DOMEISEN – Abstand nach oben */
  .header {
    top: 12px !important; /* statt 5px */
  }

  /* ABOUT-Textlink und BACK-Link – Abstand nach unten */
  .mobile-about-text,
  .mobile-back-text {
    bottom: 12px !important; /* statt 5px */
  }
}

@media (max-width: 1200px) {
  body.project-open .mobile-about-text {
    display: none !important;
  }
}

/* ============================================================
   MOBILE <1200px – Abstand des geöffneten Projektbalkens nach oben
   ============================================================ */
@media (max-width: 1200px) {
  .project__infos-inner.open {
    top: 15px !important; /* vorher war 5px */
    transform: translate(-50%, 0) !important;
    transition: top 0.35s ease, transform 0.35s ease;
  }
}

/* ============================================================
   MOBILE <1200px – kleinerer Abstand zwischen Titel & Text
   ============================================================ */
@media (max-width: 1200px) {
  .project__infos-inner.open .project__description {
    margin-top: 4px !important; /* vorher 6–10 px */
  }
}

/* ============================================================
   MOBILE <1200px – kein Blur unter Text, weißer Hintergrund
   ============================================================ */
@media (max-width: 1200px) {
  .project__description {
    background: white !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }
}

/* ============================================================
   MOBILE <1200px – Beschreibung sichtbar, aber ohne Hintergrund / Box
   ============================================================ */
@media (max-width: 1200px) {
  .project__description {
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
  }
}

/* ============================================================
   ABOUT-Seite: MICHEL DOMEISEN – fester Abstand + Hover-Animation (<768px)
   ============================================================ */
@media (max-width: 768px) {
  body.about-page .header {
    position: fixed !important;
    top: 17px !important; /* fester Abstand */
    left: 50%;
    transform: translateX(-50%);
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    z-index: 1000;
    transition: transform 0.2s ease; /* Animation aktivieren */
  }

  /* Hover: gleiche Bewegung wie BACK (leicht nach unten) */
  body.about-page .header:hover {
    transform: translateX(-50%) translateY(+2px);
  }

  body.about-page .header__title {
    position: relative;
    top: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* ============================================================
   MOBILE/TABLET <768px: Titel- & Text-Bereich schmaler (97%)
   ============================================================ */
@media (max-width: 768px) {
  .project__title,
  .project__description {
    width: 97% !important; /* nur 97% der Breite */
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }
}

/* ============================================================
   Mobile Scroll Snap – ersetzt JS-Snap komplett
   ============================================================ */
@media (max-width: 1199px) {
  html,
  body {
    /* scroll-behavior: smooth; */
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory; /* <- aktiviert das Einrasten */
  }

  html:has(body.project-open),
  body.project-open {
    scroll-snap-type: none;
  }

  section.project {
    scroll-snap-align: start; /* <- jedes Projekt ist ein Snap-Punkt */
    scroll-snap-stop: always;
  }
}

/* ============================================================
   Scroll Snap nur aktiv, wenn JS .enable-scroll-snap hinzufügt
   (also nur auf Touchgeräten unter 1200 px)
   ============================================================ */
body.enable-scroll-snap {
  /* scroll-behavior: smooth; */
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
}

body.enable-scroll-snap section.project {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Verhindert überflüssiges Scrollen am Ende der Startseite auf Mobile */
@media (max-width: 1200px) {
  body:not(.project-open) .project:last-of-type {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    overflow: hidden !important;
  }
}
