﻿/* ============================================================
   afterglow showcase
   tokens В· layout В· showcase В· pricing
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #090909;
  --bg-elev: #101010;
  --bg-menu: #101010;
  --bg-panel: #151515;
  --bg-panel-2: #202020;

  --text: #ececec;
  --muted: #9a9a9a;
  --subtle: #7d7d7d;

  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .24);

  --accent: #a9d84a;
  --accent-strong: #c3f062;
  --accent-ink: #c3f062;
  --on-accent: #0b0b10;
  --aura: #a9d84a;
  --lav: #9a9a9a;
  --shadow: rgba(0, 0, 0, .64);

  --radius: 5px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f0f0ed;
  --bg-elev: #f8f8f5;
  --bg-menu: #ededeb;
  --bg-panel: #e6e6e1;
  --bg-panel-2: #dcdcd6;

  --text: #191919;
  --muted: #565656;
  --subtle: #686868;

  --line: rgba(0, 0, 0, .13);
  --line-strong: rgba(0, 0, 0, .25);

  --accent: #292929;
  --accent-strong: #111111;
  --accent-ink: #4f7a14;
  --on-accent: #f7f7f2;
  --aura: #6f9a33;
  --lav: #6a6a6a;
  --shadow: rgba(0, 0, 0, .18);
  
  /* Инвертировать цвета фоток и видео в светлой теме */
  .screen-still,
  .screen-motion,
  .screenshot-stage {
    filter: invert(1) hue-rotate(180deg);
  }
}

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

html,
body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--text);
}

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

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

a { color: inherit; }

button { font-family: inherit; }

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

.skip-link {
  position: fixed;
  left: 14px;
  top: 14px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 3px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform .2s ease;
}
.skip-link:focus-visible { transform: none; }

/* ---------- shell ---------- */

.site {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 0 clamp(16px, 2.6vw, 44px);
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: 0 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  width: fit-content;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.075em;
  text-decoration: none;
  text-transform: lowercase;
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 22px);
  min-width: 0;
}

.social-nav {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: lowercase;
  transition: color .18s ease, opacity .18s ease;
}
.social-link svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.social-link:hover { color: var(--text); }
.social-link.is-unconfigured { opacity: .55; cursor: default; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.lang-switch button {
  appearance: none;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--subtle);
  font: inherit;
  cursor: pointer;
  transition: color .18s ease;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.is-active { color: var(--accent-ink); }
.lang-switch span { color: var(--line-strong); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .05em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.theme-toggle:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.theme-icon { font-size: 13px; line-height: 1; }

/* ---------- page book ---------- */

.page-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  perspective: 2400px;
  perspective-origin: 50% 46%;
  isolation: isolate;
}
.page-viewport.is-turning { cursor: grabbing; }

.page-book {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  transition: transform 1050ms cubic-bezier(.2, .72, .18, 1);
  will-change: transform;
}
.page-book.is-pricing { transform: rotateY(180deg); }

.book-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.book-front { transform: rotateY(0deg); }
.book-back { transform: rotateY(180deg); }
.book-face > .showcase { height: 100%; }

/* ---------- showcase ---------- */

.showcase {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 210px) minmax(0, 1fr) minmax(0, 168px);
  align-items: center;
  gap: clamp(18px, 2.6vw, 44px);
  padding: clamp(10px, 1.6vh, 20px) 0;
  min-height: 0;
}

.showcase > .section-copy,
.showcase > .menu-column,
.showcase > .side-actions {
  position: relative;
  z-index: 1;
}

