:root {
  --bg: #000;
  --card-bg: rgba(142, 142, 148, 0.2);
  --card-border: rgba(142, 142, 148, 0.2);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --divider: rgba(142, 142, 148, 0.25);
  --accent: #ffd60a;
  --pill-bg: rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

html { scrollbar-gutter: stable; }

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 102px 10px 32px;
  position: relative;
  min-height: 100vh;
}

body.menu-open { overflow: hidden; }

.page {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  opacity: 0;
  transition: opacity 240ms ease;
}
body.is-loaded .page { opacity: 1; }

/* ---------- preloader ----------
   Fixed overlay below the nav. Two skeleton cards with shimmer bars.
   Fades out once config.json + menu finished rendering. */
.preloader {
  position: fixed;
  left: 0;
  right: 0;
  top: 102px;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 0 10px 32px;
  background: var(--bg);
  pointer-events: none;
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}
body.is-loaded .preloader {
  opacity: 0;
  visibility: hidden;
}

.preloader__card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 30px;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.preloader__row {
  padding: 0 16px;
  display: flex;
}
.preloader__row--image {
  padding: 0 32px;
}
.skeleton-bar {
  width: 100%;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  position: relative;
  overflow: hidden;
}
.skeleton-bar--image {
  height: 120px;
  border-radius: 26px;
}
.skeleton-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  to { transform: translateX(100%); }
}

/* Stop the shimmer once the page is revealed — belt-and-suspenders
   alongside the JS that removes #preloader from the DOM. Avoids any
   wasted compositor work if the element lingers for a frame. */
body.is-loaded .skeleton-bar::after {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar::after { animation: none; }
  body.is-loaded .preloader { transition-duration: 0s; }
  body.is-loaded .page { transition-duration: 0s; }
}

/* ---------- top nav (fixed, content capped at 600px) ---------- */
.page-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--divider);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.8);
}
.page-nav__inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.connect-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  height: 34px;
  background: var(--pill-bg);
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.3);
  border-radius: 100px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.connect-pill__label {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.03px;
}
.connect-pill__brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.04px;
}
.connect-pill__brand img { display: block; }

/* Skeleton: until config loads, hide children and overlay a rectangle.
   min-width on brand reserves space for the name so the pill width
   doesn't jump when app.js fills in the text. overflow:hidden on the
   pill clips both pseudo-elements to the rounded shape. */
body:not(.is-loaded) .connect-pill > * { visibility: hidden; }

body:not(.is-loaded) .connect-pill::after {
  content: '';
  position: absolute;
  inset: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
}
body:not(.is-loaded) .connect-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  body:not(.is-loaded) .connect-pill::before { animation: none; }
}

.menu-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.04px;
  line-height: 22px;
  cursor: pointer;
  font-family: inherit;
  opacity: 1;
  filter: blur(0);
  transition: opacity 320ms ease, filter 320ms ease;
}
.menu-btn:hover { color: var(--accent); }

body.menu-open .menu-btn {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

/* ---------- content cards ---------- */
.card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 30px;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.card--head {
  gap: 6px;
  align-items: stretch;
}

.card__title {
  margin: 0;
  width: 100%;
  padding: 0 16px;
  font-size: 19px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.02px;
  color: var(--text);
  text-align: left;
}

.card__subtitle {
  margin: 0;
  width: 100%;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.06px;
  color: var(--text-muted);
  text-align: left;
}

/* Support links live inside .card__subtitle of the head card.
   They're brighter (75% white vs 50% muted) and underlined to read as links. */
.support-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 160ms ease;
}
.support-link:hover { color: var(--accent); }

.card__divider {
  width: 100%;
  height: 2px;
  background: var(--divider);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.8);
}

/* text block in body card */
.block-text {
  padding: 0 16px;
  font-size: 17px;
  font-weight: 400;
  line-height: 30px;
  color: var(--text);
}
.block-text p { margin: 0; }
.block-text p + p { margin-top: 0; }
.block-text ol,
.block-text ul {
  margin: 0;
  padding-left: 22px;
}
.block-text li { margin: 0; }

/* Steps list — numbered steps with screenshots inline.
   The image lives INSIDE the <li> so numbering stays continuous (1 → 5)
   even though images are interleaved. Reset the image's own horizontal
   padding so it lines up under the step text instead of double-padding. */
.block-text .steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.block-text .steps > li { padding-left: 4px; }
.block-text .steps .block-image {
  padding: 12px 0 4px;
  margin-left: -22px;
  margin-right: -16px;
}
.block-text a {
  color: var(--text);
  text-decoration: underline;
}
.block-text--underline { text-decoration: underline; }

/* Document pages (oferta/terms/privacy): smaller body text per Figma —
   15/500 white, nested ordered lists, occasional inline links. */
.block-text--doc {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.06px;
  color: var(--text);
}
.block-text--doc ol,
.block-text--doc ul {
  margin: 0;
  padding-left: 22px;
}
.block-text--doc ol ol,
.block-text--doc ul ol,
.block-text--doc ol ul {
  margin-top: 8px;
}
.block-text--doc li { margin: 0 0 8px; }
.block-text--doc li:last-child { margin-bottom: 0; }
.block-text--doc li > p { margin: 4px 0 0; }
.block-text--doc strong { font-weight: 600; }
.block-text--doc a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
.block-text--doc a:hover { color: var(--accent); }
.block-text--doc p { margin: 0 0 8px; }
.block-text--doc p:last-child { margin-bottom: 0; }
.block-text--doc hr {
  border: 0;
  border-top: 2px solid var(--divider);
  margin: 12px 0;
}

