/* Terms & Privacy — dark layout with merged background visuals */

body.page-legal {
  background: #010810;
  color: #fff;
}

body.page-legal .nav {
  background: rgba(1, 8, 16, 0.92);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.legal-page {
  padding-top: var(--nav-h);
}

.legal-section {
  position: relative;
  overflow: hidden;
  background-color: #010810;
}

.legal-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    90deg,
    #010810 0%,
    #010810 38%,
    rgba(1, 8, 16, 0.88) 52%,
    rgba(1, 8, 16, 0.45) 72%,
    rgba(1, 8, 16, 0.1) 100%
  );
  pointer-events: none;
}

.legal-section__inner {
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(56px, 7vw, 96px) clamp(20px, 5vw, 72px);
  min-height: min(100vh, 920px);
}

.legal-section__visual {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(62vw, 820px);
  height: 100%;
  min-height: calc(100vh - var(--nav-h));
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: auto 108%;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.25) 14%, #000 30%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.25) 14%, #000 30%);
}

.legal-section--terms .legal-section__visual {
  background-image: url('../images/legal-terms-bg.png');
  width: min(65vw, 860px);
  background-size: auto 112%;
}

.legal-section--privacy .legal-section__visual {
  background-image: url('../images/legal-privacy-bg.png');
  width: min(58vw, 780px);
  background-size: auto 92%;
  background-position: calc(100% + 48px) bottom;
}

.legal-section__content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.legal-page__heading {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: clamp(28px, 4vw, 44px);
  color: #fff;
}

.legal-section__title {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: #fff;
}

.legal-section__intro {
  font-size: clamp(0.9rem, 1.6vw, 0.98rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.legal-item {
  margin-bottom: clamp(1.1rem, 2vw, 1.5rem);
}

.legal-item h3 {
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: #fff;
}

.legal-item p,
.legal-item li {
  font-size: clamp(0.88rem, 1.5vw, 0.94rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
}

.legal-item ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-top: 0.35rem;
}

.legal-item li {
  margin-bottom: 0.35rem;
}

.legal-section--privacy {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.page-legal .footer {
  margin-top: 0;
}

@media (max-width: 900px) {
  .legal-section__inner {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: clamp(48px, 8vw, 72px);
  }

  .legal-section::before {
    background: linear-gradient(
      180deg,
      #010810 0%,
      #010810 42%,
      rgba(1, 8, 16, 0.92) 62%,
      rgba(1, 8, 16, 0.55) 100%
    );
  }

  .legal-section__visual {
    position: relative;
    width: 100%;
    order: 2;
    min-height: clamp(240px, 45vw, 360px);
    background-position: right bottom;
    background-size: auto 130%;
    mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
    margin-top: 0.5rem;
  }

  .legal-section--terms .legal-section__visual {
    width: 100%;
    min-height: clamp(260px, 48vw, 380px);
    background-size: auto 145%;
  }

  .legal-section__content {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .legal-section__visual {
    min-height: 200px;
    background-size: auto 140%;
    background-position: right bottom;
  }

  .legal-section--terms .legal-section__visual {
    background-size: auto 155%;
  }
}
