/* Fonts */
@font-face {
  font-family: 'MedievalSharp';
  src: url('./fonts/MedievalSharp-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Fira Code';
  src: url('./fonts/FiraCode-Regular.woff2') format('woff2');
}

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

/* RESET */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: 'MedievalSharp', cursive;
  background-color: #111;
  color: #33ff33;
  font-size: 16px;
  line-height: 1.6;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

:root {
  --header-h: 132px;
  /* Höhe deines Headers */
  --header-gap: 8px;
  /* Abstand Header → Main (wie dein margin-bottom) */
}

@media (prefers-reduced-motion: reduce) {
  #mobile-menu { transition: none; }
  #menu-backdrop { transition: none; }
}


/* FLEX LAYOUT */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: space-between;
  background: darkslateblue;
  color: lightskyblue;
}

/* HEADER */
header {
  height: 132px;
  background: linear-gradient(to bottom, #87CEFA, #483D8B);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.logo {
  width: 144px;
  height: auto;
}

.menu {
  display: flex;
  gap: 1em;
}

.Button {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border: 2px solid black;
  padding: 5px;
  background-color: lightskyblue;
  color: black;
  border-radius: 8px;
  margin-bottom: 3px;
  box-shadow: 0 0 5px black;
  overflow: hidden;
  font-size: clamp(16px, 3vw, 24px);
  text-align: center;
  font-family: 'MedievalSharp', monospace;
  text-decoration: wavy;
}

.current {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border: 2px solid black;
  padding: 5px;
  background-color: darkslateblue;
  color: white;
  border-radius: 8px;
  margin-bottom: 3px;
  box-shadow: 0 0 5px black;
  overflow: hidden;
  font-size: clamp(16px, 3vw, 24px);
  text-align: center;
  font-family: 'MedievalSharp', monospace;
  text-decoration: wavy;
  pointer-events: none;
}

.Button::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, #87CEFA, #483D8B, #87CEFA);
  background-size: 200% 100%;
  animation: moveStripe 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
}

.Button:hover::after {
  opacity: 1;
}

@keyframes moveStripe {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: 0 0;
  }
}

/* Mobile Menü: off-canvas von rechts */
#mobile-menu {
  position: fixed;
  top: calc(var(--header-h) + var(--header-gap));
  right: 0;
  max-height: calc(100vh - var(--header-h) - var(--header-gap));
  width: 80vw;                /* auf Phone angenehmer als 40% */
  background-color: rgba(72,61,139,0.95);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  z-index: 1001;

  will-change: transform;
  transform: translateX(100%);               /* Start: komplett rechts draußen */
  transition: transform 0.3s ease-in-out;

  box-shadow: 0 10px 20px rgba(0,0,0,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

#mobile-menu.open {
  transform: translateX(0);                  /* Fix: X statt Y */
}

/* Links im Dropdown */
#mobile-menu .Button {
  display: block;
  width: 100%;
  text-align: right;
  padding: 12px 16px;
  margin: 0;
  color: #fff;
  background: transparent;
  border: 0;
}

#mobile-menu .Button:hover { background: rgba(255,255,255,0.08); }

/* Backdrop */
#menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;                      /* Fix: none statt 0 */
  transition: opacity 0.3s ease;
}

#menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Korrektes dvh-Handling über @supports – muss top-level stehen */
@supports (max-height: 100dvh) {
  #mobile-menu {
    max-height: calc(100dvh - var(--header-h) - var(--header-gap));
  }
}


/* MAIN */
main {
  flex: 1;
  padding-top: 50px;
  padding-bottom: 50px;
  max-width: 1440px;
  margin: 0 auto;
  font-family: 'Fira Code', monospace;
  background-color: #000;
  color: #33ff33;
  box-shadow: 0 0 10px #0f0;
  width: 96%;
  box-sizing: border-box;
  flex-grow: 1;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  border-radius: 6px;
  padding-left: 1rem;
  padding-right: 1rem;
  overflow-y: auto;
}

/* FOOTER */
footer {
  height: 100px;
  margin-top: 8px;
  background: linear-gradient(to bottom, #483D8B, #87CEFA);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2em;
  font-size: 0.875rem;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
  color: black;
  flex-shrink: 0;
}

.footer-tribal {
  width: 40%;
  height: auto;
  max-height: 96px;
}

.social-icons {
  display: flex;
  gap: 1em;
}

.social-icons a {
  font-size: 1.5rem;
  color: black;
  text-decoration: none;
}

.impressum-link {
  color: black;
  font-size: 0.875rem;
  text-decoration: underline;
}

.legal-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.legal-link {
  font-size: 0.875rem;
  text-decoration: underline;
  background: transparent;      /* legal-Links dezent halten */
  border: 0;
  box-shadow: none;
  padding: 0;
}
@media (max-width: 520px) {
  .legal-nav { flex-direction: column; align-items: flex-end; gap: 0.25rem; }
}


/* RABBIT HOLE */
#rabbit-hole {
  position: fixed;
  right: 10px;
  width: 16px;
  height: 16px;
  background: radial-gradient(circle at center, #000 20%, transparent 80%);
  opacity: 0.2;
  border-radius: 50%;
  transition: all 0.3s ease;
  bottom: 100px;
  /* 96px Footer + 4px Abstand */
  right: 10px;
  z-index: 1500;
}

#rabbit-hole:hover {
  opacity: 0.6;
  cursor: pointer;
  transform: scale(1.2);
}

/* OVERLAY TERMINAL */
#login-overlay {
  position: fixed;
  inset: 0;
  background: black;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
}

.terminal {
  font-family: 'VT323', monospace;
  color: #00ff00;
  background-color: #000;
  padding: 2em;
  border: 2px solid #0f0;
  border-radius: 8px;
  box-shadow: 0 0 15px #0f0;
  width: 90%;
  max-width: 480px;
}

.terminal input {
  background: black;
  border: none;
  border-bottom: 1px solid #0f0;
  color: #0f0;
  font-size: 1.3rem;
  width: 100%;
  margin-bottom: 1em;
}

.terminal button {
  background-color: #0f0;
  color: black;
  border: none;
  padding: 0.5em 1em;
  cursor: pointer;
}

/* RESPONSIVE */
@media (max-width: 768px) {

  header,
  footer {
    flex-direction: row;
    align-items: center;
    text-align: center;
    height: auto;
    padding: 1em;
  }

  .menu {
    flex-direction: row;
  }

  main {
    padding: 1em;
  }

  .social-icons {
    margin-top: 0.5em;
  }
}


@media (min-width: 521px) {
  #hamburger-btn {
    display: none;
  }
}
@media (max-width: 520px) {
  .menu {
    display: none;
  }

  #hamburger-btn {
    display: block;
    position: fixed;
    top: calc(32px + env(safe-area-inset-top));
    right: 12px;
    z-index: 2001;
    font-size: 2rem;
    background: none;
    border: none;
    color: black;
    cursor: pointer;
    line-height: 1;
  }

  .footer-tribal {
    display: none;
  }
}
/* Guard gegen Mobile-Overflow */
@media (max-width: 534px){
  .content, .blog-list, .blog-entry{ min-width:0; } /* wichtig bei Grid/Flex */
  .content p{
    overflow-wrap: anywhere;   /* bricht sehr lange Wörter/URLs */
    word-break: break-word;    /* zusätzliche Bruchstellen */
    max-width:100%;
  }
  .content img, .content svg, .content pre, .content code{
    max-width:100%;
    box-sizing:border-box;
  }
}


