/* After Hours Labs — стили студии. С основным сайтом ничего не делят. */

:root {
  /* Палитра из логотипов студии */
  --bg: #0E1220;
  --bg-deep: #151c31;
  --surface: #151b2e;
  --surface-2: #1b2339;
  --line: rgba(242, 235, 221, 0.1);
  --line-strong: rgba(242, 235, 221, 0.2);
  --text: #F2EBDD;
  --muted: #8A93B0;
  --accent: #FFB547;
  --accent-ink: #1d1404;

  --f-head: "Unbounded", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --gutter: 16px;
  --header-h: 64px;

  color-scheme: dark;
}

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

html {
  overflow-x: clip;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg) 0, var(--bg) 640px, var(--bg-deep) 100%);
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--f-head);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  overflow-wrap: anywhere;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: 800px;
}

.mono {
  font-family: var(--f-mono);
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

/* ── Кнопки ─────────────────────────────────────────────────────────────── */

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 15px/1.2 var(--f-body);
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}

.btn-sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 14px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: #ffc36d;
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid rgba(255, 181, 71, 0.4);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.kicker {
  display: block;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
  margin-bottom: 10px;
}

/* ── Шапка ──────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}

.brand img {
  border-radius: 8px;
  flex-shrink: 0;
}

.burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.burger-close {
  display: none;
}

.burger[aria-expanded="true"] .burger-open {
  display: none;
}

.burger[aria-expanded="true"] .burger-close {
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: color .15s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-extra {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--muted);
  transition: color .15s;
}

.icon-link:hover {
  color: var(--accent);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 34px;
  margin-left: 4px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: 600 13px/1 var(--f-mono);
  color: var(--text);
  text-decoration: none;
}

.lang-switch:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Мобильное меню: без JS просто переносится под логотип */
@media (max-width: 820px) {
  .js .burger {
    display: inline-flex;
  }

  .no-js .header-inner {
    flex-wrap: wrap;
    padding-block: 10px;
  }

  .no-js .site-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
  }

  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.4);
  }

  .js .site-nav.is-open {
    display: flex;
  }

  .js .nav-links {
    flex-direction: column;
    gap: 0;
  }

  .js .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 17px;
    border-bottom: 1px solid var(--line);
  }

  .js .nav-extra {
    padding-top: 14px;
  }
}

/* ── Первый экран ───────────────────────────────────────────────────────── */

.hero {
  padding: 56px 0 72px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-logo {
  width: 100%;
  max-width: 920px;
}

.hero-logo img {
  width: 100%;
  height: auto;
}

.hero-tagline {
  max-width: 34ch;
  margin: 8px 0 32px;
  font-family: var(--f-head);
  font-weight: 500;
  font-size: clamp(20px, 3.6vw, 32px);
  line-height: 1.3;
}

.hero .actions {
  justify-content: center;
}

/* Слот под 3D-модель: квадрат с подсветкой. Модель кладётся внутрь [data-hero-model] */
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  margin: 0 auto;
  perspective: 900px;
}

.hero-glow {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 181, 71, 0.28), rgba(255, 181, 71, 0.06) 60%, transparent);
  filter: blur(8px);
}

.hero-model-fallback {
  position: relative;
  width: 64%;
  height: auto;
  border-radius: 22%;
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 0 80px -10px rgba(255, 181, 71, 0.35);
  transform: rotateY(-14deg) rotateX(6deg);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-model-fallback {
    animation: hero-float 7s ease-in-out infinite;
  }
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: hero-in .6s ease both;
}

/* Модель нарисована — плоская заглушка больше не нужна */
.hero-visual.is-3d .hero-model-fallback {
  display: none;
}

@keyframes hero-in {
  from { opacity: 0; }
}

@keyframes hero-float {
  0%, 100% { transform: rotateY(-14deg) rotateX(6deg) translateY(0); }
  50% { transform: rotateY(10deg) rotateX(-4deg) translateY(-12px); }
}

@media (min-width: 900px) {
  .hero {
    padding: 72px 0 88px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 48px;
  }

  .hero-text {
    align-items: flex-start;
    text-align: left;
  }

  .hero .actions {
    justify-content: flex-start;
  }

  .hero-visual {
    max-width: 480px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding-top: 24px;
  }

  .hero-logo {
    max-width: 260px;
  }

  /* На телефоне в шапке и так стоит логотип — слот под 3D не показываем */
  .hero-visual {
    display: none;
  }
}

