/* Knulux: the studio stays black and white so each game's art brings the color. */

:root {
  --bg: #09090a;
  --surface: #121214;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f3f1ec;
  --text-2: #aeaba4;
  --text-3: #74716b;
  --live: #3ee08f;

  --font-display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
}

@property --mx { syntax: '<percentage>'; inherits: true; initial-value: 72%; }
@property --my { syntax: '<percentage>'; inherits: true; initial-value: 38%; }

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Film grain over everything. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.skip:focus { top: 16px; }

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .25s, border-color .25s, color .25s, transform .2s var(--ease);
}
.btn .icon { transition: transform .3s var(--ease); }
.btn:hover .icon { transform: translate(var(--dx, 3px), var(--dy, 0)); }
.btn:active { transform: scale(.97); }
.icon--ne { --dx: 2px; --dy: -2px; }
.icon--down { --dx: 0; --dy: 3px; }

.btn--light { background: var(--text); color: var(--bg); }
.btn--light:hover { background: #fff; }

.btn--ghost { border-color: var(--line-strong); }
.btn--ghost:hover { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .04); }

.btn--small { height: 40px; padding: 0 18px; font-size: 14px; }

.btn--locked {
  border-color: var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text-3);
  cursor: not-allowed;
}
.btn--locked:active { transform: none; }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.nav.is-scrolled {
  background: rgba(9, 9, 10, .74);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark { width: 22px; height: 22px; fill: currentColor; }
.brand__word {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}
.nav__links a { position: relative; padding: 6px 0; transition: color .2s; }
.nav__links a::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

@media (max-width: 680px) {
  .nav__inner { height: 64px; gap: 20px; }
  .nav__links { gap: 18px; }
  .nav__cta { display: none; }
  .brand__word { font-size: 23px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(100svh, 1000px);
  padding: 140px 0 110px;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

.hero__bg { position: absolute; inset: 0; pointer-events: none; }

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 25%, transparent 80%);
}
/* The light ("lux") follows the pointer and lights up the grid under it. */
.hero__grid--lit {
  background-image:
    linear-gradient(rgba(255, 255, 255, .26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .26) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(280px circle at var(--mx) var(--my), #000, transparent 72%);
  mask-image: radial-gradient(280px circle at var(--mx) var(--my), #000, transparent 72%);
}
.hero__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(560px circle at var(--mx) var(--my), rgba(255, 255, 255, .08), transparent 65%);
}

@media (hover: none) and (prefers-reduced-motion: no-preference) {
  .hero { animation: drift 16s ease-in-out infinite alternate; }
}
@keyframes drift {
  0% { --mx: 22%; --my: 30%; }
  50% { --mx: 78%; --my: 52%; }
  100% { --mx: 55%; --my: 18%; }
}

.hero__inner { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .1);
}

.hero__title {
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: clamp(60px, 11.5vw, 172px);
  font-weight: 900;
  line-height: .86;
  letter-spacing: -.005em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero__title em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: clamp(1.5px, .16vw, 2.5px) var(--text);
}

.hero__lede {
  max-width: 34em;
  margin-top: 32px;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
  color: var(--text-2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* ---------- Ticker ---------- */

.ticker {
  overflow: hidden;
  padding: 18px 0;
  border-block: 1px solid var(--line);
}
.ticker__track {
  display: flex;
  align-items: center;
  width: max-content;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: ticker 45s linear infinite;
}
/* Each child carries its own spacing (no gap), so the two halves are identical and -50% loops seamlessly. */
.ticker__track > * { margin-right: 22px; }
.ticker b { font-weight: 800; color: var(--text-3); }
/* A drop of goo between items. */
.ticker i {
  width: 8px;
  height: 8px;
  margin-right: 26px;
  margin-left: 4px;
  border-radius: 50% 0 50% 50%;
  background: var(--text-3);
  transform: rotate(-45deg);
}
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */

.section { padding: clamp(80px, 11vw, 150px) 0; }
.section + .section { border-top: 1px solid var(--line); }

.section__head {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-2);
}
.label span {
  padding-right: 12px;
  border-right: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--text-3);
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(52px, 7.5vw, 112px);
  font-weight: 900;
  line-height: .88;
  text-transform: uppercase;
}

.section__note { font-size: 17px; color: var(--text-2); }

@media (min-width: 900px) {
  #games .section__head { grid-template-columns: 1fr auto; align-items: end; }
  #games .label { grid-column: 1 / -1; }
  #games .section__note { padding-bottom: 8px; }
}

/* ---------- Game cards ---------- */

.games { display: grid; gap: clamp(20px, 3vw, 32px); }

.game {
  position: relative;
  isolation: isolate;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .4s;
}
.game::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--glow, none);
  pointer-events: none;
}
.game[data-href] { cursor: pointer; }

/* Each game's own colors, faint, behind the text. */
.game--mc {
  --glow:
    radial-gradient(70% 90% at 0% 100%, rgba(47, 140, 255, .17), transparent 70%),
    radial-gradient(55% 80% at 100% 0%, rgba(255, 51, 68, .15), transparent 70%);
}
.game--tl {
  --glow: radial-gradient(70% 90% at 100% 100%, rgba(255, 255, 255, .05), transparent 70%);
}

