/* Palette, type scale and component treatments mirror the maziminds.com design system. */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #141026;
  --surface: #1e1a38;
  --ink: #15131f;
  --ink-invert: #ffffff;
  --muted: #b8b3d9;
  --accent: #2bd9c8;
  --accent-2: #ff4d6d;
  --grad-1: #7a5cff;
  --line: #2c2748;
  --placeholder: #332e54;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --text-display: clamp(2.5rem, 6vw + 1rem, 4.5rem);
  --text-h1: clamp(2rem, 5vw + 0.5rem, 3.5rem);
  --text-h2: clamp(1.75rem, 4vw + 0.5rem, 2.5rem);
  --text-h3: clamp(1.375rem, 2vw + 0.75rem, 1.75rem);
  --text-lead: clamp(1.125rem, 1vw + 0.85rem, 1.25rem);
  --text-body: 1rem;
  --text-small: 0.875rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --radius-card: 1rem;
  --radius-btn: 0.5rem;
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--ink-invert);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); overflow-wrap: break-word; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
}

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-body);
  font-weight: 400;
}

.brand__logo {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
}

.brand__text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-invert);
}

.brand__sep {
  color: var(--line);
  padding-inline: 0.15em;
}

.brand__parent {
  color: var(--muted);
  font-size: var(--text-small);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: var(--text-small);
  white-space: nowrap;
}

.status__dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ---------- hero ---------- */

.hero {
  padding-block: var(--space-8) var(--space-7);
}

@media (min-width: 768px) {
  .hero { padding-block: 6rem var(--space-8); }
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: var(--text-small);
  font-weight: 700;
  text-transform: uppercase;
}

.hero__title {
  margin-top: var(--space-4);
  max-width: 18ch;
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.08;
  color: var(--ink-invert);
}

@media (min-width: 768px) {
  .hero__title { font-size: var(--text-display); }
}

.hero__sub {
  margin-top: var(--space-5);
  max-width: 36rem;
  color: var(--muted);
  font-size: var(--text-lead);
  text-wrap: pretty;
}

.hero__note {
  margin-top: var(--space-4);
  max-width: 36rem;
  padding-left: var(--space-4);
  border-left: 2px solid var(--accent-2);
  color: var(--muted);
  font-size: var(--text-small);
}

/* ---------- shelf ---------- */

.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-6);
}

.shelf-head h2 {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--ink-invert);
}

.shelf-head__count {
  color: var(--muted);
  font-size: var(--text-small);
  white-space: nowrap;
}

.shelf {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  padding-bottom: var(--space-8);
}

/* ---------- card ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  transition: border-color 200ms ease;
}

.card__art {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--placeholder);
}

.card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tag {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  background: var(--accent-2);
  color: var(--ink);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5);
}

.card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-invert);
  transition: color 200ms ease;
}

.card__genre {
  flex: none;
  color: var(--muted);
  font-size: var(--text-small);
}

.card__tagline {
  color: var(--muted);
  font-size: var(--text-small);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: auto;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-btn);
  background: var(--accent);
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: 600;
  transition: background-color 200ms ease;
}

.play svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  transition: transform 200ms ease;
}

/* Whole card is the link; the visible affordances react to it. */
.card:hover,
.card:focus-within { border-color: var(--game-accent, var(--accent)); }

.card:hover .card__title,
.card:focus-within .card__title { color: var(--accent); }

.card:hover .card__art img,
.card:focus-within .card__art img { transform: scale(1.04); }

.card:hover .play,
.card:focus-within .play { background: color-mix(in srgb, var(--accent) 90%, transparent); }

.card:hover .play svg,
.card:focus-within .play svg { transform: translateX(3px); }

/* Stretched link: must sit above later siblings (.play) so the whole card stays clickable. */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.card__link:focus-visible { outline: none; }

.card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- footer ---------- */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-6);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-small);
}

.site-foot a:hover { color: var(--accent); }

/* ---------- reveal ---------- */

.js .shelf__item {
  opacity: 0;
  transform: translateY(12px);
}

.js .shelf__item.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 420ms ease var(--reveal-delay, 0ms),
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

/* ---------- responsive ---------- */

@media (min-width: 900px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card__art { aspect-ratio: 16 / 10; }
}

@media (max-width: 480px) {
  .site-head { position: static; }
  .brand__parent { display: none; }
}

/* ---------- prefs ---------- */

@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;
  }
  .js .shelf__item { opacity: 1; transform: none; }
  .card:hover .card__art img,
  .card:focus-within .card__art img { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --line: #4a4374; --muted: #d5d1ec; }
}
