.terms-page {
  min-width: 0;
  background: var(--color-ink-950);
}

.terms-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 8vw, 7rem);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-ink-900);
}

.terms-hero::before,
.terms-hero::after {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  content: "";
}

.terms-hero::before {
  top: 2.25rem;
  right: max(4vw, 2rem);
  width: min(31vw, 28rem);
  height: 11rem;
  border-top: 1px solid rgb(91 214 255 / 42%);
  border-right: 1px solid rgb(91 214 255 / 24%);
  border-radius: 0 100% 0 0;
  transform: rotate(-14deg);
}

.terms-hero::after {
  top: 6.8rem;
  right: min(23vw, 19rem);
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--color-amber-400);
  box-shadow: 0 0 1rem rgb(255 184 74 / 28%);
}

.terms-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-4);
}

.terms-hero__copy {
  grid-column: 1 / span 8;
  min-width: 0;
  max-width: 47.5rem;
}

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

.terms-hero h1 {
  margin-block-end: var(--space-5);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.071;
}

.terms-status {
  display: inline-flex;
  min-height: 1.75rem;
  align-items: center;
  margin-block-end: var(--space-5);
  padding-inline: var(--space-3);
  border: 1px solid rgb(255 184 74 / 48%);
  border-radius: var(--radius-xs);
  background: rgb(255 184 74 / 8%);
  color: var(--color-amber-300);
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.terms-hero__lead {
  max-width: 38.75rem;
  color: var(--color-mist-100);
  font-size: var(--text-lead);
  line-height: var(--line-lead);
}

.terms-document {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.terms-layout {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 3fr);
  column-gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.terms-layout__content,
.terms-layout__sidebar {
  min-width: 0;
}

.terms-layout__content {
  grid-column: 1;
  grid-row: 1;
  max-width: 46.25rem;
}

.terms-layout__sidebar {
  grid-column: 2;
  grid-row: 1;
}

.terms-toc {
  width: 100%;
  min-width: 0;
  padding: var(--space-5);
  border-left: 1px solid var(--color-border);
}

.terms-toc__label {
  margin-block: 0 var(--space-3);
  color: var(--color-electric-400);
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: var(--line-meta);
  text-transform: uppercase;
}

.terms-toc__list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  counter-reset: terms-toc;
}

.terms-toc__list > li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  counter-increment: terms-toc;
}

.terms-toc__list > li::before {
  content: counter(terms-toc, decimal-leading-zero);
  color: var(--color-amber-400);
  font-size: var(--text-meta);
  font-weight: 700;
}

.terms-toc__list a {
  display: block;
  min-width: 0;
  min-height: 2.75rem;
  padding-block: 0.7rem;
  color: var(--color-mist-300);
  font-size: var(--text-small);
  line-height: var(--line-small);
  text-decoration: none;
}

.terms-toc__list a:hover,
.terms-toc__list a:focus-visible,
.terms-toc__list a[aria-current="true"] {
  color: var(--color-electric-400);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

.terms-overview h2 {
  margin-block-end: var(--space-4);
}

.terms-overview__intro {
  max-width: 37.5rem;
  margin-block-end: 0;
  color: var(--color-mist-300);
}

.terms-section {
  position: relative;
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
  scroll-margin-top: 6rem;
}

.terms-section + .terms-section {
  border-top: 1px solid var(--color-border);
}

.terms-section--purpose::before {
  position: absolute;
  top: clamp(3.5rem, 7vw, 5.5rem);
  left: -1rem;
  width: 2px;
  height: 4rem;
  background: var(--color-electric-400);
  content: "";
}

.terms-section h2,
.terms-contact h2 {
  margin-block-end: var(--space-5);
  font-size: clamp(2rem, 3vw, 2.5rem);
  line-height: 1.15;
}

.terms-section h3 {
  margin-block: var(--space-6) var(--space-3);
  font-size: 1.75rem;
  line-height: 1.214;
}

.terms-section__body {
  min-width: 0;
  max-width: 45rem;
}

.terms-information {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-3);
  margin-block: var(--space-6);
}

.terms-information > * {
  min-width: 0;
}

.terms-information p {
  margin-block-end: 0;
}

.terms-rule-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 38.75rem;
  margin-block-end: 0;
  padding: 0;
}

.terms-rule-list > li {
  position: relative;
  min-width: 0;
  padding-left: 1.35rem;
  color: var(--color-mist-300);
}

.terms-rule-list > li::before {
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 0.55rem;
  height: 1px;
  background: var(--color-amber-400);
  content: "";
}

