/* ontouch.games — design tokens first. Dark only: game art is built for black. */
:root {
  --bg: #05060a;
  --bg2: #0a0d14;
  --panel: #0e121b;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .16);
  --ink: #e8edf5;
  --dim: #98a2b3;
  --mute: #5f6b7d;
  --cyan: #5ee0ff;
  --red: #ef4444;
  --violet: #a78bfa;
  --display: "Chakra Petch", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --r: 14px;
  --gut: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--body); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 em, h3 em { font-style: normal; color: var(--cyan); }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1200px, 100%); margin: 0 auto; padding: 0 var(--gut); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--cyan); color: #000; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.eyebrow {
  font: 500 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--dim);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.lede { color: var(--dim); font-size: clamp(16px, 1.6vw, 19px); max-width: 56ch; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px;
  border-radius: 12px; font: 600 15px/1 var(--display); letter-spacing: .04em; text-transform: uppercase;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn.solid { background: var(--cyan); color: #021018; box-shadow: 0 0 0 1px var(--cyan), 0 8px 30px -8px var(--cyan); }
.btn.solid:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--cyan), 0 12px 40px -6px var(--cyan); }
.btn.play { background: var(--ac); color: #050608; box-shadow: 0 10px 34px -10px var(--ac); }
.btn.play:hover { transform: translateY(-2px); box-shadow: 0 14px 44px -8px var(--ac); }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 17px/1 var(--display); letter-spacing: .02em; }
.brand svg { width: 30px; height: 30px; }
.brand b { font-weight: 700; color: var(--cyan); margin-left: 5px; }
.nav nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 30px); font: 500 14px/1 var(--body); color: var(--dim); }
.nav nav a:hover { color: var(--ink); }
.nav .lang { border: 1px solid var(--line2); padding: 7px 10px; border-radius: 8px; font: 500 12px/1 var(--mono); color: var(--ink); }

/* hero */
.hero { position: relative; overflow: hidden; min-height: min(86vh, 760px); display: grid; align-items: center; border-bottom: 1px solid var(--line); }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 75% 30%, rgba(94, 224, 255, .12), transparent 70%),
    radial-gradient(50% 50% at 15% 85%, rgba(239, 68, 68, .10), transparent 70%),
    linear-gradient(to bottom, transparent 60%, var(--bg));
}
.scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: .35;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px);
}
.hero-in { position: relative; z-index: 2; padding-top: 72px; padding-bottom: 96px; display: grid; gap: 28px; }
.hero h1 { font-size: clamp(64px, 13vw, 168px); line-height: .88; text-transform: uppercase; letter-spacing: -.02em; }
.hero h1 .ln { display: block; overflow: hidden; }
.hero h1 .ln > span { display: inline-block; }
.hero h1 .ln:nth-child(2) > span {
  background: linear-gradient(90deg, var(--cyan), #c6f6ff 45%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.caret {
  display: inline-block; width: .42em; height: .1em; margin-left: .12em; background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan); vertical-align: baseline; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 6px; }
.now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 500 13px/1 var(--mono); color: var(--mute); }
.now > span { margin-right: 4px; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; }
.now a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--ink); transition: border-color .2s ease;
}
.now a:hover { border-color: var(--ac); }
.now a i { width: 7px; height: 7px; border-radius: 50%; background: var(--ac); box-shadow: 0 0 10px var(--ac); }

/* sections */
.sec { padding: clamp(72px, 10vw, 130px) 0; }
.sec-head { display: grid; gap: 18px; margin-bottom: clamp(40px, 6vw, 72px); }
.sec-head h2 { font-size: clamp(34px, 5.2vw, 64px); line-height: 1; }

/* game cards */
.games { display: grid; gap: clamp(28px, 4vw, 44px); }
.game {
  position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(18px, 3vw, 34px); border-radius: calc(var(--r) + 6px);
  background: linear-gradient(160deg, color-mix(in srgb, var(--ac) 9%, var(--panel)), var(--panel) 45%);
  border: 1px solid color-mix(in srgb, var(--ac) 22%, var(--line));
  overflow: hidden;
}
.game::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--gl) 18%, transparent), transparent 65%);
  top: -220px; left: -160px;
}
.game.flip { grid-template-columns: 1fr 1.15fr; }
.game.flip .g-art { order: 2; }
.game.flip::before { left: auto; right: -160px; }

.g-art { position: relative; display: block; padding-bottom: 34px; }
.screen {
  position: relative; border-radius: 12px; overflow: hidden; background: #000;
  border: 1px solid var(--line2); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .6);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.g-art:hover .screen { transform: translateY(-4px); }
.screen-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #0b0e15; border-bottom: 1px solid var(--line); }
.screen-bar i { width: 8px; height: 8px; border-radius: 50%; background: #262d3a; }
.screen-bar span { margin-left: 8px; font: 400 11px/1 var(--mono); color: var(--mute); }
.inset {
  position: absolute; right: -10px; bottom: 0; width: 46%; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ac) 45%, transparent);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .95), 0 0 30px -8px var(--ac);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.g-art:hover .inset { transform: translate(6px, -6px) rotate(1deg); }
