@font-face {
    font-family: 'Handwriting';
    src: url('../fonts/Handwriting-Regular.woff2') format('woff2'),
         url('../fonts/Handwriting-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-main: "Courier New", Courier, monospace;
    --font-bold: 700;
    --font-accent: "Handwriting", "Courrier New", Courier, monospace;
    --font-color: #292929;
    --background-color: #eceae9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%; 
}

body {
  font-family: var(--font-main);
  color: var(--font-color);
  background: #eceae9;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  margin-left: 10%;
  margin-right: 10%;
  text-align: center;
  padding-top: 4rem; 
}

header {
  background: #eceae9; 
  position: sticky;
  top: 0;
  margin-bottom: 2rem;
  margin-top: 1rem;
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 4rem;
  position: relative;
}

.logo {
  font-family: var(--font-accent);
  font-size: 1rem;
  font-weight: var(--font-bold);
  text-decoration: none;
  color: #222;
  z-index: 100;
  background: none;
}

/* Desktop Navigation */
nav ul,
.nav-links {
  list-style: none;
  display: flex;
  gap: 3rem;
}

nav a {
  text-decoration: none;
  color: #222;
}

nav a.active {
  font-weight: var(--font-bold);
}

/* Burger Menu (versteckt auf Desktop) */
.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2001;
}

.burger-menu span {
  width: 100%;
  height: 3px;
  background-color: #222;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Burger Menu Animation (wenn aktiv) */
.burger-menu.active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

h1 {
  font-family: var(--font-main);
  font-weight: var(--font-bold);
  font-size: 2rem;
  margin-top: 0.5rem;
  margin-bottom: 5rem;
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
}

h1::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 8px;
  pointer-events: none;
}

footer {
  text-align: center;
  margin-top: 5rem;
  padding: 1rem;
  font-size: 0.9rem;
  color: #969696;
}

.pencil-link {
  position: relative;
  display: inline-block;
  color: #000;
  text-decoration: none;
}

.pencil-underline {
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 10px;
  pointer-events: none;
  overflow: hidden;
}

.pencil-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: butt;
  stroke-linejoin: round;
  transition: none;
}

.pencil-link:hover .pencil-path {
  stroke-dashoffset: 0;
}

.pencil-link.active {
  font-weight: var(--font-bold);
}

/* ========================================
   RESPONSIVE - TABLET & MOBILE
   ======================================== */

/* Tablet */
@media (max-width: 900px) {
  nav {
    padding: 1rem 2rem;
  }
  
  .nav-links {
    gap: 2rem;
  }
  
  main {
    margin-left: 5%;
    margin-right: 5%;
    padding-top: 2rem;
  }
  
  header {
    margin-bottom: 3rem;
  }
}

/* Mobile (Burger Menu aktivieren) */
@media (max-width: 768px) {
  /* Burger Menu anzeigen */
  .burger-menu {
    display: flex;
  }
  
  /* Navigation verstecken, als Overlay */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--background-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    padding: 2rem;
  }
  
  /* Navigation wenn aktiv */
  .nav-links.active {
    right: 0;
  }
  
  /* Navigation Links auf Mobile */
  .nav-links li {
    width: 100%;
    text-align: center;
  }
  
  .nav-links a {
    font-size: 1.3rem;
    padding: 1rem;
    display: block;
  }
  
  /* Overlay Hintergrund wenn Menü offen */
  body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  /* Main anpassen */
  main {
    margin-left: 5%;
    margin-right: 5%;
  }
  
  nav {
    padding: 1rem 1.5rem;
  }
  
  .logo {
    font-size: 1.5rem;
    background: none;
  }
  
  h1 {
    font-size: 1.5rem;
    margin-bottom: 3rem;
  }
}

/* Sehr kleine Mobile */
@media (max-width: 480px) {
  .nav-links {
    width: 80%;
  }
  
  main {
    margin-left: 3%;
    margin-right: 3%;
  }
  
  nav {
    padding: 1rem;
  }
  
  .logo {
    font-size: 1.3rem;
    background: none;
  }
  
  h1 {
    font-size: 1.3rem;
    margin-bottom: 2rem;
  }
  
  footer {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
}

/* Touch-Geräte: Größerer Hit-Bereich */
@media (hover: none) and (pointer: coarse) {
  .pencil-link {
    padding: 0.5rem 0;
  }
}