/* ============================================================
   РИОЛИТ — игровая студия. Тёмный кинематографичный мир.
   Палитра логотипа: угольный камень + оранжевая лава.
   ============================================================ */

:root {
  --ink: #0a0b0c;
  --ink-2: #101115;
  --surface: #16181d;
  --surface-2: #1d2026;
  --line: #2a2d34;
  --line-soft: #22252b;

  --stone: #4a3f3b;
  --lava: #ec6a1f;
  --lava-hot: #ff8b3e;
  --lava-deep: #b64d13;

  --text: #ece9e6;
  --text-mid: #b4aca4;   /* warm-tinted, not gray */
  --text-dim: #8a827a;

  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, 0.72);
  --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, 0.66);
  --shadow-lava: 0 18px 44px -16px rgba(236, 106, 31, 0.42);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1200px;
  --pad: clamp(20px, 5vw, 64px);

  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-text: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient rhyolite field: drifts behind the lower sections, revealed by their
   translucent backgrounds. Hero (opaque) covers it on the first screen. */
.ambient {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity 1.4s var(--ease);
}
.ambient.is-ready { opacity: 1; }
main, .site-footer { position: relative; z-index: 1; }

img, video { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* ---- Browser surfaces themed from the palette ---- */
::selection { background: var(--lava); color: #120a04; }
:focus-visible {
  outline: 2px solid var(--lava-hot);
  outline-offset: 3px;
  border-radius: 3px;
}
html { scrollbar-color: var(--stone) var(--ink); scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb {
  background: #34302c;
  border: 3px solid var(--ink);
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover { background: var(--stone); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--lava); color: #120a04; padding: 10px 16px; font-weight: 600;
}
.skip:focus { left: 12px; top: 12px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; gap: 10px;
  height: var(--h); padding: 0 24px;
  font-family: var(--font-text); font-size: 15px; font-weight: 600;
  letter-spacing: 0.01em; cursor: pointer; border: 0;
  border-radius: 2px;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease),
    box-shadow 0.4s var(--ease), border-color 0.3s var(--ease);
}
.btn .i { width: 18px; height: 18px; fill: currentColor; }
.btn-sm { --h: 42px; padding: 0 18px; font-size: 14px; }

.btn-solid {
  background: var(--lava); color: #150a03;
  box-shadow: var(--shadow-lava);
}
.btn-solid:hover {
  background: var(--lava-hot); transform: translateY(-2px);
  box-shadow: 0 22px 50px -16px rgba(236, 106, 31, 0.55);
}
.btn-solid:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03); color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--stone); background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
    backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header[data-scrolled] {
  background: rgba(10, 11, 12, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line-soft);
}
.header-inner {
  display: flex; align-items: center; gap: 28px;
  height: 74px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { width: 40px; height: 40px; }
.brand-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase;
}
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a {
  font-size: 15px; color: var(--text-mid); position: relative;
  padding: 6px 0; transition: color 0.25s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--lava); transition: width 0.35s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { width: 100%; }
.nav-cta { margin-left: 6px; }

.burger {
  display: none; margin-left: auto; width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--line); border-radius: 2px;
  cursor: pointer; position: relative;
}
.burger span {
  position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.2s var(--ease);
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { bottom: 16px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-5px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: clamp(64px, 12vh, 128px); padding-top: 120px;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 42%;
  transform: scale(1.08);
  animation: heroDrift 18s var(--ease) forwards;
}
@keyframes heroDrift { to { transform: scale(1); } }
.hero-canvas {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity 1.2s var(--ease);
}
.hero-canvas.is-ready { opacity: 1; }
.hero-grade {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to top, rgba(10, 11, 12, 0.96) 2%, rgba(10, 11, 12, 0.34) 42%, rgba(10, 11, 12, 0.62) 100%),
    radial-gradient(120% 80% at 12% 100%, rgba(236, 106, 31, 0.14), transparent 60%);
}
.hero-inner { position: relative; z-index: 2; }