/* ── Секции и карточки ──────────────────────────────────────────────────── */

.section {
  padding: 48px 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
  font-size: clamp(22px, 3vw, 30px);
}

.section-title .kicker {
  margin: 0;
  color: var(--accent);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

.card-body > p,
.card-teaser > p,
.card-engine > p {
  color: var(--muted);
}

.card-title {
  font-size: 22px;
}

.card-title a {
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent);
}

.card-media {
  display: block;
}

.media-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Видео поверх постера: прозрачное, пока не начнёт играть, затем плавно проявляется */
.media-frame .media-video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.media-frame .media-video.is-playing {
  opacity: 1;
}

.media-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 18, 32, 0.8);
  color: var(--muted);
  font-size: 12px;
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.more-link:hover {
  text-decoration: underline;
}

.apps-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 900px) {
  .apps-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.card-teaser {
  justify-content: flex-end;
  align-items: flex-start;
  gap: 14px;
  min-height: 260px;
  padding: 22px;
  border-style: dashed;
  border-color: var(--line-strong);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255, 181, 71, 0.12), transparent 60%),
    var(--surface);
}

.card-teaser .badge {
  position: absolute;
  top: 22px;
  left: 22px;
}

@media (min-width: 760px) {
  .card-wide {
    flex-direction: row;
  }

  .card-wide .card-media {
    flex: 0 0 46%;
  }

  .card-wide .media-frame {
    height: 100%;
    aspect-ratio: 3 / 2;
  }

  .card-wide .card-body {
    justify-content: center;
    padding: 32px;
  }
}

.card-engine {
  gap: 14px;
  padding: 28px 22px;
  background:
    linear-gradient(90deg, rgba(138, 147, 176, 0.08) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--surface);
}

.engine-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.card-engine > p {
  max-width: 70ch;
}

/* Роадмап: на телефоне — вертикальная линия слева, на десктопе — горизонтальная лента */
.roadmap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.roadmap-step {
  --line-color: var(--line-strong);
  position: relative;
  padding: 0 0 32px 36px;
}

/* Линия от точки к следующему шагу */
.roadmap-step::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: -2px;
  left: 7px;
  width: 2px;
  background: var(--line-color);
}

.roadmap-step:last-child::before {
  background: linear-gradient(var(--line-color), transparent);
}

.roadmap-step.is-done {
  --line-color: var(--accent);
}

.roadmap-step.is-now::before {
  background: linear-gradient(var(--accent), var(--line-strong));
}

.roadmap-step.is-next::before,
.roadmap-step.is-later::before {
  background: repeating-linear-gradient(var(--line-strong) 0 6px, transparent 6px 12px);
}

.roadmap-dot {
  position: absolute;
  top: 4px;
  left: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
}

.is-done .roadmap-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.is-now .roadmap-dot {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 5px rgba(255, 181, 71, 0.18), 0 0 18px rgba(255, 181, 71, 0.6);
}

.is-now .roadmap-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .is-now .roadmap-dot {
    animation: roadmap-pulse 2.4s ease-in-out infinite;
  }
}

@keyframes roadmap-pulse {
  50% { box-shadow: 0 0 0 9px rgba(255, 181, 71, 0.06), 0 0 24px rgba(255, 181, 71, 0.4); }
}

.roadmap-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.roadmap-when {
  color: var(--muted);
}

.roadmap-status {
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  letter-spacing: .04em;
}

.is-now .roadmap-status {
  border-color: rgba(255, 181, 71, 0.5);
  color: var(--accent);
}

.roadmap-step h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.is-now h3 {
  color: var(--accent);
}

.roadmap-step p {
  max-width: 40ch;
  color: var(--muted);
}

.is-next h3,
.is-later h3 {
  color: rgba(242, 235, 221, 0.85);
}

