/* =========================================================
   TheSpaceLaunches · Terms of Service page
   Styled for desktop only; reuses base.css / components.css tokens.
   ========================================================= */

/* ---- Page scaffold ---- */
.terms-page {
  padding: 0 0 80px;
}

/* ---- Hero section (CSS-only, no image) ---- */
.terms-hero {
  position: relative;
  padding: 72px 0 56px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(43, 110, 212, 0.22), transparent 55%),
    radial-gradient(ellipse at 80% 10%, rgba(255, 138, 61, 0.08), transparent 60%);
}
.terms-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(76, 201, 255, 0.08), transparent 70%);
  pointer-events: none;
}
.terms-hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}
.terms-hero__eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-blue);
  border: 1px solid rgba(76, 201, 255, 0.35);
  background: rgba(76, 201, 255, 0.08);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 18px;
}
.terms-hero__title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-0);
  margin: 0 0 12px;
  line-height: 1.2;
}
.terms-hero__sub {
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ---- Main layout: sidebar TOC + content ---- */
.terms-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 0;
}

/* ---- Sticky table of contents sidebar ---- */
.terms-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 20px;
  background: var(--glass-bg);
  border: var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.terms-toc__title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(76, 201, 255, 0.18);
}
.terms-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.terms-toc__item {
  font-size: 13px;
  line-height: 1.5;
}
.terms-toc__link {
  color: var(--text-2);
  text-decoration: none;
  transition: color .15s ease, padding-left .15s ease;
  display: block;
  padding: 4px 0 4px 8px;
  border-left: 2px solid transparent;
}
.terms-toc__link:hover {
  color: var(--accent-blue);
  border-left-color: rgba(76, 201, 255, 0.3);
}
.terms-toc__link.is-active {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  background: rgba(76, 201, 255, 0.06);
}

/* ---- Main content area ---- */
.terms-content {
  max-width: 800px;
}
.terms-section {
  margin-bottom: 48px;
}
.terms-section__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-0);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(76, 201, 255, 0.12);
  scroll-margin-top: 96px;
}
.terms-section__body {
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.7;
}
.terms-section__body p {
  margin: 0 0 14px;
}
.terms-section__body p:last-child {
  margin-bottom: 0;
}
.terms-section__body ul,
.terms-section__body ol {
  margin: 12px 0 14px;
  padding-left: 24px;
}
.terms-section__body li {
  margin-bottom: 8px;
  line-height: 1.6;
}
.terms-section__body strong {
  color: var(--text-0);
  font-weight: 600;
}
.terms-section__body a {
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(76, 201, 255, 0.3);
  transition: border-color .15s ease;
}
.terms-section__body a:hover {
  border-bottom-color: var(--accent-blue);
}

/* ---- Sub-sections (nested headings) ---- */
.terms-subsection {
  margin-top: 24px;
}
.terms-subsection__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-0);
  margin: 0 0 10px;
}

/* ---- Highlight box for important clauses ---- */
.terms-highlight {
  padding: 16px 18px;
  background: rgba(76, 201, 255, 0.06);
  border: 1px solid rgba(76, 201, 255, 0.2);
  border-left: 3px solid var(--accent-blue);
  border-radius: 6px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-1);
}
.terms-highlight strong {
  color: var(--accent-blue);
}

/* ---- Effective date badge ---- */
.terms-effective {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-orange);
  background: rgba(255, 138, 61, 0.10);
  border: 1px solid rgba(255, 138, 61, 0.3);
  border-radius: 6px;
  padding: 6px 14px;
  margin-top: 18px;
}

/* =========================================================
   Phase 2 (P1) — terms mobile layout
   Per mobile plan §2.4. The desktop 240 px + 1fr 2-col
   layout (TOC sidebar + content) collapses to a single
   column; the sticky TOC becomes a wrap chip row above
   the content so the section jumps stay reachable.
   Desktop rules (1-226) are untouched.
   ========================================================= */

@media (max-width: 767px) {
  .terms-page { padding: 0; }
  .terms-hero { padding: 24px 0 12px; }
  .terms-hero__title { font-size: 26px; }
  .terms-hero__sub { font-size: 14px; }

  .terms-layout {
    display: block;
    padding: 24px 18px 56px;
    gap: 0;
  }
  .terms-toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 14px;
    margin-bottom: 18px;
  }
  .terms-toc__list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .terms-toc__item { font-size: 12px; }
  .terms-toc__link {
    padding: 6px 10px;
    border-left: 0;
    border-radius: 4px;
    background: rgba(76, 201, 255, 0.08);
  }
  .terms-toc__link:hover { padding-left: 10px; }

  .terms-section__title { font-size: 18px; }
  .terms-section__body { font-size: 14px; }
}

@media (max-width: 480px) {
  .terms-hero__title { font-size: 22px; }
  .terms-layout { padding: 18px 14px 48px; }
  .terms-section__title { font-size: 16px; }
}
