.legal-page::before {
  background:
    radial-gradient(780px 470px at 9% -6%, rgba(255, 209, 172, 0.6), transparent 68%),
    radial-gradient(760px 520px at 102% 8%, rgba(201, 238, 223, 0.72), transparent 66%),
    linear-gradient(180deg, #fff9ef 0, var(--canvas) 62%);
}

.legal-page .site-nav {
  border-bottom: 1px solid var(--line);
}

.legal-page .nav-links {
  justify-self: end;
}

.legal-shell {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
  padding: 72px 0 100px;
}

.legal-hero {
  position: relative;
  max-width: none;
  min-height: 340px;
  margin-bottom: 56px;
  padding: clamp(38px, 6vw, 68px) clamp(34px, 7vw, 78px);
  padding-right: min(32vw, 330px);
  overflow: hidden;
  border: 1px solid rgba(99, 224, 188, 0.2);
  border-radius: 44px 44px 58px 34px;
  background:
    radial-gradient(400px 310px at 92% 24%, rgba(62, 207, 165, 0.18), transparent 70%),
    linear-gradient(145deg, #25342f 0%, #25352f 48%, #34271f 100%);
  box-shadow: 0 40px 80px -46px rgba(36, 27, 20, 0.82);
  color: #f6ead8;
}

.legal-hero::after {
  position: absolute;
  right: 24px;
  bottom: -54px;
  width: clamp(190px, 24vw, 270px);
  aspect-ratio: 1;
  background: url("/assets/carefully-companion-v1.png") center bottom / contain no-repeat;
  content: "";
  filter: drop-shadow(0 24px 26px rgba(12, 10, 8, 0.34));
  transform: rotate(3deg);
}

.legal-hero > * {
  position: relative;
  z-index: 1;
}

.legal-hero .eyebrow {
  margin-bottom: 17px;
}

.legal-hero h1 {
  max-width: 780px;
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
}

.legal-hero .lede {
  max-width: 720px;
  margin: 18px 0 0;
  color: #c9b8a4;
  font-size: 19px;
  text-wrap: pretty;
}

.updated {
  margin: 16px 0 0;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 700;
}

.legal-hero .updated {
  color: #ac9a80;
}

.legal-hero .legacy-note {
  border-color: rgba(255, 240, 220, 0.14);
  background: rgba(51, 41, 32, 0.72);
  color: #c9b8a4;
}

.legal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 66px;
}

.legal-toc {
  position: sticky;
  top: 30px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px 25px 21px 27px;
  background: rgba(255, 253, 249, 0.74);
  box-shadow: var(--shadow-sm);
}

.legal-toc strong {
  display: block;
  margin-bottom: 12px;
  font: 600 14px/1 var(--display);
}

.legal-toc a {
  display: block;
  padding: 6px 0;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.legal-toc a:hover {
  color: var(--mint-deep);
}

.legal-content {
  min-width: 0;
}

.legal-content > :first-child {
  margin-top: 0;
}

.legal-content h2 {
  margin: 54px 0 14px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.legal-content h3 {
  margin: 28px 0 8px;
  font-size: 20px;
  font-weight: 600;
}

.legal-content p,
.legal-content li {
  color: #51443d;
  overflow-wrap: anywhere;
}

.legal-content p {
  margin: 12px 0;
}

.legal-content ul,
.legal-content ol {
  margin: 14px 0;
  padding-left: 24px;
}

.legal-content li + li {
  margin-top: 8px;
}

.legal-content a,
.support-card a {
  color: var(--mint-deep);
  font-weight: 800;
  text-underline-offset: 3px;
}

.callout,
.content-card {
  margin: 26px 0;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 25px 28px 23px 31px;
  background: rgba(255, 253, 249, 0.88);
  box-shadow: var(--shadow-md);
}

.callout {
  border-color: rgba(14, 93, 74, 0.16);
  background: linear-gradient(135deg, rgba(221, 245, 236, 0.86), rgba(255, 253, 249, 0.9));
}

.callout.warning {
  border-color: rgba(201, 67, 45, 0.18);
  background: linear-gradient(135deg, rgba(255, 240, 234, 0.92), rgba(255, 253, 249, 0.92));
}

.callout > :first-child,
.content-card > :first-child {
  margin-top: 0;
}

.callout > :last-child,
.content-card > :last-child {
  margin-bottom: 0;
}

.legacy-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
}

.legacy-note::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 25px;
}

.support-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.support-heading {
  font-size: 34px;
}

.flush-heading {
  margin-top: 0 !important;
}

.support-card,
.link-card {
  min-height: 154px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 24px 25px 21px 28px;
  background: rgba(255, 253, 249, 0.84);
  box-shadow: var(--shadow-sm);
}

.support-card:nth-child(4n + 1),
.link-card:nth-child(4n + 1) {
  background: linear-gradient(145deg, rgba(221, 245, 236, 0.88), rgba(255, 253, 249, 0.94));
}

.support-card:nth-child(4n + 2),
.link-card:nth-child(4n + 2) {
  background: linear-gradient(145deg, rgba(255, 240, 234, 0.9), rgba(255, 253, 249, 0.94));
}

.support-card:nth-child(4n + 3),
.link-card:nth-child(4n + 3) {
  background: linear-gradient(145deg, rgba(238, 234, 255, 0.88), rgba(255, 253, 249, 0.94));
}

.support-card:nth-child(4n + 4),
.link-card:nth-child(4n + 4) {
  background: linear-gradient(145deg, rgba(255, 240, 203, 0.9), rgba(255, 253, 249, 0.94));
}

.support-card strong,
.support-card span,
.link-card strong,
.link-card span {
  display: block;
}

.support-card strong,
.link-card strong {
  font: 600 19px/1.15 var(--display);
}

.support-card span,
.link-card span {
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 14px;
}

.link-card {
  min-height: 120px;
  color: var(--ink);
  text-decoration: none;
}

.link-card:hover {
  border-color: rgba(14, 93, 74, 0.26);
  background: #fff;
}

.steps {
  counter-reset: step;
  padding-left: 0 !important;
  list-style: none;
}

.steps li {
  position: relative;
  min-height: 48px;
  padding: 4px 0 0 56px;
  counter-increment: step;
}

.steps li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: var(--mint-soft);
  color: var(--mint-deep);
  content: counter(step);
  font: 700 13px/1 var(--display);
}

