/* localai landing — "ARCADE" theme
   neon cabinet gallery, thumbnails above the fold, CRT vibes.
   fonts: Press Start 2P (display) + VT323 (machine voice) */
:root {
  --bg: #05030f;
  --bg2: #0a0620;
  --panel: #100a26;
  --line: #2b1e52;
  --ink: #efeaff;
  --muted: #9a8fc4;
  --pink: #ff2e88;
  --cyan: #26e5ff;
  --yellow: #ffd23f;
  --green: #3dff8b;
  --font-p: "Press Start 2P", monospace;
  --font-v: "VT323", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: radial-gradient(1200px 700px at 50% -10%, var(--bg2), var(--bg) 70%);
  color: var(--ink); font-family: var(--font-v); font-size: 20px;
  overflow-x: hidden; min-height: 100vh;
}
::selection { background: var(--pink); color: #fff; }

/* ---------- background layers ---------- */
#stars { position: fixed; inset: 0; z-index: 0; }
.crt {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .07;
  background: repeating-linear-gradient(0deg, transparent 0 2px, #000 2px 4px);
}
.vignette {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
}

/* ---------- music toggle ---------- */
#sound {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  font-family: var(--font-p); font-size: .55rem;
  background: var(--panel); color: var(--muted);
  border: 2px solid var(--line); padding: .6rem .8rem; cursor: pointer;
  box-shadow: 0 0 0 2px #000;
}
#sound[aria-pressed="true"] { color: var(--green); border-color: var(--green); box-shadow: 0 0 18px rgba(61,255,139,.4), 0 0 0 2px #000; }

/* ---------- marquee ---------- */
.marquee {
  position: relative; z-index: 2; overflow: hidden;
  border-bottom: 2px solid var(--line);
  background: #000; padding: .55rem 0;
}
.mq-track {
  display: flex; width: max-content;
  animation: scroll 24s linear infinite;
  font-family: var(--font-p); font-size: .6rem; letter-spacing: .1em;
  color: var(--yellow); text-shadow: 0 0 8px rgba(255,210,63,.5);
}
@keyframes scroll { to { transform: translateX(-50%); } }
.c1 { color: var(--cyan); }
.c2 { color: var(--pink); }
.c3 { color: var(--green); }

main { position: relative; z-index: 2; }

/* ---------- hero (compact: gallery must be above the fold) ---------- */
#hero {
  text-align: center; padding: 3.2rem 1.5rem 1.6rem;
}
.neon {
  margin: 0; font-family: var(--font-p);
  font-size: clamp(1.6rem, 5.5vw, 3.4rem);
  color: var(--cyan);
  text-shadow:
    0 0 8px var(--cyan), 0 0 28px rgba(38,229,255,.6),
    0 0 60px rgba(38,229,255,.35);
  animation: flicker 6s infinite;
}
.neon .c2 { color: var(--pink); text-shadow: 0 0 8px var(--pink), 0 0 28px rgba(255,46,136,.6), 0 0 60px rgba(255,46,136,.35); }
.neon .sub1 {
  display: block; margin-top: .8rem;
  font-size: clamp(.9rem, 3vw, 1.7rem); letter-spacing: .55em;
  color: var(--yellow); text-shadow: 0 0 10px rgba(255,210,63,.7);
}
@keyframes flicker {
  0%, 92%, 96%, 100% { opacity: 1; }
  93%, 95% { opacity: .55; }
}
.tagline {
  color: var(--muted); max-width: 62ch; margin: 1.4rem auto 1.6rem;
  font-size: 1.15rem; line-height: 1.45;
}
.tagline b { color: var(--green); }

.hud {
  display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap;
  font-family: var(--font-p); font-size: .55rem;
}
.hud-item {
  border: 2px solid var(--line); background: rgba(16,10,38,.8);
  padding: .55rem .9rem; display: flex; gap: .8rem; align-items: center;
  box-shadow: 0 0 0 2px #000, inset 0 0 18px rgba(43,30,82,.5);
}
.hud-item span { color: var(--muted); }
.hud-item b { color: var(--cyan); }
.blink { animation: blink 1s steps(1) infinite; color: var(--yellow) !important; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- gallery ---------- */
#gallery { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.5rem 5rem; }
.grid { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.loading {
  font-family: var(--font-p); color: var(--muted); font-size: .7rem;
  text-align: center; padding: 3rem 0;
}
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* arcade cabinet card */
.card {
  position: relative; display: block; text-decoration: none; color: inherit;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 0 0 0 2px #000, 0 14px 34px rgba(0,0,0,.5);
  padding: .8rem .8rem 1rem;
  opacity: 0; transform: translateY(26px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.9,.3,1.25), border-color .2s, box-shadow .25s;
}
.card.in { opacity: 1; transform: none; }
.card:hover, .card:focus-visible {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px #000, 0 0 26px rgba(255,46,136,.45), 0 18px 40px rgba(0,0,0,.6);
  transform: translateY(-6px) scale(1.015);
}

/* thumbnail screen */
.screen {
  position: relative; aspect-ratio: 16/10; overflow: hidden;
  background: #000; border: 2px solid #000;
  outline: 2px solid var(--line); outline-offset: 2px;
}
.screen img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  image-rendering: pixelated;
  transform: scale(1.02);
  transition: transform .5s ease, filter .3s;
  filter: saturate(1.15) contrast(1.05);
}
.card:hover .screen img { transform: scale(1.08) translateY(-2px); filter: saturate(1.35) contrast(1.1); }
/* fallback if no thumb: animated pixel pattern */
.screen .nothumb {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    repeating-conic-gradient(var(--line) 0% 25%, transparent 0% 50%) 0 0 / 24px 24px;
  font-family: var(--font-p); font-size: .6rem; color: var(--muted);
}
/* scanline sheen on the screen */
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.22) 3px 4px);
  mix-blend-mode: multiply;
}
/* power LED */
.led {
  position: absolute; top: .65rem; right: .65rem; z-index: 2;
  width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
  animation: blink 2.4s steps(1) infinite;
}
.led.draft { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }

