.terms-page {
  overflow: hidden;
  background: var(--color-page);
}

.terms-document-header {
  padding-block-end: var(--space-8);
}

.terms-document-header__grid,
.terms-index__grid,
.terms-legal-section__grid,
.terms-service-section__grid,
.terms-final-section__grid,
.terms-liability__grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-5);
}

.terms-document-header__content {
  grid-column: 3 / span 8;
  min-width: 0;
}

.terms-document-header__content > :last-child,
.terms-index__note > :last-child,
.terms-clause > :last-child,
.terms-liability__content > :last-child,
.terms-contact-panel__content > :last-child {
  margin-block-end: 0;
}

.terms-document-header h1 {
  max-width: 10ch;
  margin-block-end: var(--space-3);
  font-size: clamp(3rem, 5vw, 4rem);
}

.terms-document-header__updated {
  margin-block-end: var(--space-4);
  color: var(--color-stone-500);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.terms-document-header__rule {
  width: 4rem;
  height: 1px;
  margin-block-end: var(--space-5);
  background: var(--color-gold-muted);
}

.terms-document-header__lead {
  max-width: 42.5rem;
  color: var(--color-espresso-700);
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
}

.terms-document-header__scope {
  max-width: 42.5rem;
}

.terms-index {
  border-block: 1px solid var(--color-line-warm);
  padding-block: var(--space-8);
}

.terms-index__nav {
  grid-column: 1 / span 3;
  min-width: 15.625rem;
}

.terms-index__nav h2 {
  margin-block-end: var(--space-5);
  font-size: var(--text-2xl);
}

.terms-index__list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: terms-index;
}

.terms-index__list > li {
  position: relative;
  min-width: 0;
  counter-increment: terms-index;
  border-top: 1px solid var(--color-line-warm);
}

.terms-index__list > li:last-child {
  border-bottom: 1px solid var(--color-line-warm);
}

.terms-index__list > li::before {
  position: absolute;
  top: 0.75rem;
  left: 0;
  color: var(--color-gold-muted);
  content: counter(terms-index, decimal-leading-zero);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  line-height: 1.2;
}

.terms-index__list a {
  display: block;
  min-width: 0;
  padding: 0.75rem 0 0.75rem 2.5rem;
  color: var(--color-espresso-700);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-sm);
  text-decoration: none;
  transition: color var(--transition-fast), background-color var(--transition-fast), font-weight var(--transition-fast);
}

.terms-index__list a:hover,
.terms-index__list a[aria-current="true"] {
  color: var(--color-burgundy-700);
}

.terms-index__list a[aria-current="true"] {
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-color: var(--color-gold-muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

.terms-index__note {
  grid-column: 5 / span 5;
  min-width: 0;
  max-width: 38rem;
  align-self: start;
  padding-block-start: var(--space-1);
}

.terms-index__note p:not(.eyebrow) {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
}

.terms-legal-section,
.terms-service-section,
.terms-final-section {
  padding-block: clamp(5rem, 8vw, 7rem);
}

.terms-section-marker {
  grid-column: 1 / span 1;
  min-width: 0;
  color: var(--color-gold-muted);
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 3vw, 3rem);
  font-weight: var(--weight-medium);
  line-height: 1;
}

.terms-legal-section__content {
  grid-column: 2 / span 7;
  min-width: 0;
  max-width: 42.5rem;
}

.terms-legal-section__content--narrow {
  max-width: 41.25rem;
}

.terms-legal-section__content h2,
.terms-service-section__content h2,
.terms-final-section__content h2 {
  max-width: 13ch;
  margin-block-end: var(--space-7);
  font-size: clamp(2.5rem, 4vw, 3rem);
}

.terms-clause {
  min-width: 0;
}

.terms-clause + .terms-clause {
  margin-block-start: var(--space-7);
}

.terms-clause h3 {
  max-width: 22ch;
  margin-block-end: var(--space-4);
  font-size: clamp(1.625rem, 2.4vw, 1.875rem);
}

.terms-clause p {
  max-width: 100%;
}

.terms-clause__list {
  max-width: 100%;
}

.terms-clause__closing,
.terms-clause__updated-reference {
  color: var(--color-espresso-700);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  line-height: 1.2;
}

.terms-clause--ruled {
  border-top: 1px solid var(--color-gold-muted);
  padding-block-start: var(--space-5);
}

.terms-clause__contact-line {
  color: var(--color-espresso-700);
  font-weight: var(--weight-medium);
}

.terms-service-section {
  background: var(--color-ivory-100);
}

.terms-service-section__content {
  grid-column: 2 / span 6;
  min-width: 0;
  max-width: 41.25rem;
}

.terms-service-section__notice {
  grid-column: 9 / span 3;
  min-width: 17.5rem;
  align-self: start;
  border: 1px solid var(--color-line-warm);
  border-top-color: var(--color-gold-muted);
  padding: var(--space-5);
  background: var(--color-page);
}

.terms-service-section__notice > :last-child {
  margin-block-end: 0;
}

.terms-service-section__notice p:not(.eyebrow) {
  color: var(--color-espresso-700);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  line-height: 1.2;
}

.terms-legal-section--compact {
  padding-block-end: var(--space-9);
}

.terms-liability {
  background: var(--color-espresso-900);
  color: var(--color-ivory-50);
  padding-block: clamp(4rem, 7vw, 6rem);
}

.terms-liability__content {
  grid-column: 3 / span 7;
  min-width: 0;
  max-width: 38.75rem;
}

.terms-liability__number {
  margin-block-end: var(--space-4);
  color: var(--color-gold-muted);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: 1;
}

.terms-liability h3 {
  max-width: 18ch;
  color: var(--color-ivory-50);
  font-size: clamp(1.875rem, 3vw, 2.25rem);
}

.terms-liability p:not(.terms-liability__number) {
  max-width: 38.75rem;
  color: var(--color-ivory-50);
}

.terms-final-section__content {
  grid-column: 2 / span 7;
  min-width: 0;
  max-width: 45rem;
}

.terms-contact-panel {
  max-width: 45rem;
  margin-block-start: var(--space-7);
  border: 1px solid var(--color-line-warm);
  border-top-color: var(--color-gold-muted);
  padding: var(--space-6);
  background: var(--color-ivory-100);
}

.terms-contact-panel__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-4);
}