/* quiet module field behind the whole showcase */
.showcase-field {
  position: absolute;
  inset: -4% -1%;
  z-index: 0;
  pointer-events: none;
  color: var(--aura);
  opacity: .34;
  -webkit-mask-image: radial-gradient(ellipse 82% 76% at 50% 47%, #000 0%, rgba(0, 0, 0, .72) 52%, transparent 100%);
  mask-image: radial-gradient(ellipse 82% 76% at 50% 47%, #000 0%, rgba(0, 0, 0, .72) 52%, transparent 100%);
}
.showcase-field svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: field-drift 38s ease-in-out infinite alternate;
}
.showcase-field .field-links { opacity: .32; }
.showcase-field .field-nodes { opacity: .55; }
.showcase-field .field-beacon {
  animation: field-beacon 7s ease-in-out infinite;
}
.showcase-field .field-beacon:nth-of-type(2) { animation-delay: -1.8s; }
.showcase-field .field-beacon:nth-of-type(3) { animation-delay: -3.4s; }
.showcase-field .field-beacon:nth-of-type(4) { animation-delay: -5.1s; }

@keyframes field-drift {
  from { transform: translate3d(-1.1%, .6%, 0); }
  to   { transform: translate3d(1.1%, -.9%, 0); }
}
@keyframes field-beacon {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}

.section-copy {
  align-self: center;
  max-width: 210px;
}
.section-copy-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.section-copy-mark {
  width: 26px;
  height: 1px;
  background: var(--accent);
  opacity: .85;
}
.section-copy-kind { color: var(--subtle); }

.section-copy h1 {
  margin: 0 0 13px;
  font-size: clamp(30px, 3.1vw, 44px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.055em;
  text-transform: lowercase;
}
.section-copy > p#sectionDescription {
  margin: 0;
  max-width: 25em;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.section-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.section-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: lowercase;
}
.section-tags span::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.section-copy-rule {
  height: 1px;
  margin: 22px 0 14px;
  background: var(--line);
}
.section-copy-foot {
  margin: 0;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .1em;
  text-transform: lowercase;
}

/* ---------- stage ---------- */

.menu-column { min-width: 0; min-height: 0; height: 100%; }

.stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  perspective: 1800px;
  perspective-origin: 50% 48%;
  touch-action: pan-y;
}

/* centered halo + orbit hint behind the card */
.stage-aura {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.stage-aura::before {
  content: "";
  position: absolute;
  width: min(112%, 1240px);
  aspect-ratio: 1 / .9;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--aura) 40%, transparent) 0%,
    color-mix(in srgb, var(--aura) 16%, transparent) 42%,
    transparent 72%);
  filter: blur(38px);
  opacity: .5;
  animation: aura-breathe 13s ease-in-out infinite alternate;
}
.stage-aura::after {
  content: "";
  position: absolute;
  width: 107%;
  aspect-ratio: 1 / .9;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--aura) 30%, transparent);
  opacity: .55;
}

@keyframes aura-breathe {
  from { transform: scale(.985); opacity: .42; }
  to   { transform: scale(1.035); opacity: .64; }
}

.tilt-shell {
  z-index: 2;
  width: min(100%, 1060px, calc((100svh - 170px) * 1.1243));
  aspect-ratio: 814 / 724;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .46s cubic-bezier(.18, .75, .22, 1);
}

.flip-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .92s cubic-bezier(.18, .76, .2, 1);
  will-change: transform;
}

.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #050507;
  box-shadow:
    0 30px 80px var(--shadow),
    0 0 0 1px color-mix(in srgb, var(--aura) 7%, transparent),
    0 30px 110px -34px color-mix(in srgb, var(--aura) 30%, transparent);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.face-back { transform: rotateY(180deg); }

.stage-shadow {
  position: absolute;
  z-index: 1;
  left: 12%;
  bottom: -1%;
  width: 76%;
  height: 9%;
  border-radius: 50%;
  background: var(--shadow);
  filter: blur(36px);
  transform: translateY(22px);
}

/* ---------- screenshot face ---------- */

.screenshot-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #050507;
}

.screen-still,
.screen-motion {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #050507;
  transition: opacity .18s ease;
}
.screen-still {
  z-index: 1;
  user-select: none;
  -webkit-user-drag: none;
}
.screen-motion {
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
.screenshot-stage.is-playing .screen-still { opacity: 0; }
.screenshot-stage.is-playing .screen-motion { opacity: 1; }

.screen-hotspots {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.screen-native-tabs {
  position: absolute;
  left: 17.5%;
  top: 8.5%;
  width: 24.5%;
  height: 13.6%;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  pointer-events: auto;
}
.screen-native-tabs button {
  appearance: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
}
.screen-native-tabs button:hover {
  background: rgba(255, 255, 255, .06);
  outline: 1px solid rgba(255, 255, 255, .14);
}
.screen-native-tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ---------- side navigation ---------- */

.side-actions {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.side-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
}
.side-tab {
  appearance: none;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.side-tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.side-tab.is-active {
  color: var(--text);
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--text) 7%, transparent);
}
.side-index {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .06em;
}
.side-tab.is-active .side-index { color: var(--accent-ink); }
.side-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: lowercase;
}