.hero-tag {
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: 0.22em; font-size: 13px; color: var(--lava-hot);
  margin-bottom: 20px; font-weight: 600;
}
.hero-title {
  font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.9rem, 8.5vw, 6rem);
  line-height: 1.05; letter-spacing: -0.01em;
  margin-bottom: 26px; max-width: 16ch;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.hero-title .lava { color: var(--lava); }
.hero-lead {
  max-width: 54ch; font-size: clamp(1rem, 2.2vw, 1.22rem);
  color: var(--text-mid); margin-bottom: 34px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-strip {
  position: relative; z-index: 2; margin-top: clamp(40px, 8vh, 84px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}
.strip-inner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 13px; color: var(--text-dim);
}
.strip-inner .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--lava); flex: none; }

/* ============================================================
   Section shell
   ============================================================ */
.section { padding-block: clamp(72px, 12vh, 140px); position: relative; }
.sec-head { max-width: 720px; margin-bottom: clamp(44px, 7vh, 76px); }
.sec-head-left { margin-bottom: clamp(32px, 5vh, 52px); }
.sec-title {
  font-family: var(--font-display); text-transform: uppercase;
  font-weight: 700; letter-spacing: -0.005em;
  font-size: clamp(1.9rem, 4.6vw, 3.1rem); line-height: 1.02;
}
.sec-sub {
  margin-top: 20px; color: var(--text-mid);
  font-size: clamp(1rem, 2vw, 1.15rem); max-width: 60ch;
}

/* ---- Engine capabilities ---- */
.engine {
  background: linear-gradient(180deg, rgba(10, 11, 12, 0.9) 0%, rgba(16, 17, 21, 0.9) 100%);
  padding-top: clamp(10px, 2vh, 24px);   /* minimal gap under hero — title sits high */
  padding-bottom: clamp(18px, 3vh, 35px); /* ×0.25 gap before "Игры на движке" */
}
.engine .sec-head { max-width: none; }
.engine .sec-sub { max-width: none; }
@media (min-width: 700px) {
  .engine .sec-title { white-space: nowrap; }   /* "Один движок — под все наши игры" в одну строку */
}
@media (min-width: 1080px) {
  .engine .sec-sub { white-space: nowrap; }      /* подзаголовок «Риолита» в одну строку */
}
.caps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: 4px; overflow: hidden;
}
.cap {
  background: var(--ink-2); padding: 34px 28px 38px;
  transition: background 0.4s var(--ease);
}
.cap:hover { background: var(--surface); }
.cap-i {
  width: 34px; height: 34px; fill: none;
  stroke: var(--lava); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
  margin-bottom: 22px;
}
.cap h3 {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: 1.18rem; letter-spacing: 0.01em; margin-bottom: 12px;
}
.cap p { color: var(--text-mid); font-size: 0.98rem; }

/* ============================================================
   Games
   ============================================================ */
.games { background: rgba(16, 17, 21, 0.9); padding-top: clamp(18px, 3vh, 35px); }

.game-shot { position: relative; overflow: hidden; background: #000; }
.game-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }

/* flagship */
.game-lead {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
}
.game-lead .game-shot { min-height: 420px; }
.game-lead:hover .game-shot img { transform: scale(1.04); }
.game-body { padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.game-kind {
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 12px; color: var(--lava-hot);
  font-weight: 600; margin-bottom: 14px;
}
.game-title {
  font-family: var(--font-display); text-transform: uppercase;
  font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.9rem); line-height: 1;
  margin-bottom: 16px;
}
.game-title .sep { color: var(--stone); margin: 0 8px; font-weight: 500; }
.game-desc { color: var(--text-mid); font-size: 1.02rem; margin-bottom: 22px; }

.link-play {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; border: 0; cursor: pointer; padding: 0;
  color: var(--text); font-family: var(--font-text); font-weight: 600; font-size: 15px;
  transition: color 0.25s var(--ease), gap 0.3s var(--ease);
}
.link-play svg { width: 16px; height: 16px; fill: var(--lava); transition: fill 0.25s var(--ease); }
.link-play:hover { color: var(--lava-hot); gap: 14px; }
.link-play:hover svg { fill: var(--lava-hot); }

