/* Gemeinsame responsive Grundlagen */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
}

img {
  max-width: 100%;
  height: auto;
}

.menu-icon {
  position: fixed;
  top: max(0.5rem, env(safe-area-inset-top));
  left: max(0.75rem, env(safe-area-inset-left));
  z-index: 10001;
  min-width: 50px;
  min-height: 44px;
}

.menu-container {
  position: fixed;
  top: 4.5rem;
  left: -320px;
  width: min(300px, calc(100vw - 2rem));
  max-height: calc(100dvh - 6rem);
  overflow-y: auto;
  z-index: 10002;
}

.menu {
  box-sizing: border-box;
  padding: 0.65rem max(0.75rem, env(safe-area-inset-right))
    calc(0.65rem + env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
}

.menu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
}

.menu li {
  float: none;
  margin: 0;
}

.menu .separator {
  margin: 0;
}

.home-page .menu .liright {
  margin-left: auto;
  text-align: right;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

/* Startseite */
.home-page {
  overflow-x: clip;
}

.home-page .wrapper {
  height: auto;
  min-height: 100svh;
  padding: clamp(4.5rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem) 6rem;
}

.home-page #container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "photo"
    "biography"
    "animation"
    "actions";
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  width: min(1180px, 100%);
  height: auto;
  min-height: calc(100svh - 11rem);
  margin: 0 auto;
}

.home-page #container > *:not(canvas):not(.rectangle) {
  position: relative;
  z-index: 2;
}

.home-page #container canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.home-page .rectangle {
  z-index: 1;
  max-width: calc(50% - 1rem);
  padding: 0.4rem 0.65rem;
  font-size: clamp(0.72rem, 1.3vw, 0.95rem);
  line-height: 1.2;
  transition: none;
  pointer-events: none;
}

.home-page #circle-image-container {
  grid-area: photo;
  position: relative;
  inset: auto;
  width: min(100%, 320px);
  max-width: none;
  max-height: none;
  justify-self: center;
}

.home-page #typewriter-text {
  grid-area: biography;
  position: relative;
  inset: auto;
  margin: 0;
  justify-self: center;
  width: min(100%, 760px);
  min-width: 0;
  max-width: 100%;
  padding: clamp(0.85rem, 2vw, 1.5rem);
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  line-height: 1.45;
  white-space: nowrap;
}

.home-page #animation-stage {
  grid-area: animation;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: clamp(280px, 38vh, 420px);
  overflow: hidden;
  border-radius: 0.75rem;
}

.home-page #typewriter-llhead {
  position: relative;
  inset: auto;
  flex: 0 0 100%;
  width: 100%;
  margin: 0;
  color: #000;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  text-align: left;
}

.home-page #additional-container {
  grid-area: actions;
  position: relative;
  inset: auto;
  display: flex;
  visibility: hidden;
  width: min(100%, 1000px);
  max-width: none;
  margin: 0 auto;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  gap: 0.75rem;
  pointer-events: none;
}

.home-page #additional-container > .social-container,
.home-page #additional-container > .bt-main {
  visibility: hidden;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.home-page #additional-container.is-content-visible > .social-container,
.home-page #additional-container.is-content-visible > .bt-main {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.home-page .social-container {
  display: flex;
  padding: 0.5rem;
  margin: 0;
  white-space: normal;
}

.home-page .img-social {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin: 0.5rem;
}

.home-page .bt-main {
  min-height: 48px;
  margin: 0.35rem;
  font-size: 1rem;
}

/* Auf großen Bildschirmen steht die Animation rechts neben den Inhalten. */
@media (min-width: 80rem) {
  .home-page #container {
    grid-template-columns: minmax(360px, 0.85fr) minmax(520px, 1.15fr);
    grid-template-areas:
      "photo animation"
      "biography animation"
      "actions actions";
    align-content: center;
  }

  .home-page #circle-image-container,
  .home-page #typewriter-text {
    justify-self: center;
    width: 100%;
  }

  .home-page #circle-image-container {
    width: min(100%, 320px);
  }

  .home-page #animation-stage {
    align-self: stretch;
    min-height: 460px;
  }
}

