/* =====================================================================
   BEMOREIAN — Retro Arcade Cabinet portfolio
   Plain CSS, no build step. CSS custom properties drive the palette.
   ===================================================================== */

:root {
  /* Full arcade-rainbow palette — warm CGA/EGA reds + ambers AND cool neon */
  --arc-red:     #ff2e4d;
  --arc-orange:  #ff7b29;
  --arc-amber:   #ffd166;
  --arc-yellow:  #fff04d;
  --arc-green:   #36f5a0;
  --arc-cyan:    #2ee6ff;
  --arc-blue:    #4d7bff;
  --arc-magenta: #ff3df0;
  --arc-purple:  #9b5cff;

  --bg-deep:   #06010f;
  --bg-purple: #150a2e;
  --bg-panel:  #0c0620;

  --gold-1: #ffe79a;
  --gold-2: #d9a23b;
  --gold-3: #8a5a14;

  --ink:    #f3e9ff;
  --ink-dim:#b3a6d4;

  --font-pixel: 'Press Start 2P', 'Courier New', monospace;
  --font-term:  'VT323', 'Courier New', monospace;

  --maxw: 1240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a1150 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-purple) 0%, var(--bg-deep) 55%, #02000a 100%);
  color: var(--ink);
  font-family: var(--font-term);
  overflow-x: hidden;
  min-height: 100vh;
  /* Subtle procedural pixel-grid texture */
  background-attachment: fixed;
}

body::before {
  /* pixel-grid texture overlay */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(rgba(120,80,200,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,80,200,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mix-blend-mode: screen;
}

/* ---------- Starfield canvas ---------- */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ---------- CRT overlays ---------- */
.crt-scanlines {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.0) 0px,
    rgba(0,0,0,0.0) 2px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0.0) 4px
  );
  opacity: 0.5; /* the dark bands are already faint; ~8% effective coverage */
  mix-blend-mode: multiply;
}
.crt-vignette {
  position: fixed;
  inset: 0;
  z-index: 91;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* keep all real content above overlays/texture */
.hero, main, .footer { position: relative; z-index: 10; }

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.2rem 3rem;
}
.hero-inner { width: 100%; max-width: var(--maxw); }

.coin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 760px;
  margin: 0 auto 2.6rem;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--arc-cyan);
}
.coin-blink { letter-spacing: 1px; animation: softblink 1.4s steps(2) infinite; }

