/* Bleepforge landing page — pixel-themed to match the app's visual identity.
   Same emerald accent ladder, Press Start 2P display font, Pixelify Sans body,
   VT323 for monospace, 2px borders + no border-radius + crispEdges SVG.
   Mobile-first, single column on narrow viewports. */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #171717;
  --border: #404040;
  --border-strong: #525252;
  --text: #e5e5e5;
  --text-dim: #a3a3a3;
  --text-faint: #737373;
  --accent: #10b981;
  --accent-dim: #059669;
  --accent-bright: #6ee7b7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  min-height: 100vh;
}

body {
  color: var(--text);
  font-family: "Pixelify Sans", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* CRT scanline overlay — matches the in-app Terminal source-type styling
   from the dialog graph nodes. Very subtle (alpha 0.04) so it reads as
   atmosphere, not visual noise. pointer-events: none lets clicks fall
   through to the content beneath. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(16, 185, 129, 0.04) 0 1px,
    transparent 1px 3px
  );
  z-index: 100;
}

/* Honor users who prefer reduced motion — kills the bob, breath, and
   scroll fade-in animations. Static, no-frills layout. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.display {
  font-family: "Press Start 2P", monospace;
  letter-spacing: 0.05em;
  font-weight: normal;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

strong {
  color: var(--text);
  font-weight: 600;
}

code {
  font-family: "VT323", monospace;
  font-size: 1.05em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0 0.4em;
  color: var(--accent-bright);
}

em {
  color: var(--accent-bright);
  font-style: normal;
  font-weight: 600;
}

/* ---- Shell --------------------------------------------------------------- */

.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

section {
  margin-bottom: 5rem;
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

/* Fade-in is gated on `.js-ready` (set by script.js at boot). Without
   JS, sections render visible immediately — no blank page if the
   script fails to load (CDN blocked, file://, JS disabled). */
.js-ready section {
  opacity: 0;
  transform: translateY(14px);
}

.js-ready section.in-view,
.js-ready section.hero,
section.hero {
  opacity: 1;
  transform: translateY(0);
}

section h2 {
  font-size: 1.125rem;
  color: var(--accent);
  margin-bottom: 2rem;
  /* Small pixel-glyph prefix for each section header — a chunky 4×4
     square in accent-bright with a 1px right gap. Reads as a section
     marker, matches the in-app sidebar-active accent bar. */
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

section h2::before {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  background: var(--accent-bright);
  flex-shrink: 0;
}

/* Pixel-art divider between sections — three small emerald squares
   centered with breathing-room margins. Sits AFTER each section so
   sections own their own trailing rhythm. Not rendered on the footer-
   adjacent last section to avoid a divider then a border-top. */
.pixel-divider {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 auto 5rem;
  opacity: 0.45;
}

.pixel-divider span {
  width: 6px;
  height: 6px;
  background: var(--accent);
  display: inline-block;
}

.pixel-divider span:nth-child(2) {
  background: var(--accent-bright);
}

/* ---- Hero ---------------------------------------------------------------- */

.hero {
  text-align: center;
}

.hero-icon svg {
  width: 96px;
  height: 96px;
  display: block;
  margin: 0 auto 1.75rem;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* Slow vertical bob — the bleep is alive, gently. transform-only so
     it's compositor-cheap (no repaints). 4s cycle is slow enough to read
     as ambient, not distracting. */
  animation: hero-bob 4s ease-in-out infinite;
}

@keyframes hero-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.hero h1 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.tagline {
  font-size: 1.125rem;
  color: var(--text);
  max-width: 36rem;
  margin: 0 auto 1.75rem;
}

.accent {
  color: var(--accent);
}

.version-chip {
  display: inline-block;
  position: relative;
  font-family: "VT323", monospace;
  font-size: 1.2rem;
  color: var(--accent-bright);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--accent-dim);
  padding: 0.25rem 1rem;
  letter-spacing: 0.05em;
  z-index: 1;
}

/* Slow emerald breath behind the chip. Same trick as the splash CONTINUE
   button glow in the app: opacity-animated ::after with a blur — never
   animate box-shadow (Chromium repaints the blur every frame and the
   dithering reads as flicker). z-index: -1 keeps it behind the chip's
   border + text. */
.version-chip::after {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -1;
  background: var(--accent);
  filter: blur(14px);
  opacity: 0.18;
  animation: chip-breathe 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes chip-breathe {
  0%, 100% { opacity: 0.14; }
  50% { opacity: 0.36; }
}

/* ---- Downloads ----------------------------------------------------------- */

.downloads h2 {
  text-align: center;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.download-btn {
  display: block;
  position: relative;
  background: var(--bg-elevated);
  border: 2px solid var(--border-strong);
  padding: 1.75rem 1.5rem;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.download-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
  /* Pixel-bevel shadow on hover — light from top-left, dark from
     bottom-right. Static (no animation here), just the lift cue. */
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.5),
              inset 1px 1px 0 0 rgba(110, 231, 183, 0.25),
              inset -1px -1px 0 0 rgba(5, 150, 105, 0.4);
}

.download-btn:hover .display,
.download-btn:hover .platform-icon {
  color: var(--accent-bright);
}

/* Scanline shimmer that sweeps across the button on hover. A thin
   emerald gradient bar slides from left to right via transform —
   compositor-only animation, fires once on enter then settles. */
.download-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(110, 231, 183, 0.08) 50%,
    transparent 100%
  );
  pointer-events: none;
  transition: transform 0.6s ease;
}