/* Gemeinsame Inhaltsseiten */
.projects-page,
.bucket-page,
.gallery-page {
  overflow-x: clip;
  background: linear-gradient(145deg, #a52a2a 0%, #ffa500 48%, #222 48%, #111 100%);
  background-attachment: fixed;
}

.projects-page .wrapper,
.bucket-page .wrapper,
.gallery-page .wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(1rem, 3vw, 2rem);
  min-height: 100svh;
  padding: 4.75rem clamp(0.75rem, 3vw, 2rem) 6rem;
}

.projects-page .wrapper::before,
.bucket-page .wrapper::before,
.gallery-page .wrapper::before,
.projects-page .left-side,
.projects-page .right-side,
.bucket-page .left-side,
.bucket-page .right-side,
.gallery-page .left-side,
.gallery-page .right-side {
  display: none;
}

.projects-page #typewriter-header,
.bucket-page #typewriter-header,
.gallery-page #typewriter-header {
  position: relative;
  inset: auto;
  width: min(1100px, 100%);
  min-height: 3rem;
  padding: 0.75rem 1rem;
  font-size: clamp(1rem, 3vw, 1.5rem);
  border-radius: 0.6rem;
}

.projects-page #head-container,
.bucket-page #head-container {
  position: relative;
  inset: auto;
  width: min(1100px, 100%);
  margin: 0;
  padding: clamp(0.65rem, 2vw, 1rem);
}

.projects-page #additional-container,
.bucket-page #additional-container {
  position: relative;
  inset: auto;
  width: min(1200px, 100%);
  margin: 0;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.projects-page #additional-container {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

.projects-page #additional-container > div {
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  border-radius: 0.75rem;
}

.projects-page #additional-container > .rounded-div4 {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(620px, 100%);
}

.projects-page h1[class^="h1div"],
.projects-page h2[class^="h2div"],
.projects-page label.labelzaehl,
.projects-page ul.grid-list {
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
}

.projects-page .imgdiv {
  width: 52px;
  height: 52px;
  padding: 0.75rem 0 0 0.75rem;
  object-fit: contain;
}

.projects-page .imgul {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.projects-page table.ki,
.projects-page table.seg,
.projects-page table.mail {
  table-layout: auto;
}

.projects-page table img {
  max-width: min(180px, 35vw);
  height: auto;
}

.projects-page .geo-scroll {
  width: min(620px, 100%);
  margin-inline: auto;
  padding: 0.25rem;
  overflow-x: visible;
}

.projects-page table.geo {
  width: 100%;
  min-width: 0;
  margin: 0.5rem auto;
  table-layout: fixed;
  font-size: clamp(0.5rem, 1.6vw, 0.8rem);
}

.projects-page .geo th,
.projects-page .geo td {
  width: auto;
  min-width: 0;
  padding: clamp(0.12rem, 0.7vw, 0.45rem);
}

.projects-page .geocaching-matrix {
  width: min(620px, 100%);
  margin-inline: auto;
}

.projects-page .geo th.header {
  width: clamp(24px, 6vw, 42px);
}

.projects-page .geo th.header span {
  left: 50%;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left bottom;
}

/* Löffelliste */
.bucket-page #additional-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: stretch;
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

.bucket-page .rounded-div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: auto !important;
  min-width: 0;
  min-height: 150px;
  height: auto;
  margin: 0 !important;
  padding: 0.75rem;
  border-radius: 0.75rem;
}

.bucket-page .modal-trigger {
  position: relative;
  padding-bottom: 2.75rem;
  cursor: pointer;
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: -5px;
}

.bucket-page .modal-trigger::after {
  content: "ⓘ Info";
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  left: 0.55rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.82);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.bucket-page .modal-trigger:hover::after,
.bucket-page .modal-trigger:focus-visible::after {
  background: #701010;
}

.bucket-page .geocaching-matrix {
  width: 100%;
}

.projects-page .geocaching-matrix .geocaching-intro {
  display: none;
}

.bucket-page .geocaching-matrix .geocaching-intro {
  margin: 0 0 1.25rem;
  color: #000;
  font-size: 1rem;
  line-height: 1.6;
}