@media (min-width: 900px) {
  .roadmap {
    grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
    gap: 24px;
  }

  .roadmap-step {
    padding: 40px 0 0;
  }

  .roadmap-step::before {
    top: 7px;
    bottom: auto;
    left: 24px;
    right: -24px;
    width: auto;
    height: 2px;
  }

  .roadmap-step:last-child::before {
    background: linear-gradient(90deg, var(--line-strong), transparent);
  }

  .roadmap-step.is-done::before {
    background: var(--accent);
  }

  .roadmap-step.is-now::before {
    background: linear-gradient(90deg, var(--accent), var(--line-strong));
  }

  .roadmap-step.is-next::before,
  .roadmap-step.is-later::before {
    background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px);
  }

  .roadmap-dot {
    top: 0;
  }
}

.principles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .principles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.principle {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.principle-num {
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 13px;
}

.principle h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.principle p {
  color: var(--muted);
}

/* ── Внутренние страницы ────────────────────────────────────────────────── */

.page-hero {
  padding: 48px 0 16px;
}

.page-title {
  font-size: clamp(30px, 6vw, 52px);
  margin-bottom: 16px;
}

.lead {
  font-size: 18px;
  line-height: 1.6;
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

@media (min-width: 900px) {
  .app-hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 48px;
  }
}

.app-hero-media .media-frame {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.pills li {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.downloads,
.donations {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .downloads {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.download {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .15s, background-color .15s;
}

.download:hover {
  border-color: var(--accent);
}

.download-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.download-primary:hover {
  background: #ffc36d;
}

.download-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
}

.download-note {
  font-size: 14px;
  color: var(--muted);
}

.download-primary .download-note {
  color: rgba(29, 20, 4, 0.75);
}

.aside-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 18px;
}

.aside-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
}

.aside-links a:hover {
  color: var(--accent);
}

.features {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.feature .media-frame {
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.feature h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.feature p {
  color: var(--muted);
}

/* FAQ-папки: стопка папок, у каждой язычок с вопросом. Язычки встают в ряд, пока хватает
   места, а папка, которой не хватило, переносится на новую строку вместе с телом.
   Координаты считает ahl.js (класс .is-laid); без JS — простая стопка с открытыми ответами. */
.folders {
  /* насколько видна кромка папки, закрытой следующей в ряду */
  --step: 16px;
  /* видимая часть тела у последней папки в ряду */
  --base: 24px;
  /* зазор между язычками в ряду (плюс скос) */
  --tab-gap: 6px;
  position: relative;
  padding-top: 6px;
}

.folder {
  /* Чем ближе папка к зрителю (дальше в списке), тем светлее */
  --folder-bg: color-mix(in srgb, #141a2c, #26304d calc(var(--i) * 100% / var(--n)));
  position: relative;
}

.folder + .folder {
  margin-top: 8px;
}

.folder.is-open {
  --folder-bg: #252f4d;
}

.folder-head {
  display: flex;
  margin: 0;
  font: inherit;
}

.folder-tab {
  position: relative;
  /* Над своим телом: иначе верхняя тень тела ложится на низ язычка и виден шов */
  z-index: 1;
  display: flex;
  align-items: flex-start;
  /* место под скос справа */
  max-width: min(300px, calc(100% - 16px));
  padding: 14px 22px 14px 16px;
  border: 0;
  border-radius: 14px 14px 0 0;
  background: var(--folder-bg);
  box-shadow: inset 0 1px 0 rgba(242, 235, 221, 0.09), 0 -8px 18px -12px rgba(0, 0, 0, 0.8);
  color: var(--text);
  font: 700 16px/1.35 var(--f-body);
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, color .2s, background-color .3s;
}

.folder-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Скос справа у язычка, как у настоящей папки */
.folder-tab::after {
  content: "";
  position: absolute;
  top: 10px;
  right: -14px;
  bottom: 0;
  width: 18px;
  background: var(--folder-bg);
  clip-path: polygon(0 0, 30% 0, 100% 100%, 0 100%);
  border-top-right-radius: 6px;
  transition: background-color .3s;
}

.folder-num {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.folder:not(.is-open) .folder-tab:hover {
  transform: translateY(-4px);
}

.folder.is-open .folder-tab,
.folder.is-open .folder-num {
  color: var(--accent);
}

.folder-tab:focus-visible {
  outline-offset: -2px;
  border-radius: 14px 14px 0 0;
}

.folder-sheet {
  position: relative;
  min-height: 16px;
  padding: 0 22px;
  border-radius: 0 14px 14px 14px;
  background: var(--folder-bg);
  box-shadow: 0 -8px 18px -12px rgba(0, 0, 0, 0.8);
  transition: background-color .3s;
}

/* Выдвижение в простой стопке: высота листа анимируется через grid 0fr → 1fr */
.folder-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s cubic-bezier(.2, .8, .2, 1);
}

.folder-inner {
  min-height: 0;
  overflow: hidden;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .25s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
}

.folder-inner > p {
  max-width: 72ch;
  padding: 14px 0 26px;
}

.folder.is-open .folder-body,
.no-js .folder-body,
.folders.is-laid .folder-body {
  grid-template-rows: 1fr;
}

.folder.is-open .folder-inner,
.no-js .folder-inner {
  opacity: 1;
  transform: none;
  transition-delay: .08s;
}

/* ── Раскладка из JS: папки абсолютно, координаты — inline-стили ── */
.folders.is-laid {
  padding-top: 0;
  transition: height .45s cubic-bezier(.2, .8, .2, 1);
}

.folders.is-laid .folder {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
}

.folders.is-laid .folder-head {
  position: absolute;
  inset: 0 0 auto;
  height: 0;
}

.folders.is-laid .folder-tab,
.folders.is-laid .folder-sheet {
  position: absolute;
  pointer-events: auto;
  transition: top .45s cubic-bezier(.2, .8, .2, 1), height .45s cubic-bezier(.2, .8, .2, 1),
    transform .2s ease, color .2s, background-color .3s, border-radius .3s;
}

.folders.is-laid .folder-tab {
  width: max-content;
}

.folders.is-laid .folder-sheet {
  left: 0;
  right: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
}

/* У язычка в начале строки левый верхний угол тела прямой — язычок из него растёт */
.folders.is-laid .folder.is-row-start .folder-sheet {
  border-top-left-radius: 0;
}

/* Первая раскладка и ресайз — без анимации */
.folders.is-instant,
.folders.is-instant .folder-tab,
.folders.is-instant .folder-sheet {
  transition: none;
}

.folders-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.no-js .folders-hint {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .folder-tab,
  .folder-body,
  .folder-inner,
  .folders.is-laid,
  .folders.is-laid .folder-tab,
  .folders.is-laid .folder-sheet {
    transition: none;
  }
}

/* FAQ-карточки: сетка вопросов, карточки никогда не двигаются. Ответ выезжает панелью
   под рядом выбранной карточки, уголок панели указывает на неё (панель создаёт ahl.js).
   Без JS ответы показаны прямо в карточках. */
.qa-cards {
  --qa-gap: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  /* Зазор между рядами — отступом карточек, а не row-gap: иначе строка панели даже
     закрытой получает два зазора и ряды ниже прыгают */
  column-gap: var(--qa-gap);
  margin-bottom: calc(-1 * var(--qa-gap));
}

.qa-card {
  margin-bottom: var(--qa-gap);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s, background-color .2s;
}

.qa-card:hover {
  border-color: var(--line-strong);
}

.qa-card.is-open {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--surface-2);
}

.qa-head {
  display: flex;
  flex: 1;
  margin: 0;
  font: inherit;
}

/* Номер и «+» сверху, вопрос снизу */
.qa-q {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "num icon"
    "text text";
  align-content: space-between;
  gap: 18px 12px;
  width: 100%;
  min-height: 132px;
  padding: 18px 18px 20px 20px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: var(--text);
  font: 700 17px/1.35 var(--f-body);
  text-align: left;
  cursor: pointer;
}

.qa-q:focus-visible {
  outline-offset: -3px;
}

.qa-num {
  grid-area: num;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.qa-text {
  grid-area: text;
}

.qa-card.is-open .qa-num {
  color: var(--accent);
}

/* «+», у открытой поворачивается в «×» */
.qa-icon {
  grid-area: icon;
  position: relative;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .2s, color .2s;
}

.qa-icon::before,
.qa-icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 12px;
  height: 1.5px;
  background: currentColor;
  translate: -50% -50%;
}

.qa-icon::after {
  rotate: 90deg;
}

.qa-card:hover .qa-icon {
  border-color: var(--text);
}

.qa-card.is-open .qa-icon {
  transform: rotate(45deg);
  border-color: var(--accent);
  color: var(--accent);
}

/* Ответ в карточке — только без JS */
.qa-a {
  padding: 0 20px 22px;
  color: var(--muted);
}

.qa-a > p,
.qa-panel-body > p {
  max-width: 72ch;
  margin: 0;
}

.qa-cards.is-ready .qa-a {
  display: none;
}

/* Панель ответа: строка сетки на всю ширину. Закрытая — ровно 0px (рамка тенью, зазор
   снизу появляется вместе с высотой), поэтому ряды ниже съезжают плавно, без рывка. */
.qa-panel {
  --arrow-x: 50%;
  position: relative;
  grid-column: 1 / -1;
  margin-bottom: 0;
  transition: margin-bottom .35s cubic-bezier(.2, .8, .2, 1);
}

.qa-panel.is-open {
  margin-bottom: var(--qa-gap);
}

.qa-panel-clip {
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: height .35s cubic-bezier(.2, .8, .2, 1);
}

.qa-panel-body {
  padding: 20px 22px 24px;
  color: var(--muted);
}

/* Уголок над панелью — указывает на выбранную карточку, переезжает вместе с выбором */
.qa-panel::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -6px;
  left: var(--arrow-x);
  width: 12px;
  height: 12px;
  border: solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-width: 1px 0 0 1px;
  border-top-left-radius: 3px;
  background: var(--surface-2);
  opacity: 0;
  transform: translateX(-50%) rotate(45deg);
  transition: left .35s cubic-bezier(.2, .8, .2, 1), opacity .2s;
}

.qa-panel.is-open::before {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .qa-card,
  .qa-icon,
  .qa-panel,
  .qa-panel-clip,
  .qa-panel::before {
    transition: none;
  }
}

kbd,
code {
  font-family: var(--f-mono);
  font-size: .88em;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
}

.reqs {
  margin: 0;
}

.reqs div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 600px) {
  .reqs div {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

.reqs dt {
  color: var(--accent);
}

.reqs dd {
  margin: 0;
}

.prose h2 {
  margin: 36px 0 12px;
  font-size: 22px;
}

.prose p + p {
  margin-top: 12px;
}

.prose ul {
  padding-left: 20px;
}

.prose li + li {
  margin-top: 10px;
}

.prose a:not(.btn) {
  color: var(--accent);
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  color: var(--accent);
}

.prose .back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--muted);
}

.about-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.about-logo {
  width: 160px;
  height: auto;
  border-radius: var(--radius);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .about-logo {
    display: none;
  }
}

.where {
  margin-top: 20px;
}

/* ── Песочница ──────────────────────────────────────────────────────────── */

.page-sandbox {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.page-sandbox main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 48px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.brand-sm {
  font-size: 13px;
}

.brand-sm img {
  border-radius: 6px;
}

.mini-header .lang-switch {
  height: 30px;
}

@media (max-width: 400px) {
  .brand-sm span {
    display: none;
  }
}

.sandbox-note {
  padding: 8px var(--gutter);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.sandbox-frame {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #16130f;
}

/* ── Подвал ─────────────────────────────────────────────────────────────── */

/* ── Доска спонсоров ────────────────────────────────────────────────────── */

.sponsors {
  padding-bottom: 72px;
}

.sponsors-board {
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(60% 120% at 0% 0%, rgba(255, 181, 71, 0.1), transparent 70%),
    var(--surface);
}

.sponsors-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
}

.sponsors-title {
  margin-bottom: 6px;
  font-size: clamp(20px, 2.6vw, 26px);
}

.sponsors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sponsors-list li {
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.sponsors-empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-footer {
  margin-top: 48px;
  padding: 48px 0 28px;
  border-top: 1px solid var(--line);
  background: rgba(14, 18, 32, 0.5);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

@media (min-width: 560px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: auto;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--muted);
  max-width: 280px;
}

.footer-brand img {
  border-radius: 10px;
}

.footer-title {
  margin-bottom: 12px;
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: .04em;
}

.footer-col ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer-bottom a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.footer-bottom a:hover {
  color: var(--accent);
}
