/* Page frame: fixed black sidebar on the left, light scrolling sheet on the right.
   Below 1000px the sidebar turns into a sticky top bar, a full-screen menu and a bottom CTA. */

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.logo svg {
  width: 32px;
  height: 32px;
  flex: none;
}

.toc {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  position: relative;
  display: flex;
  align-items: center;
  padding-block: 6px;
  padding-left: 26px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

/* Keep the 14px/28px indicator and the matching label offset out of layout. */
.toc a::before,
.toc a::after {
  content: "";
  position: absolute;
  top: calc(50% - 0.75px);
  left: 0;
  width: 28px;
  height: 1.5px;
  pointer-events: none;
  transform: scaleX(0.5);
  transform-origin: left center;
  transition: transform 0.25s;
}

.toc a::before {
  background: currentColor;
}

.toc a::after {
  background: var(--blue);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
}

.toc a > span {
  transition: transform 0.25s;
}

.toc a:hover {
  color: var(--ink);
}

.toc a.on {
  color: var(--ink);
  font-weight: 700;
}

.toc a.on::before,
.toc a.on::after {
  transform: scaleX(1);
}

.toc a.on::after {
  opacity: 1;
}

.toc a.on > span {
  transform: translateX(14px);
}

/* ---------- Sidebar ---------- */

.side {
  position: fixed;
  z-index: 40;
  top: calc(12px + env(safe-area-inset-top, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  width: var(--side);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 26px;
  border-radius: 26px;
  background: var(--side-bg);
  color: var(--side-ink);
  overflow-y: auto;
}

.side .logo {
  gap: 13px;
  font-size: 31px;
  letter-spacing: -0.03em;
}

.side .logo svg {
  width: 62px;
  height: 62px;
}

.side .name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.side .about {
  font-size: 16px;
  line-height: 1.45;
  color: var(--side-muted);
}

.side .about b {
  color: #fff;
}

.side .toc a {
  color: var(--side-muted);
  font-size: 17px;
}

.side .toc a:hover,
.side .toc a.on {
  color: #fff;
}

.side-foot {
  display: grid;
  grid-template-columns: max-content;
  gap: 10px;
  justify-items: stretch;
  margin-top: auto;
}

.side-foot .btn {
  justify-content: center;
  padding: 16px 22px;
  font-size: 16px;
}

.side-docs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* the same buttons in the desktop sidebar and in the mobile menu */
.side .btn-dark,
.menu .btn-dark {
  background: #fff;
  color: var(--ink);
}

.side .btn-dark:hover,
.menu .btn-dark:hover {
  background: var(--blue);
  color: #fff;
}

.side .btn-line,
.menu .btn-line {
  border-color: var(--side-muted);
  color: var(--side-ink);
}

.side .btn-line:hover,
.menu .btn-line:hover {
  background: var(--side-ink);
  border-color: var(--side-ink);
  color: var(--ink);
}

/* ---------- Sheet ---------- */

.sheet {
  margin: 12px max(12px, env(safe-area-inset-right, 0px)) 12px
    calc(var(--side) + 24px + env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

/* hide scrollbars, scrolling itself keeps working */
html,
.sheet,
.side {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
.sheet::-webkit-scrollbar,
.side::-webkit-scrollbar {
  display: none;
}

/* desktop: the sheet is its own scroll container, the page itself does not scroll */
@media (min-width: 1001px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .sheet {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: calc(var(--side) + 24px + env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
  }
}

.in {
  padding-left: clamp(20px, calc(5 * var(--vw)), 72px);
  padding-right: clamp(20px, calc(5 * var(--vw)), 72px);
}

/* every section is its own rounded "slide" on the frame background */
section,
footer {
  flex-shrink: 0; /* the sheet is a flex column: never squeeze a section below its content */
  border-radius: 26px;
  background: var(--sheet);
}

section {
  padding-block: clamp(72px, calc(10 * var(--vw)), 140px);
}

/* ---------- Footer ---------- */

footer {
  --footer-column-gap: clamp(24px, calc(2.6 * var(--vw)), 48px);
  display: grid;
  align-items: start;
  gap: 26px var(--footer-column-gap);
  padding-block: 32px 24px;
  color: var(--muted);
  font-size: max(15px, calc(13px / var(--zoom, 1)));
  line-height: 1.45;
}

.sheet > footer {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.15fr);
}

footer nav {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
}

footer a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.footer-title {
  color: var(--ink);
  font-size: max(18px, calc(15px / var(--zoom, 1)));
  line-height: 1.25;
  text-wrap: wrap;
}

.business-links [aria-current="page"] {
  font-weight: 800;
}

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

footer nav a:hover,
footer nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.legal-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr);
  align-items: start;
  gap: 22px var(--footer-column-gap);
}

.footer-info {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.footer-app {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.footer-app svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--muted);
}

.legal-operator {
  display: grid;
  gap: 3px;
  font-size: max(14px, calc(12px / var(--zoom, 1)));
  overflow-wrap: anywhere;
}

.legal-operator h3 {
  color: var(--ink);
  font-family: var(--body);
  font-size: inherit;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: normal;
  text-wrap: wrap;
}

.footer-requisites {
  display: grid;
  gap: 2px;
  margin: 3px 0 0;
  font-variant-numeric: tabular-nums;
}

.footer-requisites > div {
  display: grid;
  grid-template-columns: 4.2em minmax(0, 1fr);
  gap: 6px;
}

.footer-requisites dd {
  margin: 0;
}

.footer-end {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: max(14px, calc(12px / var(--zoom, 1)));
}

.footer-end .logo {
  font-size: max(16px, calc(14px / var(--zoom, 1)));
}

.footer-end .logo img {
  flex: none;
  width: max(32px, calc(26px / var(--zoom, 1)));
  height: auto;
}

@media (max-width: 760px) {
  .sheet > footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
}

@media (max-width: 520px) {
  .legal-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-end {
    gap: 8px 12px;
  }
}

/* ---------- Mobile: top bar, menu, bottom CTA ---------- */

.mbar,
.mcta,
.menu {
  display: none;
}

@media (max-width: 1000px) {
  .side {
    display: none;
  }

  .sheet {
    margin: 0;
    padding: 8px max(8px, env(safe-area-inset-right, 0px)) 8px max(8px, env(safe-area-inset-left, 0px));
    gap: 8px;
  }

  .mbar {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
    /* dark like the desktop sidebar */
    background: rgba(10, 11, 13, 0.92);
    color: var(--side-ink);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .mbar .logo {
    font-size: 20px;
  }

  .mbar .logo svg {
    width: 38px;
    height: 38px;
  }

  .mbar button,
  .mbar noscript {
    margin-left: auto;
  }

  .mbar button,
  .mbar-fallback {
    padding: 10px 16px;
    border: 0;
    border-radius: 99px;
    background: #fff;
    color: var(--ink);
    font: 700 14px var(--body);
    text-decoration: none;
  }

  .mbar-fallback {
    display: inline-block;
  }

  [data-sec] {
    scroll-margin-top: calc(48px + env(safe-area-inset-top, 0px));
  }

  html.menu-open {
    overflow: hidden;
  }

  .mcta {
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
    pointer-events: none; /* only the button itself takes taps, the strip around it does not cover the page */
  }

  .mcta .btn {
    pointer-events: auto;
    box-shadow: none;
  }

  .mcta .btn {
    flex: 1;
    justify-content: center;
  }

  .menu {
    position: fixed;
    inset: 0;
    z-index: 80;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(24px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 24px
      max(24px, env(safe-area-inset-left, 0px));
    background: var(--side-bg);
    color: var(--side-ink);
  }

  .menu.open {
    display: flex;
  }

  .menu .toc a {
    padding-block: 8px;
    color: var(--side-muted);
    font-size: 22px;
  }

  .menu .toc a:hover,
  .menu .toc a.on {
    color: #fff;
  }

  /* buttons fill the menu width */
  .menu .side-foot {
    grid-template-columns: 1fr;
  }

  .menu .close {
    align-self: flex-end;
    padding: 10px 16px;
    border: 0;
    border-radius: 99px;
    background: var(--side-chip);
    color: var(--side-ink);
    font: 700 15px var(--body);
  }

  /* room for the fixed bottom CTA */
  footer {
    padding-bottom: 90px;
  }
}

/* ---------- Legal documents and Cookie preferences ---------- */

html.legal-root,
.legal-root body {
  height: auto;
  overflow: visible;
}

html.legal-root {
  scrollbar-width: auto;
}

html.legal-root::-webkit-scrollbar {
  display: initial;
}

.legal-shell {
  width: min(1120px, 100% - 24px);
  margin-inline: auto;
}

.legal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 18px 12px;
  color: var(--side-ink);
}

.legal-header .logo {
  font-size: 20px;
}

.legal-header img {
  width: 36px;
  height: 36px;
}

.legal-header > a:not(.logo) {
  font-size: 14px;
}

.legal-surface {
  background: var(--sheet);
  border-radius: 26px;
  padding: clamp(22px, 4vw, 52px);
  overflow-wrap: anywhere;
}

.legal-surface h1 {
  max-width: 25ch;
  margin: 8px 0 18px;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.12;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  color: var(--muted);
  font-size: 14px;
}

.legal-meta div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 5px;
}

.legal-meta dt {
  font-weight: 700;
}

.legal-meta dd {
  margin: 0;
}

.legal-notice {
  max-width: 72ch;
  margin-block: 20px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue-deep);
  border-radius: 10px;
  background: var(--white);
}

.legal-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
  align-items: start;
  gap: 24px clamp(28px, 4vw, 48px);
  margin-top: 32px;
}

.legal-toc {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.legal-toc h2,
.legal-directory h2,
.legal-part h2 {
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.25;
}

.legal-surface ol,
.legal-surface ul {
  padding-inline-start: 1.35em;
  margin: 10px 0 0;
}

.legal-surface li + li {
  margin-top: 6px;
}

.legal-prose {
  grid-column: 1;
  grid-row: 1;
  max-width: 72ch;
}

.legal-part {
  padding-block: 0;
  border-radius: 0;
  background: transparent;
}

.legal-part + .legal-part,
.legal-directory {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.legal-part p {
  margin-top: 10px;
}

.legal-page footer {
  margin-block: 12px;
  padding: 22px clamp(22px, 4vw, 52px);
}

.cookie-panel[hidden] {
  display: none;
}

.cookie-panel {
  --cookie-gutter: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --cookie-max-width: 720px;
  zoom: calc(1 / var(--zoom, 1));
  position: fixed;
  z-index: 60;
  inset-inline: var(--cookie-gutter);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: min(var(--cookie-max-width), 100% - 2 * var(--cookie-gutter));
  margin-inline: auto;
  max-height: min(70vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 20px;
  border: 1px solid var(--side-chip);
  border-radius: 26px;
  background: var(--graph);
  color: var(--on-dark);
  font-size: 14px;
  line-height: 1.4;
}

.cookie-panel:has(.cookie-actions > .btn:only-child) {
  --cookie-max-width: 480px;
}

.cookie-panel-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie-panel-head:has(> .cookie-close[hidden]) {
  display: none;
}

.cookie-panel h2 {
  font-size: 18px;
}

.cookie-close {
  border: 0;
  background: none;
  color: var(--on-dark);
  font: 600 14px var(--body);
  text-decoration: underline;
  cursor: pointer;
}

.cookie-copy {
  display: grid;
  gap: 4px;
}

.cookie-copy a {
  font-weight: 700;
  text-underline-offset: 0.16em;
}

.cookie-copy a:hover {
  color: var(--blue);
}

.cookie-details,
.cookie-status {
  color: var(--side-muted);
  font-size: 13px;
}

.cookie-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cookie-actions:has(> .btn:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.cookie-actions .btn {
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-color: var(--side-muted);
  background: transparent;
  color: var(--on-dark);
  font-size: 13px;
}

.cookie-actions .btn:hover {
  border-color: var(--on-dark);
  background: var(--on-dark);
  color: var(--ink);
}

body.cookie-panel-open footer {
  padding-bottom: calc(28px + var(--cookie-panel-space, 0px));
}

@media (min-width: 641px) {
  .cookie-panel:has(.cookie-close[hidden]) {
    border-radius: 56px;
    padding-inline: 26px 14px;
  }
}

@media (min-width: 1001px) {
  body:not(.legal-page) .cookie-panel {
    inset-inline-start: max(var(--cookie-gutter), calc((var(--side) + 24px) * var(--zoom, 1)));
  }
}

@media (max-width: 1000px) {
  .cookie-panel {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    max-height: min(65vh, calc(100dvh - 140px));
  }

  .legal-page .cookie-panel {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  body.cookie-panel-open:not(.legal-page) footer {
    padding-bottom: calc(90px + var(--cookie-panel-space, 0px));
  }
}

@media (max-width: 640px) {
  .cookie-panel {
    --cookie-gutter: max(12px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    padding: 12px 14px;
  }

  .cookie-panel:has(.cookie-actions > .btn:only-child) {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 760px) {
  .legal-content {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 22px;
  }

  .legal-toc,
  .legal-prose {
    grid-column: auto;
    grid-row: auto;
  }

  .legal-toc {
    position: static;
    max-height: none;
  }
}
