body {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  background-color: #1b0f08;
  color: #ffb347;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, p, nav button, footer {
  text-shadow:
    0 0 4px #ffb347; /* stronger glow to pop text above background */
  color: #ffb347;    /* keep bright and consistent */
}

main {
  flex: 1;
}

/* CRT container with scanlines and glow */
.crt {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-color: #2a1a10;
  padding-bottom: 0em;
  box-shadow: inset 0 0 50px rgba(255,140,0,0.2);
  animation: flicker 6s infinite ease-in-out;
}

.crt::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
  to bottom,
  rgba(255, 255, 255, 0.02) 0px,
  rgba(0, 0, 0, 0.015) 2px,
  transparent 3px,
  transparent 4px
);
  );
  mix-blend-mode: overlay;
  pointer-events: none;
}

.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,140,0,0.1), rgba(0,0,0,0.25));
  pointer-events: none;
}

/* CRT flicker */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.97; }
}

/* Header */
header {
  background-color: #5a2e0e;
  color: #ffb347;
  padding: 0.05em 0.75em;
  border-bottom: 3px solid #000;
  box-shadow: 0 4px 0 #000;
}

.crt header {
  text-align: center; 
  /* centers H1 and any inline content */
}
/* H1 title with per-letter flicker */
h1 {
  text-align: center;
  font-size: 1rem;
  margin: 0 auto
  color: #ffb347;
  display: inline-block;
  letter-spacing: 2px;
}

h1 span {
  display: inline-block;
  text-shadow:
    0 0 2px #ff6600,
    0 0 4px #ff884d,
    0 0 8px rgba(255,102,0,0.4);
  animation: subtleFlicker 8s infinite;
  animation-timing-function: steps(2, end);
  opacity: 1;
}

/* Gentle per-letter flicker keyframes */
@keyframes subtleFlicker {
  0%, 97%, 100% { opacity: 1; }
  98% { opacity: 0.6; }
}

/* Random delays for per-letter H1 flicker */
h1 span:nth-child(3n)   { animation-delay: 1s; }
h1 span:nth-child(4n)   { animation-delay: 2.2s; }
h1 span:nth-child(5n)   { animation-delay: 3.5s; }
h1 span:nth-child(7n)   { animation-delay: 5.1s; }

/* Nav bar */
nav {
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em;
  margin-top: 0em;
  margin-bottom: 0.5em;
}

nav button {
  font-family: inherit;
  font-size: 0.65rem;
  background-color: #d45d00;
  border: 2px outset #ffb347;
  color: #fff5e1;
  padding: 0.4em 0.8em;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
  transition: box-shadow 0.3s ease, text-shadow 0.3s ease, background-color 0.3s ease;
}

nav button:hover {
  background-color: #ff7b00;
  text-shadow: 0 0 4px #ffb347, 0 0 8px #ff6600;
  box-shadow: 0 0 12px rgba(255,102,0,0.6);
}

/* Main content */
main {
  padding: 0.5em 1em 1em;
}

/* Section fade */
section {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

section.active {
  display: block;
}

/* H2 section titles with subtle flicker */
h2 {
  align-text: left;
  margin-top: 0.25em;
  margin-bottom: 0.75em;
  color: #ffb347;
  font-size: 0.9rem;
  text-shadow:
    0 0 3px #ff6600,
    0 0 6px #ff884d,
    0 0 12px rgba(255,102,0,0.5);
  animation: neonFlicker 6s infinite ease-in-out;
}

@keyframes neonFlicker {
  0%, 97%, 100% {
    opacity: 1;
    text-shadow: 0 0 3px #ff6600, 0 0 6px #ff884d, 0 0 12px rgba(255,102,0,0.5);
  }
  98% {
    opacity: 0.7;
    text-shadow: 0 0 1px #ff6600, 0 0 2px #ff884d;
  }
}

/* Paragraphs */
p {
  font-size: 0.6rem;
  color: #ffe5b4;
  text-shadow: 0 0 2px #ff6600;
  line-height: 1.4;
}

/* Footer */
footer {
  background-color: #1b0f08
  color: #ffb347;
  border-top: none;
  /* remove the harsh line */
}

/* Links */
a {
  color: #ffb347;
  text-decoration: underline;
}

/* Fade in keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Larger screens */
@media (min-width: 768px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .crt {
    width: 600px;
    border: 4px solid #000;
  }

  h1 {
    font-size: 1.2rem;
  }
}
