/*
 * CakeLauncher — лендинг.
 * Токены повторяют дизайн-систему лаунчера (tailwind.config.js): те же цвета, радиусы и тени,
 * чтобы сайт и приложение выглядели одной вещью.
 */
@layer reset, tokens, base, components, sections, motion;

/* Поворот торта вокруг своей оси — анимируется при появлении нового торта */
@property --spin {
  syntax: '<angle>';
  inherits: true;
  initial-value: 0deg;
}

/* ---------------- Шрифты ---------------- */
@font-face {
  font-family: 'Unbounded';
  src: url('../fonts/unbounded-cyrillic.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  src: url('../fonts/unbounded-latin.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-cyrillic.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, p, figure, ol, ul, dl { margin: 0; }
  ol[role='list'], ul[role='list'] { list-style: none; padding: 0; }
  img, picture, svg { display: block; max-width: 100%; }
  img { height: auto; }
  button, input { font: inherit; color: inherit; }
  button { cursor: pointer; }
  [hidden] { display: none !important; }
}

@layer tokens {
  :root {
    color-scheme: light;

    /* Цвета лаунчера */
    --canvas: #eef1f6;
    --surface: #ffffff;
    --muted: #f4f6fa;
    --line: #e6eaf1;
    --ink-900: #0f1826;
    --ink-700: #28323f;
    --ink-500: #5b6674;
    --ink-400: #7b8797;
    --ink-300: #9aa5b4;
    --brand-50: #eaf2ff;
    --brand-100: #d7e6ff;
    --brand-400: #4d93ff;
    --brand-500: #1a73ff;
    --brand-600: #0a5cf5;
    --brand-700: #0a4bcc;
    --cake-400: #ff6a52;
    --cake-500: #ef3b2d;
    --success-500: #16a34a;
    --online: #22c55e;
    /* Цвета торта — из логотипа */
    --sponge: #c4591f;
    --sponge-deep: #8c3a15;

    /* Типографика */
    --font-display: 'Unbounded', 'Inter', system-ui, sans-serif;
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Радиусы и тени лаунчера */
    --r-lg: 10px;
    --r-xl: 14px;
    --r-2xl: 18px;
    --r-3xl: 24px;
    --r-4xl: 28px;
    --shadow-card: 0 6px 24px -12px rgba(15, 24, 38, 0.14), 0 1px 2px rgba(15, 24, 38, 0.04);
    --shadow-float: 0 18px 40px -18px rgba(15, 24, 38, 0.28);
    --shadow-brand: 0 10px 24px -10px rgba(26, 115, 255, 0.65);
    --shadow-window: 0 60px 120px -40px rgba(15, 24, 38, 0.45), 0 24px 48px -24px rgba(15, 24, 38, 0.25);

    /* Раскладка */
    --container: 1240px;
    --gutter: clamp(16px, 4vw, 32px);
    --section-gap: clamp(88px, 12vw, 160px);
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: 88px; }
  body {
    min-height: 100vh;
    background-color: var(--canvas);
    /* Тот же фон, что у лаунчера: синее пятно сверху справа, тёплое снизу слева */
    background-image:
      radial-gradient(90rem 40rem at 100% -10%, rgba(26, 115, 255, 0.14), transparent 60%),
      radial-gradient(70rem 40rem at -10% 60rem, rgba(239, 59, 45, 0.08), transparent 62%),
      linear-gradient(180deg, #f5f8fc 0%, #eef1f6 45%, #e9edf4 100%);
    background-repeat: no-repeat;
    color: var(--ink-900);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
  }
  :focus-visible { outline: 2px solid var(--brand-500); outline-offset: 3px; border-radius: 6px; }
  ::selection { background: var(--brand-100); }
  code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: var(--muted);
    border: 1px solid var(--line);
    padding: 0.1em 0.4em;
    border-radius: 6px;
    word-break: break-word;
  }
}

@layer components {
  .container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
  .visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 100;
    background: var(--ink-900); color: #fff; padding: 10px 16px; border-radius: var(--r-xl);
    text-decoration: none; font-weight: 600; transition: top 0.2s;
  }
  .skip-link:focus { top: 16px; }

  .icon { width: 20px; height: 20px; flex: none; }
  .mono { font-family: var(--font-mono); font-feature-settings: 'zero' 0; letter-spacing: -0.01em; }

  /* ---------- Типографика ---------- */
  .display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; text-wrap: balance; }
  .h2 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.06; }
  .lead { font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-500); line-height: 1.6; text-wrap: pretty; max-width: 58ch; }
  .eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-600);
  }
  .eyebrow .icon { width: 18px; height: 18px; }
  .t-cake { color: var(--cake-500); }
  .brand-cake { color: var(--cake-500); }
  .brand-cake-light { color: var(--cake-400); }
  .link { color: var(--brand-600); font-weight: 600; text-decoration: none; }
  .link:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: 3px; }

  /* ---------- Фирменный знак ---------- */
  .brand-mark {
    display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-900);
    font-weight: 800; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap;
  }
  .brand-mark img { filter: drop-shadow(0 1px 2px rgba(15, 24, 38, 0.15)); }

  /* ---------- Кнопки: копия .btn лаунчера ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 10px 16px; border-radius: var(--r-xl); border: 0;
    font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none;
    transition: transform 0.15s var(--ease-out), box-shadow 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active { transform: scale(0.98); }
  .btn-primary {
    color: #fff;
    background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
    box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
  .btn-primary:hover { background: linear-gradient(180deg, var(--brand-400), var(--brand-500)); }
  .btn-white { background: var(--surface); color: var(--ink-700); border: 1px solid var(--line); }
  .btn-white:hover { background: var(--muted); border-color: rgba(154, 165, 180, 0.4); }
  .btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 12px; gap: 8px; }
  .btn-sm .icon { width: 17px; height: 17px; }
  .btn-lg { height: 56px; padding-inline: 24px; font-size: 16px; border-radius: var(--r-2xl); }
  .btn-block { width: 100%; }

  .icon-btn {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-xl);
    background: var(--brand-50); color: var(--brand-600); transition: background-color 0.2s, transform 0.15s;
  }
  .icon-btn:hover { background: var(--brand-100); }
  .icon-btn:active { transform: scale(0.95); }

  /* ---------- Метки ---------- */
  .chip {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    padding: 6px 12px; border-radius: var(--r-lg); background: var(--muted);
    font-size: 13px; font-weight: 600; color: var(--ink-500);
  }
  .chip .icon { width: 16px; height: 16px; }
  .chip-brand { background: var(--brand-50); color: var(--brand-600); }

  /* ---------- Сегментированный переключатель лаунчера ---------- */
  .segmented {
    display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-2xl);
    background: var(--surface); box-shadow: var(--shadow-card);
  }
  .segmented-item {
    border: 0; background: transparent; border-radius: 12px; padding: 8px 16px;
    font-size: 14px; font-weight: 700; color: var(--ink-500); transition: background-color 0.2s, color 0.2s;
  }
  .segmented-item:hover { background: var(--muted); color: var(--ink-900); }
  .segmented-item[aria-checked='true'] { background: var(--brand-500); color: #fff; box-shadow: var(--shadow-brand); }
  .segmented-block { display: flex; box-shadow: none; background: var(--muted); }
  .segmented-block .segmented-item { flex: 1; }

  /* ---------- Окно приложения со скриншотом ---------- */
  .window {
    --radius: 12px; /* как у окна лаунчера в Windows 11 */
    position: relative; container-type: inline-size;
    border-radius: var(--radius); overflow: hidden; background: var(--canvas);
    box-shadow: var(--shadow-window), 0 0 0 1px rgba(15, 24, 38, 0.08);
    isolation: isolate;
  }
  .window img { width: 100%; }
}

