html {
  scroll-behavior: smooth;
}

body.terms-page {
  background: radial-gradient(circle at 20% 20%, rgba(189, 236, 93, 0.35), transparent 50%),
    radial-gradient(circle at 78% 30%, rgba(102, 153, 204, 0.3), transparent 55%),
    radial-gradient(circle at 50% 80%, rgba(189, 236, 93, 0.2), transparent 60%),
    #0f141b;
  color: #f7f3ea;
}

.terms-page .page-grain {
  opacity: 0.2;
}

.terms-page .ambient-orbs span {
  opacity: 0.22;
  animation: none;
}

.terms-container {
  width: min(94vw, var(--max-width));
  margin: 0 auto;
}

.terms-hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.terms-hero .terms-container {
  position: relative;
  z-index: 1;
}

.terms-nav {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.terms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.terms-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}
/*
.terms-heading {
  max-width: 720px;
}
*/

.terms-page .eyebrow {
  text-transform: uppercase;
  color: rgba(189, 236, 93, 0.85);
}

.terms-heading h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 3vw + 1.1rem, 3.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: #f8f4ed;
}

.terms-lead {
  font-size: clamp(1rem, 1.2vw + 0.7rem, 1.25rem);
  color: rgba(248, 244, 237, 0.72);
  margin: 0;
}

.terms-main {
  padding: 0 0 clamp(4rem, 8vw, 6rem);
}

.terms-layout {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-areas:
    "toc"
    "article";
}

.terms-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 19, 24, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 45px rgba(15, 19, 24, 0.12);
  backdrop-filter: blur(6px);
  color: var(--text);
}

.terms-toc {
  grid-area: toc;
  padding: 1.5rem;
}

.terms-toc h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 1rem;
}

.terms-toc ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
  columns: 1;
  column-gap: 1.5rem;
}

.terms-toc li {
  break-inside: avoid;
  margin-bottom: 0.3rem;
}

.terms-toc a {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 0.35rem 0.45rem;
  border-radius: 0.6rem;
  line-height: 1.4;
}

.terms-toc a:hover {
  background: rgba(102, 153, 204, 0.16);
  color: var(--ink);
}

.terms-toc a:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 2px;
}

.terms-article {
  grid-area: article;
  padding: clamp(2rem, 4vw, 3.5rem);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
}

.terms-intro {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(175, 199, 128, 0.18);
  border: 1px solid rgba(100, 124, 50, 0.35);
}

.terms-intro p {
  margin: 0;
}

.terms-article h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.6vw + 1rem, 2rem);
  letter-spacing: -0.01em;
  margin: 2.5rem 0 1rem;
  color: var(--ink);
}

.terms-article section:first-of-type h2 {
  margin-top: 0;
}

.terms-article h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.6rem 0 0.6rem;
}

.terms-article p {
  margin: 0 0 1.1rem;
}

.terms-article ul,
.terms-article ol {
  margin: 0 0 1.2rem 1.2rem;
  padding: 0;
}

.terms-article li {
  margin-bottom: 0.45rem;
}

.terms-article section + section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(15, 19, 24, 0.08);
}

.terms-article a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(102, 153, 204, 0.6);
  text-underline-offset: 3px;
}

.terms-article a:hover {
  color: #204a73;
  text-decoration-color: rgba(189, 236, 93, 0.7);
}

.terms-article a:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 3px;
}

.terms-page .brand-lockup img {
  transform: scale(1.6);
}

@media (min-width: 720px) {
  .terms-toc ol {
    columns: 2;
  }
}

@media (min-width: 1100px) {
  .terms-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas: "article toc";
    align-items: start;
  }

  .terms-toc {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .terms-toc ol {
    columns: 1;
  }
}

@media (max-width: 720px) {
  .terms-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .terms-actions {
    width: 100%;
  }

  .terms-actions .btn {
    width: 100%;
  }
}
