/* Amber-on-black overrides for the Digio theme. Loaded after /css/styles.css. */
:root {
  --amber: #ffb000;
  --amber-dim: #b37a00;
  --amber-hot: #ffd24d;
  --bg: #0a0600;
  --alert: #ff4a2e;
}

html { background-color: var(--bg); }

body {
  color: var(--amber);
  background-color: var(--bg);
  font-family: 'Fira Code', monospace;
  text-shadow: 0 0 4px rgba(255, 176, 0, 0.35);
}

/* faint scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.12) 3px
  );
}

/* headings: pixel font */
h1, h2, h3, h4, h5, h6, .toc-container h4 {
  font-family: 'VT323', monospace;
  font-weight: 400;
  color: var(--amber-hot);
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.55);
  letter-spacing: 0.02em;
}
h1 { font-size: 2.6rem; line-height: 1.1; }
h2 { font-size: 2rem; line-height: 1.2; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.35rem; }
h5, h6 { font-size: 1.15rem; }

/* post body: readable serif (page.html wraps content in .flex-1) */
.flex-1 p, .flex-1 li, .flex-1 blockquote {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.75;
  text-shadow: none;
}
.flex-1 code, .flex-1 pre, .flex-1 pre * {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  text-shadow: none;
}
.flex-1 pre {
  border: 1px solid var(--amber-dim);
  padding: 1rem;
  overflow-x: auto;
}
.flex-1 img { max-width: 100%; height: auto; }

/* links */
a { color: var(--amber); }
a:hover:not(.block):not(.not-prose) { color: var(--amber-hot); }

/* theme hard-codes white/pink/gray utilities */
.border-white { border-color: var(--amber) !important; }
.hover\:border-pink-300:hover,
.focus\:ring-pink-300:focus { border-color: var(--amber-hot) !important; --tw-ring-color: var(--amber-hot) !important; }
.text-white { color: var(--amber-hot) !important; }
.text-gray-300, .text-gray-400 { color: var(--amber-dim) !important; }
blockquote { border-left-color: var(--amber); color: var(--amber); }
hr { border-top-color: var(--amber-dim); }
::selection { background: var(--amber); color: var(--bg); }

/* tint the stock black & white pixel art amber */
header img, .not-prose img, body > div > img, body > div img[src$=".png"]:not(.flex-1 img) {
  filter: sepia(1) saturate(6) hue-rotate(-12deg) brightness(0.95);
}
.flex-1 img { filter: none; }

/* blinking cursor after the main page title */
main h1::after {
  content: "_";
  margin-left: 0.15em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  main h1::after { animation: none; }
  * { transition: none !important; }
}

/* frog divider banner: keep true colours, never overflow on narrow screens */
img[src$="border-home1.png"] {
  filter: none !important;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* hero art is already drawn in the site palette; don't re-tint it */
picture img, img[src$="portrait-hero.gif"], img[src$="portrait-hero.png"] { filter: none !important; }

/* listening-card frog reuses the banner frog's exact colours */
img[src$="listening-frog.png"],
img[src$="listening-frog.gif"] { filter: none !important; image-rendering: pixelated; }

/* status heading: trailing dots "type out" on a loop, like something in progress */
.status-dots {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  width: 3ch;
  animation: status-dots 1.6s step-end infinite;
}
@keyframes status-dots { 0% { width: 0; } 25% { width: 1ch; } 50% { width: 2ch; } 75% { width: 3ch; } }
@media (prefers-reduced-motion: reduce) {
  .status-dots { animation: none; width: auto; }
}

/* post TOC panel: game-menu frame (9-slice) with Oggie peeking over the top edge */
img[src$="toc-peek.png"] { filter: none !important; image-rendering: pixelated; }
.toc-container {
  position: sticky;
  top: 3.5rem;
  overflow: visible;
  max-height: none;
  flex: none;
  align-self: flex-start;
  box-sizing: border-box;
  width: 16rem;
  margin-left: 2.5rem;
  margin-top: 2.25rem;
  padding: 0.5rem 0.75rem 0.75rem;
  border: 9px solid transparent;
  border-image: url("/toc-frame.png") 9 / 9px stretch;
  background: rgba(255, 176, 0, 0.04);
  image-rendering: pixelated;
}
.toc-container .toc-peek-wrap {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  line-height: 0;
}
.toc-container .toc-peek { display: block; max-width: none; transition: transform 0.35s steps(5); }
/* hidden behind the frame until no banner Oggie is on screen, then he hops up */
.toc-container.oggie-armed .toc-peek { transform: translateY(100%); }
.toc-container.oggie-armed.oggie-up .toc-peek { transform: none; }
@media (prefers-reduced-motion: reduce) { .toc-container .toc-peek { transition: none; } }
.toc-container h4 { text-align: center; }
main .flex > .flex-1 { min-width: 0; }
@media (max-width: 900px) { .toc-container { display: none; } }

/* homepage: tighten vertical rhythm */
main > div { padding-top: 1rem; padding-bottom: 1rem; }
main .grid > .not-prose { padding: 1rem 1.25rem; }
main .grid.lg\:grid-rows-2 { grid-template-rows: auto auto; align-content: stretch; }
body > div.mt-8 { margin-top: 0.75rem; }
body > div.py-4 { padding-top: 0.5rem; }
body > div.py-2 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
/* recent-post cards: teaser, not the whole post */
.post-excerpt {
  max-height: 9.5rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.post-excerpt h1, .post-excerpt h2, .post-excerpt h3, .post-excerpt h4 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.post-excerpt p { margin: 0 0 0.5rem; }

/* hero: portrait (left half) + Recent / Topics boxes (right half), each with its own border */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: stretch; }
.hero picture { line-height: 0; }
.hero img { image-rendering: pixelated; display: block; width: 100%; height: auto; }
.hud-col { position: relative; height: 0; min-height: 100%; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.hud-box {
  flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.2rem;
  border: 2px solid #ffb000; background: #0b0b08; padding: 0.2rem 0.6rem;
  font-family: "VT323", monospace; line-height: 1.05;
}
.hud-label { color: #c98500; font-size: 1.05rem; text-transform: lowercase; }
.hud-label::after { content: ":"; }
.hud-recent a {
  font-size: 1.3rem; text-decoration: underline;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.topic-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; }
.topic {
  font-size: 1.05rem; line-height: 1; text-align: center;
  color: #ffb000; background: transparent; border: 2px solid #c98500;
  padding: 0.05rem 0.3rem; cursor: pointer; text-decoration: none;
}
.topic:hover, .topic:focus-visible { background: rgba(255, 176, 0, 0.15); border-color: #ffb000; outline: none; }
.topic[aria-pressed="true"] { background: #ffb000; border-color: #ffb000; }
.hud-box a, .hud-box a:visited { color: #ffb000; }
.hud-box a:hover { color: #ffd060; }
.hud-box a.topic[aria-pressed="true"], .hud-box a.topic[aria-pressed="true"]:hover { color: #0b0b08; }
.post-card[hidden] { display: none !important; }
.topic-status { margin: 0 0 0.75rem; color: #c98500; }
.post-heading { margin: 1.25rem 0 0.5rem; }