.download-btn:hover::before {
  transform: translateX(400%);
}

.platform-icon {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 0.85rem;
  color: var(--accent);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: color 0.15s ease;
}

/* Tux's yellow beak + feet are explicit fills inside the SVG; the body
   fills inherit currentColor and tint with the button's text color on
   hover. The dark-pixel eye punch-outs stay var(--bg)-equivalent so they
   read as cut-outs against whichever body color is active. */
.platform-icon-tux {
  width: 44px;
  height: 44px;
}

.download-btn .display {
  display: block;
  font-size: 1.125rem;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.download-btn .meta {
  display: block;
  font-family: "VT323", monospace;
  font-size: 1.15rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.caveat {
  font-size: 0.95rem;
  color: var(--text-dim);
  text-align: center;
  max-width: 38rem;
  margin: 0 auto;
}

/* ---- Features ------------------------------------------------------------ */

.feature-list {
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

.feature-list li {
  background: var(--bg-elevated);
  border-left: 4px solid var(--accent-dim);
  padding: 1rem 1.25rem;
  color: var(--text-dim);
}

.feature-list strong {
  color: var(--accent);
  font-weight: 600;
}

/* ---- Screenshots --------------------------------------------------------- */

.screenshots-intro {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 38rem;
  margin: -1rem auto 2rem;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.screenshots-tile {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 2px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease,
    box-shadow 0.15s ease;
}

.screenshots-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
  /* Same pixel-bevel shadow the download buttons use on hover — keeps
     the interactive feel consistent across the page. */
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.5),
    inset 1px 1px 0 0 rgba(110, 231, 183, 0.15),
    inset -1px -1px 0 0 rgba(5, 150, 105, 0.3);
}

.screenshots-tile img {
  display: block;
  width: 100%;
  height: auto;
  /* Screenshots are anti-aliased UI captures, not pixel art — let the
     browser smooth-scale them. (Pixel art icons inside the screenshots
     already shipped pre-scaled when the AppImage rendered them.) */
  image-rendering: auto;
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
}

.screenshots-caption {
  padding: 1rem 1.25rem 1.1rem;
}

.screenshots-caption h3 {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.screenshots-caption p {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

/* ---- Context ------------------------------------------------------------- */

.context p {
  margin-bottom: 1rem;
  color: var(--text-dim);
}

.context p:last-child {
  margin-bottom: 0;
}

/* ---- Footer -------------------------------------------------------------- */

footer {
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-faint);
  margin-bottom: 0;
}

footer a {
  color: var(--text-dim);
}

footer a:hover {
  color: var(--accent-bright);
}

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 600px) {
  .shell {
    padding: 2.5rem 1rem 2rem;
  }

  section {
    margin-bottom: 3.5rem;
  }

  .hero-icon svg {
    width: 72px;
    height: 72px;
  }

  .tagline {
    font-size: 1rem;
  }

  .download-btn {
    padding: 1.25rem 1rem;
  }
}

.release-notes {
  margin: 3rem 0;
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
  color: #6ee7b7;
  margin-bottom: 1.25rem;
  opacity: 0.85;
}

.release-meta .dot {
  opacity: 0.4;
}

.release-meta a {
  color: #34d399;
  text-decoration: none;
}

.release-meta a:hover {
  text-decoration: underline;
}

.release-body {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  line-height: 1.6;
}

.release-body h2,
.release-body h3,
.release-body h4 {
  font-family: "Pixelify Sans", sans-serif;
  color: #34d399;
  margin: 1.25rem 0 0.5rem;
}

.release-body h2:first-child,
.release-body h3:first-child {
  margin-top: 0;
}

.release-body ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.release-body li {
  margin: 0.25rem 0;
}

.release-body code {
  font-family: "VT323", monospace;
  background: rgba(52, 211, 153, 0.12);
  padding: 0.05em 0.35em;
  border-radius: 3px;
  font-size: 1.05em;
}

.release-body pre {
  background: #0a0a0a;
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}

.release-body pre code {
  background: none;
  padding: 0;
}

.release-body a {
  color: #6ee7b7;
}