/* ==========================================================================
   purpleguy — site styles
   Single stylesheet, no build step. Sections:
   1. Tokens   2. Base   3. Layout   4. Buttons   5. Header
   6. Hero + parallax   7. Games grid   8. Studio / contact   9. Footer
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --ink:          #0b0613;
  --ink-raised:   #150c26;
  --purple:       #7c3aed;
  --purple-lit:   #a78bfa;
  --purple-deep:  #3b0f70;
  --magenta:      #d946ef;

  --text:         #f2edfa;
  --text-dim:     #a99dc0;
  --line:         rgba(255, 255, 255, 0.09);

  --wrap:         1140px;
  --radius:       18px;
  --shadow:       0 24px 60px -20px rgba(0, 0, 0, 0.75);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* The wordmark is Arial, deliberately. */
  --font-logo: Arial, "Helvetica Neue", Helvetica, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
  /* The page ground. Body stays transparent so the fixed starfield,
     which sits at z-index -1, is visible behind every section. */
  background: var(--ink);
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  line-height: 1.1;
  margin: 0 0 0.4em;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }

:focus-visible {
  outline: 2px solid var(--purple-lit);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--purple);
  color: #fff;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* 3. Layout ---------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

.section {
  position: relative;
  padding-block: clamp(4.5rem, 11vw, 8rem);
}

.section__head { max-width: 40rem; margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }

.eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--purple-lit);
}

.lede { color: var(--text-dim); font-size: 1.06rem; margin: 0; }
.section__head .lede { margin-top: 0.9rem; }

.logo {
  font-family: var(--font-logo);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.035em;
  font-size: 1.4rem;
  line-height: 1;
}

.logo--sm { font-size: 1.2rem; }

/* 4. Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.btn--sm { padding: 0.62rem 1.1rem; font-size: 0.9rem; }

.btn--primary {
  background: linear-gradient(120deg, var(--purple), var(--magenta));
  color: #fff;
  box-shadow: 0 12px 30px -12px rgba(124, 58, 237, 0.9);
}

.btn--ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.btn--disabled {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
  cursor: default;
}

.btn--primary:hover, .btn--ghost:hover { transform: translateY(-2px); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(167, 139, 250, 0.5); }
.btn--primary:hover { box-shadow: 0 18px 38px -12px rgba(168, 58, 237, 1); }
.btn--disabled:hover { transform: none; }

/* 5. Header ---------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding-block: 1rem;
  transition: background-color 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  background: rgba(11, 6, 19, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.9rem);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dim);
}

.site-nav a { transition: color 0.2s; }
.site-nav a:hover { color: #fff; }

/* 6. Starfield + hero ----------------------------------------------------- */
/* Fixed behind the whole document: three tiled layers that scroll at
   different rates, plus a static nebula wash at infinite distance.
   Each layer is sized by JS to cover its own travel, so it never runs out. */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.nebula {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 42% at 18% 16%, rgba(124, 58, 237, 0.34), transparent 70%),
    radial-gradient(40% 40% at 84% 30%, rgba(217, 70, 239, 0.20), transparent 72%),
    radial-gradient(70% 55% at 50% 104%, rgba(59, 15, 112, 0.45), transparent 76%);
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-repeat: repeat;
  will-change: transform;
}

.stars--far  { background-image: url("../img/stars-far.svg");  background-size: 720px 720px; }
.stars--mid  { background-image: url("../img/stars-mid.svg");  background-size: 900px 900px;
               animation: twinkle 9s ease-in-out infinite; }
.stars--near { background-image: url("../img/stars-near.svg"); background-size: 1100px 1100px; }

