* { margin: 0; padding: 0; box-sizing: border-box; -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;}

@font-face {
  font-family: 'Archivo';
  src: url('Archivo-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Archivo-M';
  src: url('Archivo-Medium.ttf') format('truetype');
}

html {
  height: 100%;
  background: #ebebeb;
}

html.light-html {
  background: #000000;
}

body {
  --bg: #ebebeb;
  --fg: #000000;
  --fg-muted: #000000;
  min-height: 100vh;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Archivo';
  color: var(--fg);
  cursor: none;
  transition: background 0.4s ease, color 0.4s ease;
}

body.light {
  --bg: #000000;
  --fg: #ebebeb;
  --fg-muted: #ebebeb;
}

#footer-links {
  position: fixed;
  bottom: 1.5rem;
  left: 1vw;
  width: auto;
  z-index: 999;
  display: flex;
  gap: 2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

#footer-links.visible {
  opacity: 1;
  pointer-events: auto;
}

#footer-links a {
  font-size: 12pt;
  color: var(--fg);
  text-decoration: none;
}

#footer-links a:hover {
  text-decoration: underline;
}

/* --- Navigation --- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1vw 1vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: auto;
  z-index: 1000;
}

.logo {
  font-size: 16pt;
  cursor: none;
}

.nav-links a {
  cursor: pointer !important;
  color: var(--fg-muted);
  text-decoration: none;
  margin-left: 35px;
  font-size: 16pt;
  letter-spacing: 1px;
  transition: color 0.3s ease;
  display: inline-block;
}

@keyframes waggle {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(-3deg); }
  50%  { transform: rotate(3deg); }
  80%  { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}

.nav-links a:hover {
  color: var(--fg);
  animation: waggle 0.6s ease-in-out;
  text-decoration: underline;
}

#theme-toggle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  color: var(--fg);
  font-size: 20pt;
  cursor: pointer !important;
  letter-spacing: 1px;
  transition: color 0.4s ease;
}

.hint-center {
  font-size: 12pt;
  left: 50%;
  margin-top: 4vw;
}

/* --- Slideshow Container --- */
#slideshow-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 71vh;
  cursor: none;
  overflow: visible;
}

#slideshow {
  display: flex;
  white-space: nowrap;
  align-items: flex-end;
}

.slide img {
  height: 71vh;
  width: auto;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.slide {
  flex-shrink: 0;
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  width: auto;
  max-width: 100%;
}

.slide:hover img { transform: translateY(-60px); }

.slide-text {
  width: 100%;
  max-width: 100%;
  text-align: center;
  padding-top: 0.5vh;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
  word-break: break-word;
}

.slide-title {
  font-family: 'Archivo-M';
  font-size: 12pt;
  margin-bottom: 0.1vh;
  display: block;
  white-space: normal;
}

.slide-subtitle {
  font-family: 'Archivo';
  font-size: 12pt;
  font-weight: 300;
  color: var(--fg-muted);
  display: block;
  white-space: normal;
}

.slide:hover .slide-text {
  opacity: 1;
  transform: translateY(-60px);
}

/* --- Custom Cursor --- */
#cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  background: rgb(0, 0, 0) !important;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  top: 50px;
  left: 50px;
  filter: invert(1);
  mix-blend-mode: difference;
}

/* --- Grid Modus --- */
body.grid-view { overflow-y: auto; cursor: default; }
body.grid-view #cursor { display: block; }

body.grid-view #slideshow-container {
  position: relative;
  height: auto;
  min-height: 100vh;
  padding: 26vh 1vw 5vh 1vw;
}

body.grid-view #slideshow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10vw, 1fr));
  gap: 0.3rem 0.3rem;
  width: 100%;
  white-space: normal;
  transform: none !important;
  align-items: start;
}

body.grid-view .slide {
  width: 100% !important;
  padding: 0;
  justify-content: flex-start;
  align-self: start;
  margin-bottom: 1.5rem;
}
body.grid-view .slide.clone { display: none; }

body.grid-view .slide img {
  transform: none !important;
  height: 25vh;
  width: 100%;
  object-fit: cover;
  transition: none;
}

body.grid-view .slide-text {
  opacity: 1;
  transform: none !important;
  position: relative;
  padding-top: 10px;
}