@layer sections {
  /* ---------------- Шапка ---------------- */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(238, 241, 246, 0.72);
    backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
    border-bottom: 1px solid transparent; transition: border-color 0.3s, background-color 0.3s;
  }
  .site-header[data-scrolled] { border-bottom-color: rgba(15, 24, 38, 0.07); background: rgba(245, 248, 252, 0.85); }
  .header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
  .header-nav { display: flex; gap: 4px; margin-inline: auto; }
  .header-nav a {
    padding: 8px 14px; border-radius: 12px; color: var(--ink-500); font-weight: 600; font-size: 15px;
    text-decoration: none; transition: background-color 0.2s, color 0.2s;
  }
  .header-nav a:hover { background: rgba(255, 255, 255, 0.7); color: var(--ink-900); }

  /* ---------------- Первый экран ---------------- */
  .hero { padding-top: clamp(40px, 7vw, 88px); }
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; gap: 32px; }
  /* Это H1 страницы: строка длиннее обычной метки, поэтому переносится */
  .hero-chip { margin-bottom: 24px; white-space: normal; line-height: 1.35; font-size: 14px; }
  .hero-title { font-size: clamp(42px, 6.6vw, 84px); line-height: 1.0; letter-spacing: -0.045em; margin-bottom: 24px; }
  .hero-title .t-cake { display: inline-block; }
  .download-pair { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
  .btn-os { background: var(--surface); color: var(--ink-900); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
  .btn-os:hover { border-color: var(--brand-100); background: #fff; box-shadow: var(--shadow-float); }
  .btn-os .icon { width: 22px; height: 22px; }
  /* Кнопка системы посетителя — главная, как «Играть» в лаунчере */
  .btn-os[data-primary] {
    color: #fff; border-color: transparent;
    background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
    box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
  .btn-os[data-primary]:hover { background: linear-gradient(180deg, var(--brand-400), var(--brand-500)); }
  .hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; color: var(--ink-500); font-size: 13px; }
  .mobile-note {
    margin-top: 28px; padding: 16px; border-radius: var(--r-2xl); background: var(--surface); box-shadow: var(--shadow-card);
    display: grid; gap: 12px; color: var(--ink-500); font-size: 15px;
  }

  /* ---------------- Воксельный торт в стиле Minecraft ---------------- */
  .cake-stage { position: relative; display: grid; justify-items: center; gap: 8px; }
  .cake-button {
    --u: clamp(13px, 1.9vw, 21px); /* один «пиксель» Minecraft */
    --tilt-x: 0deg; --tilt-y: 0deg;
    position: relative; width: calc(var(--u) * 24); height: calc(var(--u) * 22);
    border: 0; background: none; padding: 0; border-radius: 32px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* частые нажатия не приближают страницу на телефоне */
  }
  .cake-scene { position: absolute; inset: 0; perspective: 1800px; display: grid; place-items: center; }
  /* Точка опоры — у основания торта: так он приседает при приземлении, а не сжимается к центру */
  /* Постоянный «пустой» transform: торт рисуется в одной и той же перспективе и в покое, и во время
     анимации появления — иначе в момент её окончания он заметно «прыгает» */
  .cake-drop { position: relative; display: block; width: 0; height: 0; transform-style: preserve-3d; transform-origin: 0 calc(var(--u) * 5); transform: translate3d(0, 0, 0); }
  .cake {
    --w: 14; /* ширина в пикселях: 14, минус 2 за каждый укус */
    --bites: 0;
    --pose: rotateX(calc(-32deg + var(--tilt-x))) rotateY(calc(-42deg + var(--tilt-y) + var(--spin)));
    /* display: block обязателен: это <span>, а к строчным элементам transform не применяется */
    position: relative; display: block; width: 0; height: 0; transform-style: preserve-3d;
    /* Укусы снимают правую, обращённую к зрителю сторону — виден срез, как в игре */
    transform: translateY(calc(var(--u) * -1)) var(--pose) translateX(calc(var(--bites) * var(--u) * -1));
    transition: transform 0.6s var(--ease-out), opacity 0.4s;
  }
  .cake-face {
    position: absolute; left: 0; top: 0; transform-style: preserve-3d;
    image-rendering: pixelated; background-repeat: no-repeat;
    backface-visibility: hidden;
    transition: width 0.28s var(--ease-spring), transform 0.28s var(--ease-spring);
  }
  /* Грани обрезаются со стороны укуса: текстура остаётся на месте, как в игре */
  .cake-top {
    width: calc(var(--w) * var(--u)); height: calc(14 * var(--u));
    background-image: url('../img/cake/top.svg'); background-size: calc(14 * var(--u)) 100%; background-position: left;
    transform: translate(-50%, -50%) rotateX(90deg) translateZ(calc(4 * var(--u)));
  }
  .cake-front, .cake-back {
    width: calc(var(--w) * var(--u)); height: calc(8 * var(--u));
    background-image: url('../img/cake/side.svg'); background-size: calc(14 * var(--u)) 100%;
  }
  .cake-front { background-position: left; transform: translate(-50%, -50%) translateZ(calc(7 * var(--u))); filter: brightness(0.94); }
  .cake-back { background-position: right; transform: translate(-50%, -50%) rotateY(180deg) translateZ(calc(7 * var(--u))); filter: brightness(0.7); }
  .cake-right, .cake-left { width: calc(14 * var(--u)); height: calc(8 * var(--u)); background-size: 100% 100%; background-image: url('../img/cake/side.svg'); }
  .cake-right { transform: translate(-50%, -50%) rotateY(90deg) translateZ(calc(var(--w) * var(--u) / 2)); filter: brightness(0.76); }
  .cake-left { transform: translate(-50%, -50%) rotateY(-90deg) translateZ(calc(var(--w) * var(--u) / 2)); filter: brightness(0.9); }
  .cake[data-bitten] .cake-right { background-image: url('../img/cake/inner.svg'); }
  /* Новый торт встаёт целым сразу, без «доедания» назад */
  .cake[data-instant], .cake[data-instant] .cake-face { transition: none; }
  .cake-shadow {
    position: absolute; left: 50%; top: 72%; width: calc(var(--u) * 20); height: calc(var(--u) * 5);
    translate: -50% 0; border-radius: 50%; z-index: -1;
    background: radial-gradient(closest-side, rgba(15, 24, 38, 0.22), transparent);
    transition: opacity 0.3s, scale 0.3s;
  }
  /* Эффекты наведения — только там, где есть мышь: на телефоне они «залипают» после касания */
  @media (hover: hover) {
    .cake-button:hover .cake { transform: translateY(calc(var(--u) * -1.6)) var(--pose) translateX(calc(var(--bites) * var(--u) * -1)); }
  }
  .cake-button:focus-visible { outline-offset: 8px; border-radius: 40px; }
  .cake-caption { font-size: 13px; color: var(--ink-500); min-height: 1.6em; text-align: center; }
  .cake-crumbs { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; }
  .crumb { position: absolute; width: 8px; height: 8px; will-change: transform, opacity; }

  /* ---------------- Главный скриншот ---------------- */
  .hero-shot { margin-top: clamp(48px, 7vw, 88px); perspective: 2000px; }
  .hero-shot .window { transform-origin: 50% 0; }
  .shot-caption {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 28px; color: var(--ink-500); font-size: 15px; text-align: center; text-wrap: balance;
  }
  .shot-caption .icon { width: 18px; height: 18px; color: var(--brand-500); }
  .shot-caption b { color: var(--ink-900); font-weight: 600; }

  /* ---------------- Версии и моды ---------------- */
  .loaders { margin-top: clamp(64px, 9vw, 112px); }
  .loaders-inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px;
    padding: 24px 28px; border-radius: var(--r-3xl); background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-card); border: 1px solid rgba(255, 255, 255, 0.8);
  }
  .loaders-count { display: flex; align-items: center; gap: 14px; color: var(--ink-500); font-size: 15px; }
  .loaders-count > span:last-child { max-width: 24ch; line-height: 1.4; }
  .loaders-count .display { font-size: 40px; color: var(--brand-600); letter-spacing: -0.04em; }
  .loader-list { display: flex; flex-wrap: wrap; gap: 8px 22px; }
  .loader-list li { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--ink-700); }
  .loader-list img { width: 40px; height: 40px; }

  /* ---------------- Секции ---------------- */
  .section { padding-top: var(--section-gap); }
  .section-head { display: grid; gap: 16px; margin-bottom: clamp(36px, 5vw, 56px); max-width: 760px; }

  /* ---------------- Витрина разделов ---------------- */
  .showcase { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
  .showcase-tabs { display: grid; gap: 6px; }
  .showcase-tab {
    display: flex; gap: 14px; text-align: left; border: 0; background: transparent;
    padding: 16px 18px; border-radius: var(--r-2xl); color: var(--ink-500);
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
  }
  .showcase-tab .icon { width: 22px; height: 22px; margin-top: 2px; }
  .tab-text { display: grid; gap: 4px; }
  .tab-title { font-weight: 700; font-size: 16px; color: var(--ink-900); transition: color 0.2s; }
  /* Текст вкладки раскрывается плавно (0fr → 1fr), без скачка соседних вкладок */
  .tab-body {
    display: grid; grid-template-rows: 0fr; font-size: 14px; line-height: 1.55;
    transition: grid-template-rows 0.45s var(--ease-out);
  }
  .tab-body > span { overflow: hidden; }
  @media (hover: hover) { .showcase-tab:hover { background: rgba(255, 255, 255, 0.7); } }
  /* Активная вкладка — как активный пункт меню лаунчера (.nav-item-active) */
  .showcase-tab[aria-selected='true'] {
    background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); color: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-brand);
  }
  .showcase-tab[aria-selected='true'] .tab-title { color: #fff; }
  .showcase-tab[aria-selected='true'] .tab-body { grid-template-rows: 1fr; }
  .showcase-view { position: sticky; top: 100px; perspective: 2400px; outline-offset: 12px; }

  /* Сцена: у каждой вкладки свой ракурс «камеры», переход между ними — плавный облёт */
  .stage {
    --ry: -14deg; --rx: 7deg; --rz: 0deg; --tz: 0px; --gx: 25%; --k: 1;
    transform-style: preserve-3d;
    transform: rotateY(calc(var(--ry) * var(--k))) rotateX(calc(var(--rx) * var(--k))) rotateZ(calc(var(--rz) * var(--k))) translateZ(var(--tz));
    transition: transform 1.1s var(--ease-out), opacity 0.8s var(--ease-out);
    will-change: transform;
  }
  .stage[data-angle='mods'] { --ry: 13deg; --rx: 6deg; --rz: -0.6deg; --gx: 80%; }
  .stage[data-angle='builds'] { --ry: -6deg; --rx: 16deg; --rz: 0.4deg; --tz: -20px; --gx: 45%; }
  .stage[data-angle='servers'] { --ry: 16deg; --rx: -3deg; --rz: 0.6deg; --gx: 95%; }
  .stage[data-angle='player'] { --ry: -18deg; --rx: 3deg; --rz: -0.4deg; --tz: 10px; --gx: 5%; }
  /* Пока секция не на экране — окно лежит «плашмя» и ждёт своего выхода */
  .stage[data-waiting] { --ry: -28deg; --rx: 34deg; --rz: 4deg; --tz: -160px; opacity: 0; }

  /* Подпись активной вкладки нужна только на узких экранах: там текст вкладки уходит под скриншот */
  .showcase-caption { display: none; margin-top: 20px; color: var(--ink-500); font-size: 15px; }

  .stage-window { display: grid; box-shadow: 0 50px 100px -40px rgba(15, 24, 38, 0.5), 0 0 0 1px rgba(15, 24, 38, 0.08); }
  .stage-layer { grid-area: 1 / 1; }
  .stage-layer:not(.is-active) { visibility: hidden; opacity: 0; }
  /* Новый экран «проявляется» сверху вниз, сбрасывая размытие */
  .stage-layer.is-entering { visibility: visible; animation: layer-in 0.75s var(--ease-out) both; z-index: 2; }
  .stage-layer.is-leaving { visibility: visible; animation: layer-out 0.75s ease both; z-index: 1; }
  /* Блик скользит по стеклу вслед за поворотом */
  .stage-glare {
    grid-area: 1 / 1; z-index: 3; pointer-events: none; mix-blend-mode: soft-light;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 45%, transparent 60%);
    background-size: 250% 100%; background-position: var(--gx) 0;
    transition: background-position 1.1s var(--ease-out);
  }

  /* ---------------- CakeLink ---------------- */
  .cakelink { padding-bottom: 0; }
  .cakelink-grid {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 64px); align-items: center;
    padding: clamp(28px, 5vw, 64px); border-radius: var(--r-4xl); color: #fff;
    /* Как баннер CakeLink в лаунчере */
    background:
      radial-gradient(60rem 30rem at 110% -20%, rgba(77, 147, 255, 0.9), transparent 60%),
      radial-gradient(40rem 30rem at -20% 120%, rgba(10, 75, 204, 0.9), transparent 60%),
      linear-gradient(135deg, var(--brand-500), var(--brand-700));
    box-shadow: 0 40px 80px -40px rgba(10, 75, 204, 0.6);
  }
  .cakelink-grid::before {
    /* Пиксельная сетка — отсылка к блокам, еле заметная */
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.08;
    background-image: linear-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at 80% 20%, #000, transparent 70%);
  }
  .cakelink .eyebrow-light { color: #fff; text-transform: none; letter-spacing: -0.01em; font-size: 20px; font-weight: 800; }
  .cakelink .lead { color: rgba(255, 255, 255, 0.82); }
  .cakelink-copy { position: relative; display: grid; gap: 18px; }
  .cakelink .h2 { font-size: clamp(28px, 3.5vw, 44px); }
  .steps { display: grid; gap: 18px; margin-top: 14px; }
  .steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
  .step-num {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.25); font-weight: 700;
  }
  .steps h3 { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
  .steps p { color: rgba(255, 255, 255, 0.78); font-size: 15px; }
  .cakelink-note {
    margin-top: 6px; font-size: 14px; color: rgba(255, 255, 255, 0.8);
    padding: 12px 14px; border-radius: var(--r-xl); background: rgba(15, 24, 38, 0.18);
  }
  .cakelink-visual { position: relative; padding-bottom: 40px; }
  .cakelink-visual .window { box-shadow: 0 40px 80px -30px rgba(5, 20, 60, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.2); }
  .invite-card {
    position: absolute; z-index: 3; left: clamp(-8px, -2vw, -24px); bottom: 0;
    display: grid; gap: 6px; padding: 18px 22px; border-radius: var(--r-3xl);
    background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-float), 0 30px 60px -30px rgba(5, 20, 60, 0.6);
  }
  .invite-label { font-size: 12px; font-weight: 700; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.06em; }
  .invite-code { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; letter-spacing: 0.14em; color: var(--brand-600); min-width: 7.5ch; }
  .invite-code .caret { display: inline-block; width: 0.08em; height: 0.9em; background: var(--brand-500); margin-left: 2px; vertical-align: -0.08em; animation: blink 1s steps(1) infinite; }
  .invite-status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--success-500); }
  .invite-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }

  /* ---------------- Удобно ---------------- */
  .care-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .care-card {
    padding: 26px; border-radius: var(--r-3xl); background: var(--surface); box-shadow: var(--shadow-card);
    display: grid; align-content: start; gap: 10px; transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
  }
  @media (hover: hover) { .care-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-float); } }
  .care-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--r-xl); background: var(--brand-50); color: var(--brand-600); margin-bottom: 6px; }
  .care-icon .icon { width: 22px; height: 22px; }
  .care-card h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
  .care-card p { color: var(--ink-500); font-size: 15px; }

  /* ---------------- Скачать ---------------- */
  .download { position: relative; margin-top: var(--section-gap); padding-block: clamp(80px, 10vw, 128px); isolation: isolate; }
  /* Мир Minecraft за карточками: края растворяются в фоне страницы маской, без полос */
  .download-bg {
    position: absolute; inset: 0; z-index: -1; overflow: hidden;
    mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 68%, transparent 100%);
  }
  .download-bg img { width: 100%; height: 100%; object-fit: cover; }
  .download-bg::after {
    content: ''; position: absolute; inset: 0;
    background:
      radial-gradient(60rem 22rem at 50% 24%, rgba(15, 24, 38, 0.55), transparent 70%),
      rgba(15, 24, 38, 0.38);
  }
  .section-head-light { color: #fff; text-align: center; justify-items: center; margin-inline: auto; }
  .section-head-light .lead { color: rgba(255, 255, 255, 0.86); }
  .section-head-light .h2 { text-shadow: 0 2px 24px rgba(15, 24, 38, 0.35); }
  .download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; max-width: 960px; margin-inline: auto; }
  .download-card {
    display: flex; flex-direction: column; gap: 18px; padding: clamp(22px, 3vw, 32px); border-radius: var(--r-4xl);
    background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: var(--shadow-float);
    transition: box-shadow 0.3s, transform 0.3s var(--ease-out);
  }
  .download-card[data-detected] { box-shadow: 0 0 0 2px var(--brand-500), var(--shadow-float); }
  .download-card-head { display: flex; align-items: center; gap: 14px; }
  .download-card-head h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
  .download-card-head p { font-size: 14px; color: var(--ink-500); }
  .os-badge { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-2xl); background: var(--ink-900); color: #fff; }
  .os-badge .icon { width: 26px; height: 26px; }
  .detected-chip { margin-left: auto; display: none; }
  .download-card[data-detected] .detected-chip { display: inline-flex; }
  .download-meta { font-size: 13px; color: var(--ink-500); text-align: center; margin-top: -6px; }
  .download-hint { font-size: 14px; color: var(--ink-500); padding-top: 16px; border-top: 1px solid var(--line); }
  .download-foot {
    width: fit-content; max-width: min(100%, 72ch); margin: 24px auto 0; padding: 12px 18px; border-radius: var(--r-2xl);
    text-align: center; font-size: 14px; color: var(--ink-700);
    background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }

  /* ---------------- Вопросы ---------------- */
  .faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
  .faq .section-head { position: sticky; top: 100px; }
  .faq-list { display: grid; gap: 10px; }
  .faq details { border-radius: var(--r-2xl); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
  .faq summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 20px 22px; font-weight: 700; font-size: 17px; cursor: pointer; list-style: none;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after {
    content: ''; flex: none; width: 28px; height: 28px; border-radius: 10px; background-color: var(--muted);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6674' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E");
    background-size: 16px; background-position: center; background-repeat: no-repeat;
    transition: rotate 0.25s var(--ease-out), background-color 0.2s;
  }
  /* Крестик поворачивается сразу по нажатию — и при открытии, и при закрытии */
  .faq details[open]:not([data-closing]) summary::after { rotate: 45deg; background-color: var(--brand-50); }
  .faq summary:hover::after { background-color: var(--line); }
  .faq-body { overflow: hidden; }
  .faq-body p { padding: 0 22px 22px; color: var(--ink-500); }

  /* ---------------- Подвал ---------------- */
  .site-footer { margin-top: var(--section-gap); padding-block: 40px calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(15, 24, 38, 0.07); }
  .footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
  .social { display: flex; gap: 8px; margin-left: auto; }
  .footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; flex-basis: 100%; }
  .footer-links a { color: var(--ink-500); font-size: 14px; font-weight: 600; text-decoration: none; }
  .footer-links a:hover { color: var(--brand-600); text-decoration: underline; text-underline-offset: 3px; }

  /* ---------------- Статьи ---------------- */
  .article { padding-top: clamp(32px, 5vw, 56px); }
  .article-inner { width: min(100% - 2 * var(--gutter), 780px); margin-inline: auto; }
  .breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 22px; font-size: 14px; color: var(--ink-500); }
  .breadcrumbs li + li::before { content: '›'; margin-right: 6px; color: var(--ink-300); }
  .breadcrumbs a { color: var(--ink-500); text-decoration: none; }
  .breadcrumbs a:hover { color: var(--brand-600); }
  .article-title { font-size: clamp(32px, 5vw, 52px); line-height: 1.06; margin-bottom: 18px; }
  .article-meta { margin-top: 14px; font-size: 14px; color: var(--ink-500); }
  .prose { margin-top: 40px; font-size: 17px; line-height: 1.7; color: var(--ink-700); }
  .prose > * + * { margin-top: 18px; }
  .prose h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; color: var(--ink-900); margin-top: 52px; }
  .prose h3 { font-size: 20px; font-weight: 700; color: var(--ink-900); margin-top: 32px; }
  .prose ul, .prose ol { padding-left: 1.3em; }
  .prose li + li { margin-top: 8px; }
  .prose a:not(.btn) { color: var(--brand-600); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
  .prose strong { color: var(--ink-900); }
  .prose figure { margin: 32px 0; }
  .prose figure .window { box-shadow: var(--shadow-float), 0 0 0 1px rgba(15, 24, 38, 0.08); }
  .prose figcaption { margin-top: 12px; font-size: 14px; color: var(--ink-500); text-align: center; }
  .prose table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); border-radius: var(--r-2xl); overflow: hidden; box-shadow: var(--shadow-card); }
  .prose th, .prose td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
  .prose th { color: var(--ink-900); background: var(--muted); font-weight: 700; }
  .prose tr:last-child td { border-bottom: 0; }
  .table-scroll { overflow-x: auto; }
  /* Шаги инструкции — нумерация здесь настоящая последовательность */
  .howto { list-style: none; padding: 0 !important; counter-reset: step; display: grid; gap: 14px; }
  .howto > li { counter-increment: step; position: relative; padding: 20px 22px 20px 70px; border-radius: var(--r-2xl); background: var(--surface); box-shadow: var(--shadow-card); margin: 0 !important; }
  .howto > li::before {
    content: counter(step); position: absolute; left: 20px; top: 18px; display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 11px; background: var(--brand-50); color: var(--brand-600);
    font-family: var(--font-mono); font-weight: 700;
  }
  .howto h3 { margin: 0 0 4px; font-size: 18px; }
  .howto p { margin: 0; }
  .callout { padding: 18px 20px; border-radius: var(--r-2xl); background: var(--brand-50); color: var(--brand-700); font-size: 16px; }
  .cta-block {
    margin-top: 56px; padding: clamp(24px, 4vw, 40px); border-radius: var(--r-4xl); color: #fff; display: grid; gap: 16px;
    background: radial-gradient(40rem 20rem at 110% -20%, rgba(77, 147, 255, 0.9), transparent 60%), linear-gradient(135deg, var(--brand-500), var(--brand-700));
    box-shadow: 0 30px 60px -30px rgba(10, 75, 204, 0.6);
  }
  .cta-block h2 { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.03em; line-height: 1.1; margin: 0; color: #fff; }
  .cta-block p { color: rgba(255, 255, 255, 0.85); margin: 0; }
  .cta-block .download-pair { margin-top: 6px; }
  .cta-block .btn-os { border-color: transparent; }
  .cta-block .btn-os[data-primary] { background: #fff; color: var(--brand-700); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.35); }
  .related { margin-top: 56px; }
  .related h2 { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
  .related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
  .related-grid a {
    display: grid; gap: 6px; padding: 18px 20px; border-radius: var(--r-2xl); background: var(--surface); box-shadow: var(--shadow-card);
    color: var(--ink-900); text-decoration: none; font-weight: 700; transition: box-shadow 0.2s, transform 0.2s var(--ease-out);
  }
  .related-grid a span { color: var(--ink-500); font-weight: 500; font-size: 14px; }
  @media (hover: hover) { .related-grid a:hover { box-shadow: var(--shadow-float); transform: translateY(-2px); } }
  /* ---------------- Счётчик скачиваний ---------------- */
  .counter-card {
    position: relative; overflow: hidden; isolation: isolate; display: grid; justify-items: center; text-align: center; gap: 18px;
    padding: clamp(40px, 7vw, 80px) clamp(20px, 5vw, 64px); border-radius: var(--r-4xl); color: #fff;
    background: radial-gradient(46rem 24rem at 100% -10%, rgba(77, 147, 255, 0.95), transparent 60%),
      radial-gradient(30rem 20rem at -10% 120%, rgba(10, 60, 170, 0.9), transparent 60%), linear-gradient(135deg, var(--brand-500), var(--brand-700));
    box-shadow: 0 40px 80px -40px rgba(10, 75, 204, 0.65);
  }
  .counter-card::before {
    content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0.16;
    background-image: linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 32px 32px; mask-image: radial-gradient(closest-side, #000, transparent);
  }
  .counter-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 2.6vw, 28px); letter-spacing: -0.02em; color: rgba(255, 255, 255, 0.9); }
  .counter-value { display: flex; flex-wrap: nowrap; justify-content: center; gap: 0.08em; margin: 4px 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 9vw, 96px); line-height: 1; }
  .counter-digit {
    position: relative; display: inline-block; width: 1em; height: 1.3em; overflow: hidden; border-radius: 0.2em;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 18px 30px -18px rgba(0, 20, 70, 0.6);
  }
  .counter-digit::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 30, 90, 0.18); }
  .counter-strip { display: flex; flex-direction: column; transform: translateY(0); transition: transform 1.8s var(--ease-out); }
  .counter-strip span { display: grid; place-items: center; font-size: 0.78em; height: calc(1.3em / 0.78); text-shadow: 0 4px 18px rgba(0, 20, 70, 0.35); }
  .counter-gap { width: 0.12em; }
  .counter-sub { font-size: clamp(16px, 1.8vw, 19px); color: rgba(255, 255, 255, 0.85); }
  .counter-sub [data-counter-word] { font-weight: 700; color: #fff; }
  .counter-cta { margin-top: 10px; background: #fff; color: var(--brand-700); box-shadow: 0 14px 30px -12px rgba(0, 20, 70, 0.5); }
  .counter-cta:hover { background: var(--brand-50); }
  .counter-block { position: absolute; z-index: -1; width: clamp(56px, 8vw, 96px); height: auto; image-rendering: pixelated; filter: drop-shadow(0 18px 24px rgba(0, 20, 70, 0.45)); animation: floaty 6s ease-in-out infinite; }
  .counter-block-a { left: 6%; top: 14%; rotate: -12deg; }
  .counter-block-b { right: 7%; bottom: 12%; rotate: 10deg; animation-delay: -2s; }
  .counter-block-c { right: 12%; top: 10%; width: clamp(36px, 5vw, 60px); rotate: 18deg; animation-delay: -4s; opacity: 0.85; }
  @media (max-width: 640px) { .counter-block-a, .counter-block-c { display: none; } .counter-block-b { right: -10px; bottom: -10px; opacity: 0.6; } }
  @media (prefers-reduced-motion: reduce) { .counter-strip { transition: none; } .counter-block { animation: none; } }

  /* ---------------- Minecraft-детали: слот инвентаря, «достижение» о cookie ---------------- */
  /* Слот инвентаря: серый квадрат с вдавленной пиксельной рамкой, как в игре */
  .mc-slot {
    display: grid; place-items: center; flex-shrink: 0; width: 56px; height: 56px; background: #8b8b8b;
    box-shadow: inset 3px 3px 0 #373737, inset -3px -3px 0 #ffffff;
  }
  .mc-slot img { width: 40px; height: 40px; image-rendering: pixelated; }

  .privacy-short { margin-top: 36px; padding: 22px; border-radius: var(--r-3xl); background: #c6c6c6; box-shadow: inset 4px 4px 0 #ffffff, inset -4px -4px 0 #555555, 0 0 0 3px #1d1d1d; }
  .privacy-short-title { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: #3f3f3f; margin-bottom: 14px; }
  .privacy-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
  .privacy-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px; background: #d9d9d9; box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #8b8b8b; }
  .privacy-card strong { display: block; color: #1d1d1d; font-size: 15px; }
  .privacy-card span span { display: block; margin-top: 2px; color: #3f3f3f; font-size: 13.5px; line-height: 1.45; }
  .privacy-promise { display: flex; align-items: center; gap: 10px; margin: 16px 2px 0; font-weight: 700; color: #1d1d1d; }
  .privacy-promise img { image-rendering: pixelated; }

  /* Уведомление о cookie — как всплывающее «достижение» в Minecraft */
  .mc-toast {
    position: fixed; left: 20px; bottom: 20px; z-index: 60; width: min(420px, calc(100vw - 32px));
    display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; padding: 14px 16px 16px;
    background: #212121; color: #e6e6e6; border-radius: 4px;
    box-shadow: 0 0 0 3px #000, inset 3px 3px 0 #555, inset -3px -3px 0 #121212, 0 24px 48px -18px rgba(0, 0, 0, 0.6);
    animation: mc-toast-in 0.55s var(--ease-out) both;
  }
  .mc-toast.is-leaving { animation: mc-toast-out 0.35s ease-in both; }
  @keyframes mc-toast-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
  @keyframes mc-toast-out { to { opacity: 0; transform: translateY(16px); } }
  .mc-toast .mc-slot { width: 52px; height: 52px; }
  .mc-toast .mc-slot img { width: 36px; height: 36px; animation: mc-bob 2.4s ease-in-out infinite; }
  @keyframes mc-bob { 50% { transform: translateY(-3px) rotate(-6deg); } }
  .mc-toast-title { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: #ffff55; text-shadow: 2px 2px 0 #3f3f15; letter-spacing: 0.01em; }
  .mc-toast-title b { display: block; color: #ffffff; text-shadow: 2px 2px 0 #3f3f3f; font-size: 15px; }
  .mc-toast-text { grid-column: 1 / -1; margin: 0; font-size: 13.5px; line-height: 1.5; color: #d0d0d0; }
  .mc-toast-text a { color: #7cc4ff; text-decoration: underline; text-underline-offset: 3px; }
  .mc-toast-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
  /* Кнопка из игрового меню: серый камень с фаской и тенью у текста */
  .mc-button {
    flex: 1; min-height: 40px; padding: 8px 14px; border: 2px solid #000; border-radius: 0; cursor: pointer;
    background: #6f6f6f; color: #fff; font: 700 14px/1 var(--font-mono); text-shadow: 2px 2px 0 #3f3f3f;
    box-shadow: inset 2px 2px 0 #a9a9a9, inset -2px -3px 0 #3a3a3a;
  }
  .mc-button:hover { background: #7d86c4; box-shadow: inset 2px 2px 0 #b9c0f0, inset -2px -3px 0 #3c4272; }
  .mc-button:focus-visible { outline: 2px solid #ffff55; outline-offset: 2px; }
  .mc-button:active { box-shadow: inset 2px 3px 0 #3a3a3a, inset -2px -2px 0 #a9a9a9; }
  @media (max-width: 520px) { .mc-toast { left: 16px; right: 16px; bottom: 16px; width: auto; } }
  @media (prefers-reduced-motion: reduce) { .mc-toast, .mc-toast.is-leaving, .mc-toast .mc-slot img { animation: none; } }

  /* ---------------- Страницы по ссылкам из писем: новый пароль, подтверждение почты ---------------- */
  .account-page { max-width: 560px; }
  .account-form { display: grid; gap: 16px; margin-top: 28px; padding: 26px; border-radius: var(--r-3xl); background: var(--surface); box-shadow: var(--shadow-card); }
  .account-field { display: grid; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-700); }
  .account-field input {
    height: 50px; padding: 0 16px; border-radius: var(--r-xl); border: 1.5px solid var(--line); background: var(--muted);
    font: inherit; font-weight: 500; font-size: 16px; color: var(--ink-900); transition: border-color 0.15s, background 0.15s;
  }
  .account-field input:focus { outline: none; border-color: var(--brand-500); background: var(--surface); }
  .account-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-500); cursor: pointer; }
  .account-message { margin: 0; padding: 12px 14px; border-radius: var(--r-xl); background: #fdecec; color: #b42318; font-size: 14px; font-weight: 600; }
  .account-done { margin-top: 24px; padding: 22px; border-radius: var(--r-3xl); font-size: 16px; line-height: 1.6; }
  .account-done p + p { margin-top: 16px; }
  .account-ok { background: #e9f8ef; color: #14532d; }
  .account-error { background: #fdecec; color: #7a1d14; }

  /* ---------------- Новости ---------------- */
  .news-page .lead { margin-bottom: 32px; }
  .news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
  .news-card {
    display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-3xl); background: var(--surface); box-shadow: var(--shadow-card);
    color: var(--ink-900); text-decoration: none; transition: box-shadow 0.2s, transform 0.2s var(--ease-out);
  }
  @media (hover: hover) { .news-card:hover { box-shadow: var(--shadow-float); transform: translateY(-2px); } }
  .news-card-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--muted); }
  .news-cover-empty { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-400, #4d93ff), var(--brand-600)); }
  .news-cover-empty img { width: 56px; height: 56px; }
  .news-card-body { display: grid; gap: 6px; padding: 16px 18px 20px; }
  .news-card-body strong { font-size: 17px; line-height: 1.3; }
  .news-card-body span { color: var(--ink-500); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .news-date { font-size: 13px; color: var(--ink-500); font-family: var(--font-mono); }
  .news-skeleton { aspect-ratio: 4 / 3; border-radius: var(--r-3xl); background: linear-gradient(90deg, var(--muted), var(--surface), var(--muted)); background-size: 200% 100%; animation: news-shimmer 1.4s linear infinite; }
  @keyframes news-shimmer { to { background-position: -200% 0; } }
  .news-hero { display: block; width: 100%; margin-top: 28px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-3xl); box-shadow: var(--shadow-card); background: var(--muted); }
  .news-prose { margin-top: 32px; }
  .news-prose img { max-width: 100%; height: auto; border-radius: var(--r-2xl); }
  .news-prose blockquote { margin: 0; padding: 14px 18px; border-left: 3px solid var(--brand-500); background: var(--brand-50); border-radius: 0 var(--r-2xl) var(--r-2xl) 0; }
  .news-prose code { font-family: var(--font-mono); font-size: 0.9em; padding: 2px 6px; border-radius: 6px; background: var(--muted); }
  .news-more { margin-top: 32px; }
  .news-back { margin-top: 40px; }
  .news-empty { margin-top: 8px; }

  .not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-top: 60px; }
  .not-found .lead { margin-inline: auto; }
  .not-found .btn { margin-top: 24px; }
  .legal { flex-basis: 100%; color: var(--ink-500); font-size: 13px; }

  /* ---------------- Адаптив ---------------- */
  @media (max-width: 1080px) {
    .showcase { grid-template-columns: 1fr; }
    .showcase-tabs { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .showcase-view { position: static; order: -1; }
    .showcase-tab[aria-selected='true'] .tab-body { grid-template-rows: 0fr; }
    .stage { --k: 0.45; }
    .showcase-caption { display: block; }
    .cakelink-grid { grid-template-columns: 1fr; }
    .care-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .faq-grid { grid-template-columns: 1fr; }
    .faq .section-head { position: static; }
  }
  @media (max-width: 860px) {
    .header-nav { display: none; }
    .header-cta { margin-left: auto; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-grid { gap: 8px; }
    .cake-button { --u: clamp(9px, 2.8vw, 15px); }
    .download-grid { grid-template-columns: 1fr; }
    .download-card[data-detected] { order: -1; } /* в колонку — своя система первой */
  }
  @media (max-width: 560px) {
    .cta-os { display: none; }
    .care-grid { grid-template-columns: 1fr; }
    .download-pair .btn { width: 100%; }
    .loaders-inner { padding: 20px; }
    .showcase-tabs { grid-template-columns: 1fr 1fr; }
    .showcase-tab { padding: 12px; }
    .showcase-tab .icon { display: none; }
    .tab-title { font-size: 14px; }
    .invite-card { position: relative; left: 0; margin-top: -32px; margin-inline: 12px; }
    .cakelink-visual { padding-bottom: 0; }
    .social { margin-left: 0; }
  }
}

@layer motion {
  @keyframes blink { 50% { opacity: 0; } }
  @keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); } }
  @keyframes layer-in {
    from { clip-path: inset(0 0 100% 0); filter: blur(14px) saturate(1.3); transform: scale(1.04); }
    60% { filter: blur(0) saturate(1); }
    to { clip-path: inset(0 0 0 0); transform: none; }
  }
  @keyframes layer-out { to { opacity: 0; transform: scale(0.97); filter: blur(6px); } }

  @media (prefers-reduced-motion: no-preference) {
    /* Торт покачивается, как иконки в лаунчере (animate-floaty) */
    .cake-scene { animation: floaty 6s ease-in-out infinite; }

    /* Первый экран собирается при загрузке */
    .hero-copy > * { animation: rise 0.8s var(--ease-out) both; }
    .hero-copy > :nth-child(2) { animation-delay: 0.06s; }
    .hero-copy > :nth-child(3) { animation-delay: 0.12s; }
    .hero-copy > :nth-child(4) { animation-delay: 0.18s; }
    .hero-copy > :nth-child(5) { animation-delay: 0.24s; }
    .cake-stage { animation: rise 1s 0.15s var(--ease-out) both; }

    /* Скриншот «ложится» к зрителю по мере прокрутки — только где есть scroll-driven анимации */
    @supports (animation-timeline: view()) {
      @keyframes shot-tilt {
        from { transform: rotateX(22deg) scale(0.92) translateY(-12px); }
        to { transform: none; }
      }
      .hero-shot .window { animation: shot-tilt linear both; animation-timeline: view(); animation-range: entry 0% cover 42%; }

      @keyframes reveal { from { opacity: 0; translate: 0 36px; } }
      .section-head, .care-card, .download-card, .faq details, .loaders-inner {
        animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 60%;
      }
    }

  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cake, .cake-face { transition: none; }
    .stage { --k: 0; transition: none; }
    .stage[data-waiting] { opacity: 1; }
    .stage-layer.is-entering, .stage-layer.is-leaving { animation: none; }
  }
}