.side-purchase {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--text);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .07em;
  text-decoration: none;
  text-transform: lowercase;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.side-purchase:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.purchase-symbol {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- pricing ---------- */

.pricing-page {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.4vh, 26px);
  padding: clamp(16px, 3vh, 34px) clamp(6px, 2vw, 22px) 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.pricing-page > * { flex: 0 0 auto; }
.pricing-page::-webkit-scrollbar { width: 8px; }
.pricing-page::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 8px;
}
.pricing-page::-webkit-scrollbar-track { background: transparent; }

.pricing-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
}
.pricing-heading { max-width: 620px; }

.pricing-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.pricing-kicker i {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.pricing-heading h1 {
  margin: 10px 0 10px;
  font-size: clamp(30px, 4.2vw, 58px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.06em;
  text-transform: lowercase;
}
.pricing-heading h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent-ink), var(--lav) 82%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pricing-heading > p {
  max-width: 34em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.pricing-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 13px;
}

.currency {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  overflow: hidden;
}
.currency button {
  appearance: none;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.currency button + button { border-left: 1px solid var(--line); }
.currency button:hover { color: var(--text); }
.currency button.is-active {
  background: var(--accent);
  color: var(--on-accent);
}

.pricing-back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: lowercase;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.pricing-back:hover { color: var(--text); border-color: var(--accent); }

.pricing-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 16px);
}

.price-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: clamp(260px, 33vh, 360px);
  padding: clamp(14px, 1.8vw, 22px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .24s ease, border-color .24s ease, background .24s ease, box-shadow .24s ease;
}
.price-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--text) 65%, transparent);
}
.price-card.is-selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--bg-elev)), var(--bg-elev) 58%);
  box-shadow: inset 0 0 0 1px var(--accent), 0 18px 46px var(--shadow);
}

.price-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.price-dot {
  width: 6px;
  height: 6px;
  border: 1px solid var(--muted);
  border-radius: 50%;
}
.price-card.is-selected .price-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.price-name {
  display: block;
  margin-top: clamp(20px, 3.4vh, 40px);
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.055em;
  text-transform: lowercase;
}
.price-caption {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.price-amount {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin-top: auto;
  padding-top: 22px;
}
.price-amount strong {
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.price-amount small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.price-features {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.price-features span {
  position: relative;
  padding-left: 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.price-features span::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .85;
}

.price-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.price-card-bottom b {
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
}

/* ---------- comparison ---------- */

.compare {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
}
.compare-scroll { overflow-x: auto; }
.compare-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}
.compare-table th,
.compare-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}
.compare-table thead th {
  background: var(--bg-panel);
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.compare-table tbody th {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.compare-table tbody td { color: var(--text); }
.compare-table tr:last-child th,
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table td[data-price-compare] {
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

/* ---------- faq ---------- */

.faq { display: grid; gap: 10px; }
.faq h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-transform: lowercase;
}
.faq-list { display: grid; gap: 6px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 13px;
}
.faq-item[open] summary::after { content: "вЂ“"; }
.faq-item p {
  max-width: 72ch;
  margin: 0;
  padding: 0 14px 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

/* ---------- checkout + footer ---------- */

.checkout-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-elev) 93%, transparent);
  backdrop-filter: blur(12px);
}
.checkout-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.checkout-info strong {
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.02em;
  text-transform: lowercase;
}
.checkout-info span:last-child {
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
}
.checkout-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 11px 18px;
  border-radius: 3px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: lowercase;
  transition: background .18s ease, opacity .18s ease;
}
.checkout-link:hover { background: var(--accent-strong); }
.checkout-link.is-unconfigured { opacity: .45; cursor: not-allowed; }

