/* ===== Cafeda Games brand palette ===== */
:root {
  /* Primary */
  --deep-space: #0B0D1A;
  --night-blue: #1F2748;
  --steel-blue: #445A84;
  --pixel-gray: #D8DFEE;
  /* Accent */
  --arcade-cyan: #00D1FF;
  --power-green: #4AFF91;
  --coin-yellow: #FFC83D;
  --action-red: #FF5A3C;
  /* Secondary */
  --retro-purple: #6B4DE8;
  --synth-pink: #D946B4;
  --teal-slate: #2C8F9E;
  --console-gray: #7A8899;
  --cloud-white: #F5F7FF;

  --font-pixel: "Press Start 2P", monospace;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --radius: 12px;
  --max-width: 1120px;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--deep-space);
  color: var(--pixel-gray);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
.pixel { image-rendering: pixelated; }

a { color: var(--arcade-cyan); }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

:focus-visible { outline: 3px solid var(--coin-yellow); outline-offset: 3px; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  padding: 16px 22px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, background .2s ease;
}
.btn-primary {
  background: var(--arcade-cyan);
  color: var(--deep-space);
  box-shadow: 0 5px 0 #0089a8;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #0089a8; }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #0089a8; }

.btn-ghost {
  color: var(--cloud-white);
  box-shadow: inset 0 0 0 2px var(--steel-blue);
}
.btn-ghost:hover { background: var(--night-blue); }

.btn-small {
  padding: 11px 14px;
  font-size: 0.625rem;
  background: var(--arcade-cyan);
  color: var(--deep-space) !important;
}

/* ===== Navigation ===== */
/* Hidden over the hero; slides in once the visitor scrolls past it (see script.js) */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform .3s ease, visibility .3s;
  background: rgba(11, 13, 26, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--night-blue);
}
.nav.visible { transform: translateY(0); visibility: visible; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-brand { display: block; }
.nav-brand img { height: 32px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) {
  color: var(--pixel-gray);
  text-decoration: none;
  font-weight: 500;
}
.nav-links a:not(.btn):hover { color: var(--arcade-cyan); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  margin: 4px 0;
  background: var(--pixel-gray);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 200px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(107, 77, 232, 0.35), transparent 60%),
    linear-gradient(180deg, var(--deep-space) 0%, var(--night-blue) 50%, var(--deep-space) 100%);
}
/* Soft fade into the Games section below */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 320px;
  background: linear-gradient(180deg,
    rgba(11, 13, 26, 0) 0%,
    rgba(11, 13, 26, .08) 20%,
    rgba(11, 13, 26, .3) 45%,
    rgba(11, 13, 26, .7) 72%,
    var(--deep-space) 100%);
  pointer-events: none;
}

.hero-bg, .hero-sky { position: absolute; inset: 0; }

/* Slow-moving glows of brand color */
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .35;
  animation: drift 18s ease-in-out infinite alternate;
}
.aurora-1 { width: 520px; height: 320px; left: 8%; top: 18%; background: var(--retro-purple); }
.aurora-2 { width: 420px; height: 280px; right: 6%; top: 30%; background: var(--synth-pink); opacity: .22; animation-duration: 22s; animation-delay: -6s; }
.aurora-3 { width: 460px; height: 240px; left: 35%; top: 55%; background: var(--arcade-cyan); opacity: .16; animation-duration: 26s; animation-delay: -12s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, -30px) scale(1.15); }
  100% { transform: translate(-40px, 20px) scale(.95); }
}

/* Twinkling pixel stars */
.star {
  position: absolute;
  width: var(--size);
  height: var(--size);
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
  animation: twinkle var(--dur) ease-in-out var(--delay) infinite alternate;
}
/* Larger stars get a pixel "plus" sparkle */
.star.sparkle {
  box-shadow:
    0 calc(var(--size) * -1) 0 var(--c),
    0 var(--size) 0 var(--c),
    calc(var(--size) * -1) 0 0 var(--c),
    var(--size) 0 0 var(--c),
    0 0 12px var(--c);
}
@keyframes twinkle {
  from { opacity: .15; transform: scale(.8); }
  to   { opacity: 1;   transform: scale(1); }
}