.bucket-page .geocaching-matrix .geo-scroll {
  width: 100%;
  padding: 0.25rem;
  overflow-x: visible;
}

.bucket-page .geocaching-matrix table.geo {
  width: 100%;
  min-width: 0;
  margin: 0.5rem auto;
  border-collapse: collapse;
  table-layout: fixed;
  color: #000;
  background: #fff;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(0.45rem, 1.8vw, 0.8rem);
}

.bucket-page .geocaching-matrix .geo th,
.bucket-page .geocaching-matrix .geo td {
  width: auto;
  min-width: 0;
  padding: clamp(0.08rem, 0.65vw, 0.45rem);
  border: 1px solid #000;
  text-align: center;
}

.bucket-page .geocaching-matrix .geo td.tdgreen {
  background-color: forestgreen;
}

.bucket-page .geocaching-matrix .geo th.header {
  position: relative;
  width: clamp(22px, 6vw, 42px);
  min-width: 0;
  vertical-align: bottom;
  white-space: nowrap;
}

.bucket-page .geocaching-matrix .geo th.header span {
  position: absolute;
  bottom: 45%;
  left: 50%;
  display: inline-block;
  white-space: nowrap;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left bottom;
}

.bucket-page .rounded-div h2,
.bucket-page .rounded-div h3,
.bucket-page .rounded-div p {
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  text-align: center;
}

.bucket-page .imgdiv {
  width: 52px;
  height: 52px;
  padding: 0;
  object-fit: contain;
}

.bucket-page .bucket-card-icon {
  display: none;
}

@media (max-width: 47.99rem), (hover: none) and (pointer: coarse) {
  .bucket-page .rounded-div {
    position: relative;
    padding-top: 2.5rem;
  }

  .bucket-page .bucket-card-icon {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
  }
}

.bucket-page .centered-image {
  grid-column: 1 / -1;
}

.bucket-page .centered-image img {
  width: min(100%, 291px);
}

/* Bilderverzeichnis */
.gallery-page .table-scroll {
  width: min(1000px, 100%);
  margin: 0;
  border-radius: 0.75rem;
}

.gallery-page table {
  width: 100%;
  min-width: 720px;
  max-width: none;
  margin: 0;
}

.gallery-page th,
.gallery-page td {
  padding: clamp(0.5rem, 1.5vw, 0.9rem);
}

.gallery-page td img {
  display: block;
  width: auto;
  max-width: 90px;
  max-height: 110px;
  margin: 0 auto;
  object-fit: contain;
}

/* Impressum und Datenschutz */
.legal-page {
  margin: 0;
  font-family: Arial, sans-serif;
}

.legal-page .header,
.legal-page .middle,
.legal-page .footer {
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
}

.legal-page .header {
  padding: clamp(1rem, 4vw, 2rem);
}

.legal-page .middle {
  padding: clamp(1rem, 4vw, 2rem);
}

.legal-page :is(h1, h2, h3, h4, p, ul) {
  margin-left: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 47.99rem) {
  .home-page .wrapper {
    padding-top: 4.25rem;
  }

  .home-page #container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "biography"
      "animation"
      "actions";
    min-height: auto;
    text-align: center;
  }

  .home-page #circle-image-container {
    width: min(68vw, 260px);
  }

  .home-page #animation-stage {
    min-height: 460px;
  }

  .home-page .rectangle {
    padding: 0.3rem 0.4rem;
    font-size: clamp(0.65rem, 2.8vw, 0.78rem);
  }

  .home-page #additional-container {
    flex-direction: column;
  }

  .home-page .bt-main {
    width: min(100%, 280px);
  }

  .projects-page #additional-container {
    grid-template-columns: 1fr;
  }

  .projects-page #additional-container > .rounded-div4 {
    grid-column: auto;
  }

  .projects-page table.ki,
  .projects-page table.seg,
  .projects-page table.mail {
    width: calc(100% - 1rem);
  }

  .bucket-page #additional-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu {
    font-size: 0.85rem;
  }

  .menu .separator {
    display: none;
  }

  .legal-page .header h1,
  .legal-page .header h2 {
    display: block;
    margin: 0;
  }
}

