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

body {
  font-family: monospace;
  font-size: 15px;
  line-height: 1.6;
  max-width: 850px;
  margin: 2rem auto;
  padding: 0 1rem;
  color: #222;
  background: #fff;
}

body[data-theme="dark"] {
  color: #ccc;
  background: #111;
}

body[data-theme="dark"] nav {
  border-bottom-color: #ccc;
}

body[data-theme="dark"] nav a,
body[data-theme="dark"] #theme-toggle {
  color: #ccc;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ascii {
  font-size: 0.55rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  overflow: hidden;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid #222;
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

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

.mode-toggle {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 0;
}

.mode-label {
  font-size: 0.7em;
}

#theme-toggle {
  background: none;
  border: none;
  font-family: monospace;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

nav a:hover,
nav a.active {
  text-decoration: none;
}

nav a::before {
  content: '';
  visibility: hidden;
}

nav a:hover::before,
nav a.active::before {
  content: '> ';
  visibility: visible;
}

main {
  font-size: 0.85em;
}

h1 {
  font-size: 1em;
  margin-bottom: 1rem;
}

ul {
  list-style: none;
}

li {
  margin-bottom: 0.5rem;
}

main a {
  color: inherit;
  font-weight: bold;
}

/* blinkender cursor */
.cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* prompt-zeichen */
.prompt {
  opacity: 0.4;
}

/* scanlines */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  z-index: 999;
}

body[data-theme="dark"]::after {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.02) 2px,
    rgba(255, 255, 255, 0.02) 4px
  );
}

.dot {
  color: #c00;
  animation: pulse 1.5s ease-in-out infinite;
  display: inline-block;
}

/* ascii glitch */
.ascii {
  animation: glitch 8s infinite;
}

@keyframes glitch {
  0%, 97%, 100% { transform: none; opacity: 1; }
  97.5% { transform: translate(-2px, 1px) skewX(1deg); opacity: 0.8; }
  98% { transform: translate(2px, -1px) skewX(-0.5deg); opacity: 0.9; }
  98.5% { transform: none; opacity: 1; }
}

/* pulsierendes herz */
footer span.heart {
  display: inline-block;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

footer {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.55em;
}

.counter {
  display: block;
  margin-top: 0.3rem;
  opacity: 0.4;
}

.wordcloud {
  position: relative;
  width: 100%;
  height: 250px;
}

.wordcloud span {
  position: absolute;
  cursor: default;
  white-space: nowrap;
}

/* tablet */
@media (max-width: 850px) {
  body {
    font-size: 14px;
    margin: 1.5rem auto;
  }

  .ascii {
    font-size: 0.4rem;
  }

  nav {
    gap: 1.2rem;
  }

  .wordcloud {
    height: 280px;
  }
}

/* smartphone */
@media (max-width: 520px) {
  body {
    font-size: 13px;
    margin: 1rem auto;
    padding: 0 0.75rem;
  }

  .ascii {
    font-size: 0.25rem;
  }

  nav {
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    padding-bottom: 0.4rem;
    margin-bottom: 1.5rem;
  }

  .mode-toggle {
    margin-left: 0;
  }

  .wordcloud {
    height: 350px;
  }

  footer {
    margin-top: 2rem;
  }
}