/* play fab overlay */
.play-fab {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 74px; height: 74px; border-radius: 50%;
  background: rgba(10, 11, 12, 0.42); border: 1.5px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px); cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.45s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.play-fab svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }
.play-fab:hover {
  background: var(--lava); border-color: var(--lava);
  transform: translate(-50%, -50%) scale(1.08);
}
.play-fab:hover svg { fill: #150a03; }

/* secondary grid */
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.game-tile {
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: var(--surface); display: flex; flex-direction: column;
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease), box-shadow 0.5s var(--ease);
}
.game-tile:hover {
  transform: translateY(-6px); border-color: var(--stone);
  box-shadow: var(--shadow-md);
}
.game-tile .game-shot { aspect-ratio: 16 / 10; }
.game-tile:hover .game-shot img { transform: scale(1.06); }
.game-tile .game-body { padding: 26px 26px 30px; }
.game-tile .game-title { font-size: clamp(1.4rem, 2.6vw, 1.7rem); }
.game-tile .game-desc { font-size: 0.96rem; margin-bottom: 0; }

.game-text {
  justify-content: center;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(236, 106, 31, 0.1), transparent 55%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
}
.game-text .game-body { padding: 34px 30px; }
.game-flag {
  margin-top: 20px; align-self: flex-start;
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 12px; font-weight: 600;
  color: var(--lava-hot);
  border: 1px solid var(--lava-deep); border-radius: 2px; padding: 6px 12px;
}

/* ============================================================
   Invest
   ============================================================ */
.invest { background: rgba(10, 11, 12, 0.88); padding-bottom: clamp(27px, 4.5vh, 52px); }
.invest-inner {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(40px, 6vw, 88px);
  align-items: start;
}
.invest-lead {
  margin-top: 24px; font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.5; color: var(--text);
}
.invest-note { margin-top: 8px; color: var(--text-mid); max-width: 56ch; }
.invest-copy .btn { margin-top: 32px; }