.block-subhead {
  padding: 0 16px;
  font-size: 17px;
  font-weight: 700;
  line-height: 22px;
  letter-spacing: 0.04px;
  color: var(--text);
}

/* image block — border-radius 26 on the inner container */
.block-image {
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.block-image__inner {
  width: 100%;
  border-radius: 26px;
  overflow: hidden;
  display: block;
  background: rgba(255, 255, 255, 0.04);
}
.block-image__inner img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- menu overlay ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 280ms;
  isolation: isolate;
}
.menu-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s linear 0s;
}

.menu-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 50%);
  mask-image: linear-gradient(to right, transparent 0%, black 50%);
  pointer-events: none;
  opacity: 0;
}
.menu-overlay__blur {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}
.menu-overlay__blur--2 {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to right, transparent 20%, black 50%);
  mask-image: linear-gradient(to right, transparent 20%, black 50%);
}
.menu-overlay__blur--3 {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to right, transparent 35%, black 50%);
  mask-image: linear-gradient(to right, transparent 35%, black 50%);
}
.menu-overlay.is-open::before,
.menu-overlay.is-open .menu-overlay__blur {
  opacity: 1;
}

.menu-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(270deg, #000000 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
}
.menu-overlay.is-open::after { opacity: 1; }

.menu-overlay__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  height: 100%;
  padding: 24px 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 28px;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 240ms ease, transform 280ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
.menu-overlay.is-open .menu-overlay__inner {
  opacity: 1;
  transform: translateX(0);
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 28px;
  width: 100%;
}

.menu-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}
.menu-row__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}
.menu-row__label,
.menu-row__platform {
  font-family: 'Inter', sans-serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 26px;
  text-align: right;
}
.menu-row__sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  flex-shrink: 0;
}
.menu-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text);
}
.menu-row__icon img,
.menu-row__icon svg { display: block; }
.menu-row__icon svg { width: 20px; height: 20px; }

.menu-row.is-active {
  color: var(--accent);
}
.menu-row.is-active .menu-row__label,
.menu-row.is-active .menu-row__platform,
.menu-row.is-active .menu-row__icon {
  color: var(--accent);
}

/* Dropdown — single root <li> wraps the toggle row and the sub <ul>.
   The chevron points right when closed; CSS rotates it 90° when open. */
.menu-dropdown {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 28px;
  width: 100%;
}
.menu-dropdown__head {
  /* Visually identical to a regular .menu-row, but it's a <button> so
     we need to reset the default button styling. */
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}
.menu-row__icon--chevron {
  transition: transform 220ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
.menu-dropdown.is-open .menu-row__icon--chevron {
  transform: rotate(90deg);
}

/* Sublist — animated max-height + opacity. Items right-aligned, no icons. */
.menu-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  width: 100%;
  /* collapsed state */
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 280ms cubic-bezier(0.2, 0.6, 0.2, 1),
              opacity 200ms ease;
}
.menu-dropdown.is-open .menu-sublist {
  max-height: 400px;   /* generous — collapses room for ~10 rows */
  opacity: 1;
  pointer-events: auto;
}
.menu-row--sub .menu-row__label {
  /* Slightly muted compared to top-level rows for visual hierarchy */
  color: rgba(255, 255, 255, 0.85);
}
.menu-row--sub.is-active .menu-row__label {
  color: var(--accent);
}

.menu-row--close .menu-row__label {
  color: var(--text-muted);
}

/* ---------- responsive ---------- */
@media (max-width: 619px) {
  body { padding: 102px 10px 32px; }
  .card { border-radius: 30px; }
}

@media (min-width: 620px) {
  body { padding: 102px 16px 48px; gap: 24px; }
}
/* Docs-specific tweaks. The page reuses the global .page-nav, .menu-overlay
   and .card shell from /_shared/style.css — these rules only style the
   title/body typography per Figma spec. */

.card--doc-head {
  padding: 24px 0;
  gap: 6px;
}
.card--doc-head .card__title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 19px;
  line-height: 24px;
  letter-spacing: -0.02px;
  color: #fff;
  margin: 0;
  padding: 0 16px;
  text-align: center;
  width: 100%;
}

.card--doc-body {
  padding: 24px 0;
  gap: 10px;
}
.card--doc-body .doc-body {
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.06px;
  color: #fff;
}

.doc-body p { margin: 0 0 10px; }
.doc-body p:last-child { margin-bottom: 0; }
.doc-body ol,
.doc-body ul {
  margin: 0 0 10px;
  padding-left: 24px;
}
.doc-body ol ol,
.doc-body ol ul,
.doc-body ul ol,
.doc-body ul ul {
  margin: 6px 0;
}
.doc-body li { margin: 0 0 6px; }
.doc-body strong { font-weight: 600; }
.doc-body a {
  color: var(--accent, #ffd60a);
  text-decoration: none;
  word-break: break-word;
}
.doc-body a:hover { text-decoration: underline; }
.doc-body hr {
  border: 0;
  border-top: 1px solid var(--nav-divider, rgba(142,142,148,0.25));
  margin: 12px 0;
}
