
.legal-page {
  --legal-navy: #14132b;
  --legal-blue: #4448ff;
  --legal-muted: #555574;
  --legal-paper: #f9f9f6;
  --legal-rule: #dcdbe4;
  background: var(--legal-paper);
  color: var(--legal-navy);
}

body.privacy-page,
body.terms-page {
  background: #f9f9f6;
}

main.legal-page {
  display: block;
  width: 100%;
  margin-top: -76px;
}

body.privacy-page > .header,
body.terms-page > .header {
  z-index: 200;
}

body.privacy-page > .header .nav-links > a:first-child,
body.terms-page > .header .nav-links > a:first-child {
  background: transparent;
  color: #121429;
}

body.privacy-page > .header .nav-links > a:first-child::after,
body.terms-page > .header .nav-links > a:first-child::after {
  content: none;
}

body.privacy-page > .header .nav-links > a:first-child:hover,
body.terms-page > .header .nav-links > a:first-child:hover {
  background: rgba(68, 72, 255, 0.075);
  color: #4f4acc;
}

.legal-shell {
  width: min(1000px, calc(100% - 48px));
  margin: 0 auto;
}

.legal-hero {
  position: relative;
  isolation: isolate;
  min-height: 344px;
  padding: 143px 0 48px;
  overflow: hidden;
  background: #eceaff;
  border-bottom: 1px solid #dcd9ed;
}

.terms-page .legal-hero {
  background: #ebebff;
}

.legal-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(
    ellipse at 85% 3%,
    rgba(255, 255, 255, 0.31),
    transparent 56%
  );
  pointer-events: none;
}

.legal-eyebrow,
.legal-date,
.legal-toc > h2,
.legal-mobile-nav summary {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
}

.legal-eyebrow {
  color: var(--legal-blue);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 1.1px;
}

.legal-hero h1 {
  margin: 20px 0 0;
  color: var(--legal-navy);
  font-family: 'Manrope', Arial, sans-serif;
  font-size: clamp(44px, 5vw, 68px);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -0.063em;
}

.legal-subtitle {
  max-width: 655px;
  margin-top: 23px;
  color: #4d4b71;
  font-size: 17px;
  line-height: 1.75;
}

.legal-date {
  margin-top: 21px;
  color: #595879;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0;
}

.legal-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: 70px;
  padding-top: 52px;
  padding-bottom: 105px;
}

.legal-sidebar {
  position: sticky;
  top: 97px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.legal-toc > h2 {
  margin: 0 0 15px;
  color: var(--legal-blue);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 1px;
}

.legal-toc > a {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-height: 39px;
  padding: 10px 6px 10px 0;
  border-bottom: 1px solid var(--legal-rule);
  border-left: 2px solid transparent;
  color: var(--legal-navy);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    padding-left 180ms ease;
}

.legal-toc > a .toc-number {
  color: var(--legal-blue);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.8;
  white-space: nowrap;
}

.legal-toc > a:hover,
.legal-toc > a.is-current {
  padding-left: 7px;
  border-left-color: var(--legal-blue);
  color: var(--legal-blue);
  background: rgba(68, 72, 255, 0.045);
}

.legal-content {
  min-width: 0;
}

.legal-section {
  position: relative;
  margin-bottom: 30px;
  padding-bottom: 33px;
  border-bottom: 1px solid var(--legal-rule);
  scroll-margin-top: 105px;
}

.legal-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.legal-section h2 {
  margin: 0 0 21px;
  color: var(--legal-navy);
  font-family: 'Manrope', Arial, sans-serif;
  font-size: clamp(23px, 2.3vw, 26px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.042em;
}

.legal-number {
  color: var(--legal-blue);
  white-space: nowrap;
}

.legal-body {
  color: #4f506f;
  font-size: 15px;
  line-height: 1.83;
}

.legal-body p + p,
.legal-body p + ul,
.legal-body ul + p,
.legal-body ul + ul,
.legal-body p + .legal-address {
  margin-top: 16px;
}

.legal-body strong {
  color: var(--legal-navy);
  font-weight: 700;
}

.legal-body a {
  color: #4146c9;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition:
    color 180ms ease,
    text-decoration-color 180ms ease;
}

.legal-body a:hover {
  color: #c63774;
}

.legal-bullets {
  padding-left: 23px;
  list-style: disc;
}

.legal-bullets li {
  padding-left: 2px;
  list-style: inherit;
}

.legal-bullets li + li {
  margin-top: 13px;
}

.legal-bullets li::marker {
  color: var(--legal-blue);
}

.legal-address {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-style: normal;
}

.legal-anchor {
  position: relative;
  top: -105px;
  display: block;
  height: 0;
}

.legal-mobile-nav {
  display: none;
}

.legal-page .footer.legal-only {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--legal-rule);
  border-radius: 0;
  box-shadow: none;
  background: var(--legal-paper);
  color: #505175;
}

.legal-page .footer .legal-strip {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--legal-paper);
  color: #505175;
}

