/* ModFlow Studio — единая система стилей.
   Всё держится на переменных ниже: цвета, шрифты, отступы, скругления. Новые проекты, категории и платформы
   не требуют новых стилей: карточки и фильтры строятся из данных (site/content.js). */

@font-face { font-family: 'Golos Text'; src: url('fonts/golos-text-cyrillic-wght-normal.woff2') format('woff2'); unicode-range: U+0400-04FF; font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Golos Text'; src: url('fonts/golos-text-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Unbounded'; src: url('fonts/unbounded-cyrillic-wght-normal.woff2') format('woff2'); unicode-range: U+0400-04FF; font-weight: 200 900; font-display: swap; }
@font-face { font-family: 'Unbounded'; src: url('fonts/unbounded-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; font-weight: 200 900; font-display: swap; }

:root {
  /* палитра студии */
  --gold: #e8b23a;          /* главное действие и фирменный знак */
  --gold-2: #f6cd5b;
  --teal: #42d6cc;          /* дополнительный акцент */
  --ink: #17130a;           /* текст на золотом */

  /* поверхности и линии */
  --bg: #0b0d12;
  --bg-alt: #0e1117;
  --surface: #12161e;
  --surface-2: #171c26;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);

  /* текст */
  --text: #f3f4f6;
  --text-2: #c4c9d3;
  --text-3: #8f97a5;

  /* форма */
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --wrap: 1120px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px; --s-9: 96px;

  /* шрифты */
  --font: 'Golos Text', 'Segoe UI', system-ui, sans-serif;
  --display: 'Unbounded', 'Golos Text', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.ico { width: 20px; height: 20px; flex: none; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.narrow { width: min(800px, 100% - 32px); }
.muted { color: var(--text-3); }
.center { text-align: center; margin-top: var(--s-4); }
.link { color: var(--gold-2); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ───── Шапка ───── */
.top { position: sticky; top: 0; z-index: 50; background: rgba(11, 13, 18, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: var(--s-5); height: 64px; }
.brand { flex: none; display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand i { font-style: normal; color: var(--gold); margin: 0 1px; }
.brand b { font-weight: 500; color: var(--text-2); }
.crumb { display: inline-flex; flex: none; align-items: center; gap: 8px; color: var(--text-2); font-size: 14.5px; font-weight: 600; white-space: nowrap; padding: 6px 8px 6px 4px; border-radius: var(--r-s); transition: background .15s, color .15s; }
.crumb:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.crumb img { width: 28px; height: 28px; }
.crumb-sep { color: var(--text-3); margin: 0 -12px 0 -20px; font-weight: 400; flex: none; }
.nav { display: flex; gap: 2px; margin-left: var(--s-2); }
.nav a { white-space: nowrap; padding: 8px 12px; border-radius: var(--r-s); color: var(--text-2); font-size: 14.5px; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
.lang { height: 36px; min-width: 44px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: var(--r-s); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 700; color: var(--text-2); transition: border-color .15s, color .15s; }
.lang:hover { border-color: var(--text-3); color: var(--text); }
.burger { display: none; width: 40px; height: 40px; border-radius: var(--r-s); border: 1px solid var(--line-strong); background: none; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, top .2s; }
.burger span:first-child { top: 15px; } .burger span:last-child { top: 23px; }
.burger[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* ───── Кнопки: золотая — главное действие, остальные спокойные ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: var(--r-m); border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 600 15px var(--font); cursor: pointer; transition: background .15s, border-color .15s, filter .15s; }
.btn:hover { background: rgba(255, 255, 255, .06); border-color: var(--text-3); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-ghost { background: transparent; }
.btn-sm { height: 36px; padding: 0 14px; border-radius: var(--r-s); font-size: 14px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn small { font-weight: 500; opacity: .7; font-size: 12.5px; }
.btn-tg { background: #229ed9; border-color: #229ed9; color: #fff; }
.btn-dc { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-tg:hover { background: #2aabee; border-color: #2aabee; }
.btn-dc:hover { background: #6d79f5; border-color: #6d79f5; }
.btn-soon { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: var(--r-m); border: 1px dashed var(--line-strong); color: var(--text-3); font-weight: 600; font-size: 14.5px; }

/* ───── Метки: категория, платформа, статус ───── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-2); font-size: 12.5px; line-height: 1.7; white-space: nowrap; }
.chip-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.chip-status[data-status="release"]::before { background: var(--teal); }
.chip-status[data-status="beta"]::before { background: var(--gold); }
.chip-status[data-status="soon"] { border-style: dashed; color: var(--text-3); }

/* ───── Первый экран ───── */
.hero { position: relative; padding: var(--s-8) 0 var(--s-7); border-bottom: 1px solid var(--line); background: radial-gradient(640px 280px at 12% 0%, rgba(232, 178, 58, .08), transparent 70%), radial-gradient(560px 280px at 92% 10%, rgba(66, 214, 204, .06), transparent 70%); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s-7); align-items: center; }
.kicker { display: inline-flex; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: var(--s-4); }
.hero h1 { font-size: clamp(30px, 4.4vw, 50px); }
.hero h1 span { color: var(--teal); }
.lead { margin-top: var(--s-4); font-size: 18px; color: var(--text-2); max-width: 540px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero-meta { margin-top: var(--s-3); display: flex; gap: 10px; color: var(--text-3); font-size: 13.5px; }
.hero-meta #verDate::before { content: '·'; margin-right: 10px; }
.hero-meta #verDate:empty::before { content: none; }
.points { margin-top: var(--s-5); display: grid; gap: var(--s-2); color: var(--text-2); font-size: 14.5px; }
.points li { display: flex; align-items: center; gap: 10px; }
.points .ico { color: var(--teal); width: 18px; height: 18px; }
.frame { border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line-strong); background: #0c0d10; }
.frame img { width: 100%; height: auto; cursor: zoom-in; }

/* первый экран страницы проекта: значок и название над заголовком */
.phead { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); }
.phead-icon { width: 56px; height: 56px; border-radius: var(--r-m); }
.phead-name { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.2; }
.phead .chips { margin-top: 6px; }

/* первый экран главной (студия): текст и знак */
.studio-hero { padding: var(--s-9) 0 var(--s-8); }
.studio-hero .hero-in { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
/* большая «M» студии: лента рисуется, точки загораются по очереди, лента стирается; цикл 8 секунд */
.logo-m { justify-self: center; width: min(400px, 82%); position: relative; }
.logo-m::before { content: ''; position: absolute; inset: -12%; background: radial-gradient(closest-side, rgba(232, 178, 58, .10), rgba(66, 214, 204, .05) 60%, transparent 75%); pointer-events: none; }
.logo-m svg { position: relative; width: 100%; height: auto; display: block; overflow: visible; }
.m-ribbon { stroke-dasharray: 200 200; stroke-dashoffset: 200; opacity: 0; animation: m-draw 8s cubic-bezier(.45, .05, .25, 1) infinite; }
.m-dot { fill: var(--teal); opacity: 0; transform-box: fill-box; transform-origin: center; animation: m-dot 8s ease-in-out infinite both; animation-delay: calc(var(--i) * .18s); }
@keyframes m-draw {
  0% { stroke-dashoffset: 200; opacity: 0; }
  1% { opacity: 1; }
  30% { stroke-dashoffset: 0; }
  76% { stroke-dashoffset: 0; opacity: 1; }
  93% { stroke-dashoffset: -200; opacity: 1; }
  94%, 100% { stroke-dashoffset: -200; opacity: 0; }
}
@keyframes m-dot {
  0%, 30% { opacity: 0; transform: scale(.2); }
  38% { opacity: 1; transform: scale(1.6); }
  44%, 80% { opacity: 1; transform: scale(1); }
  92%, 100% { opacity: 0; transform: scale(.6); }
}
@media (prefers-reduced-motion: reduce) { .m-ribbon, .m-dot { animation: none; } .m-ribbon { stroke-dashoffset: 0; opacity: 1; } .m-dot { opacity: 1; } }

/* ───── Секции ───── */
.sec { padding: var(--s-8) 0; }
.sec-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.sec-head { margin-bottom: var(--s-6); }
.sec-head.center-head { text-align: center; }
.sec-head h2 { font-size: clamp(24px, 3vw, 34px); }
.sec-head p { margin-top: var(--s-3); color: var(--text-3); max-width: 640px; }
.sec-head.center-head p { margin-inline: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-5); }

/* ───── Каталог проектов: фильтр и универсальные карточки ───── */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); }
.filter { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); font: 600 14px var(--font); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.filter:hover { border-color: var(--text-3); color: var(--text); }
.filter[aria-pressed="true"] { background: var(--surface-2); border-color: var(--teal); color: var(--text); }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-4); }
.pcard { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-5); transition: border-color .2s; }
.pcard:hover { border-color: var(--line-strong); }
.pcard[hidden] { display: none; }
.pcard-shot { display: block; margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) 0; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: #0c0d10; border-radius: var(--r-l) var(--r-l) 0 0; }
.pcard-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.pcard:hover .pcard-shot img { transform: scale(1.02); }
.pcard-top { display: flex; align-items: center; gap: var(--s-4); }
.pcard-icon { width: 52px; height: 52px; border-radius: var(--r-m); flex: none; }
.pcard-title { min-width: 0; flex: 1; }
.pcard h3 { font-size: 18px; }
.pcard .chip-status { margin-top: 6px; }
.pcard p { color: var(--text-2); font-size: 15px; }
.pcard .chips { margin-top: auto; }
.pcard-cta { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.catalog-empty { color: var(--text-3); text-align: center; padding: var(--s-6) 0; }
.catalog-more { margin-top: var(--s-5); padding: var(--s-4) var(--s-5); border: 1px dashed var(--line-strong); border-radius: var(--r-l); color: var(--text-3); font-size: 14.5px; display: flex; flex-direction: column; gap: 2px; }
.catalog-more b { color: var(--text-2); font-size: 15px; }

/* ───── Возможности проекта ───── */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s-4); }
.feat { display: flex; flex-direction: column; gap: var(--s-3); overflow: hidden; transition: border-color .2s; }
.feat:hover { border-color: var(--line-strong); }
.feat h3 { font-size: 18px; }
.feat p { color: var(--text-2); font-size: 15px; }
.feat-ico { width: 44px; height: 44px; border-radius: var(--r-m); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--gold-2); }
.feat-ico .ico { width: 22px; height: 22px; }
.feat-shot { margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-2); height: 210px; overflow: hidden; border-bottom: 1px solid var(--line); background: #0c0d10; }
.feat-shot img { width: 100%; height: 100%; object-fit: cover; }
.feat-sort { grid-column: span 7; } .feat-crash { grid-column: span 5; }
.feat-mods, .feat-builds, .feat-editor { grid-column: span 4; }
.feat-games, .feat-more { grid-column: span 6; }
.feat-ct.s7 { grid-column: span 7; } .feat-ct.s6 { grid-column: span 6; } .feat-ct.s5 { grid-column: span 5; }
.feat-ct .feat-shot { height: 250px; }

/* ───── Галерея скриншотов (вкладки) ───── */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin-bottom: var(--s-5); }
.tab { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; color: var(--text-2); font: 600 14px var(--font); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.tab:hover { border-color: var(--text-3); color: var(--text); }
.tab.on { background: var(--surface-2); border-color: var(--teal); color: var(--text); }
.show { margin: 0; text-align: center; }
.show-img { display: block; width: min(1000px, 100%); margin: 0 auto; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-l); overflow: hidden; background: #0c0d10; cursor: zoom-in; }
.show-img img { width: 100%; height: auto; transition: opacity .2s; }
.show figcaption { margin: var(--s-4) auto 0; max-width: 680px; color: var(--text-2); min-height: 52px; }

/* ───── Шаги ───── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); counter-reset: st; }
.step { display: flex; flex-direction: column; gap: 10px; }
.step b { width: 34px; height: 34px; border-radius: var(--r-s); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--gold-2); font-family: var(--display); font-size: 15px; }
.step h3 { font-size: 17px; }
.step p { color: var(--text-2); font-size: 15px; }
.honest { margin: var(--s-5) auto 0; max-width: 760px; text-align: center; color: var(--text-3); font-size: 14.5px; }

/* ───── Что нового ───── */
.notes h3 { font-size: 15px; margin: var(--s-4) 0 var(--s-2); color: var(--gold-2); font-family: var(--font); font-weight: 700; letter-spacing: 0; }
.notes h3:first-child { margin-top: 0; }
.notes ul { display: grid; gap: var(--s-2); }
.notes li { position: relative; padding-left: 18px; color: var(--text-2); font-size: 15px; }
.notes li::before { content: ''; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

/* ───── Установка ───── */
.dl-card { display: grid; gap: var(--s-5); justify-items: center; text-align: center; }
.dl-steps { counter-reset: s; display: grid; gap: var(--s-3); text-align: left; width: 100%; max-width: 640px; }
.dl-steps li { counter-increment: s; position: relative; padding-left: 44px; color: var(--text-2); }
.dl-steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: var(--r-s); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--gold-2); font-weight: 700; font-size: 14px; }
.ct-soon { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.ct-soon b { font-size: 18px; }
.ct-soon span { color: var(--text-2); max-width: 480px; }

/* ───── Вопросы ───── */
.faq { display: grid; gap: 10px; }
.qa { padding: 0; }
.qa summary { cursor: pointer; list-style: none; padding: 18px 56px 18px 22px; font-weight: 600; position: relative; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: '+'; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--gold-2); transition: transform .2s; }
.qa[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.qa p { padding: 0 22px 20px; color: var(--text-2); }

/* ───── Студия и контакты ───── */
.studio { text-align: center; display: grid; gap: var(--s-4); justify-items: center; padding: var(--s-7) var(--s-5); }
.studio-logo { width: min(260px, 70%); height: auto; }
.studio p { max-width: 560px; color: var(--text-2); }
.studio-links { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: center; }
.about-points { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); justify-content: center; color: var(--text-2); font-size: 14.5px; }
.about-points li { display: flex; align-items: center; gap: 8px; }
.about-points .ico { color: var(--teal); width: 18px; height: 18px; }

/* ───── Подвал ───── */
.foot { padding: var(--s-7) 0 var(--s-8); border-top: 1px solid var(--line); }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-4); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--text-2); font-size: 14.5px; }
.foot-links a:hover { color: var(--text); }
.foot-note { color: var(--text-3); font-size: 13px; max-width: 820px; margin-top: var(--s-2); }

/* ───── Документы (соглашение) ───── */
.doc h1 { font-size: clamp(24px, 3.6vw, 34px); margin: var(--s-4) 0 var(--s-3); }
.doc-body h2 { font-family: var(--font); font-size: 18px; letter-spacing: 0; color: var(--gold-2); margin: var(--s-6) 0 var(--s-2); }
.doc-body p { color: var(--text-2); margin-bottom: 10px; }

/* ───── Увеличенная картинка ───── */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--s-5); background: rgba(5, 6, 8, .92); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 94vh; width: auto; border-radius: var(--r-m); }

/* ───── Мягкое появление ───── */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; transition: none; } }