.terms-quote-panel,
.terms-appstore-panel,
.terms-contact {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-ink-800);
}

.terms-quote-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-4);
  width: min(92%, 40rem);
  margin-block: var(--space-6);
  padding: var(--space-5);
  box-shadow: var(--shadow-elevated);
}

.terms-quote-panel::before {
  position: absolute;
  top: var(--space-5);
  left: 0;
  width: 3px;
  height: 2.75rem;
  background: var(--color-amber-400);
  content: "";
}

.terms-quote-panel > * {
  min-width: 0;
  margin: 0;
}

.terms-quote-panel h3 {
  padding-left: var(--space-3);
  font-size: 1.4rem;
}

.terms-appstore-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-3);
  width: min(100%, 37.5rem);
  margin-block: var(--space-6) 0;
  padding: var(--space-5);
  border-color: rgb(91 214 255 / 38%);
}

.terms-appstore-panel > * {
  min-width: 0;
  margin: 0;
}

.terms-appstore-panel__label {
  color: var(--color-electric-400);
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: var(--line-meta);
  text-transform: uppercase;
}

.terms-appstore-panel h3 {
  font-size: 1.5rem;
  line-height: 1.2;
}

.terms-warning {
  max-width: 40.625rem;
  margin-block: var(--space-6);
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--color-coral-400);
  background: rgb(255 107 99 / 5%);
}

.terms-warning p {
  margin-block-end: 0;
  color: var(--color-mist-300);
}

.terms-update {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

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

.terms-update h3 {
  font-size: 1.75rem;
  line-height: 1.214;
}

.terms-contact {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 46.25rem;
  margin-top: var(--space-4);
  padding: clamp(var(--space-5), 4vw, var(--space-6));
  box-shadow: var(--shadow-elevated);
  scroll-margin-top: 6rem;
}

.terms-contact__inner {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 35rem;
}

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

.terms-contact__email {
  display: inline-flex;
  min-width: 0;
  min-height: 2.75rem;
  align-items: center;
  align-self: flex-start;
  color: var(--color-electric-400);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.terms-contact__date {
  width: 100%;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  color: var(--color-mist-300);
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: var(--line-meta);
  text-transform: uppercase;
}

.terms-page ul {
  list-style: none !important;
}

@media (min-width: 64.01rem) and (min-height: 42rem) {
  .terms-toc {
    position: sticky;
    top: 6.5rem;
  }
}

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

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

@media (max-width: 63.99rem) {
  .terms-layout {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-7);
  }

  .terms-layout__sidebar,
  .terms-layout__content {
    grid-column: 1;
  }

  .terms-layout__sidebar {
    grid-row: 1;
  }

  .terms-layout__content {
    grid-row: 2;
    max-width: 46.25rem;
  }

  .terms-toc {
    padding: 0 0 var(--space-5);
    border-bottom: 1px solid var(--color-border);
    border-left: 0;
  }

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

  .terms-toc__list > li {
    min-width: 0;
  }
}

@media (max-width: 47.99rem) {
  .terms-hero {
    padding-block: var(--space-8);
  }

  .terms-hero::before {
    top: 1.5rem;
    right: -4rem;
    width: 12rem;
    height: 5rem;
    opacity: 0.65;
  }

  .terms-hero::after {
    top: 3.5rem;
    right: 3rem;
  }

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

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

  .terms-hero h1 {
    font-size: 2.125rem;
    line-height: 1.176;
  }

  .terms-hero__lead {
    max-width: none;
    font-size: 1rem;
    line-height: var(--line-body);
  }

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

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

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

  .terms-toc__list a {
    min-height: 2.75rem;
  }

  .terms-overview {
    padding-bottom: var(--space-6);
  }

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

  .terms-section--purpose::before {
    top: var(--space-7);
    left: 0;
    width: 3rem;
    height: 2px;
  }

  .terms-section--purpose h2 {
    padding-top: var(--space-5);
  }

  .terms-section h2,
  .terms-contact h2 {
    font-size: 1.75rem;
    line-height: 1.214;
  }

  .terms-section h3,
  .terms-update h3 {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .terms-section__body,
  .terms-overview__intro {
    max-width: none;
  }

  .terms-information {
    gap: var(--space-3);
  }

  .terms-quote-panel,
  .terms-appstore-panel {
    width: 100%;
    padding: var(--space-5);
  }

  .terms-warning {
    width: 100%;
    padding: var(--space-4);
  }

  .terms-contact {
    margin-top: 0;
  }

  .terms-contact__email {
    align-self: stretch;
    min-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .terms-toc__list a {
    scroll-behavior: auto;
  }
}