body.grid-view .slide:hover img {
  transform: none !important;
}

body.grid-view #hint-left,
body.grid-view #hint-right,
body.grid-view #hint-center {
  display: none;
}

#sort-bar {
  margin-bottom: 1.5vh;
}

#sort-bar a {
  font-size: 14pt;
  color: #000000;
  text-decoration: none;
}

/* --- Project Overlay --- */
#project-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, background 0.4s ease;
  display: grid;
  grid-template-columns: 1fr 920px;
}

#project-overlay .overlay-close,
#project-overlay .overlay-nav {
  cursor: pointer !important;
}

#project-overlay.active { opacity: 1; visibility: visible; }

.overlay-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 16pt;
  cursor: pointer !important;
  color: var(--fg);
  z-index: 3100;
}

.overlay-image-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  height: 100vh;
  margin-top: 1.5rem;
  margin-left: 1.5rem;
}
.overlay-image-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-height: calc(100vh - 4rem);
}

#overlay-img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  object-fit: contain;
  display: block;
}

.overlay-image-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.6rem;
}
.overlay-nav {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 20pt;
  cursor: pointer !important;
  padding: 0.5rem;
}

#project-counter {
  font-family: 'Archivo';
  font-size: 12pt;
  color: var(--fg-muted);
}

.overlay-info {
  position: relative;
  height: 100vh;
  display: flex;
  margin-right: 15rem;
  margin-left: 1.5rem;
  flex-direction: column;
}

.overlay-info-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 5rem;
}

#project-title {
  font-family: 'Archivo-M';
  font-size: 1.1rem;
  line-height: 1.4;
}

#project-info {
  font-size: 14pt;
  line-height: 1.4;
  color: var(--fg-muted);
  overflow-wrap: break-word;
  hyphens: auto;
}

.overlay-image-wrap:hover .overlay-nav { opacity: 1; }

/* --- Scroll Hints --- */
.scroll-hint {
  position: fixed;
  bottom: calc(72vh + 0.2rem);
  font-size: 14pt;
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 500;
}

#hint-left  { left: clamp(1rem, 1vw, 3rem); }
#hint-right { right: clamp(1rem, 1vw, 3rem); }

.scroll-hint.visible { opacity: 1; }

/* --- Kontakt Panel --- */
#kontakt-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
  padding: 1vw 1vw;
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 2fr;
  gap: 2rem;
}

#kontakt-panel.active {
  opacity: 1;
  visibility: visible;
}

.kontakt-panel-close {
  position: absolute;
  top: 1vw;
  right: 1vw;
  font-size: 16pt;
  cursor: pointer !important;
  color: var(--fg);
}

.kontakt-col h2 {
  font-size: 16pt;
  margin-bottom: 2.6rem;
  font-weight: normal;
}

.kontakt-col p {
  font-size: 14pt;
  color: var(--fg-muted);
}

.kontakt {
  font-size: 16pt;
  line-height: 1.4;
}

.kontakt-col a {
  font-size: 16pt;
  color: var(--fg);
  text-decoration: none;
}

.kontakt-col a:hover {
  cursor: pointer;
  text-decoration: underline;
}

.datenschutz-preview p,
.datenschutz-full p {
  font-size: 14pt;
  line-height: 1.05;
  color: var(--fg-muted);
}

#datenschutz-toggle,
#datenschutz-toggle-close {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 14pt;
  cursor: pointer !important;
  padding: 0;
  margin-top: 0.5rem;
}

