.terms-page {
  background: var(--color-canvas);
  padding-bottom: var(--section-space);
}

.terms-hero {
  padding-top: clamp(4.5rem, 9vw, 8.5rem);
  padding-bottom: var(--section-space-compact);
}

.terms-hero__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-5);
  align-items: start;
}

.terms-hero__marker {
  grid-column: 1 / span 1;
  width: 100%;
  min-width: 0;
  height: 12rem;
  margin-top: var(--space-2);
  background: var(--color-cobalt);
}

.terms-hero__copy {
  grid-column: 3 / span 6;
  min-width: 0;
  max-width: 64ch;
}

.terms-hero__copy .eyebrow {
  margin-bottom: var(--space-5);
}

.terms-hero__copy h1 {
  max-width: 16rem;
  margin-bottom: var(--space-4);
}

.terms-hero__updated {
  margin-bottom: var(--space-4);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.terms-hero__rule {
  width: 100%;
  margin-bottom: var(--space-5);
}

.terms-hero__intro {
  max-width: 64ch;
  margin-bottom: 0;
}

.terms-document {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-5);
  align-items: start;
}

.terms-contents {
  grid-column: 1 / span 2;
  width: 100%;
  min-width: 0;
  position: sticky;
  top: var(--space-6);
  padding-top: var(--space-2);
}

.terms-contents__label {
  margin-bottom: var(--space-3);
  color: var(--color-burgundy);
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: var(--line-micro);
  text-transform: uppercase;
}

.terms-contents__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.terms-contents__list > li {
  width: 100%;
  min-width: 0;
}

.terms-contents__list a {
  display: inline-block;
  max-width: 100%;
  color: var(--color-ink);
  font-size: var(--text-small);
  font-weight: 700;
  line-height: var(--line-small);
}

.terms-section {
  grid-column: 3 / span 7;
  width: 100%;
  min-width: 0;
  padding-bottom: var(--section-space);
}

.terms-section__content {
  width: min(100%, 68ch);
  min-width: 0;
}

.terms-section__content > .eyebrow {
  margin-bottom: var(--space-4);
}

.terms-section__content > h2 {
  max-width: 18ch;
}

.terms-clause {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: var(--space-4);
  width: 100%;
  min-width: 0;
  margin-bottom: var(--space-8);
}

.terms-clause__number {
  grid-column: 1;
  width: 100%;
  min-width: 0;
  padding-top: 0.35rem;
  color: var(--color-cobalt);
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: var(--line-micro);
}

.terms-clause__body {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  max-width: 68ch;
}

.terms-clause__body h3 {
  margin-bottom: var(--space-3);
}

.terms-clause__body > :last-child {
  margin-bottom: 0;
}

.terms-clause--ruled {
  padding-bottom: var(--space-7);
  border-bottom: 1px solid var(--color-line);
}

.terms-clause--burgundy {
  padding-left: var(--space-4);
  border-left: 2px solid var(--color-burgundy);
}

.terms-clause--burgundy .terms-clause__number {
  color: var(--color-burgundy);
}

.terms-clause__emphasis {
  font-weight: 700;
}

.terms-boundary {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: calc(100% + ((100% - 68ch) * 0.18));
  min-width: 0;
  max-width: 72ch;
  margin: 0 0 var(--space-8) 2.5rem;
  padding: var(--space-6);
  border: 1px solid var(--color-line-dark);
}

.terms-boundary__label,
.terms-liability__label {
  margin: 0;
  color: var(--color-paper);
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: var(--line-micro);
  text-transform: uppercase;
}

.terms-boundary__label {
  color: #f0b4c3;
}

.terms-boundary h3,
.terms-boundary p,
.terms-liability h3,
.terms-liability p {
  margin: 0;
}

.terms-boundary p,
.terms-liability p {
  max-width: 60ch;
}

.terms-planning-note,
.terms-materials,
.terms-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: calc(100% - 2.5rem);
  min-width: 0;
  max-width: 64ch;
  margin: 0 0 var(--space-8) 2.5rem;
}

.terms-planning-note__label,
.terms-materials__label,
.terms-contact__label,
.terms-not-permitted__label {
  margin: 0;
  color: var(--color-burgundy);
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: var(--line-micro);
  text-transform: uppercase;
}

.terms-planning-note h3,
.terms-planning-note p,
.terms-materials h3,
.terms-materials p,
.terms-contact h3,
.terms-contact p {
  margin: 0;
}

.terms-planning-note p,
.terms-materials p {
  max-width: 60ch;
}

.terms-clause--not-permitted {
  padding-left: var(--space-4);
  border-left: 2px solid var(--color-burgundy);
}