.chiptune-btn {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--arc-amber);
  background: #1a0e33;
  border: 2px solid var(--gold-2);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 0 0 2px #000 inset, 0 0 12px rgba(255,209,102,0.25);
  transition: transform .12s, box-shadow .2s, color .2s;
}
.chiptune-btn:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 0 0 2px #000 inset, 0 0 22px rgba(255,209,102,0.6); }
.chiptune-btn.on { color: var(--arc-green); border-color: var(--arc-green); box-shadow: 0 0 0 2px #000 inset, 0 0 22px rgba(54,245,160,0.6); }
.chip-ico { display: inline-block; }
.chiptune-btn.on .chip-ico { animation: spin 1.6s linear infinite; }

/* ---------- THE BEMOREIAN LOGO ---------- */
.logo {
  font-family: var(--font-pixel);
  font-size: clamp(2.1rem, 8.5vw, 6.4rem);
  line-height: 1;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.02em;
  letter-spacing: 0.02em;
  user-select: none;
}
.logo-letter {
  display: inline-block;
  /* each letter a distinct arcade-rainbow hue (screen-printed marquee look),
     with a top-white sheen → solid colour gradient for a glossy bevel */
  --hue: #ff3b3b;
  background: linear-gradient(180deg, #fff7e0 4%, var(--hue) 30%, var(--hue) 72%, #00000055 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* chunky bevel: stacked dark drops give the pixel block depth */
  text-shadow:
    0 3px 0 #2a0024,
    0 5px 0 #100010,
    4px 6px 0 rgba(0,0,0,0.5);
  filter:
    drop-shadow(0 0 4px rgba(255,255,255,0.3))
    drop-shadow(0 0 18px var(--hue))
    drop-shadow(0 0 30px rgba(255,255,255,0.12));
  animation: pixbob 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s);
}
/* B-E-M-O-R-E-I-A-N → full arcade rainbow sweep */
.logo-letter:nth-child(1) { --hue: #ff2e4d; } /* red     */
.logo-letter:nth-child(2) { --hue: #ff7b29; } /* orange  */
.logo-letter:nth-child(3) { --hue: #ffd166; } /* amber   */
.logo-letter:nth-child(4) { --hue: #fff04d; } /* yellow  */
.logo-letter:nth-child(5) { --hue: #36f5a0; } /* green   */
.logo-letter:nth-child(6) { --hue: #2ee6ff; } /* cyan    */
.logo-letter:nth-child(7) { --hue: #4d7bff; } /* blue    */
.logo-letter:nth-child(8) { --hue: #9b5cff; } /* purple  */
.logo-letter:nth-child(9) { --hue: #ff3df0; } /* magenta */

.tagline {
  font-family: var(--font-pixel);
  font-size: clamp(0.5rem, 1.6vw, 0.78rem);
  color: var(--arc-amber);
  letter-spacing: 2px;
  margin: 1.8rem 0 0.4rem;
  text-shadow: 0 0 10px rgba(255,123,41,0.6);
}
.press-start {
  font-family: var(--font-pixel);
  font-size: clamp(0.55rem, 1.7vw, 0.9rem);
  color: var(--arc-green);
  letter-spacing: 3px;
  margin: 0.2rem 0 2.4rem;
  animation: hardblink 1.05s steps(2) infinite;
  text-shadow: 0 0 14px rgba(54,245,160,0.7);
}

.select-arrow {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--arc-cyan);
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(46,230,255,0.7);
}
.select-arrow svg { animation: bobdown 1.4s ease-in-out infinite; }
.select-arrow:hover { color: #fff; }

/* =====================================================================
   GAME GRID / CABINETS
   ===================================================================== */
.cabinet {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.2rem 4rem;
}
.section-title {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: clamp(0.9rem, 3vw, 1.7rem);
  letter-spacing: 3px;
  margin: 0 0 2.6rem;
}
.section-title .ti-1 { color: var(--arc-red); }
.section-title .ti-2 { color: var(--arc-amber); }
.section-title .ti-3 { color: var(--arc-cyan); }
.section-title span { text-shadow: 0 0 14px currentColor; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
  justify-items: center;
}

/* ---------- Arcade cabinet card ---------- */
.cab {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 360px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border-radius: 10px;
  /* chunky bevelled gold-amber frame over black inner */
  padding: 8px;
  background:
    linear-gradient(150deg, var(--gold-1) 0%, var(--gold-2) 38%, var(--gold-3) 70%, #3a2407 100%);
  box-shadow:
    0 0 0 2px #000,
    0 10px 26px rgba(0,0,0,0.6),
    0 0 0 4px rgba(255,231,154,0.15);
  transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .25s, filter .25s;
  cursor: pointer;
}
.cab-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #05030d;
  border: 2px solid #000;
  border-radius: 6px;
  overflow: hidden;
}

/* marquee */
.cab-marquee {
  padding: 9px 8px;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  line-height: 1.35;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(180deg, #1a0c33 0%, #0a0418 100%);
  border-bottom: 2px solid var(--accent, var(--arc-cyan));
  text-shadow: 0 0 8px var(--accent, var(--arc-cyan));
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* screen */
.cab-screen {
  position: relative;
  flex: 1;
  background: #02030a;
  overflow: hidden;
}
.cab-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cab-screen::after {
  /* faint screen scanline + glass curve */
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.22) 3px),
    radial-gradient(120% 90% at 50% 30%, rgba(255,255,255,0.06), transparent 60%);
  pointer-events: none;
}
.ext-badge {
  position: absolute;
  top: 6px; right: 6px;
  z-index: 2;
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: #02030a;
  background: var(--arc-amber);
  padding: 3px 5px;
  border-radius: 3px;
  letter-spacing: 1px;
}

/* control panel */
.cab-panel {
  background: linear-gradient(180deg, #120a26 0%, #0a0518 100%);
  border-top: 2px solid #000;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cab-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 0.46rem;
  letter-spacing: 1px;
}
.genre-tag { color: var(--accent, var(--arc-cyan)); text-shadow: 0 0 6px var(--accent); }
.ver-badge {
  color: #05030d;
  background: var(--accent, var(--arc-cyan));
  padding: 3px 6px;
  border-radius: 3px;
}
.ver-badge.is-new { background: var(--arc-green); animation: softblink 1s steps(2) infinite; }

.start-btn {
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  text-align: center;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(180deg, var(--arc-red), #b3001f);
  border: 2px solid #ffcaca;
  border-radius: 4px;
  padding: 9px 6px;
  text-shadow: 0 0 8px rgba(255,255,255,0.6);
  box-shadow: 0 0 14px rgba(255,46,77,0.5), 0 3px 0 #6e0014;
  transition: transform .1s, box-shadow .2s, background .2s;
}

/* hover state */
.cab:hover, .cab:focus-visible {
  transform: translateY(-6px) scale(1.05);
  outline: none;
  box-shadow:
    0 0 0 2px #000,
    0 18px 38px rgba(0,0,0,0.7),
    0 0 26px var(--accent, var(--arc-cyan)),
    0 0 60px rgba(255,255,255,0.08);
  filter: saturate(1.15);
}
.cab:hover .cab-marquee { color: #fff; text-shadow: 0 0 16px var(--accent); }
.cab:hover .start-btn {
  background: linear-gradient(180deg, #ff5d77, var(--arc-red));
  box-shadow: 0 0 26px rgba(255,46,77,0.9), 0 3px 0 #6e0014;
  animation: pulsebtn 0.5s ease-in-out infinite;
}
.cab:active { transform: translateY(-2px) scale(1.02); }

/* =====================================================================
   ABOUT
   ===================================================================== */
.about {
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem 1.2rem 4rem;
}
.about-card {
  background: linear-gradient(180deg, rgba(26,12,51,0.85), rgba(8,4,20,0.9));
  border: 2px solid var(--gold-2);
  border-radius: 10px;
  padding: 2rem 1.8rem;
  box-shadow: 0 0 0 2px #000 inset, 0 0 30px rgba(255,209,102,0.12);
}
.about-title {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  color: var(--arc-amber);
  letter-spacing: 2px;
  margin: 0 0 1.2rem;
  text-shadow: 0 0 12px rgba(255,209,102,0.5);
}
.about-card p {
  font-family: var(--font-term);
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 1rem;
}
.about-card p strong { color: var(--arc-cyan); }
.about-sub { color: var(--ink-dim) !important; }
.about-links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.4rem; }
.pixel-link {
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  color: var(--arc-magenta);
  text-decoration: none;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(255,61,240,0.5);
  transition: color .2s, text-shadow .2s;
}
.pixel-link:hover { color: var(--arc-cyan); text-shadow: 0 0 14px var(--arc-cyan); }

/* =====================================================================
   FOOTER
   ===================================================================== */
.footer {
  text-align: center;
  padding: 1.6rem 1rem 2.4rem;
  border-top: 1px solid rgba(155,92,255,0.25);
}
.footer p {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--ink-dim);
  letter-spacing: 1px;
  margin: 0;
}

/* =====================================================================
   ANIMATIONS
   ===================================================================== */
@keyframes pixbob   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bobdown  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes hardblink{ 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes softblink{ 0%,60% { opacity: 1; } 61%,100% { opacity: 0.3; } }
@keyframes blinkc   { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes pulsebtn { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes spin     { to { transform: rotate(360deg); } }

.blink { animation: blinkc 0.9s steps(2) infinite; color: var(--arc-magenta); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1100px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
}
@media (max-width: 520px) {
  .game-grid { grid-template-columns: 1fr; }
  .cab { max-width: 320px; }
  .coin-row { font-size: 0.5rem; }
  .about-card p { font-size: 1.15rem; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
}