.status-card {
  max-width: 720px;
  margin-top: 30px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 30px 34px 27px 38px;
  background: rgba(255, 253, 249, 0.88);
  box-shadow: var(--shadow-md);
}

.status-card h2 {
  margin-top: 0;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--butter);
  box-shadow: 0 0 0 5px rgba(255, 177, 60, 0.15);
}

.join-shell {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 86px);
  padding: 72px 0 100px;
}

.join-shell::before {
  position: absolute;
  z-index: -1;
  inset: 18px -7vw auto;
  height: 620px;
  background:
    radial-gradient(circle at 12% 28%, rgba(255, 183, 137, 0.28), transparent 27%),
    radial-gradient(circle at 88% 18%, rgba(70, 207, 166, 0.22), transparent 30%);
  content: "";
  filter: blur(18px);
  pointer-events: none;
}

.join-panel {
  position: relative;
  z-index: 1;
  display: grid;
  overflow: hidden;
  grid-template-columns: 0.9fr 1.1fr;
  border: 1px solid var(--line);
  border-radius: 42px 42px 54px 34px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: var(--shadow-lg);
}

.join-art {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 550px;
  place-items: center;
  padding: 50px;
  background:
    radial-gradient(310px 270px at 50% 42%, rgba(62, 207, 165, 0.24), transparent 72%),
    linear-gradient(145deg, #25342f, #2f392e 54%, #3b2a21);
}

.join-art::before {
  position: absolute;
  width: min(360px, 78%);
  aspect-ratio: 1;
  border: 1px solid rgba(99, 224, 188, 0.34);
  border-radius: 48% 52% 42% 58%;
  background: rgba(31, 50, 43, 0.42);
  box-shadow: 0 0 0 22px rgba(62, 207, 165, 0.05);
  content: "";
  transform: rotate(-7deg);
}

.join-art img {
  position: relative;
  z-index: 1;
  width: min(330px, 82%);
  filter: drop-shadow(0 34px 30px rgba(12, 10, 8, 0.38));
  transform: rotate(-3deg);
}

.join-copy {
  align-self: center;
  padding: 58px;
}

.join-copy h1 {
  margin-top: 17px;
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.join-copy p {
  color: var(--ink-soft);
}

.join-copy .content-card {
  border-color: rgba(52, 108, 89, 0.12);
  background:
    radial-gradient(circle at 100% 0, rgba(62, 207, 165, 0.14), transparent 42%),
    linear-gradient(145deg, rgba(255, 253, 249, 0.98), rgba(241, 249, 245, 0.92));
}

.simple-footer {
  margin-top: 68px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.simple-footer strong {
  font: 600 14px/1 var(--display);
}

.simple-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 11px;
}

.simple-footer a {
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

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

  .legal-toc {
    position: static;
    display: flex;
    overflow: auto;
    align-items: center;
    gap: 14px;
    padding: 14px 17px;
    scrollbar-width: none;
  }

  .legal-toc::-webkit-scrollbar {
    display: none;
  }

  .legal-toc strong,
  .legal-toc a {
    flex: 0 0 auto;
    margin: 0;
  }

  .legal-toc a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding-inline: 8px;
  }

  .join-panel {
    grid-template-columns: 1fr;
  }

  .join-art {
    min-height: 320px;
  }

  .join-art img {
    width: 220px;
  }
}

@media (max-width: 620px) {
  .legal-shell,
  .join-shell {
    width: min(100% - 28px, 1080px);
    padding: 52px 0 78px;
  }

  .legal-hero {
    margin-bottom: 38px;
    min-height: 0;
    padding: 34px 24px 168px;
    border-radius: 32px 32px 42px 25px;
  }

  .legal-hero::after {
    right: -8px;
    bottom: -58px;
    width: 190px;
  }

  .legal-hero h1 {
    font-size: 45px;
  }

  .legal-content h2 {
    margin-top: 44px;
    font-size: 27px;
  }

  .callout,
  .content-card,
  .status-card {
    padding: 20px;
  }

  .page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions .button {
    width: 100%;
  }

  .support-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .support-card a,
  .simple-footer a {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding-inline: 6px;
  }

  .link-card {
    display: flex;
    min-height: 120px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }

  .join-panel {
    border-radius: 30px 30px 38px 24px;
  }

  .join-art {
    min-height: 260px;
    padding: 30px;
  }

  .join-art img {
    width: 170px;
  }

  .join-copy {
    padding: 34px 24px;
  }

  .join-copy h1 {
    font-size: clamp(39px, 12vw, 52px);
  }
}