.terms-contact-panel__content > * {
  min-width: 0;
  margin: 0;
}

.terms-contact-panel h3 {
  max-width: 18ch;
  font-size: clamp(1.625rem, 2.4vw, 1.875rem);
}

.terms-contact-panel__details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-3);
  color: var(--color-espresso-700);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.terms-contact-panel__details span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 1051px) {
  .terms-index__nav {
    position: sticky;
    top: 7rem;
  }
}

@media (max-width: 1050px) {
  .terms-index__grid {
    row-gap: var(--space-6);
  }

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

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

  .terms-service-section__grid {
    row-gap: var(--space-6);
  }

  .terms-service-section__notice {
    grid-column: 2 / span 7;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .terms-document-header__grid,
  .terms-index__grid,
  .terms-legal-section__grid,
  .terms-service-section__grid,
  .terms-final-section__grid,
  .terms-liability__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .terms-document-header__content {
    grid-column: 1 / span 6;
  }

  .terms-index__nav,
  .terms-index__note {
    grid-column: 1 / span 6;
    min-width: 0;
  }

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

  .terms-legal-section__content,
  .terms-service-section__content,
  .terms-final-section__content {
    grid-column: 1 / span 6;
    max-width: 42.5rem;
  }

  .terms-service-section__notice {
    grid-column: 1 / span 6;
    max-width: 42.5rem;
  }

  .terms-liability__content {
    grid-column: 1 / span 6;
    max-width: 38.75rem;
  }

  .terms-legal-section__content h2,
  .terms-service-section__content h2,
  .terms-final-section__content h2 {
    margin-block-end: var(--space-6);
  }
}

@media (max-width: 767px) {
  .terms-document-header {
    padding-block-end: var(--space-7);
  }

  .terms-document-header h1 {
    font-size: clamp(1.875rem, 9vw, 2.125rem);
    line-height: 1.04;
  }

  .terms-document-header__lead {
    font-size: var(--text-base);
    line-height: var(--leading-base);
  }

  .terms-index {
    padding-block: var(--space-7);
  }

  .terms-index__nav h2 {
    font-size: clamp(1.875rem, 8vw, 2.25rem);
  }

  .terms-index__list a {
    min-height: 2.75rem;
    padding-block: 0.75rem;
  }

  .terms-index__note p:not(.eyebrow) {
    font-size: var(--text-base);
    line-height: var(--leading-base);
  }

  .terms-legal-section,
  .terms-service-section,
  .terms-final-section {
    padding-block: clamp(4rem, 16vw, 5rem);
  }

  .terms-legal-section__grid,
  .terms-service-section__grid,
  .terms-final-section__grid {
    row-gap: var(--space-3);
  }

  .terms-section-marker {
    font-size: 1.875rem;
  }

  .terms-legal-section__content h2,
  .terms-service-section__content h2,
  .terms-final-section__content h2 {
    max-width: 100%;
    margin-block-end: var(--space-5);
    font-size: clamp(1.875rem, 8vw, 2.125rem);
  }

  .terms-clause + .terms-clause {
    margin-block-start: var(--space-6);
  }

  .terms-clause h3,
  .terms-contact-panel h3 {
    font-size: clamp(1.5rem, 7vw, 1.75rem);
  }

  .terms-service-section__notice {
    padding: var(--space-5);
  }

  .terms-liability {
    padding-block: var(--space-7);
  }

  .terms-liability__number {
    font-size: 1.875rem;
  }

  .terms-liability h3 {
    font-size: clamp(1.75rem, 8vw, 2rem);
  }

  .terms-contact-panel {
    margin-block-start: var(--space-6);
    padding: var(--space-5);
  }

  .terms-contact-panel__details a {
    display: inline-block;
    min-height: 2.75rem;
    padding-block: 0.625rem;
  }
}