/* Pixels that float upward like magic dust */
.float-pixel {
  position: absolute;
  bottom: -10px;
  width: var(--size);
  height: var(--size);
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
  opacity: 0;
  animation: rise var(--dur) linear var(--delay) infinite;
}
@keyframes rise {
  0%   { opacity: 0; transform: translate(0, 0); }
  15%  { opacity: .9; }
  80%  { opacity: .6; }
  100% { opacity: 0; transform: translate(var(--drift), -100vh); }
}

.hero-inner { position: relative; z-index: 1; }
.hero-logo {
  width: min(640px, 100%);
  margin: 0 auto 32px;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .35));
}
.hero-tagline {
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--cloud-white);
  margin: 0 0 36px;
}
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hero-actions .btn { width: min(260px, 100%); text-align: center; }

/* ===== Sections ===== */
.section { padding: 96px 0; }
.section-alt { background: var(--night-blue); }
/* Fades in from the section above instead of starting with a hard edge */
.section-fade {
  padding-top: 200px;
  background: linear-gradient(180deg,
    var(--deep-space) 0,
    rgba(31, 39, 72, .35) 90px,
    rgba(31, 39, 72, .8) 170px,
    var(--night-blue) 240px);
}

.section-title {
  font-family: var(--font-pixel);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  line-height: 1.4;
  color: var(--cloud-white);
  margin: 0 0 8px;
}
.section-title span { margin-right: 12px; }
.section-lead { max-width: 640px; margin: 0 0 32px; }

/* Negative top margin pulls the section up into the hero's fade.
   Fills a full screen with its content centered, so the Games buttons can center it (see script.js) */
#games {
  padding: 40px 0 80px;
  margin-top: -60px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#games .section-title { margin-bottom: 40px; }

.accent-cyan { color: var(--arcade-cyan); }
.accent-green { color: var(--power-green); }
.accent-yellow { color: var(--coin-yellow); }

/* ===== Games ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 380px));
  justify-content: center; /* cards sit centered, even when there's only one */
  gap: 28px;
}
.game-card {
  display: flex;
  flex-direction: column;
  background: var(--night-blue);
  border: 2px solid var(--steel-blue);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--card-accent, var(--arcade-cyan)); }

.game-art {
  aspect-ratio: 16 / 9;
  background: var(--deep-space);
  position: relative;
}
.game-art img { width: 100%; height: 100%; object-fit: cover; }
.game-art-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--cloud-white);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .4);
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 4px, transparent 4px 8px),
    linear-gradient(135deg, var(--card-accent, var(--retro-purple)), var(--steel-blue));
}
.game-art .game-art-logo {
  width: 78%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .35));
}
.game-status {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-pixel);
  font-size: 0.5625rem;
  padding: 7px 9px;
  border-radius: 4px;
  background: var(--deep-space);
  color: var(--card-accent, var(--arcade-cyan));
}

.game-body { padding: 22px 22px 26px; display: flex; flex-direction: column; flex: 1; }
.game-body h3 {
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--cloud-white);
  margin: 0 0 10px;
}
.game-genre {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--card-accent, var(--arcade-cyan));
  margin: 0 0 12px;
}
.game-body p { margin: 0 0 20px; }
.game-links { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.game-links a {
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--deep-space);
  background: var(--card-accent, var(--arcade-cyan));
}
.game-links a:hover { filter: brightness(1.1); }

/* ===== About ===== */
.about {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-text p { margin: 0 0 18px; }
.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stat {
  background: var(--deep-space);
  border: 1px solid var(--steel-blue);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-icon { font-size: 1.4rem; color: var(--c); line-height: 1; margin-bottom: 8px; }
.stat strong { color: var(--cloud-white); }
.stat span:last-child { font-size: 0.92rem; color: var(--console-gray); }

/* ===== Contact ===== */
/* Contact is the last section, so it also fills a full screen to leave room for centering it (see script.js) */
#contact {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.contact {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: start;
}
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; }
.contact-list li { margin-bottom: 10px; }
.contact-list .label {
  display: inline-block;
  min-width: 70px;
  font-weight: 700;
  color: var(--console-gray);
}