.legal-page .footer .legal-strip-inner {
  width: min(1548px, calc(100% - 44px));
  min-height: 76px;
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.legal-page .footer .legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 30px;
}

.legal-page .footer .legal-links a {
  color: inherit;
  white-space: nowrap;
  transition: color 180ms ease;
}

.legal-page .footer .legal-links a:hover {
  color: var(--legal-blue);
}

.legal-toc > a:focus-visible,
.legal-mobile-nav a:focus-visible,
.legal-mobile-nav summary:focus-visible,
.legal-body a:focus-visible,
.legal-page .footer a:focus-visible {
  outline: 2px solid var(--legal-blue);
  outline-offset: 3px;
}

.legal-scroll-progress {
  position: fixed;
  z-index: 1200;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    #4448ff,
    #7550ef 56%,
    #fa598b
  );
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

@keyframes legal-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes legal-section-enter {
  from {
    opacity: 0.87;
    transform: translateY(11px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .legal-eyebrow {
    animation: legal-enter 600ms ease-out both;
  }

  .legal-hero h1 {
    animation: legal-enter 700ms 90ms ease-out both;
  }

  .legal-subtitle {
    animation: legal-enter 700ms 165ms ease-out both;
  }

  .legal-date {
    animation: legal-enter 700ms 235ms ease-out both;
  }

  .legal-section.is-visible {
    animation: legal-section-enter 520ms ease-out both;
  }
}

@media (max-width: 1050px) {
  .legal-shell {
    width: calc(100% - 56px);
  }

  .legal-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 44px;
  }
}

@media (max-width: 980px) {
  main.legal-page {
    margin-top: -67px;
  }

  .legal-hero {
    padding-top: 134px;
  }
}

@media (max-width: 700px) {
  .legal-shell {
    width: calc(100% - 42px);
  }

  .legal-hero {
    min-height: 0;
    padding: 121px 0 52px;
  }

  .legal-hero h1 {
    margin-top: 17px;
    font-size: clamp(40px, 10vw, 54px);
  }

  .legal-subtitle {
    margin-top: 21px;
    font-size: 15.5px;
    line-height: 1.7;
  }

  .legal-date {
    margin-top: 18px;
  }

  .legal-layout {
    display: block;
    padding-top: 34px;
    padding-bottom: 73px;
  }

  .legal-sidebar {
    display: none;
  }

  .legal-mobile-nav {
    display: block;
    margin-bottom: 34px;
    border: 1px solid var(--legal-rule);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.56);
  }

  .legal-mobile-nav summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 17px;
    color: var(--legal-blue);
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: 0.8px;
    list-style: none;
    cursor: pointer;
  }

  .legal-mobile-nav summary::-webkit-details-marker {
    display: none;
  }

  .legal-mobile-nav summary span {
    transition: transform 180ms ease;
  }

  .legal-mobile-nav[open] summary span {
    transform: rotate(180deg);
  }

  .legal-mobile-nav nav {
    display: flex;
    flex-direction: column;
    padding: 0 17px 12px;
  }

  .legal-mobile-nav nav a {
    padding: 11px 0;
    border-top: 1px solid var(--legal-rule);
    color: var(--legal-navy);
    font-size: 13px;
    line-height: 1.5;
  }

  .legal-mobile-nav nav a:hover,
  .legal-mobile-nav nav a.is-current {
    color: var(--legal-blue);
  }

  .legal-section {
    margin-bottom: 27px;
    padding-bottom: 29px;
    scroll-margin-top: 95px;
  }

  .legal-section h2 {
    margin-bottom: 18px;
    font-size: 23px;
  }

  .legal-body {
    font-size: 14px;
    line-height: 1.85;
  }

  .legal-page .footer .legal-strip-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 0;
  }

  .legal-page .footer .legal-links {
    justify-content: flex-start;
    gap: 14px 24px;
  }
}

@media (max-width: 480px) {
  main.legal-page {
    margin-top: -65px;
  }

  .legal-hero {
    padding-top: 119px;
  }
}

@media (max-width: 400px) {
  .legal-page .footer .legal-strip-inner {
    font-size: 13px;
  }

  .legal-page .footer .legal-links {
    gap: 12px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-page *,
  .legal-page *::before,
  .legal-page *::after {
    scroll-behavior: auto;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
