.sh-page--legal,
.sh-page--not-found {
  background: var(--sh-paper);
}

.sh-legal-main {
  min-height: 60vh;
  background: var(--sh-paper);
  color: var(--sh-dark-ink);
}

.ip-page,
.ip-legal {
  min-width: 0;
}

.ip-wrap {
  width: var(--sh-shell);
  margin-inline: auto;
}

.ip-legal-hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(78px, 9vw, 126px) clamp(62px, 7vw, 96px);
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 20%, rgba(139, 92, 246, 0.23), transparent 31%),
    radial-gradient(circle at 68% 92%, rgba(240, 86, 140, 0.12), transparent 29%),
    var(--sh-ground);
  color: var(--sh-ink);
}

.ip-legal-hero::after {
  position: absolute;
  z-index: -1;
  right: -8vw;
  bottom: -18vw;
  width: clamp(280px, 42vw, 660px);
  aspect-ratio: 1;
  border: 1px solid rgba(248, 245, 251, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(248, 245, 251, 0.025),
    0 0 0 90px rgba(248, 245, 251, 0.018);
  content: "";
}

.ip-kicker {
  margin: 0 0 20px;
  color: var(--sh-pink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.25;
  text-transform: uppercase;
}

.ip-legal-hero h1 {
  max-width: 13ch;
  margin: 0;
  color: var(--sh-ink);
  font-size: clamp(50px, 7.6vw, 106px);
  font-weight: 200;
  letter-spacing: -0.058em;
  line-height: 0.95;
  text-wrap: balance;
}

.ip-legal-hero > .ip-wrap > p:not(.ip-kicker) {
  max-width: 66ch;
  margin: 28px 0 0;
  color: rgba(248, 245, 251, 0.76);
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 300;
  line-height: 1.55;
}

.ip-hero__meta {
  margin-top: 28px;
  color: rgba(248, 245, 251, 0.54);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ip-legal-body {
  padding-block: clamp(62px, 8vw, 112px);
  background: var(--sh-paper);
}

.ip-legal-layout {
  width: var(--sh-shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(190px, 0.31fr) minmax(0, 1fr);
  gap: clamp(42px, 8vw, 116px);
  align-items: start;
}

.ip-legal-nav {
  position: sticky;
  top: calc(var(--sh-nav-h) + 34px);
  padding: 24px 0;
  border-top: 1px solid var(--sh-line-dark);
  border-bottom: 1px solid var(--sh-line-dark);
}

.ip-legal-nav h2 {
  margin: 0 0 20px;
  color: var(--sh-dark-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ip-legal-nav nav {
  display: grid;
  gap: 2px;
}

.ip-legal-nav a {
  position: relative;
  padding: 9px 0;
  color: var(--sh-dark-muted);
  font-size: 13px;
  line-height: 1.35;
  transition: color 180ms ease, transform 180ms var(--sh-ease);
}

.ip-legal-nav a::before {
  display: none;
}

.ip-legal-nav a:hover,
.ip-legal-nav a:focus-visible {
  color: var(--sh-dark-ink);
  transform: translateX(3px);
}

.ip-legal-copy {
  min-width: 0;
  max-width: 840px;
}

.ip-legal-copy > section {
  padding-block: 42px;
  border-bottom: 1px solid var(--sh-line-dark);
  scroll-margin-top: calc(var(--sh-nav-h) + 28px);
}

.ip-legal-copy > section:first-of-type {
  padding-top: 16px;
}

.ip-legal-copy > section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.ip-legal-copy h2,
.ip-legal-copy h3 {
  color: var(--sh-dark-ink);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.ip-legal-copy h2 {
  margin: 0 0 20px;
  font-size: clamp(28px, 3.2vw, 44px);
}

.ip-legal-copy h3 {
  margin: 30px 0 12px;
  font-size: clamp(21px, 2vw, 28px);
}

.ip-legal-copy p,
.ip-legal-copy li {
  color: var(--sh-dark-muted);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.72;
}

.ip-legal-copy p {
  max-width: 70ch;
  margin: 0 0 18px;
}

.ip-legal-copy ul,
.ip-legal-copy ol {
  max-width: 68ch;
  margin: 18px 0 0;
  padding-left: 22px;
}

.ip-legal-copy li + li {
  margin-top: 10px;
}

.ip-legal-copy a {
  color: #5d2cc5;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(93, 44, 197, 0.32);
  text-underline-offset: 0.2em;
}

.ip-legal-copy a:hover,
.ip-legal-copy a:focus-visible {
  text-decoration-color: currentColor;
}

.ip-disclosure {
  max-width: 74ch !important;
  margin: 0 0 22px !important;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid rgba(139, 92, 246, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.09), rgba(240, 86, 140, 0.04)),
    #fff;
  color: #42364d !important;
}

.ip-not-found {
  position: relative;
  min-height: min(760px, calc(100svh - var(--sh-nav-h)));
  padding: 72px 0;
  background:
    radial-gradient(circle at 76% 36%, rgba(139, 92, 246, 0.28), transparent 28%),
    radial-gradient(circle at 28% 84%, rgba(240, 86, 140, 0.12), transparent 26%),
    var(--sh-ground);
  color: var(--sh-ink);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ip-not-found__content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.ip-not-found__mark {
  width: 74px;
  height: 74px;
  margin-bottom: 32px;
  border: 1px solid rgba(248, 245, 251, 0.24);
  border-radius: 50%;
  background: rgba(248, 245, 251, 0.06);
  display: grid;
  place-items: center;
}

.ip-not-found__mark svg {
  width: 38px;
  height: 38px;
  color: var(--sh-pink);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.ip-not-found h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(58px, 9vw, 126px);
  font-weight: 200;
  letter-spacing: -0.06em;
  line-height: 0.94;
}

.ip-not-found__content > p:not(.ip-kicker) {
  max-width: 56ch;
  margin: 26px 0 32px;
  color: var(--sh-muted);
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 300;
}

.ip-button {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--sh-pink);
  color: var(--sh-ground);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

@media (max-width: 800px) {
  .ip-legal-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .ip-legal-nav {
    position: static;
    padding: 22px;
    border: 1px solid var(--sh-line-dark);
    border-radius: 14px;
    background: #fff;
  }

  .ip-legal-nav nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
  }
}

@media (max-width: 560px) {
  .ip-legal-hero {
    padding-block: 62px 54px;
  }

  .ip-legal-hero h1 {
    font-size: clamp(46px, 15vw, 70px);
  }

  .ip-legal-body {
    padding-block: 42px 68px;
  }

  .ip-legal-nav nav {
    grid-template-columns: 1fr;
  }

  .ip-legal-copy > section {
    padding-block: 34px;
  }

  .ip-not-found {
    min-height: 660px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ip-legal-nav a {
    transition: none;
  }
}

/* Keep every legal and utility hero inside the same first-viewport frame. */
.ip-legal-hero,
.ip-not-found {
  height: var(--sh-hero-height);
  min-height: var(--sh-hero-height);
  max-height: var(--sh-hero-height);
  box-sizing: border-box;
  overflow: hidden;
}

.ip-legal-hero {
  padding-block: clamp(34px, 5.6svh, 52px);
  display: grid;
  align-items: end;
}

.ip-legal-hero h1 {
  max-width: 16ch;
  font-size: clamp(46px, 5.8vw, 82px);
  line-height: 1;
}

.ip-legal-hero > .ip-wrap > p:not(.ip-kicker) {
  max-width: 58ch;
  margin-top: 16px;
  font-size: clamp(14px, 1.16vw, 17px);
  line-height: 1.46;
}

.ip-legal-hero .ip-hero__meta {
  margin-top: 16px;
}

.ip-not-found {
  padding-block: clamp(28px, 5svh, 48px);
}

.ip-not-found__mark {
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
}

.ip-not-found h1 {
  max-width: 14ch;
  font-size: clamp(46px, 6vw, 82px);
  line-height: 1;
}

.ip-not-found__content > p:not(.ip-kicker) {
  margin: 18px 0 22px;
  font-size: clamp(14px, 1.16vw, 17px);
  line-height: 1.46;
}

@media (max-width: 560px) {
  .ip-legal-hero {
    padding-block: 22px;
  }

  .ip-legal-hero h1 {
    font-size: clamp(34px, 9.7vw, 43px);
  }

  .ip-legal-hero > .ip-wrap > p:not(.ip-kicker) {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.38;
  }

  .ip-legal-hero .ip-hero__meta {
    margin-top: 12px;
  }

  .ip-not-found {
    height: var(--sh-hero-height);
    min-height: var(--sh-hero-height);
    max-height: var(--sh-hero-height);
    padding-block: 22px;
  }

  .ip-not-found__mark {
    width: 50px;
    height: 50px;
    margin-bottom: 14px;
  }

  .ip-not-found h1 {
    font-size: clamp(34px, 10vw, 43px);
  }

  .ip-not-found__content > p:not(.ip-kicker) {
    margin: 12px 0 16px;
    font-size: 13px;
    line-height: 1.4;
  }

  .ip-button {
    min-height: 46px;
  }
}