.pricing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: lowercase;
}
.legal-nav { display: flex; gap: 13px; }
.legal-nav button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.legal-nav button:hover { color: var(--text); }

/* ---------- dialog ---------- */

.legal-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: 82vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
}
.legal-dialog::backdrop {
  background: rgba(4, 4, 8, .72);
  backdrop-filter: blur(4px);
}
.legal-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.legal-dialog-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-transform: lowercase;
}
.legal-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.legal-close:hover { border-color: var(--accent); color: var(--accent-ink); }
.legal-dialog-body {
  max-height: 62vh;
  overflow-y: auto;
  padding: 16px 18px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}
.legal-dialog-body p { margin: 0 0 10px; }
.legal-dialog-body p:last-child { margin-bottom: 0; }
.legal-dialog-body code {
  font-family: var(--mono);
  font-size: .92em;
  color: var(--accent-ink);
}

/* ---------- 404 / noscript ---------- */

.noscript-note {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: 420px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 12px;
}

.notfound {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
}
.notfound-inner { max-width: 460px; }
.notfound-code {
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
}
.notfound h1 {
  margin: 14px 0 12px;
  font-size: clamp(34px, 7vw, 62px);
  line-height: .95;
  letter-spacing: -.06em;
  text-transform: lowercase;
}
.notfound p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.notfound a {
  display: inline-flex;
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: lowercase;
}
.notfound a:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ============================================================
   responsive
   ============================================================ */

@media (max-width: 1180px) {
  .showcase {
    grid-template-columns: minmax(0, 186px) minmax(0, 1fr) minmax(0, 150px);
    gap: clamp(14px, 2vw, 26px);
  }
  .section-copy { max-width: 186px; }
  .section-copy h1 { font-size: clamp(26px, 3vw, 36px); }
  .tilt-shell { width: min(100%, 960px, calc((100svh - 160px) * 1.1243)); }
}

@media (max-width: 960px) {
  .showcase {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 6px 0 4px;
  }

  .section-copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 14px;
    align-items: baseline;
    max-width: none;
  }
  .section-copy-meta { grid-column: 1; grid-row: 1; margin: 0; }
  .section-copy h1 { grid-column: 2; grid-row: 1; margin: 0; font-size: 23px; }
  .section-copy > p#sectionDescription {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 6px;
    max-width: 72em;
    font-size: 11px;
    line-height: 1.55;
  }
  .section-tags { grid-column: 1 / -1; grid-row: 3; margin-top: 8px; }
  .section-copy-rule,
  .section-copy-foot { display: none; }

  .menu-column { grid-row: 2; height: 100%; }
  .stage { height: 100%; }

  .side-actions {
    grid-row: 3;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }
  .side-tabs {
    flex-direction: row;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .side-tabs::-webkit-scrollbar { display: none; }
  .side-tab {
    flex: 0 0 auto;
    width: auto;
    padding: 7px 8px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    grid-template-columns: auto auto;
    gap: 6px;
  }
  .side-tab:hover { background: transparent; }
  .side-tab.is-active {
    border-left: 0;
    border-bottom-color: var(--accent);
    background: transparent;
  }
  .side-purchase {
    width: auto;
    min-height: 34px;
    margin-top: 0;
    padding: 8px 12px;
    flex: 0 0 auto;
  }

  .tilt-shell { width: min(100%, calc((100svh - 330px) * 1.1243)); }
}

