:root {
  --bg: #07090a;
  --surface-2: rgba(255, 255, 255, .06);
  --stroke: rgba(255, 255, 255, .08);
  --stroke-hi: rgba(255, 255, 255, .16);
  --text: #f2f5f3;
  --muted: #94a19a;
  --green: #12ee7a;
  --green-deep: #0a9a4a;
  --red: #ff2d4b;
  --red-deep: #c50f2c;
  --display: "Sora", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1180px;
  --radius: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow-lg:
    0 1px 0 rgba(255, 255, 255, .06) inset,
    0 0 0 1px var(--stroke),
    0 40px 80px -30px rgba(0, 0, 0, .8),
    0 20px 40px -20px rgba(0, 0, 0, .6);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Ambient light + Tatar tulip lattice ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.backdrop i {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  animation: drift 30s ease-in-out infinite alternate;
}
.backdrop i:nth-child(1) { left: -18vmax; top: -22vmax; background: radial-gradient(circle, #0fd36d, transparent 65%); opacity: .26; }
.backdrop i:nth-child(2) { right: -18vmax; top: 4vmax; background: radial-gradient(circle, #d4183a, transparent 65%); opacity: .24; animation-duration: 36s; }
.backdrop i:nth-child(3) { left: 25vmax; bottom: -38vmax; background: radial-gradient(circle, #0fd36d, transparent 65%); opacity: .12; animation-duration: 42s; }
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/img/pattern.svg") 0 0 / 140px 140px;
  opacity: .07;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000, transparent 75%);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(16px, calc((100% - var(--wrap)) / 2));
  background: rgba(7, 9, 10, .6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--stroke);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 700 19px/1 var(--display);
  letter-spacing: -.01em;
}
.brand b { font-weight: 500; color: var(--muted); margin-left: 4px; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav > a:not(.btn) {
  position: relative;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s;
}
.nav > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--green);
  transform: scaleX(0);
  transition: transform .3s var(--ease);
}
.nav > a:not(.btn):hover { color: var(--text); }
.nav > a:not(.btn):hover::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */
.btn {
  --c1: #3dfb98;
  --c2: var(--green-deep);
  --ink: #04140b;
  --glow: rgba(18, 238, 122, .45);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  font: 600 15px/1 var(--display);
  text-decoration: none;
  color: var(--ink);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .45) inset,
    0 -2px 0 rgba(0, 0, 0, .18) inset,
    0 10px 24px -8px var(--glow),
    0 2px 4px rgba(0, 0, 0, .3);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s;
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .5) inset,
    0 -2px 0 rgba(0, 0, 0, .18) inset,
    0 18px 36px -10px var(--glow),
    0 4px 8px rgba(0, 0, 0, .3);
}
.btn:active { transform: translateY(0); }
.btn span { transition: transform .25s var(--ease); }
.btn:hover span { transform: translateX(3px); }

.btn--red { --c1: #ff5a6a; --c2: var(--red-deep); --ink: #fff; --glow: rgba(255, 45, 75, .45); }
.btn--ghost {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 0 0 1px var(--stroke-hi);
}
.btn--ghost:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .1) inset, 0 0 0 1px rgba(255, 255, 255, .28); }
.btn--sm { padding: 10px 16px; font-size: 13px; border-radius: 11px; }

/* ---------- Layout ---------- */
main, .footer {
  width: min(var(--wrap), 100% - 32px);
  margin-inline: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font: 600 12px/1 var(--display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--green);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 18px;
  background: url("assets/img/tulip-mini.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 45, 75, .5));
}

h1, h2, h3 { font-family: var(--display); letter-spacing: -.025em; }

.lead {
  margin: 0 0 34px;
  max-width: 46ch;
  font-size: 18px;
  color: var(--muted);
}

/* ---------- Tatar ornament band ---------- */
.ornament {
  height: 56px;
  background: url("assets/img/ornament.svg") center / 120px 56px repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  opacity: .75;
  filter: drop-shadow(0 0 6px rgba(18, 238, 122, .25));
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  min-height: min(calc(100svh - 64px), 820px);
  padding: 32px 0 56px;
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(38px, 4.6vw, 62px);
  font-weight: 800;
  line-height: 1.05;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(95deg, #5dffae, #12ee7a 50%, #0fbf62);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- 3D game showcase ---------- */
.showcase {
  --rx: 7deg;
  --ry: -16deg;
  position: relative;
  aspect-ratio: 16 / 12;
  perspective: 1400px;
}
.showcase::before {
  /* game light spilling onto the page */
  content: "";
  position: absolute;
  inset: 0 -10%;
  background:
    radial-gradient(circle at 55% 50%, rgba(255, 45, 75, .35), transparent 55%),
    radial-gradient(circle at 30% 70%, rgba(18, 238, 122, .18), transparent 50%);
  filter: blur(30px);
}
.showcase::after {
  /* floor shadow */
  content: "";
  position: absolute;
  left: 14%; right: 10%; bottom: 0;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .75), transparent 70%);
  filter: blur(10px);
}

.showcase__card {
  position: absolute;
  inset: 8% 6% 12%;
  display: block;
  border-radius: 22px;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .7s var(--ease);
  animation: bob 7s ease-in-out infinite;
}
.showcase__card::before {
  /* slab thickness */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #1b2320, #050706);
  transform: translateZ(-26px);
  box-shadow: 0 60px 100px -30px rgba(0, 0, 0, .9);
}
.showcase__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
}
.showcase__hud { position: absolute; inset: 0; transform: translateZ(30px); }
.showcase__logo {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: -9%;
  width: 82%;
  transform: translateZ(90px);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .75));
}
.showcase__orn {
  position: absolute;
  width: 26%;
  aspect-ratio: 1;
  background: url("assets/img/corner.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(18, 238, 122, .45));
}
.showcase__orn--tl { top: -5%; left: -4%; transform: translateZ(50px); }
.showcase__orn--br { right: -4%; bottom: -5%; transform: translateZ(50px) rotate(180deg); }
.showcase__chip {
  position: absolute;
  top: 7%;
  right: -5%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font: 600 13px/1 var(--display);
  border-radius: 999px;
  background: rgba(12, 16, 15, .85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px var(--stroke-hi), 0 20px 30px -10px rgba(0, 0, 0, .8);
  transform: translateZ(120px);
}
.showcase__chip i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}
.showcase .glare {
  border-radius: inherit;
  transform: translateZ(1px);
  opacity: .9;
}

/* ---------- Shared body-cam HUD bits ---------- */
.corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 2px solid rgba(255, 255, 255, .85);
}
.corner.tl { top: 16px; left: 16px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.corner.tr { top: 16px; right: 16px; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.corner.bl { bottom: 16px; left: 16px; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.corner.br { bottom: 16px; right: 16px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }

.rec, .timecode {
  position: absolute;
  font: 700 12px/1 var(--mono);
  letter-spacing: .1em;
  color: #fff;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.rec { bottom: 22px; left: 50px; display: flex; align-items: center; gap: 7px; }
.rec i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: softPulse 2s ease-in-out infinite;
}
.timecode { top: 22px; right: 50px; }

.glare {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--gx, 30%) var(--gy, 20%), rgba(255, 255, 255, .22), transparent 45%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section__head { margin-bottom: 32px; }
.section__head h2, .studio h2 {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 700;
  line-height: 1.05;
}

/* Glass card with depth */
.card {
  position: relative;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015)),
    rgba(12, 16, 15, .72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}
/* Tatar corner ornaments */
.card--ornate::before,
.card--ornate::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 104px;
  height: 104px;
  background: url("assets/img/corner.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(18, 238, 122, .35));
  pointer-events: none;
}
.card--ornate::before { top: -12px; left: -12px; }
.card--ornate::after { right: -12px; bottom: -12px; transform: rotate(180deg); }

/* ---------- Featured game ---------- */
.game {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  padding: clamp(16px, 2.6vw, 30px);
  background:
    radial-gradient(circle at 25% 50%, rgba(255, 45, 75, .16), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015)),
    rgba(12, 16, 15, .72);
}

.viewfinder {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .9), 0 0 0 1px var(--stroke);
}
.viewfinder:hover { box-shadow: 0 40px 80px -25px rgba(255, 45, 75, .35), 0 0 0 1px var(--stroke-hi); }
.viewfinder__shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  transform: scale(1.04);
  transition: transform .8s var(--ease);
}
.viewfinder:hover .viewfinder__shot { transform: scale(1.09); }
.viewfinder .glare { opacity: 0; transition: opacity .4s; }
.viewfinder:hover .glare { opacity: 1; }