/* Mobiltelefone im Querformat: lange Informationszeilen sicher im Feld halten. */
@media (orientation: landscape) and (max-height: 36rem) {
  .home-page #typewriter-text {
    width: 100%;
    max-width: 100%;
    padding-inline: 0.65rem;
    font-size: clamp(0.58rem, 1.45vw, 0.75rem) !important;
    letter-spacing: 0;
  }
}

@media (max-width: 30rem) {
  .bucket-page #additional-container {
    grid-template-columns: 1fr;
  }

  .projects-page .wrapper,
  .bucket-page .wrapper,
  .gallery-page .wrapper {
    padding-inline: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Einheitlicher, feststehender Seitenkopf */
:root {
  --site-header-height: 4.5rem;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10000;
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  align-items: center;
  min-height: calc(var(--site-header-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(0.75rem, env(safe-area-inset-right)) 0
    max(0.25rem, env(safe-area-inset-left));
  color: #fff;
  background: rgba(0, 0, 0, 0.88);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.site-header .menu-icon {
  position: relative;
  inset: auto;
  z-index: auto;
  align-self: center;
  justify-self: center;
  cursor: pointer;
}

.barwhite {
  width: 50px;
  height: 9px;
  border-radius: 2px;
  background-color: #fff;
}

.barwhitemenu {
  width: 50px;
  height: 15px;
  border-radius: 0;
  color: #000;
  background-color: #fff;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.7rem;
  line-height: 15px;
  text-align: center;
}

.bargray {
  width: 50px;
  height: 5px;
  border-radius: 2px;
  background-color: rgba(128, 128, 128, 0.65);
}

.menu-container {
  background-color: lightyellow;
  border-radius: 0 10px 10px 0;
  box-shadow: 2px 4px 14px rgba(0, 0, 0, 0.3);
}

.menu-content {
  padding: 1.25rem;
}

.menu-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-content li {
  margin-bottom: 0.65rem;
}

.menu-content a {
  padding: 0.3rem;
  color: #000;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(0.85rem, 1.6vh, 1.1rem);
  text-decoration: none;
}

.menu-content a:hover,
.menu-content a:focus-visible {
  color: #b35900;
}

.menu-content .li_erste {
  margin-left: 0.65rem;
}

.menu-content .li_zweite {
  margin-left: 1.25rem;
}

.menu-content .li_head {
  color: #000;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(0.8rem, 2vh, 1.2rem);
}

.site-header .site-header-title,
.site-header #typewriter-header {
  grid-area: auto !important;
  position: static !important;
  inset: auto !important;
  display: flex;
  align-items: center;
  align-self: stretch;
  justify-self: stretch;
  width: auto !important;
  min-width: 0;
  min-height: var(--site-header-height);
  margin: 0 !important;
  padding: 0.6rem 0.75rem !important;
  overflow: hidden;
  color: #fff !important;
  background: transparent !important;
  font-family: monospace;
  font-size: clamp(0.85rem, 2.4vw, 1.3rem) !important;
  font-weight: 700;
  line-height: 1.25;
  text-align: left !important;
  overflow-wrap: anywhere;
}

.menu-container {
  top: calc(var(--site-header-height) + env(safe-area-inset-top) + 0.5rem);
  transition: left 0.2s ease;
}

.menu-container.is-open {
  left: max(0px, env(safe-area-inset-left));
}

.home-page .wrapper,
.projects-page .wrapper,
.bucket-page .wrapper,
.gallery-page .wrapper {
  padding-top: calc(var(--site-header-height) + env(safe-area-inset-top) + 1rem);
}

.legal-page {
  padding-top: calc(var(--site-header-height) + env(safe-area-inset-top) + 1rem);
}

@media (max-width: 30rem) {
  :root {
    --site-header-height: 4rem;
  }

  .site-header {
    grid-template-columns: 3.75rem minmax(0, 1fr);
  }

  .site-header .site-header-title,
  .site-header #typewriter-header {
    font-size: clamp(0.78rem, 3.7vw, 1rem) !important;
    padding-inline: 0.4rem !important;
  }
}