.datenschutz-full {
  overflow-y: auto;
  max-height: calc(26vh - 6rem);
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 768px) {
  * { cursor: auto !important; }
  #cursor { display: none !important; }

  nav {
    padding: 4vw 3vw;
  }

  .logo { font-size: 14pt; }
  .nav-links a { font-size: 14pt; margin-left: 20px; }

  /* --- Slideshow Modus --- */
  #slideshow-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 75vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 9vh;
    overflow: visible;
  }

  #slideshow {
    display: flex;
    white-space: nowrap;
    align-items: flex-end;
    height: 100%;
  }

  .slide {
    height: 52vh;
    width: auto !important;
    flex-shrink: 0;
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    max-width: min-content !important;
  }

  .slide img {
    height: 100% !important;
    width: auto !important;
    object-fit: contain !important;
    display: block;
  }

  .slide-text {
    opacity: 1 !important;
    transform: none !important;
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    padding-top: 10px;
    display: block !important;
    white-space: normal !important;
    text-align: center !important;
  }

  .slide-title {
    font-size: 10pt !important;
    line-height: 1.4;
    display: block !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
    margin: 0 auto;
  }

  .slide-subtitle {
    font-size: 10pt !important;
    margin-top: 4px;
    display: block !important;
    text-align: center !important;
    white-space: normal !important;
    max-width: 100% !important;
  }

  .slide:hover img { transform: none !important; }
  .slide:hover .slide-text { transform: none !important; }

  /* --- Scroll Hints: immer sichtbar, knapp über Slideshow --- */
  .scroll-hint {
    bottom: calc(62vh + 0.5rem);
    opacity: 1;
    transition: none;
  }

  #hint-left  { left: clamp(1rem, 3vw, 3rem); }
  #hint-right { right: clamp(1rem, 3vw, 3rem); }

  .hint-center {
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
  }

  /* --- Grid / Index Modus --- */
  body.grid-view {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    height: auto !important;
  }

  body.grid-view #slideshow-container {
    position: relative !important;
    top: 0 !important;
    height: auto !important;
    min-height: 100vh !important;
    width: 100vw !important;
    padding: 12vh 3vw 3vw 3vw !important;
    display: block !important;
    overflow-y: visible !important;
  }

  body.grid-view #slideshow {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0px 12px !important;
    height: auto !important;
    width: 100% !important;
    white-space: normal !important;
    align-items: start !important;
    transform: none !important;
  }

  body.grid-view .slide {
    max-width: none !important;
    height: auto !important;
    width: 100% !important;
    padding: 0 !important;
    align-items: flex-start !important;
    margin-bottom: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body.grid-view .slide img {
    height: auto !important;
    width: 100% !important;
    aspect-ratio: 4 / 5 !important;
    object-fit: cover !important;
  }

  body.grid-view .slide-text {
    text-align: left !important;
    padding-top: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.grid-view .slide-title {
    text-align: center !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  body.grid-view .slide-subtitle {
    text-align: center !important;
    margin-top: 2px !important;
    white-space: normal !important;
  }

  /* --- Project Overlay --- */
  #project-overlay {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    grid-template-columns: none;
  }

  .overlay-image-wrap { display: none; }

  .overlay-info {
    height: auto;
    margin: 0;
    padding: 3rem 3vw 3vw 3vw;
  }

  .overlay-info-text { margin-top: 0; }
  #project-title { font-size: 13pt; }
  #project-info { font-size: 11pt; line-height: 1.4; }

  #mobile-overlay-images {
    padding: 1rem 3vw 3vw 3vw;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  #mobile-overlay-images img {
    width: 100%;
    height: auto;
    display: block;
  }

  .overlay-close {
    position: fixed;
    top: 4vw;
    right: 3vw;
    font-size: 18pt;
  }

  /* --- Kontakt Panel --- */
  #kontakt-panel {
    height: 100vh;
    min-height: unset;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: 1fr;
    padding: 4vw 3vw 3vw 3vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2.2rem;
  }

  .kontakt-col h2 {
    margin-bottom: 0.5rem;
    font-size: 14pt;
  }

  .kontakt-col p{
    font-size: 11pt;
    line-height: 1.3;
  }

  .kontakt a {
    font-size: 14pt;
    line-height: 1.4;
  }

  .kontakt-col a{
    line-height: 1.3;
    text-decoration: underline;
  }

  .kontakt-panel-close {
    top: 4vw;
    right: 3vw;
    font-size: 16pt;
  }

  /* Mobile: Datenschutz immer komplett sichtbar, kein Toggle */
  .datenschutz-preview        { display: none !important; }
  .datenschutz-full           { display: block !important; max-height: none; overflow: visible; }
  #datenschutz-toggle,
  #datenschutz-toggle-close   { display: none !important; }

  .datenschutz-full p {
    font-size: 11pt;
    line-height: 1.3;
  }

  .datenschutz-full a {
    font-size: 11pt;
    line-height: 1.3;
  }

  #sort-bar     { display: none !important; }
  #footer-links { display: none !important; }
}