/* ====================
   Amber Terminal Theme (Corrected)
   ==================== */

:root {
  --bg-color: #050505;
  --amber-text: #ffbf00;
  --amber-accent: #ffd966;
  --amber-glow: rgba(255, 191, 0, 0.35);
}

/* ====================
   Base terminal look
   ==================== */
body {
  background-color: var(--bg-color);
  color: var(--amber-text);
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
  font-size: clamp(15px, 1.4vw, 17px);
  min-height: 100vh;

  /* Fade-in setup */
  opacity: 0;
  transition: opacity 1.2s ease-in;
}

.terminal-bullet {
  display: inline-block;
  width: 1.2em;
  color: var(--amber-accent, #ffb000);
}

.fiction-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
  white-space: normal;
}

.fiction-list li.terminal-line {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.fiction-list li::before {
  content: none;
}

.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease-in;
}

.hidden.show {
  opacity: 1;
  visibility: visible;
}

/* ====================
   Terminal container
   ==================== */
.terminal {
  width: min(100vw, 900px);
  margin: 2rem auto;
  padding: clamp(1rem, 4vw, 2.5rem);
}

/* ====================
   UI / Header Typography
   ==================== */
.header-title,
.nav-links,
.nav-item a,
.terminal-header {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.12em;
}

.terminal-image-block {
  margin-top: 2rem;
  text-align: center;
}

.terminal-image {
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(255, 191, 0, 0.35);
  box-shadow:
    0 0 10px rgba(255, 191, 0, 0.25),
    0 0 20px rgba(255, 191, 0, 0.15);
  border-radius: 4px;
  transition: filter 0.3s ease, transform 0.3s ease;
  z-index: 0;
  position: relative;
}

/* ====================
   Text glow for CRT feel
   ==================== */
body,
.terminal {
  text-shadow:
    0 0 4px var(--amber-glow),
    0 0 10px rgba(255, 191, 0, 0.15);
}

.terminal-line {
  margin-bottom: 0.75rem;
}

/* ====================
   Terminal text output
   ==================== */
.terminal-output {
  white-space: pre-wrap;
  margin-top: 1.5rem;
  color: var(--amber-text);
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.terminal-text {
  white-space: pre-wrap;
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* ====================
   Prompt styling
   ==================== */
.prompt::before {
  content: "sean@gronholt:~$ ";
  color: var(--amber-accent);
}

/* ====================
   Navigation
   ==================== */
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
}

.nav-dropdown {
  position: relative;
}

/* Hidden by default */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 10rem;
  padding: 0.5rem 0;
  background: rgba(5, 5, 5, 0.95);
  border: 1px solid rgba(255, 191, 0, 0.35);
  box-shadow: 0 0 8px rgba(255, 191, 0, 0.25);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.dropdown-menu a {
  display: block;
  padding: 0.4rem 1rem;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-text);
}

.dropdown-menu a:hover {
  background: rgba(255, 191, 0, 0.08);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.focus-indicator {
  opacity: 0;
  animation: blink 1s steps(2, start) infinite;
  color: var(--amber-text);
}

.nav-item:focus-within .focus-indicator,
.nav-item:hover .focus-indicator {
  opacity: 1;
}

.nav-item a:focus {
  outline: none;
}

/* ====================
   Links
   ==================== */
a {
  color: var(--amber-accent);
  text-decoration: none;
}

/* ====================
   Lists
   ==================== */
ul {
  list-style: none;
  padding-left: 0;
}

li::before {
  content: "> ";
  color: var(--amber-accent);
}

/* ====================
   Blinking cursor
   ==================== */
.cursor {
  display: inline-block;
  width: 0.6em;
  margin-left: 4px;
  animation: blink 1s steps(1) infinite;
}

.prompt-cursor {
  display: inline-block;
  margin-left: 2px;
  opacity: 0;
  text-shadow:
    0 0 4px rgba(255, 191, 0, 0.8),
    0 0 8px rgba(255, 191, 0, 0.5);
}

.prompt-cursor::after {
  content: "█";
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ====================
   Responsive tweaks
   ==================== */
@media (max-width: 600px) {
  .terminal-header {
    justify-content: space-between;
  }

  .header-title {
    font-size: 0.9em;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .terminal {
    margin-top: 2rem;
  }
}

/* ====================
   Black & White Story Page
   ==================== */
#story-content {
  max-width: 65ch;
  margin: 3rem auto 4rem;
  padding: 1.5rem 2rem;
  border: 1px solid rgba(255, 191, 0, 0.25);
  border-radius: 6px;
  background: rgba(255, 191, 0, 0.02);
  box-shadow:
    0 0 6px rgba(255, 191, 0, 0.15),
    inset 0 0 8px rgba(255, 191, 0, 0.08);
  text-align: center;
  position: relative;
  overflow: hidden;
}

#story-content::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 191, 0, 0.04) 0px,
      rgba(255, 191, 0, 0.04) 1px,
      transparent 2px,
      transparent 4px
    );
  opacity: 0.25;
  mix-blend-mode: screen;
  animation: story-scanlines 7s linear infinite;
}

@keyframes story-scanlines {
  from { background-position: 0 0; }
  to { background-position: 0 100%; }
}

/* Paragraph fade-in with parallax */
.story-paragraph {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  margin-bottom: 1.5rem;
  line-height: 1.55;
  font-size: clamp(16px, 1.25vw, 18px);
  text-align: center;
}

.story-paragraph.show {
  opacity: 1;
  transform: translateY(0);
}

/* Story title & subtitle */
.story-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40vh;
  margin-bottom: 3rem;
}

.story-title-text,
.story-subtitle-text {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.story-title-text.visible,
.story-subtitle-text.visible {
  opacity: 1;
}

.story-subtitle-text.rgb-flicker {
  text-shadow:
    -0.5px 0 rgba(255, 80, 80, 0.5),
     0.5px 0 rgba(80, 255, 160, 0.4),
     0 0 10px rgba(255, 191, 0, 0.4);
}

/* ----------------------------
   Story Title / Subtitle CRT Effects
----------------------------- */
.h1-crt {
  position: relative;
  overflow: hidden;
  animation: crt-flicker 3.5s infinite;
  text-shadow:
    0 0 6px rgba(255, 191, 0, 0.6),
    0 0 14px rgba(255, 191, 0, 0.35),
    0 0 24px rgba(255, 191, 0, 0.15);
}

.h1-crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.15) 0px,
      rgba(0, 0, 0, 0.15) 1px,
      transparent 2px,
      transparent 4px
    );
  mix-blend-mode: multiply;
  animation: scanline-drift 6s linear infinite;
}

.h1-crt.rgb-flicker {
  text-shadow:
    -1px 0 rgba(255, 80, 80, 0.6),
     1px 0 rgba(80, 255, 160, 0.5),
     0 0 12px rgba(255, 191, 0, 0.5);
}

@keyframes scanline-drift {
  from { background-position: 0 0; }
  to   { background-position: 0 100%; }
}

@keyframes crt-flicker {
  0%   { opacity: 1; }
  3%   { opacity: 0.9; }
  5%   { opacity: 1; }
  7%   { opacity: 0.85; }
  8%   { opacity: 1; }
  100% { opacity: 1; }
}

/* ----------------------------
   Body fade-in (JS triggers)
----------------------------- */
body.fade-in {
  opacity: 1;
}
