/*
 * Theme: "vintage terminal" (dark, amber-on-black CRT aesthetic — sharp
 * corners, dashed ASCII-style rules, Courier-family monospace throughout).
 * Kept isolated from build.ts on purpose: swapping the look of the whole
 * site should only ever require replacing this one file. Previous themes
 * are archived in themes/archive/ before being replaced.
 */

:root {
  --bg: #090907;
  --bg-alt: #14140f;
  --fg: #d8cdb0;
  --fg-dim: #9f9373;
  --accent: #e8a33d;
  --accent-2: #8fae6e;
  --border: #4a4430;
  --font-mono: "Courier New", Courier, ui-monospace, "Cascadia Code",
    "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  /* Neon hover effect, shared by every link on the site. --glow-color
     defaults to --accent but is overridden per context below so each
     link's glow matches its own base color. */
  --glow-text: #fff4de;
  --glow-color: var(--accent);
  --glow-blur-1: 4px;
  --glow-blur-2: 10px;
  --glow-blur-3: 22px;
  --glow-blur-4: 40px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: underline;
}

/* Body-text links (inside markdown content) get a distinct color from
   chrome links (nav/footer/brand/breadcrumb), which keep --accent via
   their own :not(:hover) rules. The breadcrumb, though nested in <main>,
   is chrome too, so it resets --glow-color back to --accent below. */
main a:not(:hover) {
  color: var(--accent-2);
}

main a:hover {
  --glow-color: var(--accent-2);
}

.breadcrumb a:hover {
  --glow-color: var(--accent);
}

a:hover {
  color: var(--glow-text);
  text-shadow:
    0 0 var(--glow-blur-1) var(--glow-color),
    0 0 var(--glow-blur-2) var(--glow-color),
    0 0 var(--glow-blur-3) var(--glow-color),
    0 0 var(--glow-blur-4) var(--glow-color);
  animation: neon-flicker 5s infinite;
}

/* A failing neon tube: mostly steady, with a few slow, gradual voltage
   swings per cycle — both dips and surges. brightness() (unlike opacity)
   can go above 1, so it can render both. Kept well under 3 flashes/second
   (WCAG 2.3.1). */
@keyframes neon-flicker {
  0%, 20%, 32%, 60%, 100% {
    filter: brightness(1);
  }
  26% {
    filter: brightness(0.85);
  }
  46% {
    filter: brightness(1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  a:hover {
    animation: none;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--bg);
}

.skip-link:focus {
  left: 0;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 2px dashed var(--border);
}

.site-header .brand {
  font-size: 1.6rem;
  font-weight: bold;
  text-decoration: none;
}

.site-header .brand:not(:hover) {
  color: var(--accent);
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-header nav a {
  font-size: 0.9rem;
  text-decoration: none;
}

.site-header nav a:not(:hover) {
  color: var(--fg-dim);
}

.site-header nav a[aria-current="page"] {
  border-bottom: 2px solid var(--accent);
}

.site-header nav a[aria-current="page"]:not(:hover) {
  color: var(--fg);
}

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.breadcrumb {
  display: block;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
}

.breadcrumb a:not(:hover) {
  color: var(--fg-dim);
}

.breadcrumb [aria-current="page"] {
  color: var(--fg);
}

h1,
h2,
h3 {
  font-weight: bold;
  color: var(--accent);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h1 {
  border-bottom: 2px double var(--border);
  padding-bottom: 0.5rem;
  margin-top: 0;
}

img {
  max-width: 100%;
  filter: sepia(0.15) contrast(1.05);
}

/* About page author photo: targeted by alt text since raw HTML/classes are
   disabled in markdown content (see note below), so there's no class to
   hook into. Keeps it a small portrait instead of filling the column. */
img[alt="Giacomo Scarpellini"] {
  max-width: 200px;
}

/*
 * No custom classes below: content is plain markdown with raw HTML disabled
 * (editorial content stays sanitized even when written by us, defense in
 * depth), so styling only targets standard elements markdown-it produces.
 */

blockquote {
  border: 1px dashed var(--border);
  background: var(--bg-alt);
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  color: var(--fg-dim);
}

blockquote strong {
  color: var(--accent-2);
}

hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 2rem 0;
}

.site-footer {
  border-top: 2px dashed var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.85rem;
}

.site-footer a {
  margin: 0 0.5rem;
}

.site-footer a:not(:hover) {
  color: var(--fg-dim);
}

.newsletter-form {
  margin-top: 2rem;
}

.newsletter-form label[for="newsletter-email"] {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.newsletter-form-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  min-width: 220px;
}

.newsletter-form button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.newsletter-form button:hover {
  background: var(--accent);
  color: var(--bg);
}

.newsletter-form-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--fg-dim);
}

.newsletter-form-consent input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.newsletter-form-consent span {
  min-width: 0;
}

/* Honeypot: hidden off-screen rather than display:none (some naive bots
   specifically skip display:none fields to avoid honeypots), and pulled out
   of the tab order / assistive tech tree so real keyboard/screen-reader
   users never land on it. See newsletterForm.ts for the field name. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.formula {
  margin: 1.5rem 0;
  padding: 1rem;
  overflow-x: auto;
  border: 1px dashed var(--border);
  background: var(--bg-alt);
  text-align: center;
}

.formula math {
  color: var(--fg);
}

.a11y-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  font-size: 0.75rem;
}

.releases-status {
  color: var(--fg-dim);
}

.app-release-card {
  border: 1px dashed var(--border);
  background: var(--bg-alt);
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
}

.app-release-card h2 {
  margin-top: 0;
}

.latest-badge {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.15rem 0.6rem;
  font-weight: bold;
  text-decoration: none;
}

.release-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.release-list li {
  padding: 0.2rem 0;
}

.release-source {
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--fg-dim);
  font-size: 0.75rem;
}

.a11y-badge:hover {
  border-color: var(--accent);
}