@keyframes twinkle {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

.hero {
  position: relative;
  min-height: 100vh;   /* fallback for browsers without svh */
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 7rem 5rem;
}

.hero__content { position: relative; z-index: 1; will-change: transform; }

.logo--hero {
  font-size: clamp(3rem, 13vw, 8.5rem);
  margin: 0;
  text-shadow: 0 0 60px rgba(167, 139, 250, 0.45);
}

.hero__tagline {
  margin: 1.2rem auto 0;
  max-width: 34rem;
  font-size: clamp(1.02rem, 2.4vw, 1.3rem);
  color: var(--text-dim);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 2.2rem;
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  translate: -50% 0;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.hero__scroll span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: #fff;
  animation: wheel 1.8s ease-in-out infinite;
}

@keyframes wheel {
  0%        { opacity: 0; translate: 0 -4px; }
  35%, 55%  { opacity: 1; }
  100%      { opacity: 0; translate: 0 14px; }
}

/* Alternating sections get a veil: dark enough to read against, sheer
   enough that the starfield still shows through, with soft edges so the
   bands don't butt up against each other. */
.section--veiled {
  background: linear-gradient(
    180deg,
    rgba(11, 6, 19, 0) 0%,
    rgba(11, 6, 19, 0.72) 7%,
    rgba(11, 6, 19, 0.72) 93%,
    rgba(11, 6, 19, 0) 100%);
}

/* 7. Games grid ------------------------------------------------------------ */
.grid {
  display: grid;
  gap: clamp(1.1rem, 2.6vw, 1.8rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(31, 18, 54, 0.78), rgba(15, 8, 28, 0.72));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}

.card:hover, .card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: var(--shadow), 0 0 0 1px rgba(167, 139, 250, 0.12);
}

.card--soon:hover { transform: none; }

.card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--ink-raised);
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s;
}

.card:hover .card__media img { transform: scale(1.05); }
.card--soon .card__media img { filter: saturate(0.45) brightness(0.7); }

.card__cue {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #fff;
  background: rgba(11, 6, 19, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s;
}

.card__media:hover .card__cue,
.card__media:focus-visible .card__cue { opacity: 1; }

.badge {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(11, 6, 19, 0.8);
  border: 1px solid var(--line);
  color: var(--purple-lit);
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.3rem 1.35rem 1.45rem;
}

.card__title { margin-bottom: 0.25rem; }

.card__tagline {
  margin: 0 0 0.7rem;
  color: var(--purple-lit);
  font-size: 0.93rem;
  font-weight: 600;
}

.card__desc { color: var(--text-dim); font-size: 0.95rem; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
}

.tags li {
  padding: 0.24rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: auto;
}

.empty {
  padding: 2.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-dim);
}

.empty code { color: var(--purple-lit); }

/* 8. Studio + contact ------------------------------------------------------ */
.cols {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2.4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.col p { color: var(--text-dim); margin: 0; font-size: 0.97rem; }

.col h3 {
  padding-top: 1.1rem;
  border-top: 2px solid var(--purple);
}

.section--contact { text-align: center; }
.contact .lede { margin: 0 auto 2rem; max-width: 34rem; }

/* 9. Footer ---------------------------------------------------------------- */
.site-footer {
  position: relative;
  background: rgba(11, 6, 19, 0.72);
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.social { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.social a:hover { color: #fff; }
.copyright { margin: 0; }

/* Reveal on scroll --------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible { opacity: 1; transform: none; }

/* Stagger the cards a little as a row scrolls in. */
.card.reveal:nth-child(2) { transition-delay: 0.08s; }
.card.reveal:nth-child(3) { transition-delay: 0.16s; }
.card.reveal:nth-child(4) { transition-delay: 0.24s; }

/* Responsive tweaks -------------------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav { font-size: 0.88rem; }
  .hero { padding-block: 6rem 4.5rem; }
  /* Roomier taps on touch screens. */
  .btn { padding-block: 0.95rem; }
  .btn--sm { padding-block: 0.9rem; }
  .hero__actions .btn { flex: 1 1 auto; }
  /* Smaller tiles keep the field looking dense on a narrow screen. */
  .stars--far  { background-size: 460px 460px; }
  .stars--mid  { background-size: 580px 580px; }
  .stars--near { background-size: 720px 720px; }
  .site-footer__inner { justify-content: center; text-align: center; }
}

/* Touch devices never get a hover, so keep the play cue visible but quiet. */
@media (hover: none) {
  .card__cue { opacity: 1; background: linear-gradient(0deg, rgba(11, 6, 19, 0.85), transparent 55%); align-content: end; padding-bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