.game__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent);
  mask-image: linear-gradient(180deg, #000 50%, transparent);
}
.game__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease);
}

.game__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-top: -56px;
  padding: 0 22px 28px;
}

.game__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.game__platform { font-size: 13px; color: var(--text-3); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.status--live {
  background: rgba(62, 224, 143, .1);
  box-shadow: inset 0 0 0 1px rgba(62, 224, 143, .28);
  color: var(--live);
}
.status--live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 224, 143, .55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(62, 224, 143, 0); }
}
.status--soon {
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text-2);
}

.game__title { line-height: 0; }
.game__logo {
  width: min(100%, 440px);
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .55));
}
.game__logo--tl { width: min(92%, 340px); }

.game__pitch {
  font-family: var(--font-display);
  font-size: clamp(25px, 2.5vw, 32px);
  font-weight: 800;
  line-height: 1.02;
  text-transform: uppercase;
  text-wrap: balance;
}
.game__desc { max-width: 44ch; color: var(--text-2); }

.game__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.game__tags li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.game__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 8px;
}

.game__social { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.game__social a { transition: color .2s; }
.game__social a:hover { color: var(--text); }

.game--mc:hover { border-color: var(--line-strong); }
.game--mc:hover .game__media img { transform: scale(1.045); }

/* Not out yet: grayscale, dimmed, hatched. */
.game--soon .game__media img { filter: grayscale(1) brightness(.55) contrast(1.08); }
.game--soon .game__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 10px);
}
.game--soon .game__logo { filter: grayscale(1) brightness(.85) drop-shadow(0 12px 28px rgba(0, 0, 0, .55)); }
.game--soon .game__pitch { color: var(--text-2); }
.game--soon .game__desc,
.game--soon .game__tags li { color: var(--text-3); }

@media (min-width: 900px) {
  .game { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 580px; }

  .game__media {
    grid-area: 1 / 2;
    aspect-ratio: auto;
    margin-left: -14%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%);
    mask-image: linear-gradient(90deg, transparent, #000 40%);
  }
  .game__body {
    grid-area: 1 / 1;
    justify-content: center;
    margin: 0;
    padding: 56px 0 56px 56px;
    z-index: 1;
  }

  .game--flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .game--flip .game__media {
    grid-area: 1 / 1;
    margin: 0 -14% 0 0;
    -webkit-mask-image: linear-gradient(270deg, transparent, #000 40%);
    mask-image: linear-gradient(270deg, transparent, #000 40%);
  }
  .game--flip .game__body { grid-area: 1 / 2; padding: 56px 56px 56px 0; }
}

/* ---------- Studio ---------- */

.studio { display: grid; gap: 8px; }

.studio__lede {
  max-width: 28ch;
  font-size: clamp(23px, 2.5vw, 32px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.015em;
}

.pillars { margin-top: 48px; border-top: 1px solid var(--line); }
.pillars li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px 16px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.pillars__n {
  grid-row: span 2;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-3);
}
.pillars h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}
.pillars p { max-width: 50ch; color: var(--text-2); }

@media (min-width: 900px) {
  .studio { grid-template-columns: 5fr 7fr; gap: 64px; }
  .studio .section__head { align-content: start; margin: 0; }
}

/* ---------- Contact ---------- */

.contact { display: grid; justify-items: center; gap: 20px; text-align: center; }
.contact__title {
  font-family: var(--font-display);
  font-size: clamp(52px, 8.5vw, 124px);
  font-weight: 900;
  line-height: .88;
  text-transform: uppercase;
  text-wrap: balance;
}
.contact__text { max-width: 42ch; font-size: 17px; color: var(--text-2); }
.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line-strong);
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: .01em;
  transition: border-color .3s;
  overflow-wrap: anywhere;
}
.contact__mail .icon { width: .6em; height: .6em; stroke-width: 2; transition: transform .3s var(--ease); }
.contact__mail:hover { border-color: var(--text); }
.contact__mail:hover .icon { transform: translate(3px, -3px); }

/* ---------- Footer ---------- */

.footer { padding-top: 28px; border-top: 1px solid var(--line); overflow: hidden; }
.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  font-size: 14px;
  color: var(--text-3);
}
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer__links a { transition: color .2s; }
.footer__links a:hover { color: var(--text); }

.footer__mark { width: 100%; height: auto; margin-top: clamp(40px, 7vw, 88px); }
.footer__mark text {
  font-family: var(--font-display);
  font-size: 412px;
  font-weight: 900;
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  min-height: 100svh;
  padding: 120px var(--gutter);
  text-align: center;
}
.lost__code {
  font-family: var(--font-display);
  font-size: clamp(120px, 26vw, 300px);
  font-weight: 900;
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 2px var(--text);
}
.lost__text { max-width: 36ch; font-size: 18px; color: var(--text-2); }

/* ---------- Reveal on scroll ---------- */

.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-in { animation: rise .9s var(--ease) var(--d, 0s) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}
.hero__inner > :nth-child(2) { --d: .08s; }
.hero__inner > :nth-child(3) { --d: .16s; }
.hero__inner > :nth-child(4) { --d: .24s; }
.pillars li:nth-child(2) { --d: .08s; }
.pillars li:nth-child(3) { --d: .16s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .ticker__track { animation: none; }
}