/* ───── Состояния «скоро» и «вышла»: у html появляется класс released, когда на GitHub есть релиз ───── */
html:not(.released) .when-live { display: none !important; }
html.released .when-soon { display: none !important; }

/* ───── Планшеты и телефоны ───── */
@media (max-width: 980px) {
  .hero-in, .studio-hero .hero-in { grid-template-columns: 1fr; gap: var(--s-6); }
  .logo-m { justify-self: start; width: min(220px, 60%); }
  .hero { padding: var(--s-7) 0 var(--s-6); }
  .studio-hero { padding: var(--s-8) 0 var(--s-7); }
  .bento { grid-template-columns: repeat(6, 1fr); }
  .feat-sort, .feat-crash, .feat-games, .feat-more, .feat-editor, .feat-ct.s7, .feat-ct.s6, .feat-ct.s5 { grid-column: span 6; }
  .feat-mods, .feat-builds { grid-column: span 3; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav { position: fixed; left: 0; right: 0; top: 64px; flex-direction: column; margin: 0; padding: var(--s-3) var(--s-4) var(--s-4); background: rgba(11, 13, 18, .98); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; font-size: 16px; }
  .burger { display: block; }
  .top-actions .btn { display: none; }
  .sec { padding: var(--s-7) 0; }
  .bento { grid-template-columns: 1fr; }
  .bento > * { grid-column: auto !important; }
  .feat-shot, .feat-ct .feat-shot { height: 170px; }
  .hero-cta .btn { width: 100%; }
  .catalog { grid-template-columns: 1fr; }
  .tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .tab { flex: none; }
  .brand-long b { display: none; }
  .crumb span:not(.crumb-sep) { display: none; }
  .pcard-cta .btn, .pcard-cta .btn-soon { flex: 1 1 100%; }
}
