/* ================================================================
   CHROMADI — styles.css
   Fonts: m6x11 (body/pixel text), GravityBold8 (headings)
   Place font files in assets/fonts/ and uncomment @font-face blocks
================================================================ */

@font-face {
  font-family: 'm6x11';
  src: url('../assets/fonts/m6x11.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'GravityBold8';
  src: url('../assets/fonts/GravityBold8.ttf') format('truetype');
  font-weight: 700;
}

/* ----------------------------------------------------------------
   TOKENS
---------------------------------------------------------------- */
:root {
  --black:       #000000;
  --ink:         #0a0a0a;
  --ink-soft:    #111111;
  --ink-mid:     #1a1a1a;
  --white:       #ffffff;
  --grey:        #666666;
  --grey-light:  #999999;

  /* Active hue — JS writes these via setTheme() */
  --theme:       #FFFFFF;
  --theme-rgb:   255, 255, 255;
  --theme-dark:  rgba(255,255,255,.12);
  --theme-glow:  rgba(255,255,255,.35);

  --font-pixel:  'm6x11', 'Courier New', monospace;
  --font-head:   'GravityBold8', 'Impact', monospace;

  --nav-h:       72px;
  --max-w:       1200px;
  --pad:         clamp(20px, 4vw, 140px);
}

/* ----------------------------------------------------------------
   RESET + BASE
---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-pixel);
  line-height: 1.5;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ----------------------------------------------------------------
   THEME WASH  (fixed full-page tint driven by active character)
---------------------------------------------------------------- */
.theme-wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 35%,
    rgba(var(--theme-rgb), .14), transparent 72%);
  transition: background .7s ease;
}

/* ----------------------------------------------------------------
   UTILITIES
---------------------------------------------------------------- */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  position: relative;
  z-index: 1;
}

.heading-pixel {
  font-family: var(--font-head);
  font-size: clamp(24px, 3vw, 40px);
  color: var(--white);
  line-height: 1.2;
  letter-spacing: .5px;
  text-align: center;
}

.body-pixel {
  font-family: var(--font-pixel);
  font-size: clamp(14px, 1.6vw, 22px);
  color: rgba(255,255,255,.55);
  line-height: 1.6;
  text-align: center;
}

/* ----------------------------------------------------------------
   NAV
---------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 60px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav__social {
  display: flex;
  gap: 18px;
  align-items: center;
}

.nav__icon {
  color: rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  transition: color .2s;
}
.nav__icon:hover { color: var(--white); }

.nav__links {
  display: flex;
  gap: clamp(24px, 3vw, 56px);
  align-items: center;
}

.nav__link {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 1.6vw, 24px);
  color: rgba(255,255,255,.5);
  letter-spacing: 1px;
  transition: color .2s;
}
.nav__link:hover { color: var(--white); }
.nav__link--active {
  color: var(--theme);
  transition: color .5s;
}

.nav__right { display: flex; align-items: center; }

.nav__steam {
  font-family: var(--font-head);
  font-size: clamp(10px, 1vw, 14px);
  color: var(--black);
  background: var(--theme);
  padding: 8px 16px;
  border-radius: 6px;
  letter-spacing: .5px;
  transition: background .4s, color .4s, box-shadow .3s;
}
.nav__steam:hover {
  box-shadow: 0 0 18px -4px rgba(var(--theme-rgb), .7);
}

/* ----------------------------------------------------------------
   HERO
---------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.hero__bg {
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / 558;
  background-image: url('../assets/sprites/hero-bg.png');
  background-size: cover;
  background-position: center top;
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: clamp(24px, 4.7vw, 68px) 24px clamp(24px, 4.3vw, 62px);
}

.hero__logo {
  width: clamp(240px, 42.5vw, 611px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 30px rgba(var(--theme-rgb), .25));
  transition: filter .6s;
}

.hero__tagline {
  font-family: var(--font-head);
  font-size: clamp(11px, 1.4vw, 20px);
  color: rgba(255,255,255,.8);
  letter-spacing: 3px;
  text-align: center;
}

/* ----------------------------------------------------------------
   LORE / OVERVIEW
---------------------------------------------------------------- */
.lore {
  position: relative;
  z-index: 1;
  padding: 32px 0;
  background: linear-gradient(to bottom, transparent, var(--black) 20%);
}

.lore__text {
  max-width: 820px;
  margin: 12px auto 0;
}

.lore__heading {
  background: linear-gradient(90deg,
    #FF0C00, #FE7A00, #E9FF00, #26FF00, #005AFF, #AA00FF, #FF0C00);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow-shift 8s linear infinite;
}

@keyframes rainbow-shift {
  from { background-position: 0% 50%; }
  to   { background-position: -200% 50%; }
}

/* ----------------------------------------------------------------
   CHROMA CREW
---------------------------------------------------------------- */
.crew {
  position: relative;
  padding: 40px 0 40px;
  overflow: hidden;
}

/* The big coloured glow that shifts when you pick a character */
.crew__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%,
    rgba(var(--theme-rgb), .12), transparent 70%);
  pointer-events: none;
  transition: background .7s ease;
}

.crew__sub {
  max-width: 700px;
  margin: 24px auto 24px;
}

.crew__grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 2.5vw, 44px);
  justify-content: center;
  align-items: flex-end;
}

/* Individual character card */
.crew-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.crew-card__name {
  font-family: var(--font-pixel);
  font-size: clamp(14px, 1.6vw, 22px);
  letter-spacing: 1px;
  /* color is set inline per character */
  transition: opacity .2s;
}

.crew-card__sprite-wrap {
  position: relative;
  width: clamp(72px, 7vw, 100px);
  height: clamp(72px, 7vw, 100px);
}

.crew-card__border {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 12px;
  transition: border-color .3s, box-shadow .3s;
}

