*,
*::before,
*::after {
  box-sizing: border-box;
}

/* This is a debugging technique that will draw a thin border around page elements to reveal their size
* {
  outline: 1px solid rgba(255, 0, 0, 0.1);
}
*/

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease-in-out;
  font-size: clamp(14px, 1.2vw, 16px);
}

body.loaded {
  opacity: 1;
  transform: translateY(0);
}

body.fade-out {
  opacity: 0;
  filter: brightness(0.8) contrast(1.1);
}

body.fade-out .cursor {
  animation: none;
  opacity: 0.5;
}

/* Title on the left */
.header-title {
  margin-right: auto;
  color: var(--amber-accent, #ffd966);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-shadow: 0 0 6px rgba(255, 191, 0, 0.4);
  cursor: pointer;
}

/* Hover/focus feedback (terminal-appropriate) */
.header-title:hover,
.header-title:focus {
  text-decoration: underline;
}

/* Navigation on the right */
.nav-links {
  display: flex;
  gap: 1.5rem;
}

/* Terminal-style fixed header */
.terminal-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: clamp(3rem, 8vh, 4.5rem);
  padding-inline: clamp(1rem, 4vw, 2rem);

  background-color: #050505;
  padding: 0.75rem 1.5rem;

  display: flex;
  align-items: center;

  justify-content: flex-end;

  gap: 1.5rem;

  border-bottom: 1px solid rgba(255, 191, 0, 0.25);
  z-index: 1000;
}

/* Header links */
.terminal-header a {
  color: var(--amber-accent, #ffd966);
  text-decoration: none;
}

.terminal-header a:hover {
  text-decoration: underline;
}

/* Push terminal content down so it doesn't hide under header */
.terminal {
  margin-top: 5rem;
}


/* CRT scanline overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.02) 1px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.25;
  z-index: 9999;
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
