/* ================================================================
   platoshin. — DARK cinematic theme (grid homepage)
   Warm near-black paper, bone foreground, signal red.
   Rubik only. Pairs with site.js.
   ================================================================ */

/* Rubik — локальная статика темы (вариативный woff2, 400–900) */
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('../fonts/rubik-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('../fonts/rubik-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #0D0D0D;          /* neutral deep */
  --bg-2: #161616;        /* card well */
  --panel: #1A1813;
  --ink: #F4EFE6;         /* bone (foreground) */
  --ink-soft: #C9C2B5;
  --fg-dim: #8A8378;
  --line: #2A2722;
  --line-soft: #211E19;
  --red: #E8332B;         /* signal — overridable accent */
  --red-deep: #C2261F;

  --pad-x: 56px;
  --pad-x-mob: 20px;
  --easing: cubic-bezier(.2,.7,.1,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: 'Rubik', system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  letter-spacing: -0.005em;
  transition: background-color .6s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, video { display: block; max-width: 100%; }

.mono { font-family: 'Rubik', sans-serif; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }

/* film grain */
body::after {
  content: ""; position: fixed; inset: -180px 0 0; pointer-events: none; z-index: 60;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/></svg>");
  opacity: 0.06; mix-blend-mode: overlay;
}

/* ---------- LOADER ---------- */
.loader { position: fixed; inset: 0; background: var(--bg); z-index: 200; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 26px; }
.loader-mark { width: 84px; height: 84px; }
.loader-mark .mark-clip { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s var(--easing); }
.loader-pct { font-family: 'Rubik', sans-serif; color: var(--ink); font-feature-settings: "tnum"; }
.loader-pct b { color: var(--red); font-weight: 800; }

/* ---------- NAV ---------- */
nav.site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: 22px var(--pad-x); display: flex; justify-content: space-between; align-items: center; transition: background-color .4s ease, padding .4s ease, border-color .4s ease; border-bottom: 1px solid transparent; }
nav.site-nav.scrolled { background: rgb(from var(--bg) r g b / 0.82); backdrop-filter: blur(16px); padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-word { font-family: 'Rubik', sans-serif; font-weight: 800; letter-spacing: -0.04em; font-size: 22px; color: var(--ink); display: inline-flex; align-items: baseline; }
.brand-word .dot { color: var(--red); }
nav.site-nav ul { display: flex; gap: 28px; list-style: none; align-items: center; }
nav.site-nav ul a { display: inline-flex; gap: 8px; align-items: baseline; padding: 8px 2px; font-size: 14px; font-weight: 500; color: var(--ink); transition: color .35s ease; position: relative; }
nav.site-nav ul a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--easing); }
nav.site-nav ul a:hover { color: var(--ink); }
nav.site-nav ul a:hover::after { transform: scaleX(1); }
nav.site-nav ul a.is-current { color: var(--ink); }
nav.site-nav ul a.is-current::after { transform: scaleX(1); }

/* ---------- LANGUAGE SWITCH (underline, matches nav) ---------- */
.lang-li { margin-left: 4px; }
.lang-switch { display: inline-flex; align-items: center; gap: 10px; }
.lang-opt {
  position: relative; background: none; border: none; cursor: pointer; outline: none;
  font-family: 'Rubik', system-ui, sans-serif; font-size: 14px; letter-spacing: -0.005em;
  font-weight: 500; color: var(--ink); text-transform: lowercase;
  padding: 8px 2px; transition: color .35s ease;
}
.lang-opt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--easing);
}
.lang-opt:hover { color: var(--ink); }
.lang-opt:hover::after { transform: scaleX(1); }
.lang-opt.is-active { color: var(--ink); }
.lang-opt.is-active::after { transform: scaleX(1); }

/* i18n fallback fade — only when GSAP isn't driving the swap (.lang-fade path) */
body.lang-fade [data-i18n], body.lang-fade [data-i18n-html] { opacity: 0; transition: opacity .2s ease; }