.contact-form {
  background: rgba(11, 13, 26, 0.55);
  border: 2px solid var(--steel-blue);
  border-radius: var(--radius);
  padding: 30px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--cloud-white);
}
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--cloud-white);
  background: var(--deep-space);
  border: 2px solid var(--steel-blue);
  border-radius: 8px;
  padding: 11px 13px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--arcade-cyan);
}
.field.invalid input, .field.invalid textarea { border-color: var(--action-red); }

.form-status { margin: 16px 0 0; min-height: 1.5em; font-weight: 500; }
.form-status.ok { color: var(--power-green); }
.form-status.error { color: var(--action-red); }

/* ===== Footer ===== */
/* Continues the Contact section's color and fades back to the page background */
.footer {
  padding: 120px 0 36px;
  background: linear-gradient(180deg,
    var(--night-blue) 0,
    rgba(31, 39, 72, .55) 60px,
    rgba(31, 39, 72, .15) 120px,
    var(--deep-space) 100%);
  font-size: 0.9rem;
  color: var(--console-gray);
}
/* Game pages end on the dark background, so the footer stays plain dark to match */
.footer-from-dark { background: var(--deep-space); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer p { margin: 0; }

.socials { display: flex; gap: 12px; }
.socials a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--night-blue);
  border: 2px solid var(--steel-blue);
  color: var(--pixel-gray);
  transition: transform .15s ease, color .15s ease, border-color .15s ease;
}
.socials a:hover { transform: translateY(-3px); color: var(--c); border-color: var(--c); }
.socials svg { width: 20px; height: 20px; fill: currentColor; }

/* ===== Game detail pages (e.g. gorf-the-dwarf.html) ===== */
.hero-compact {
  min-height: 0;
  padding: 160px 0 190px;
}
.game-page-title {
  font-family: var(--font-pixel);
  font-size: clamp(1.6rem, 5vw, 3rem);
  line-height: 1.3;
  color: var(--cloud-white);
  text-shadow: 0 5px 0 rgba(0, 0, 0, .4);
  margin: 0 0 20px;
}
/* Game logo in the banner; 2x its pixel size so the pixel art stays crisp */
.game-page-logo { margin: 0 0 24px; }
.game-page-logo img {
  width: min(572px, 100%);
  margin: 0 auto;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .35));
}
.game-tags { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.game-tag {
  font-family: var(--font-pixel);
  font-size: 0.625rem;
  padding: 8px 10px;
  border-radius: 4px;
  background: var(--deep-space);
  color: var(--arcade-cyan);
  border: 1px solid var(--steel-blue);
}
.game-tag.alt { color: var(--coin-yellow); }

.game-details .section { padding: 0 0 80px; }

.about-game {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
}
.about-game p { margin: 0 0 16px; }
.features ul { list-style: none; margin: 0; padding: 0; }
.features {
  align-self: start;
  padding: 24px;
  background: var(--night-blue);
  border: 2px solid var(--steel-blue);
  border-radius: var(--radius);
}
.features h3 {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--cloud-white);
  margin: 0 0 16px;
}
.features li { padding-left: 22px; position: relative; margin-bottom: 10px; }
.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 8px;
  height: 8px;
  background: var(--power-green);
}

/* Empty boxes that mark where a trailer or screenshots will go */
.media-placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  border: 2px dashed var(--steel-blue);
  border-radius: var(--radius);
  background: var(--night-blue);
  color: var(--console-gray);
  font-family: var(--font-pixel);
  font-size: 0.625rem;
  line-height: 1.8;
}
.media-placeholder img, .media-placeholder iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.shots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.back-link {
  display: inline-block;
  margin-top: 48px;
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .about, .contact, .about-game { grid-template-columns: 1fr; gap: 40px; }
  .shots-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--deep-space);
    border-bottom: 1px solid var(--night-blue);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; text-align: center; padding: 16px; }
  .nav-links .btn-small { width: auto; margin: 8px 0 16px; }

  .hero { padding: 72px 0 150px; }
  .aurora { filter: blur(50px); }
  .section { padding: 72px 0; }
  .games-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .contact-form { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
