:root {
  --paper: #F4EDE1;
  --card: #FFFDF7;
  --edge: #D9CBB0;
  --ink: #1F2433;
  --ink-2: #555B70;
  --blue: #3B6FD8;
  --green: #2F9E7A;
  --amber: #E8A93A;
  --red: #E0573D;
  --purple: #8A63D2;
  --radius: 20px;
  --cell: 34px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); font-weight: 900; letter-spacing: -.03em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; }
h3 { font-size: 1.2rem; font-weight: 700; }
.muted { color: var(--ink-2); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
section { padding: 96px 0; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head .sub { color: var(--ink-2); margin: 0; font-size: 1.08rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700;
  color: var(--ink-2); margin: 0 0 14px;
}
.eyebrow.light { color: #B9BED0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #2F9E7A33; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mark { display: grid; grid-template-columns: repeat(2, 12px); gap: 3px; }
.mark i { width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--ink); }
.mark i:nth-child(1) { background: var(--blue); }
.mark i:nth-child(2) { background: var(--red); }
.mark i:nth-child(3) { background: var(--amber); }
.mark i:nth-child(4) { background: var(--green); }
nav { display: flex; align-items: center; gap: 26px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--blue); }
.nav-cta { background: var(--ink); color: var(--card) !important; padding: 8px 16px; border-radius: 999px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 13px 24px; border-radius: 999px;
  background: var(--ink); color: var(--card); font-weight: 700; text-decoration: none;
  border: 2px solid var(--ink); transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 0 var(--edge);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--edge); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 9px 18px; font-size: .95rem; background: var(--accent, var(--ink)); border-color: var(--ink); }