@media (max-width: 720px) {
  .site { padding: 0 12px; }
  .topbar { min-height: 54px; gap: 10px; }
  .wordmark { font-size: 20px; }
  .top-actions { gap: 10px; }
  .social-nav { gap: 12px; }
  .social-link { gap: 0; }
  .social-link span { display: none; }
  .social-link svg { width: 17px; height: 17px; }
  .theme-toggle { padding: 7px 8px; }
  .theme-toggle #themeLabel { display: none; }

  .section-copy h1 { font-size: 20px; }
  .section-copy > p#sectionDescription {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .section-tags span { font-size: 7px; padding: 3px 7px; }
  .side-index { font-size: 7px; }
  .side-label { font-size: 10px; }
  .side-purchase { padding: 8px 10px; }

  .tilt-shell { width: min(100%, calc((100svh - 310px) * 1.1243)); }

  .pricing-head { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pricing-head-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .pricing-heading h1 { font-size: clamp(28px, 8vw, 40px); }
  .pricing-plans { grid-template-columns: minmax(0, 1fr); }
  .price-card { min-height: 0; }
  .price-name { margin-top: 14px; }
  .price-amount { padding-top: 14px; }
  .compare-table { min-width: 480px; }
  .pricing-footer { flex-direction: column; align-items: flex-start; }
  .checkout-bar { flex-wrap: wrap; }
  .checkout-link { margin-left: auto; }

}

@media (max-width: 420px) {
  .section-tags { display: none; }
  .section-copy > p#sectionDescription { display: none; }
  .side-label { display: none; }
  .side-tab { padding: 7px 9px; }
  .checkout-info { gap: 7px; font-size: 7px; }
}

@media (max-height: 640px) and (max-width: 960px) {
  .section-tags,
  .section-copy > p#sectionDescription { display: none; }
  .showcase { gap: 6px; }
  .tilt-shell { width: min(100%, calc((100svh - 240px) * 1.1243)); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Ecosystem UI styles
   ============================================================ */

/* Telemetry strip */
.telemetry-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
}

.telemetry-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.telemetry-stat strong {
  color: var(--text);
  font-weight: 600;
}

.telemetry-status-ok {
  color: var(--accent);
}

.telemetry-status-error {
  color: #ff5555;
}

/* Ecosystem section container */
.ecosystem-section {
  padding: 24px 0;
}

.ecosystem-section h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
}

/* User card / profile card */
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-panel);
  border-radius: 6px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.user-info {
  flex: 1 1 auto;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.uid-badge {
  background: var(--bg-panel-2);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--mono);
}

.role-badge {
  padding: 2px 6px;
  border-radius: 3px;
}

.role-admin {
  background: rgba(169, 216, 74, .2);
  color: var(--accent);
}

.role-user {
  background: rgba(154, 154, 154, .2);
  color: var(--muted);
}

/* Avatar upload section */
.avatar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.change-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: lowercase;
  cursor: pointer;
}

.change-avatar-btn:hover {
  background: var(--accent-strong);
}

.change-avatar-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Player cards (top players, top creators) */
.player-card,
.creator-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-panel);
  border-radius: 4px;
}

.player-rank,
.creator-rank {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  width: 24px;
  text-align: center;
}

.player-avatar,
.creator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.player-info,
.creator-info {
  flex: 1 1 auto;
}

.player-name,
.creator-name {
  font-weight: 500;
  font-size: 12px;
}

.player-rank-text {
  font-size: 9px;
  color: var(--muted);
}

.creator-likes {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
}

/* Config cards */
.config-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-panel);
  border-radius: 6px;
}

.config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.config-name {
  font-weight: 600;
  font-size: 13px;
}

.config-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.config-meta {
  display: flex;
  gap: 12px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.config-actions {
  display: flex;
  gap: 6px;
}

.config-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted);
  cursor: pointer;
}

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

.config-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* Profile link copy button */
.copy-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted);
  cursor: pointer;
}

.copy-profile-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* UID selector dropdown */
.uid-selector {
  position: relative;
}

.uid-selector select {
  appearance: none;
  padding: 6px 24px 6px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.uid-selector::after {
  content: '▼';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: var(--muted);
  pointer-events: none;
}

/* Auth modal */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .7);
}

.auth-modal.active {
  display: flex;
}

.auth-modal-content {
  max-width: 400px;
  width: 100%;
  padding: 24px;
  background: var(--bg-panel);
  border-radius: 8px;
}

.auth-modal h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.auth-btn-discord {
  background: #5865F2;
  color: white;
  border: none;
}

.auth-btn-discord:hover {
  background: #4752C4;
}

.auth-btn-key {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
}

.auth-btn-key:hover {
  background: var(--accent-strong);
}

/* Loading spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