/* ---------- BUTTONS ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: background-color .4s ease, color .4s ease, border-color .4s ease; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--ink); color: var(--bg); }
.btn .arrow { display: inline-flex; align-items: center; transition: transform .4s var(--easing); }
.btn .arrow svg { width: 18px; height: 18px; display: block; }
.btn:hover .arrow { transform: translateX(6px); }

/* ---------- FOOTER (slim) ---------- */
footer.site-footer { padding: 70px var(--pad-x) 34px; border-top: 1px solid var(--line); margin-top: 60px; }
.footer-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.footer-row .brand-word { font-size: 26px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--ink); font-size: 14px; display: inline-flex; gap: 6px; align-items: baseline; transition: color .3s ease; position: relative; padding-bottom: 3px; }
.footer-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--easing); }
.footer-links a:hover { color: var(--ink); }
.footer-links a:hover::after { transform: scaleX(1); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 26px; margin-top: 30px; border-top: 1px solid var(--line-soft); color: var(--fg-dim); flex-wrap: wrap; gap: 14px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  :root { --pad-x: var(--pad-x-mob); }
  nav.site-nav { padding: 13px var(--pad-x-mob); }
  nav.site-nav ul { gap: 12px; }
  nav.site-nav ul a { padding: 6px 2px; font-size: 12px; }
  .footer-row { align-items: flex-start; }
}

/* ---------- TOUCH / SMALL SCREENS ---------- */
@media (max-width: 640px) {
  nav.site-nav ul li:not(.mnav-li) { display: none; }
  nav.site-nav ul { gap: 0; }
  .brand-word { font-size: 20px; }
}
@media (max-width: 480px) {
  nav.site-nav ul { gap: 10px; }
  nav.site-nav ul a { font-size: 12px; }
  .lang-opt { font-size: 12px; }
  .brand-word { font-size: 18px; }
}
/* notch / home-indicator safe areas */
/* strip above the nav: in-app browsers (Telegram etc.) let the page bleed under
   the status bar but report env(safe-area-inset-top)=0 — a fixed element can't
   reach that zone, so the nav grows a solid cap extending upwards */
nav.site-nav::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 160px; background: transparent; pointer-events: none; }
nav.site-nav.scrolled::before { background: var(--bg); }
nav.site-nav { padding-left: max(var(--pad-x), env(safe-area-inset-left)); padding-right: max(var(--pad-x), env(safe-area-inset-right)); padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
nav.site-nav.scrolled { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
@media (max-width: 900px) {
  nav.site-nav { padding-top: calc(13px + env(safe-area-inset-top, 0px)); }
  nav.site-nav.scrolled { padding-top: calc(11px + env(safe-area-inset-top, 0px)); }
}
footer.site-footer { padding-bottom: max(34px, env(safe-area-inset-bottom)); }

/* ---------- MOBILE MENU (burger + fullscreen overlay) ---------- */
.mnav-li { display: none; }
.mnav-btn { -webkit-appearance: none; appearance: none; background: transparent; border: 0; border-radius: 0; color: inherit; -webkit-tap-highlight-color: transparent; position: relative; width: 44px; height: 40px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; padding: 8px 2px 8px 14px; }
.mnav-btn span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.35s var(--easing); }
.mnav-btn.is-open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.mnav-btn.is-open span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
.mnav { position: fixed; inset: -180px 0; z-index: 49; display: none; align-items: center; background: rgb(from var(--bg) r g b / 0.90); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s; }
.mnav.is-open { opacity: 1; visibility: visible; }
.mnav::before, .mnav::after { content: ""; position: absolute; left: 0; right: 0; height: 180px; background: var(--bg); pointer-events: none; }
.mnav::before { top: 0; }
.mnav::after { bottom: 0; }
.mnav-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; padding: 0 max(var(--pad-x), env(safe-area-inset-left)); }
.mnav-lang { margin-top: 30px; }
.mnav-lang .lang-opt { font-size: 15px; padding: 10px 4px; }
.mnav-link { display: flex; align-items: baseline; gap: 14px; font-family: 'Rubik', sans-serif; font-weight: 500; font-size: 22px; letter-spacing: -0.005em; line-height: 1.25; color: var(--ink); }
.mnav-link .mnav-n { font-size: 11px; color: var(--red); }
.mnav-link .mnav-t { position: relative; padding: 2px 2px 4px; }
.mnav-link .mnav-t::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: -2px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--easing); }
.mnav-link.is-current .mnav-t::after { transform: scaleX(1); }
@media (max-width: 640px) {
  .mnav-li { display: block; }
  .mnav { display: flex; }
}
