/* NM Studio — Web Games launcher. Clean studio look: the neon belongs inside the games, not on the shelf. */

:root {
  --bg: #ffffff;
  --paper: #f7f4f4;
  --line: #e8e1e2;
  --ink: #171214;
  --muted: #6d6266;
  --card: #ffffff;
  --red: #e60012;
  --red-deep: #b3000e;
  --red-soft: #fdecee;
  --shadow: 0 18px 40px -24px rgba(23, 18, 20, .35);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* Dark follows the system by default, and the switch can override it in either direction. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141012;
    --paper: #1c1719;
    --line: #302629;
    --ink: #f4eeef;
    --muted: #a79a9e;
    --card: #1c1719;
    --red: #ff2a3a;
    --red-deep: #e60012;
    --red-soft: #33141a;
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  --bg: #141012;
  --paper: #1c1719;
  --line: #302629;
  --ink: #f4eeef;
  --muted: #a79a9e;
  --card: #1c1719;
  --red: #ff2a3a;
  --red-deep: #e60012;
  --red-soft: #33141a;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.6 "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  margin: 0;
  font-family: Montserrat, "Public Sans", system-ui, sans-serif;
  letter-spacing: -.02em;
  line-height: 1.05;
  text-wrap: balance;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }

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

.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }

/* ---------- header ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }

/* logo.png is the wordmark cropped to its own edges with a real alpha channel, so it needs no blend tricks:
   the same file sits correctly on white and on dark. Set `--mw` to resize it. */
.mark {
  --mw: 50px;
  display: block;
  width: var(--mw);
  transition: transform .3s var(--ease);
}
.mark img { display: block; width: 100%; height: auto; }
.logo:hover .mark { transform: translateY(-1px) scale(1.03); }

.actions { display: flex; align-items: center; gap: 12px; }

.theme {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  font: 600 13px/1 "Public Sans", sans-serif;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: border-color .2s;
}
.theme:hover { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.theme input { position: absolute; opacity: 0; pointer-events: none; }
.theme .track {
  position: relative;
  width: 44px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 70%, var(--line));
  transition: background .2s, border-color .2s;
}
.theme .track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
  transition: transform .22s var(--ease), background .2s;
}
.theme input:checked + .track { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.theme input:checked + .track::after { transform: translateX(18px); background: var(--red); }
.theme .mode { color: var(--ink); font-weight: 700; min-width: 38px; }

.navlink {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.navlink:hover { color: var(--ink); border-color: var(--red); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s, transform .15s var(--ease);
}
.btn:hover { background: var(--red-deep); transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }

/* ---------- the shelf ---------- */

.shelf { padding: 64px 0 96px; text-align: center; }

.hero-mark { --mw: clamp(150px, 20vw, 210px); margin: 0 auto; }

.shelf h1 {
  margin-top: 18px;
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 900;
  text-transform: uppercase;
}
.shelf .rule { display: block; width: 72px; height: 2px; margin: 26px auto 52px; background: var(--red); }

.games {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  text-align: left;
}

.card,
.soon {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s var(--ease), transform .6s var(--ease), box-shadow .3s, border-color .3s;
  transition-delay: calc(var(--i, 0) * 80ms);
}
.card.in, .soon.in { opacity: 1; transform: none; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.card:hover, .card:focus-visible {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--red) 30%, var(--line));
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .55);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.thumb .art {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.card:hover .thumb .art { transform: scale(1.05); }

.badge {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 9px;
  background: var(--red);
  color: #fff;
  border-radius: 4px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.card .body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 20px 20px 18px;
}
.card h2 { font-size: 21px; font-weight: 800; }
.card .tagline {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }
.tags span {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.card .play {
  display: block;
  margin-top: auto;
  padding: 16px 16px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-family: Montserrat, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: background .15s, box-shadow .2s;
}
.card:hover .play, .card:focus-visible .play {
  background: var(--red-deep);
  box-shadow: 0 10px 24px -12px var(--red);
}

.soon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  min-height: 280px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  overflow: hidden;
}
/* a soft red light circling behind the panel */
.soon::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 190px; height: 190px;
  margin: -95px 0 0 -95px;
  background: radial-gradient(circle, color-mix(in srgb, var(--red) 24%, transparent), transparent 70%);
  animation: orbit 11s linear infinite;
  pointer-events: none;
}
/* and a slow sweep across it, so the empty slot still feels alive */
.soon::after {
  content: "";
  position: absolute;
  inset: -40% -70%;
  background: linear-gradient(105deg, transparent 42%, color-mix(in srgb, var(--red) 14%, transparent) 50%, transparent 58%);
  transform: translateX(-60%);
  animation: sweep 5s ease-in-out infinite;
  pointer-events: none;
}
/* lift the content above the two moving layers — but leave the badge pinned to its corner */
.soon > :not(.badge) { position: relative; z-index: 1; }

.soon .badge {
  z-index: 1;
  background: var(--muted);
  animation: pulse 2.4s ease-in-out infinite;
}
.soon b {
  font-family: Montserrat, sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  animation: float 4s ease-in-out infinite;
}
.soon .note { font-size: 14px; color: var(--muted); max-width: 22ch; }
.soon .dots { display: flex; gap: 7px; margin-top: 6px; }
.soon .dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  opacity: .22;
  animation: blip 1.4s ease-in-out infinite;
}
.soon .dots i:nth-child(2) { animation-delay: .18s; }
.soon .dots i:nth-child(3) { animation-delay: .36s; }

@keyframes orbit {
  from { transform: rotate(0deg) translateX(72px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(72px) rotate(-360deg); }
}
@keyframes sweep {
  0%        { transform: translateX(-60%); }
  55%, 100% { transform: translateX(60%); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--muted) 50%, transparent); }
  70%      { box-shadow: 0 0 0 10px transparent; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes blip {
  0%, 60%, 100% { opacity: .22; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-5px); }
}

/* ---------- footer ---------- */

footer.site { border-top: 1px solid var(--line); padding: 24px 0; }
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.status {
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  transition: color .2s;
}
a.status:hover { color: var(--red); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; }

/* ---------- responsive ---------- */

@media (max-width: 860px) { .theme .mode { display: none; } }

@media (max-width: 760px) {
  .wrap { width: min(100% - 28px, 1120px); }
  .shelf { padding: 52px 0 72px; }
  .shelf .rule { margin: 22px auto 40px; }
}

@media (max-width: 480px) {
  .bar { gap: 12px; }
  .btn { padding: 10px; }
  .btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card, .soon { opacity: 1; transform: none; }
}