.btn.light { background: var(--card); color: var(--ink); border-color: var(--card); box-shadow: 0 4px 0 #0006; }

/* ---------- hero ---------- */
.hero { padding: 80px 0 88px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--edge) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
  opacity: .6;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hl { color: var(--red); position: relative; }
.hl::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: .06em; height: .2em;
  background: var(--amber); z-index: -1; border-radius: 4px; opacity: .55;
}
.lead { font-size: 1.18rem; max-width: 560px; color: var(--ink-2); margin: 0 0 32px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { display: flex; gap: 36px; margin: 44px 0 0; padding-top: 28px; border-top: 1px dashed var(--edge); flex-wrap: wrap; }
.stats div { margin: 0; }
.stats dt { font-size: 2rem; font-weight: 900; line-height: 1; }
.stats dd { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; }

/* hero art: a little board */
.hero-art { position: relative; display: flex; justify-content: center; padding: 30px 0; }
.board {
  position: relative; width: calc(var(--cell) * 8 + 28px); height: calc(var(--cell) * 10 + 28px);
  background: var(--card); border: 3px solid var(--ink); border-radius: 24px; padding: 12px;
  box-shadow: 0 10px 0 var(--edge), 0 30px 60px -20px #1F243344;
  background-image:
    linear-gradient(var(--paper) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: 12px 12px;
  transform: rotate(-3deg);
  overflow: hidden;
}
.stack {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: grid; grid-template-columns: repeat(8, var(--cell));
}
.stack i, .piece i {
  width: var(--cell); height: var(--cell); border-radius: 7px;
}
.stack i[class] { border: 2px solid var(--ink); box-shadow: inset 0 -4px 0 #0002; }
.b { background: var(--blue); } .r { background: var(--red); } .g { background: var(--green); }
.a { background: var(--amber); } .p { background: var(--purple); }
.piece {
  position: absolute; left: calc(12px + var(--cell) * 2); top: 12px;
  display: grid; grid-template-columns: repeat(2, var(--cell));
  animation: drop 3.6s cubic-bezier(.55, 0, .4, 1) infinite;
}
.piece i { background: var(--red); border: 2px solid var(--ink); box-shadow: inset 0 -4px 0 #0002; }
@keyframes drop {
  0%   { transform: translateY(calc(var(--cell) * -2)); opacity: 0; }
  12%  { opacity: 1; }
  70%  { transform: translateY(calc(var(--cell) * 4)); }
  76%  { transform: translateY(calc(var(--cell) * 3.9)); }
  90%  { transform: translateY(calc(var(--cell) * 4)); opacity: 1; }
  100% { transform: translateY(calc(var(--cell) * 4)); opacity: 0; }
}
.float {
  position: absolute; width: 84px; height: 84px; border-radius: 22px; overflow: hidden;
  border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--edge); background: var(--card);
  animation: bob 5s ease-in-out infinite;
}
.f1 { top: 0; left: 4%; transform: rotate(-10deg); }
.f2 { top: 42%; right: 0; transform: rotate(8deg); animation-delay: -1.6s; }
.f3 { bottom: 4%; left: 0; transform: rotate(6deg); animation-delay: -3.2s; }
@keyframes bob { 50% { translate: 0 -10px; } }

/* ---------- tech strip ---------- */
.strip { background: var(--ink); color: #B9BED0; }
.strip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 30px; padding-top: 20px; padding-bottom: 20px; font-size: .95rem; }
.strip-row span { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; }
.strip-row b { color: var(--card); font-weight: 700; }

/* ---------- games ---------- */
.game-list { display: grid; gap: 28px; }
.game {
  display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: center;
  background: var(--card); border: 1px solid var(--edge); border-radius: 28px;
  padding: 36px 48px; box-shadow: 0 6px 0 var(--edge);
  position: relative; overflow: hidden;
}
.game::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 330px;
  background: var(--tint);
}
.game.flip { grid-template-columns: 1fr 260px; }
.game.flip::before { left: auto; right: 0; }
.game.flip .phone { order: 2; }
.phone {
  position: relative; width: 200px; margin: 0 auto;
  border: 8px solid var(--ink); border-radius: 30px; overflow: hidden;
  box-shadow: 0 14px 0 -4px color-mix(in srgb, var(--accent) 45%, transparent), 0 24px 40px -18px #1F243366;
  transform: rotate(-2deg); transition: transform .3s ease;
  background: var(--ink);
}
.game.flip .phone { transform: rotate(2deg); }
.game:hover .phone { transform: rotate(0) translateY(-4px); }
.phone img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 20px; }
.game-body { position: relative; }
.game-head { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.game-head h3 { margin: 6px 0 0; font-size: 1.55rem; font-weight: 800; }
.icon { width: 76px; height: 76px; border-radius: 20px; border: 2px solid var(--ink); flex-shrink: 0; }
.tag { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tag.live { background: #DDF1E8; color: #1D6B51; }
.tag.soon { background: #FBEBCB; color: #8A5A0B; }
.game p { color: var(--ink-2); max-width: 540px; margin: 0; }
.chips { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: .85rem; font-weight: 500; padding: 5px 12px; border-radius: 999px;
  background: var(--tint); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.links { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.links a:not(.btn) { font-size: .92rem; color: var(--ink-2); }

/* ---------- gallery ---------- */
.gallery { padding: 0 0 24px; overflow: hidden; }
.track { display: flex; gap: 20px; width: max-content; animation: scroll 50s linear infinite; padding: 10px 0 20px; }
.track img {
  width: 150px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 18px;
  border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--edge);
}
.track img:nth-child(odd) { transform: rotate(-2deg); }
.track img:nth-child(even) { transform: rotate(2deg) translateY(10px); }
.gallery:hover .track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(calc(-50% - 10px)); } }

/* ---------- services ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 26px; box-shadow: 0 5px 0 var(--edge); transition: transform .2s ease;
}
.card:hover { transform: translateY(-4px); }
.card p { margin: 0; color: var(--ink-2); font-size: .96rem; }
.ico {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--c); border: 2px solid var(--ink); margin-bottom: 18px;
}
.ico svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- process ---------- */
.process { background: var(--card); border-block: 1px solid var(--edge); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; }
.steps li { padding: 0 28px 0 0; position: relative; }
.steps li + li { padding-left: 28px; border-left: 1px dashed var(--edge); }
.steps span { display: block; font-size: 2.6rem; font-weight: 900; color: var(--edge); line-height: 1; margin-bottom: 14px; }
.steps li:nth-child(1) span { color: var(--blue); }
.steps li:nth-child(2) span { color: var(--green); }
.steps li:nth-child(3) span { color: var(--amber); }
.steps li:nth-child(4) span { color: var(--red); }
.steps p { color: var(--ink-2); margin: 0; font-size: .96rem; }

/* ---------- contact ---------- */
.contact-card {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center;
  background: var(--ink); color: var(--card); border-radius: 32px; padding: 56px;
  position: relative; overflow: hidden;
}
.contact-card::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px;
  background:
    linear-gradient(var(--blue) 0 0) 0 0 / 48% 48% no-repeat,
    linear-gradient(var(--red) 0 0) 100% 0 / 48% 48% no-repeat,
    linear-gradient(var(--amber) 0 0) 0 100% / 48% 48% no-repeat,
    linear-gradient(var(--green) 0 0) 100% 100% / 48% 48% no-repeat;
  opacity: .16; transform: rotate(18deg); border-radius: 20px;
}
.contact-card h2 { color: var(--card); }
.contact-card p { color: #B9BED0; max-width: 460px; margin: 0 0 28px; }
address {
  font-style: normal; line-height: 1.7; position: relative; z-index: 1;
  background: #ffffff0d; border: 1px solid #ffffff1f; border-radius: 20px; padding: 28px;
}
address strong { display: block; font-size: 1.15rem; }
.label { display: block; text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 700; color: #8F95AA; margin: 14px 0 2px; }
.label:first-child { margin-top: 0; }

footer { padding: 32px 0 40px; font-size: .9rem; }
.foot-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.brand.small { font-size: 1rem; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 32px 0; }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .game, .game.flip { grid-template-columns: 200px 1fr; gap: 32px; padding: 32px; }
  .game.flip .phone { order: 0; }
  .game::before, .game.flip::before { width: 248px; left: 0; right: auto; }
  .phone { width: 170px; }
  .contact-card { grid-template-columns: 1fr; padding: 40px; }
}
@media (max-width: 680px) {
  :root { --cell: 26px; }
  section { padding: 64px 0; }
  .hero { padding: 40px 0 56px; }
  nav a:not(.nav-cta) { display: none; }
  .game, .game.flip { grid-template-columns: 1fr; padding: 28px 22px; gap: 24px; }
  .game::before, .game.flip::before { width: auto; right: 0; bottom: auto; height: 250px; }
  .phone { width: 150px; }
  .game-head h3 { font-size: 1.3rem; }
  .icon { width: 60px; height: 60px; border-radius: 16px; }
  .grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps li, .steps li + li { padding: 0; border: 0; }
  .float { width: 60px; height: 60px; border-radius: 16px; }
  .contact-card { padding: 32px 24px; border-radius: 24px; }
  .stats { gap: 24px; }
  .track img { width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
