:root {
  color-scheme: dark;
  --ink: #07080d;
  --paper: #f4f1e8;
  --muted: #9699a8;
  --line: rgba(255, 255, 255, 0.12);
  --orange: #ff6b35;
  --blue: #78dce8;
  --max: 1160px;
  --pad: clamp(22px, 5vw, 72px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  min-width: 320px;
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.masthead {
  position: relative;
  z-index: 2;
  padding: 30px var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--paper);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-decoration: none;
}

.brand span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 16px var(--orange);
}

/* Main-site holding page */
.teaser {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 48%, #171b2b 0, var(--ink) 55%);
}

.teaser::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.25) 0.7px, transparent 0.8px);
  background-size: 58px 58px;
  content: "";
  opacity: .4;
  animation: stars-far 32s linear infinite;
}

.teaser-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  min-height: calc(100svh - 150px);
  padding: 5vh var(--pad) 15vh;
}

.kicker {
  margin: 0 0 24px;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.teaser h1 {
  max-width: 950px;
  margin: 0;
  font-size: clamp(3.3rem, 10vw, 8.5rem);
  font-weight: 750;
  letter-spacing: -.075em;
  line-height: .88;
}

.teaser h1 span { color: var(--orange); }

.teaser-copy > p:last-of-type {
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.contact {
  justify-self: start;
  margin-top: 34px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--orange);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.contact span { color: var(--orange); }

.teaser-foot {
  position: absolute;
  z-index: 2;
  right: var(--pad);
  bottom: 30px;
  left: var(--pad);
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.space { position: absolute; inset: 0; }

.space::before {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 24%, rgba(255,255,255,.68) 0 1px, transparent 1.5px),
    radial-gradient(circle at 73% 16%, rgba(255,255,255,.48) 0 1px, transparent 1.5px),
    radial-gradient(circle at 84% 62%, rgba(255,255,255,.42) 0 1px, transparent 1.5px),
    radial-gradient(circle at 43% 84%, rgba(255,255,255,.38) 0 1px, transparent 1.5px);
  background-size: 300px 260px;
  content: "";
  opacity: .65;
  animation: stars-near 52s linear infinite;
}

.space i { position: absolute; display: block; }

@keyframes stars-far {
  to { background-position: -58px 58px; }
}

@keyframes stars-near {
  to { background-position: -300px 260px; }
}

.rocket-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}

.rocket-canvas.is-ready { opacity: .9; }

.planet-far {
  top: 13%;
  right: 13%;
  width: clamp(70px, 9vw, 130px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #726e7c, #292735 45%, #0c0d14 72%);
  box-shadow: inset -20px -12px 35px #05060a, 0 0 60px rgba(132, 123, 175, .12);
  opacity: .62;
}

.planet-near {
  right: -19vw;
  bottom: -39vw;
  width: clamp(430px, 68vw, 1050px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 28% 30%, rgba(255, 116, 64, .13), transparent 25%),
    radial-gradient(circle at 30% 25%, #202238, #0b0c14 48%, #030407 70%);
  box-shadow: -30px -28px 110px rgba(74, 101, 157, .18), inset 24px 24px 80px rgba(118, 143, 190, .08);
}

/* Portfolio */
.portfolio {
  min-height: 100svh;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    radial-gradient(circle at 80% 0, #1b1f32 0, transparent 40%),
    var(--ink);
  background-size: 64px 64px, 64px 64px, auto, auto;
}

.portfolio .masthead {
  max-width: calc(var(--max) + var(--pad) * 2);
  margin: auto;
}

.portfolio-main {
  width: min(100%, calc(var(--max) + var(--pad) * 2));
  margin: auto;
  padding: clamp(70px, 10vw, 140px) var(--pad) 100px;
}

.portfolio-intro { max-width: 780px; }

.portfolio h1 {
  margin: 0;
  font-size: clamp(3.1rem, 8vw, 7rem);
  font-weight: 750;
  letter-spacing: -.07em;
  line-height: .91;
}

.portfolio-intro > p:last-child {
  max-width: 600px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.6;
}

.games {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 2.5vw, 30px);
  margin: clamp(70px, 10vw, 130px) 0 0;
  padding: 0;
  list-style: none;
}

.game-card {
  position: relative;
  display: grid;
  min-height: 340px;
  padding: clamp(28px, 4vw, 46px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0c0e15;
  text-decoration: none;
  transition: background .2s ease;
}

.game-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 8, 13, .25), rgba(7, 8, 13, .96));
  content: "";
}

.game-card:hover { background: #121521; }

.game-card > picture {
  position: absolute;
  inset: 0;
}

.game-card > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .72;
  transition: transform .4s ease;
}

.game-card:hover > picture > img { transform: scale(1.035); }

.game-card small {
  position: relative;
  z-index: 1;
  align-self: start;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.game-card div { position: relative; z-index: 1; align-self: end; max-width: 430px; }

.game-card h2 {
  margin: 55px 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -.045em;
}

.game-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.game-card b {
  position: absolute;
  z-index: 1;
  top: 34px;
  right: 36px;
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
}

.game-card[data-game="coin"] { --accent: #4aa8ff; }
.game-card[data-game="dice"] { --accent: #67e3c2; }
.game-card[data-game="launch"] { --accent: #ff8c42; }
.game-card[data-game="planet"] { --accent: #c8a776; }
.game-card[data-game="rush"] { --accent: #d56cff; }

.portfolio-foot {
  width: min(100%, calc(var(--max) + var(--pad) * 2));
  margin: auto;
  padding: 0 var(--pad) 42px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 700px) {
  .teaser-copy {
    background: linear-gradient(90deg, rgba(7, 8, 13, .94) 0, rgba(7, 8, 13, .72) 58%, transparent 100%);
  }
  .rocket-canvas.is-ready { opacity: .82; }
  .planet-near { right: -48vw; bottom: -22vw; }
  .planet-far { top: 18%; right: 9%; }
  .game-card { min-height: 235px; }
  .game-card[data-game="launch"] > picture > img { object-position: 60% center; }
}

@media (prefers-reduced-motion: reduce) {
  .teaser::before, .space::before { animation: none; }
  .rocket-canvas { transition: none; }
  .game-card, .game-card > picture > img { transition: none; }
}