.terms-clause--not-permitted .terms-clause__number {
  color: var(--color-burgundy);
}

.terms-ownership {
  display: grid;
  grid-template-columns: minmax(0, 28%) minmax(0, 72%);
  column-gap: var(--space-5);
  width: 100%;
  min-width: 0;
  margin-bottom: var(--space-8);
}

.terms-ownership__title,
.terms-ownership__body {
  width: 100%;
  min-width: 0;
}

.terms-ownership__title {
  grid-column: 1;
}

.terms-ownership__title .terms-clause__number {
  display: block;
  margin-bottom: var(--space-3);
}

.terms-ownership__title h3,
.terms-ownership__body p {
  margin: 0;
}

.terms-ownership__body {
  grid-column: 2;
  max-width: 58ch;
}

.terms-liability {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: calc(100% + ((100% - 68ch) * 0.12));
  min-width: 0;
  max-width: 72ch;
  margin: 0 0 var(--space-8) 2.5rem;
  padding: var(--space-6);
  border: 1px solid var(--color-line-dark);
}

.terms-liability__label {
  color: #f0b4c3;
}

.terms-section--closing {
  padding-bottom: 0;
}

.terms-contact {
  position: relative;
  padding-top: calc(var(--space-6) + 0.25rem);
}

.terms-contact::before {
  position: absolute;
  top: 0;
  right: var(--space-6);
  left: var(--space-6);
  height: 4px;
  background: var(--color-cobalt);
  content: "";
}

.terms-contact__details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
  max-width: 56ch;
  margin: 0;
  font-style: normal;
}

.terms-contact__link {
  display: flex;
  align-items: center;
  width: fit-content;
  min-width: min(100%, 12rem);
  min-height: 3rem;
  overflow-wrap: anywhere;
}

@media (max-width: 899px) {
  .terms-hero__grid,
  .terms-document {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .terms-hero__marker {
    grid-column: 1 / span 1;
  }

  .terms-hero__copy {
    grid-column: 2 / span 6;
  }

  .terms-contents {
    grid-column: 1 / -1;
    position: static;
    margin-bottom: var(--space-8);
    padding: var(--space-5);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-card);
    background: var(--color-paper);
  }

  .terms-contents__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-5);
    row-gap: var(--space-3);
  }

  .terms-section {
    grid-column: 1 / -1;
  }

  .terms-section__content {
    width: min(100%, 68ch);
    margin-inline: auto;
  }

  .terms-boundary,
  .terms-liability {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 819px) {
  .terms-ownership {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-3);
  }

  .terms-ownership__title,
  .terms-ownership__body {
    grid-column: 1;
  }

  .terms-ownership__body {
    max-width: 66ch;
  }
}

@media (max-width: 759px) {
  .terms-hero {
    padding-top: var(--space-8);
  }

  .terms-hero__grid,
  .terms-document {
    grid-template-columns: minmax(0, 1fr);
  }

  .terms-hero__marker {
    grid-column: 1;
    width: 100%;
    height: 4px;
    margin: 0 0 var(--space-5);
  }

  .terms-hero__copy {
    grid-column: 1;
    max-width: none;
  }

  .terms-hero__copy h1 {
    max-width: 9ch;
    font-size: clamp(3rem, 14vw, 4.4rem);
  }

  .terms-hero__intro {
    max-width: none;
  }

  .terms-contents {
    grid-column: 1;
    margin-bottom: var(--space-7);
    padding: var(--space-5);
  }

  .terms-contents__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .terms-section {
    grid-column: 1;
    padding-bottom: clamp(3.5rem, 13vw, 5rem);
  }

  .terms-section__content {
    width: 100%;
    margin: 0;
  }

  .terms-section__content > h2 {
    max-width: 13ch;
  }

  .terms-clause {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-3);
    margin-bottom: var(--space-7);
  }

  .terms-clause__number,
  .terms-clause__body {
    grid-column: 1;
  }

  .terms-clause__number {
    padding-top: 0;
  }

  .terms-clause--burgundy,
  .terms-clause--not-permitted {
    padding-left: var(--space-4);
  }

  .terms-boundary,
  .terms-liability {
    width: 100%;
    margin-bottom: var(--space-7);
    padding: var(--space-5);
  }

  .terms-planning-note,
  .terms-materials,
  .terms-contact {
    width: 100%;
    margin-left: 0;
    margin-bottom: var(--space-7);
    padding: var(--space-5);
  }

  .terms-contact::before {
    right: var(--space-5);
    left: var(--space-5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .terms-page a {
    transition: none;
  }
}