.game__logo { width: 100%; margin-bottom: 18px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .5)); }
.game__desc { margin: 0 0 18px; color: var(--muted); font-size: 17px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--stroke) inset;
}

/* ---------- Studio ---------- */
.studio {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(28px, 4.5vw, 56px);
}
.studio .lead { margin: 18px 0 0; font-size: 17px; }

.studio__visual {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1;
  margin-inline: auto;
}
.studio__halo {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 45, 75, .28), transparent 55%),
    radial-gradient(circle, rgba(18, 238, 122, .26), transparent 68%);
  filter: blur(30px);
  animation: breathe 6s ease-in-out infinite;
}
.studio__fallback,
.emblem-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.studio__fallback { padding: 8%; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .5)); }
.studio__visual.has-3d .studio__fallback { display: none; }

/* ---------- Footer ---------- */
.footer { padding: 32px 0 40px; }
.heart {
  display: inline-block;
  color: var(--red);
  text-shadow: 0 0 18px rgba(255, 45, 75, .6);
  animation: heartbeat 2.4s ease-in-out infinite;
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--stroke);
  font-size: 14px;
  color: var(--muted);
}
.footer .brand { font-size: 17px; color: var(--text); }
.footer__meta { display: flex; flex-wrap: wrap; gap: 6px 22px; }

