:root {
  color-scheme: dark;
  font-family: system-ui, "Segoe UI", sans-serif;
  background: #10101a;
  color: #f3f2fa;
  --surface: #191a28;
  --border: #373649;
  --muted: #b8b7cd;
  --lavender: #c5b4ff;
  --lime: #d6efa4;
}

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--lime); outline-offset: 5px; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }

.wrap {
  width: min(73rem, calc(100% - 2 * clamp(1rem, 5vw, 4rem)));
  margin-inline: auto;
}

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

.site-header {
  min-height: 4.75rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: .65rem;
  font-size: .85rem;
  font-weight: 780;
  letter-spacing: .14em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border-radius: .6rem;
  background: #27243b;
  color: var(--lavender);
  font-size: 1.2rem;
  letter-spacing: 0;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem clamp(.6rem, 3vw, 1.8rem);
  justify-content: flex-end;
}

.site-header nav a, .site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: .4rem;
  font-size: .86rem;
  font-weight: 615;
  color: var(--muted);
}

.site-header nav a:hover, .site-footer a:hover { color: #fff; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  margin-top: 1.6rem;
  min-height: clamp(17rem, 26vw, 21rem);
  padding: clamp(1.35rem, 3vw, 2.7rem) clamp(1.35rem, 5vw, 4rem);
  border: 1px solid #403955;
  border-radius: 1.5rem;
  background:
    radial-gradient(ellipse at 88% 25%, #41386f 0%, transparent 59%),
    linear-gradient(133deg, #26203a 3%, #191c36 70%, #141626);
}

.hero-copy { position: relative; z-index: 1; }
.hero-copy h1 {
  font-size: clamp(2.7rem, 5.35vw, 5rem);
  line-height: .98;
  font-weight: 730;
  letter-spacing: -.068em;
}

.hero-copy h1 span { color: var(--lavender); }

.hero-copy p {
  margin-top: 1.2rem;
  max-width: 28rem;
  font-size: clamp(.96rem, 2vw, 1.1rem);
  color: #d3d0e6;
  line-height: 1.55;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
  min-height: 3rem;
  margin-top: 1.4rem;
  padding: .5rem 1rem;
  border-radius: .65rem;
  background: var(--lime);
  color: #171e12;
  font-size: .9rem;
  font-weight: 740;
  transition: background-color .18s ease;
}

.button:hover { background: #e6ffc1; }

.orbital-art {
  position: absolute;
  inset: -12% -2% -12% 43%;
  z-index: -1;
  --ring: #c5b4ff66;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 22%, #d6efa4 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 86% 26%, #decfff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 80% 78%, #c5b4ff 0 2px, transparent 3px),
    radial-gradient(circle at 27% 77%, #d3d9ff 0 1px, transparent 2.5px),
    radial-gradient(circle at 92% 53%, #d3d9ff99 0 1px, transparent 2px);
}

.planet {
  position: absolute;
  top: 50%;
  left: 52%;
  width: clamp(10rem, 23vw, 21rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid #d3c3ff77;
  background:
    radial-gradient(circle at 43% 30%, #d5c0fa 0, #977bc6 31%, #4d418a 60%, #282645 88%);
  box-shadow: 0 0 65px #a98fe452, inset -18px -14px 55px #171a3680;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 52%;
  width: 93%;
  height: 40%;
  border: 1px solid var(--ring);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-31deg);
}

.orbit-near {
  clip-path: inset(44% 0 0);
  border-color: #e8deffa8;
}

.orbit-far {
  width: 112%;
  height: 57%;
  opacity: .56;
}

.catalog, .experiments { margin-top: clamp(2rem, 5vw, 3.6rem); scroll-margin-top: 1rem; }

.catalog h2, .experiments h2 {
  margin-bottom: .95rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -.04em;
}

.game-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.game-card { min-width: 0; }

.game-link {
  --game-accent: var(--lime);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  transition: border-color .18s ease, background-color .18s ease;
}

.game-link.chess { --game-accent: var(--lavender); }
.game-link:hover { border-color: var(--game-accent); background: #202133; }

.game-image {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 2.2;
  background: #171b30;
  border-bottom: 1px solid var(--border);
}

.game-image::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #14152455, transparent 35%);
  content: "";
}

.game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
}

.chess .game-image img { object-position: center 69%; }

.game-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.game-type { margin-bottom: .4rem; color: var(--game-accent); font-size: .8rem; font-weight: 665; }
.game-info h3 { font-size: clamp(1.35rem, 2.65vw, 2rem); letter-spacing: -.04em; }
.game-summary { margin: .35rem 0 1rem; color: var(--muted); line-height: 1.5; font-size: .92rem; }

.game-action {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  min-height: 2.6rem;
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: .55rem;
  padding: .35rem .8rem;
  font-size: .85rem;
  font-weight: 700;
}

.game-action span { color: var(--game-accent); }

.experiment-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.experiment-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .7rem;
  min-height: 2.95rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  color: var(--muted);
  font-size: .9rem;
}

.experiment-links a:hover { color: #fff; border-color: var(--lavender); }
.experiment-links a span { color: var(--lavender); }

.site-footer {
  margin-top: 2.4rem;
  min-height: 4.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
}

.entry-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 1rem;
}

.hero-entry { margin-top: 0; }
.hero-entry .brand { margin-bottom: 1.5rem; }
.hero-entry h1 { font-size: clamp(2.55rem, 6.2vw, 5rem); }
.hero-entry h1 span { display: block; }

@media (max-width: 44rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 19.5rem;
  }

  .hero-copy h1 span { display: block; }
  .hero-copy p { max-width: 16rem; }
  .orbital-art { inset: 3% -22% 0 40%; opacity: .47; }
  .planet { left: 62%; }
  .orbit { left: 62%; }
  .game-grid { grid-template-columns: minmax(0, 1fr); }
  .experiment-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 24rem) {
  .site-header { gap: .5rem; }
  .brand { gap: .45rem; letter-spacing: .07em; }
  .site-header nav a { font-size: .78rem; }
  .hero h1 { font-size: 2.45rem; }
  .experiment-links a { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