/* coin slot strip */
.slot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .85rem;
}
.card h3 {
  margin: 0; font-family: var(--font-p); font-size: .8rem; line-height: 1.5;
  color: var(--ink);
}
.card:hover h3 { color: var(--yellow); text-shadow: 0 0 10px rgba(255,210,63,.5); }
.card p {
  margin: .55rem 0 .8rem; color: var(--muted); font-size: 1.05rem; line-height: 1.35;
  min-height: 2.7em;
}
.tags { display: flex; gap: .45rem; flex-wrap: wrap; font-family: var(--font-p); font-size: .5rem; }
.tag { border: 1px solid var(--line); padding: .3rem .5rem; color: var(--muted); }
.tag.live { color: var(--green); border-color: var(--green); }
.tag.draft { color: var(--yellow); border-color: var(--yellow); }
.play {
  font-family: var(--font-p); font-size: .6rem; color: var(--pink);
  white-space: nowrap;
  transition: color .2s, text-shadow .2s;
}
.card:hover .play { color: var(--cyan); text-shadow: 0 0 12px var(--cyan); animation: blink .8s steps(1) infinite; }
.empty { color: var(--muted); font-family: var(--font-p); font-size: .7rem; text-align: center; padding: 3rem 0; }

/* ---------- footer dock (sticky bottom) ---------- */
footer#dock {
  position: sticky; bottom: 0; z-index: 30;
  border-top: 2px solid var(--line);
  padding: .7rem 1.5rem;
  text-align: center;
  background: linear-gradient(rgba(0,0,0,.72), rgba(0,0,0,.92));
  backdrop-filter: blur(8px);
  box-shadow: 0 -12px 30px rgba(0,0,0,.55);
}
footer .fine { color: var(--muted); font-family: var(--font-p); font-size: .5rem; letter-spacing: .08em; margin: 0; }

.p1 {
  width: 34px; height: 34px; display: block;
  image-rendering: pixelated;               /* pixel-art touch on the logo */
  border: 2px solid #000; outline: 2px solid var(--line); outline-offset: 1px;
  filter: saturate(1.25) contrast(1.08);
  transition: filter .25s, outline-color .2s;
}

/* operator badge in hero — doubles as back link to ponkcoding.com */
.operator {
  display: inline-flex; align-items: center; gap: .7rem;
  margin-bottom: 1.4rem;
  border: 2px solid var(--line); background: rgba(16,10,38,.7);
  padding: .4rem .9rem;
  font-family: var(--font-p); font-size: .5rem; color: var(--muted);
  box-shadow: 0 0 0 2px #000;
  text-decoration: none;
  transition: border-color .2s, box-shadow .25s, transform .2s;
}
.operator:hover {
  border-color: var(--cyan); transform: translateY(-2px);
  box-shadow: 0 0 0 2px #000, 0 0 22px rgba(38,229,255,.45);
}
.operator:hover .p1 { outline-color: var(--cyan); filter: saturate(1.5) contrast(1.12) drop-shadow(0 0 6px rgba(38,229,255,.6)); }
.operator b { color: var(--cyan); }
.operator:hover b { color: var(--yellow); text-shadow: 0 0 10px rgba(255,210,63,.55); }
.operator .ext { color: var(--pink); }
.operator:hover .ext { animation: blink 1s steps(1) infinite; }
.p1.mini { width: 26px; height: 26px; }

/* ---------- responsive ---------- */
@media (max-width: 700px) {
  body { font-size: 18px; }
  .grid { grid-template-columns: 1fr; }
  #hero { padding-top: 2.2rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .mq-track, .blink, .led, .neon, .play, .dots::after { animation: none !important; }
  .card { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