/* ---------- Intro ---------- */
.intro { display: none; }
html.intro-on .intro,
.intro.is-out {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  background: radial-gradient(circle at 50% 44%, #10201a 0%, #050606 62%);
  /* failsafe: never block the page if the 3D script fails */
  animation: introFailsafe .5s 6s forwards;
}
.intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/img/pattern.svg") 0 0 / 140px 140px;
  opacity: .06;
  -webkit-mask-image: radial-gradient(circle at 50% 44%, transparent 20%, #000 70%);
  mask-image: radial-gradient(circle at 50% 44%, transparent 20%, #000 70%);
}
.intro.is-out { animation: fadeOut 1s var(--ease) forwards; }

.intro-stage {
  position: fixed;
  z-index: 101;
  left: 50%;
  top: 44%;
  width: min(88vw, 62vh);
  aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: none;
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.intro-stage.is-out { opacity: 0; transform: scale(1.3); }

.intro__caption {
  position: absolute;
  left: 0; right: 0; bottom: 8vh;
  z-index: 1;
  margin: 0;
  text-align: center;
  font: 700 clamp(24px, 3vw, 32px)/1 var(--display);
  opacity: 0;
  animation: fadeUp .8s 1.6s var(--ease) forwards;
}
.intro__caption span { font-weight: 500; color: var(--muted); }
.intro__caption small {
  display: block;
  margin-top: 10px;
  font: 500 12px/1 var(--display);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--green);
}
.intro__skip {
  position: absolute;
  z-index: 1;
  right: 24px;
  bottom: 24px;
  padding: 9px 14px;
  font: 500 13px/1 var(--body);
  color: var(--muted);
  background: var(--surface-2);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--stroke);
  cursor: pointer;
}
.intro__skip:hover, .intro__skip:focus-visible { color: var(--text); }

/* Page content waits for the intro, then rises in */
html.js .topbar,
html.js .hero__text > *,
html.js .showcase {
  animation: fadeUp .9s var(--ease) both;
  animation-delay: var(--d, 0s);
}
html.js.intro-on .topbar,
html.js.intro-on .hero__text > *,
html.js.intro-on .showcase { animation-delay: calc(var(--d, 0s) + 4s); }
.hero__text > :nth-child(1) { --d: .1s; }
.hero__text > :nth-child(2) { --d: .2s; }
.hero__text > :nth-child(3) { --d: .32s; }
.hero__text > :nth-child(4) { --d: .44s; }
.showcase { --d: .3s; }

/* ---------- Scroll reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(48px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.lost {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 100vh;
  min-height: 100svh;
  text-align: center;
}
.lost h1 { margin: 0 0 12px; font-size: clamp(64px, 12vw, 140px); font-weight: 800; line-height: 1; }
.lost h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #3dfb98, #ff5a6a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lost .lead { margin-inline: auto; }

/* ---------- Keyframes ---------- */
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }
@keyframes breathe { 50% { opacity: .7; transform: scale(.94); } }
@keyframes bob { 50% { translate: 0 -10px; } }
@keyframes softPulse { 50% { opacity: .35; } }
@keyframes heartbeat { 0%, 40%, 100% { transform: scale(1); } 20% { transform: scale(1.18); } 30% { transform: scale(.96); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }
@keyframes introFailsafe { to { opacity: 0; visibility: hidden; } }

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

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    min-height: auto;
    padding-top: 24px;
  }
  .lead { margin-inline: auto; }
  .actions { justify-content: center; }
  .showcase { max-width: 620px; width: 100%; margin-inline: auto; }
  .showcase::before { inset: 0; }
  .game, .studio { grid-template-columns: 1fr; }
  .studio { text-align: center; }
  .footer__row, .footer__meta { justify-content: center; text-align: center; }
}

@media (max-width: 560px) {
  .nav { gap: 16px; }
  .nav > a:not(.btn) { display: none; }
  .section { padding: 44px 0; }
  .rec { left: 44px; }
  .timecode { right: 44px; }
  .showcase { --ry: -10deg; }
  .showcase__chip { right: 0; font-size: 12px; }
  .card--ornate::before, .card--ornate::after { width: 76px; height: 76px; }
}