.proof { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.proof li {
  display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: baseline;
  padding: 24px 0; border-top: 1px solid var(--line-soft);
}
.proof li:last-child { border-bottom: 1px solid var(--line-soft); }
.proof-k {
  font-family: var(--font-display); text-transform: uppercase;
  font-weight: 700; font-size: 1.5rem; color: var(--lava);
  line-height: 1;
}
.proof-v { color: var(--text-mid); font-size: 1rem; }

/* ============================================================
   Dev
   ============================================================ */
.dev { background: linear-gradient(180deg, rgba(10, 11, 12, 0.9) 0%, rgba(16, 17, 21, 0.9) 100%); padding-top: clamp(27px, 4.5vh, 52px); padding-bottom: 0; }
.dev .sec-title { color: var(--lava); }
.dev-rows {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--line);
}
.dev-row {
  padding: 34px 28px 34px 0; border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.dev-row:last-child { border-right: 0; }
.dev-row { padding-left: 28px; }
.dev-row:first-child { padding-left: 0; }
.dev-row h3 {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: 1.2rem; margin-bottom: 12px;
}
.dev-row p { color: var(--text-mid); font-size: 0.98rem; }
.dev-inner > .btn { margin-top: 40px; }

/* ============================================================
   Contact
   ============================================================ */
.contact {
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(236, 106, 31, 0.12), transparent 58%),
    rgba(10, 11, 12, 0.9);
  text-align: center;
}
.contact-inner { max-width: min(1120px, 94vw); margin-inline: auto; }
.contact-title {
  font-family: var(--font-display); text-transform: uppercase;
  font-weight: 700; font-size: clamp(1.8rem, 4.6vw, 3.2rem); line-height: 0.98;
  letter-spacing: -0.01em;
}
.contact-sub { margin-top: 22px; color: var(--text-mid); font-size: clamp(0.95rem, 1.9vw, 1.1rem); max-width: none; margin-inline: auto; }
@media (min-width: 720px) {
  .contact-title { white-space: nowrap; }
  .contact-sub { white-space: nowrap; }
}
.contact-links {
  margin-top: 44px; display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
}
.contact-card {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  min-width: 260px; padding: 24px 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
  transition: transform 0.45s var(--ease), border-color 0.35s var(--ease), box-shadow 0.45s var(--ease);
}
.contact-card:hover {
  transform: translateY(-4px); border-color: var(--stone); box-shadow: var(--shadow-md);
}
.contact-k {
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 12px; color: var(--lava-hot); font-weight: 600;
}
.contact-v { font-size: 1.28rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--line-soft); padding-block: 40px; background: rgba(10, 11, 12, 0.9); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.footer-brand img { width: 34px; height: 34px; }
.footer-note { color: var(--text-dim); font-size: 0.9rem; }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(4, 4, 5, 0.86); backdrop-filter: blur(6px); }
.lightbox-body {
  position: relative; z-index: 1; width: min(1000px, 100%);
  animation: lbIn 0.5s var(--ease);
}
@keyframes lbIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.lightbox-title {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-mid); margin-bottom: 12px; font-size: 14px;
}
.lightbox-video { width: 100%; border-radius: 6px; box-shadow: var(--shadow-lg); background: #000; aspect-ratio: 16 / 9; }
.lightbox-close {
  position: absolute; top: -50px; right: 0; width: 42px; height: 42px;
  background: transparent; border: 1px solid var(--line); border-radius: 3px; cursor: pointer;
  display: grid; place-items: center; transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.lightbox-close svg { width: 22px; height: 22px; stroke: var(--text); stroke-width: 2; fill: none; }
.lightbox-close:hover { border-color: var(--lava); background: rgba(236, 106, 31, 0.12); }

/* ============================================================
   Reveal (restrained)
   ============================================================ */
.shot [data-reveal] { opacity: 1 !important; transform: none !important; }
.shot.tall .hero { min-height: auto !important; }
.js [data-reveal] { opacity: 0; transform: translateY(20px); }
.js [data-reveal].in { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].d1 { transition-delay: 0.08s; }
[data-reveal].d2 { transition-delay: 0.16s; }
[data-reveal].d3 { transition-delay: 0.24s; }
[data-reveal].d4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  .hero-media img { animation: none; transform: scale(1); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .caps { grid-template-columns: repeat(2, 1fr); }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .invest-inner { grid-template-columns: 1fr; gap: 44px; }
  .dev-rows { grid-template-columns: 1fr; border-top: 0; }
  .dev-row { border-right: 0; padding: 26px 0; border-top: 1px solid var(--line); border-bottom: 0; padding-left: 0; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav, .nav-cta { display: none; }
  .burger { display: block; }
  .site-header[data-menu] { background: rgba(10, 11, 12, 0.96); backdrop-filter: blur(14px); }
  .site-header[data-menu] .nav {
    display: flex; position: fixed; inset: 74px 0 auto 0; flex-direction: column;
    gap: 0; padding: 8px var(--pad) 24px; margin: 0; border-bottom: 1px solid var(--line);
    background: rgba(10, 11, 12, 0.98);
  }
  .site-header[data-menu] .nav a { padding: 16px 0; border-bottom: 1px solid var(--line-soft); font-size: 18px; }
  .site-header[data-menu] .nav-cta {
    display: inline-flex; position: fixed; inset: auto 0 0 0; margin: 0;
    border-radius: 0; justify-content: center; height: 56px;
  }

  .game-lead { grid-template-columns: 1fr; }
  .game-lead .game-shot { min-height: 260px; aspect-ratio: 16 / 10; }
  .game-grid { grid-template-columns: 1fr; }
  .caps { grid-template-columns: 1fr; }
  .proof li { grid-template-columns: 90px 1fr; gap: 14px; }
  .contact-card { min-width: 0; width: 100%; }
  .hero { padding-bottom: 56px; }
}

@media (max-width: 400px) {
  .proof li { grid-template-columns: 1fr; gap: 4px; }
}

/* Faithful color when rendered to PDF (used for full-page QA capture) */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .hero { min-height: auto !important; }
  .hero-media img { animation: none !important; transform: none !important; }
}