.crew-card__img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
  image-rendering: pixelated;
}

/* Hover state */
.crew-card:hover .crew-card__border {
  border-color: currentColor;
}
.crew-card:hover .crew-card__name {
  opacity: 1;
}

/* Active / selected character */
.crew-card[aria-pressed="true"] .crew-card__border {
  border-color: var(--white);
  box-shadow: 0 0 0 3px rgba(255,255,255,.15),
              0 0 20px -4px rgba(var(--theme-rgb), .6);
}
.crew-card[aria-pressed="true"] .crew-card__name {
  opacity: 1;
}

/* ----------------------------------------------------------------
   SCREENSHOTS
---------------------------------------------------------------- */
.shots {
  padding: 100px 0;
  background: rgba(255,255,255,.04);
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.shots__heading {
  text-align: left;
  font-size: clamp(28px, 4vw, 56px);
}

.shots__sub {
  text-align: left;
  max-width: 720px;
  margin-top: 20px;
  margin-bottom: 48px;
}

.shots__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.shot {
  aspect-ratio: 16/10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: var(--ink-mid);
  /* grayscale until scrolled into view */
  filter: grayscale(1) brightness(.7);
  transform: scale(1.01);
  transition: filter 1s ease, transform 1.2s ease;
}
.shot.in-view {
  filter: grayscale(0) brightness(1);
  transform: scale(1);
}
.shot img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Placeholder shown until real screenshots are dropped in */
.shot__placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: rgba(255,255,255,.2);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------
   TRAILER
---------------------------------------------------------------- */
.trailer {
  padding: 100px 0;
}

.trailer .heading-pixel { margin-bottom: 40px; }

.trailer__slot {
  aspect-ratio: 16/9;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--ink-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trailer__slot iframe {
  border: 0;
}

/* ----------------------------------------------------------------
   DAILY PUZZLE
---------------------------------------------------------------- */
.puzzle {
  padding: 100px 0;
  background: rgba(255,255,255,.03);
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.puzzle .heading-pixel { margin-bottom: 16px; }
.puzzle__sub { margin-bottom: 40px; }

.puzzle__slot {
  display: flex;
  justify-content: center;
}

.puzzle__slot iframe {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 0 60px -10px rgba(var(--theme-rgb), .3);
  transition: box-shadow .6s;
}

/* ----------------------------------------------------------------
   LEADERBOARD
---------------------------------------------------------------- */
.leaderboard {
  padding: 32px 0;
}

.leaderboard .heading-pixel { margin-bottom: 16px; }
.leaderboard__sub { margin-bottom: 12px; }

.lb-toggle {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.lb-toggle__btn {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(255,255,255,.5);
  background: var(--ink-soft);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.lb-toggle__btn:hover { color: var(--white); }
.lb-toggle__btn[aria-pressed="true"] {
  color: var(--theme);
  border-color: var(--theme);
}

.lb-panel {
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 1px;
  overflow: hidden;
}

.lb-head {
  display: grid;
  grid-template-columns: 70px 1fr 130px;
  padding: 14px 24px;
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--grey);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.lb-row {
  display: grid;
  grid-template-columns: 70px 1fr 130px;
  padding: 16px 24px;
  font-family: var(--font-pixel);
  font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,255,255,.03); }

.lb-rank { color: var(--grey); }
.lb-row.rank-1 .lb-rank { color: var(--theme); }
.lb-row.rank-2 .lb-rank { color: rgba(255,255,255,.7); }
.lb-row.rank-3 .lb-rank { color: #C97A3D; }
.lb-player { color: var(--white); }
.lb-score-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.lb-score-icon {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}
.lb-score-val { color: var(--theme); transition: color .5s; }

/* ----------------------------------------------------------------
   STEAM CTA
---------------------------------------------------------------- */
.steam-cta {
  padding: 120px 0 140px;
  text-align: center;
}

.steam-cta__heading {
  font-size: clamp(28px, 4vw, 52px);
  margin-bottom: 16px;
}

.steam-cta__sub {
  margin-bottom: 40px;
}

.cta-btn {
  display: inline-block;
  font-family: var(--font-head);
  font-size: clamp(14px, 1.4vw, 20px);
  color: var(--black);
  background: var(--theme);
  padding: 18px 40px;
  border-radius: 10px;
  letter-spacing: 1px;
  transition: background .4s, box-shadow .3s, transform .2s;
}
.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px -10px rgba(var(--theme-rgb), .6);
}

/* ----------------------------------------------------------------
   FOOTER
---------------------------------------------------------------- */
.site-footer {
  background: #0d0d0d;
  padding: 19px 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 3.5vw, 50px);
}

.footer__link {
  font-family: var(--font-pixel);
  font-size: clamp(12px, 1.9vw, 22px);
  color: var(--white);
  opacity: .5;
  white-space: nowrap;
  transition: opacity .2s;
}
.footer__link:hover { opacity: .9; }

.footer__copyright {
  font-family: var(--font-pixel);
  font-size: clamp(10px, 1.5vw, 16px);
  color: var(--white);
  opacity: .2;
  text-align: center;
}

/* ----------------------------------------------------------------
   PLACEHOLDER LABEL (used in trailer + empty sections)
---------------------------------------------------------------- */
.placeholder-label {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.2);
  text-transform: uppercase;
}

/* ----------------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------------- */
@media (max-width: 900px) {
  .shots__grid { grid-template-columns: 1fr 1fr; }
  .shots__grid .shot:last-child { grid-column: span 2; }
}

@media (max-width: 600px) {
  .nav__links { gap: 16px; }
  .nav__steam { display: none; }
  .shots__grid { grid-template-columns: 1fr; }
  .shots__grid .shot:last-child { grid-column: span 1; }
  .crew__grid { gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}
