/* ===================== TERMOS — PAGE INTRO ===================== */
#termos-head {
  position: relative;
  padding: 160px 0 40px;
  text-align: center;
  overflow: hidden;
  background: var(--bg);
}

#termos-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(0,204,255,.08), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(123,45,255,.05), transparent 70%);
  pointer-events: none;
}

#termos-head::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0, rgba(255,255,255,.012) 1px, transparent 1px, transparent 44px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0, rgba(255,255,255,.012) 1px, transparent 1px, transparent 44px);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, rgba(0,0,0,.6), transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, rgba(0,0,0,.6), transparent 80%);
  pointer-events: none;
}

.tm-head-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 32px;
}

.tm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0,204,255,.06);
  border: 1px solid rgba(0,204,255,.2);
  margin-bottom: 24px;
  opacity: 0;
  animation: fade-up .7s var(--ease) .2s both;
}

.tm-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0,204,255,.6);
  animation: pulse 1.8s ease-in-out infinite;
}

.tm-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -.025em;
  color: #fff;
  margin: 0 0 18px;
  opacity: 0;
  animation: fade-up .8s var(--ease) .5s both;
}

.tm-title .accent {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tm-sub {
  font-size: 15px;
  font-weight: 300;
  color: #9ea3b4;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 22px;
  opacity: 0;
  animation: fade-up .8s var(--ease) .8s both;
}

.tm-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  font-weight: 400;
  color: #9ea3b4;
  letter-spacing: .06em;
  padding: 8px 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  opacity: 0;
  animation: fade-up .8s var(--ease) 1.1s both;
}

.tm-meta strong { color: #aaa; font-weight: 500; }
.tm-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: #333; }

/* ===================== LAYOUT: content + TOC ===================== */
.tm-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 32px 96px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}

/* TOC sticky */
.tm-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 4px 12px 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.tm-toc::-webkit-scrollbar { width: 4px; }
.tm-toc::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 999px; }

.tm-toc-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #9095a5;
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 2px solid rgba(0,204,255,.3);
}

.tm-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid rgba(255,255,255,.06);
}

.tm-toc li {
  position: relative;
}

.tm-toc a {
  display: block;
  padding: 9px 0 9px 14px;
  font-size: 12px;
  font-weight: 400;
  color: #9ea3b4;
  letter-spacing: -.005em;
  line-height: 1.4;
  transition: color .2s;
  border-left: 2px solid transparent;
  margin-left: -1px;
}

.tm-toc a:hover { color: #ccc; }

.tm-toc a.active {
  color: var(--cyan);
  border-left-color: var(--cyan);
  background: linear-gradient(to right, rgba(0,204,255,.04), transparent);
}

.tm-toc a .num {
  display: inline-block;
  width: 22px;
  font-weight: 500;
  color: #82869a;
  font-variant-numeric: tabular-nums;
}

.tm-toc a.active .num { color: var(--cyan); }

/* ===================== CONTENT ===================== */
.tm-content {
  min-width: 0;
}

.tm-intro {
  padding: 28px 32px;
  background: rgba(0,204,255,.03);
  border: 1px solid rgba(0,204,255,.14);
  border-radius: 16px;
  margin-bottom: 48px;
}

.tm-intro p {
  font-size: 14px;
  font-weight: 300;
  color: #b3b8c8;
  line-height: 1.8;
  letter-spacing: -.005em;
}

.tm-intro p + p { margin-top: 12px; }

.tm-intro strong { color: #ccc; font-weight: 500; }

.tm-clause {
  padding: 40px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  scroll-margin-top: 100px;
}

.tm-clause:last-child { border-bottom: none; }

.tm-clause-num {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 5px 12px;
  background: rgba(0,204,255,.06);
  border: 1px solid rgba(0,204,255,.18);
  border-radius: 999px;
  margin-bottom: 16px;
}

.tm-clause h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 400;
  color: #fff;
  letter-spacing: -.015em;
  line-height: 1.3;
  margin-bottom: 24px;
}

.tm-clause p {
  font-size: 14.5px;
  font-weight: 300;
  color: #b3b8c8;
  line-height: 1.85;
  margin-bottom: 14px;
  letter-spacing: -.002em;
}

.tm-clause p:last-child { margin-bottom: 0; }

.tm-clause p strong {
  color: #bbb;
  font-weight: 500;
}

.tm-clause ul,
.tm-clause ol {
  list-style: none;
  padding: 0;
  margin: 12px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tm-clause li {
  position: relative;
  padding: 10px 16px 10px 38px;
  font-size: 13.5px;
  font-weight: 300;
  color: #b3b8c8;
  line-height: 1.75;
  background: rgba(255,255,255,.015);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
}

.tm-clause li::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: .7;
}

.tm-clause li strong { color: #bbb; font-weight: 500; }

.tm-clause .tm-sub-num {
  color: var(--cyan);
  font-weight: 500;
  margin-right: 6px;
}

/* Back-to-top button */
.tm-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(8,8,18,.92);
  border: 1px solid rgba(0,204,255,.22);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.tm-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tm-top:hover {
  background: rgba(0,204,255,.1);
  border-color: rgba(0,204,255,.5);
  color: #8ce0ff;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .tm-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .tm-toc {
    position: relative;
    top: 0;
    max-height: none;
    overflow-y: visible;
    padding: 16px 20px;
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
  }
  .tm-toc ol {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-left: none;
  }
  .tm-toc a { padding: 6px 10px; }
  .tm-toc a.active { border-left: none; background: rgba(0,204,255,.06); border-radius: 6px; }
}

@media (max-width: 768px) {
  #termos-head { padding: 120px 0 32px; }
  .tm-head-inner { padding: 0 20px; }
  .tm-title { font-size: 38px; }
  .tm-container { padding: 20px 20px 64px; }
  .tm-intro { padding: 22px 20px; }
  .tm-clause { padding: 32px 0; }
  .tm-toc ol { grid-template-columns: 1fr; }
  .tm-top { bottom: 16px; right: 16px; width: 42px; height: 42px; }
}
