/* ====================
   Amber Terminal Theme
   ==================== */

: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);

  /* DEFAULT: monospace for content */
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  line-height: 1.6;
  font-size: clamp(15px, 1.4vw, 17px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;

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

.terminal-bullet {
  display: inline-block;
  width: 1.2em;
  color: var(--terminal-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);
  min-height: calc(100vh - 4rem);
  margin: 4rem auto 0;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.terminal-header {
  height: clamp(3rem, 8vh, 4.5rem);
  padding-inline: clamp(1rem, 4vw, 2rem);
  overflow: visible;
}

/* ====================
   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;
}


/* ====================
   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, #ffbf00);

  /* Explicitly enforce monospace */
  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;
}

/* Links inside dropdown */
.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);
}

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

/* Show dropdown on hover OR keyboard focus */
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

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

/* Show indicator on focus or hover */
.nav-item:focus-within .focus-indicator,
.nav-item:hover .focus-indicator {
  opacity: 1;
}

/* Remove default browser focus outline */
.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
   ==================== */

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

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

/* Add cursor glyph via pseudo-element */
.prompt-cursor::after {
  content: "█";
}

/* Blink only when idle */
.post-title-prompt.idle .prompt-cursor {
  opacity: 1;
  animation: blink 1s steps(1) infinite;
}

/* Blink keyframes */
@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: 5.5rem;
  }
}

/* ====================
   Title / CRT Effects
   ==================== */
h1 {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.12em;
  text-shadow:
    0 0 6px rgba(255, 191, 0, 0.4),
    0 0 12px rgba(255, 191, 0, 0.2);
}

.header-title,
.nav-item a,
h1 {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.12em;
}

/* CRT Flicker Title Effect */
.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;
}

/* CRT Power-On Bloom Effect */
.h1-poweron {
  animation: crt-poweron 0.55s ease-out forwards;
}

@keyframes crt-poweron {
  0% {
    opacity: 0;
    filter: brightness(4) blur(6px);
    transform: scaleY(0.95);
  }
  60% {
    opacity: 1;
    filter: brightness(1.8) blur(2px);
  }
  100% {
    filter: none;
    transform: none;
  }
}

/* =========================
   CRT Degauss Effect
   ========================= */
.h1-degauss {
  animation: degauss 0.35s ease-out forwards;
}

@keyframes degauss {
  0% {
    filter: brightness(2.2) contrast(1.4);
    transform: translateY(2px) skewX(0.6deg);
  }
  40% {
    filter: brightness(0.8) contrast(1.1);
    transform: translateY(-2px) skewX(-0.4deg);
  }
  70% {
    filter: brightness(1.1);
    transform: translateY(1px);
  }
  100% {
    filter: none;
    transform: none;
  }
}

/* RGB Phosphor separation */
.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%; }
}

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