.portraits { position: absolute; right: -6px; bottom: 0; display: flex; width: 54%; }
.portraits img {
  width: 36%; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 18px 40px -10px #000, 0 0 24px -10px var(--ac);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.portraits img + img { margin-left: -6%; }
.portraits img:nth-child(1) { transform: rotate(-7deg) translateY(10px); }
.portraits img:nth-child(2) { transform: translateY(-4px); z-index: 1; }
.portraits img:nth-child(3) { transform: rotate(7deg) translateY(12px); }
.g-art:hover .portraits img:nth-child(1) { transform: rotate(-10deg) translate(-6px, 4px); }
.g-art:hover .portraits img:nth-child(2) { transform: translateY(-12px); }
.g-art:hover .portraits img:nth-child(3) { transform: rotate(10deg) translate(6px, 6px); }

.g-txt { position: relative; display: grid; gap: 14px; align-content: start; }
.g-top { display: flex; align-items: center; gap: 12px; }
.idx { font: 500 12px/1 var(--mono); color: var(--mute); }
.status {
  display: inline-flex; align-items: center; gap: 7px; justify-self: start; padding: 6px 10px; border-radius: 999px;
  font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--ac) 40%, transparent); color: var(--ac);
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.genre { font: 500 13px/1.3 var(--mono); color: var(--ac); letter-spacing: .06em; text-transform: uppercase; }
.game h3 { font-size: clamp(40px, 5.4vw, 68px); line-height: .95; text-transform: uppercase; }
.tag { font: 600 clamp(18px, 1.8vw, 21px)/1.35 var(--display); color: var(--ink); }
.desc { color: var(--dim); }
.facts { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { padding: 7px 11px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.g-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 8px; }
.price { font: 500 14px/1.3 var(--mono); color: var(--dim); }
.price b { color: var(--ink); font-weight: 500; }

/* reserved slot for the next game */
.game.soon { grid-template-columns: auto 1fr; gap: clamp(20px, 3vw, 40px); border-style: dashed; background: transparent; }
.game.soon::before { opacity: .5; }
.slot {
  width: clamp(110px, 16vw, 180px); aspect-ratio: 1; border-radius: 16px; display: grid; place-items: center;
  border: 1px dashed color-mix(in srgb, var(--ac) 45%, transparent);
  background: repeating-linear-gradient(135deg, rgba(167, 139, 250, .06) 0 10px, transparent 10px 20px);
}
.slot span { font: 700 clamp(30px, 4vw, 46px)/1 var(--display); color: color-mix(in srgb, var(--ac) 70%, #fff); }
.game.soon h3 { font-size: clamp(26px, 3.2vw, 38px); text-transform: none; line-height: 1.1; }

/* about */
.about { background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ab { padding: 26px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.ab .n { font: 500 12px/1 var(--mono); color: var(--cyan); }
.ab h3 { font-size: 22px; line-height: 1.2; }
.ab p { color: var(--dim); font-size: 15px; }

/* contact */
.contact { padding: clamp(80px, 10vw, 130px) 0; text-align: center; }
.contact .wrap { display: grid; gap: 18px; justify-items: center; }
.contact h2 { font-size: clamp(30px, 4.6vw, 54px); line-height: 1.05; }
.mail {
  margin-top: 10px; font: 600 clamp(20px, 3vw, 30px)/1.2 var(--display); color: var(--cyan);
  border-bottom: 2px solid color-mix(in srgb, var(--cyan) 40%, transparent); padding-bottom: 4px; word-break: break-all;
}
.mail:hover { border-color: var(--cyan); }

/* footer */
footer { border-top: 1px solid var(--line); padding: 48px 0 32px; color: var(--mute); font-size: 14px; }
footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
footer .legal { display: grid; gap: 8px; align-content: start; }
footer .legal .brand { color: var(--ink); margin-bottom: 6px; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
footer ul a:hover { color: var(--ink); }
footer .bottom { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); font: 400 12px/1 var(--mono); }

/* reveal on scroll (only when JS runs) */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .rv.in { opacity: 1; transform: none; }
.js .hero h1 .ln > span { transform: translateY(105%); transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.js .hero h1 .ln:nth-child(2) > span { transition-delay: .08s; }
.js.ready .hero h1 .ln > span { transform: none; }

@media (max-width: 900px) {
  .game, .game.flip { grid-template-columns: 1fr; }
  .game.flip .g-art { order: 0; }
  .ab-grid { grid-template-columns: 1fr; }
  footer .wrap { grid-template-columns: 1fr 1fr; }
  footer .legal { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .game.soon { grid-template-columns: 1fr; }
  .inset { width: 52%; right: -4px; }
  .portraits { width: 62%; }
  .btn { height: 48px; }
  .g-foot .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
  .js .hero h1 .ln > span { transform: none; }
}
