/* =========================================
   LEGAL PAGE STYLES — VERVAIN
========================================= */

/* Wrapper */
.wrapper {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding-top: 140px;
  padding-bottom: 120px;
  position: relative;
  z-index: 2;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 5rem;
  min-height: auto;
  padding: 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.06em;
  margin-bottom: 1.5rem;
}

.hero-title em {
  font-style: normal;
  color: var(--primary);
}

.hero h2 {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.9;
}

.hero mark {
  background: rgba(255, 183, 0, 0.15);
  color: #ffc857;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hero-meta span {
  border: 1px solid var(--border);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0.75;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
}

/* Toggle */
.toggle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 4rem;
}

.pill-toggle {
  position: relative;
  display: inline-flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem;
  backdrop-filter: blur(16px);
}

.pill-btn {
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.pill-btn.active {
  color: white;
}

.pill-bg {
  position: absolute;
  top: 5px;
  left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  background: var(--primary);
  border-radius: 999px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Panels */
.panel {
  display: none;
  animation: fadePanel 0.4s ease;
}

.panel.active {
  display: block;
}

@keyframes fadePanel {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table of Contents */
.toc {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 3rem;
  backdrop-filter: blur(16px);
}

.toc-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.5;
  margin-bottom: 1rem;
}

.toc ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  padding-left: 1rem;
}

.toc li {
  opacity: 0.8;
}

.toc a {
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.toc a:hover {
  color: var(--primary);
  padding-left: 4px;
}

/* Callout */
.callout {
  padding: 1.5rem;
  border-radius: 22px;
  background: linear-gradient(
    135deg,
    rgba(91,75,138,0.15),
    rgba(91,75,138,0.05)
  );
  border: 1px solid rgba(91,75,138,0.2);
  margin-bottom: 3rem;
  backdrop-filter: blur(14px);
}

.callout p {
  opacity: 0.9;
}

/* Sections */
.legal-section {
  position: relative;
  margin-bottom: 5rem;
  padding: 2.5rem;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.legal-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right,
    rgba(91,75,138,0.08),
    transparent 40%);
  pointer-events: none;
}

.section-number {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.legal-section p {
  margin-bottom: 1.2rem;
  opacity: 0.82;
  font-size: 1.02rem;
}

.legal-section ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.legal-section li {
  margin-bottom: 0.9rem;
  opacity: 0.82;
}

.sub-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text);
}

/* Contact */
.contact-block {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}

.contact-label {
  display: inline-block;
  margin-bottom: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

.contact-email {
  color: var(--primary);
  font-weight: 600;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding-top: 2rem;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}

/* Selection */
::selection {
  background: rgba(91,75,138,0.35);
}

/* Responsive */
@media (max-width: 768px) {

  .wrapper {
    width: 94%;
    padding-top: 120px;
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-meta {
    flex-direction: column;
    align-items: center;
  }

  .pill-toggle {
    width: 100%;
  }

  .pill-btn {
    width: 50%;
    padding: 0.9rem 0.5rem;
    font-size: 0.9rem;
  }

  .toc ol {
    grid-template-columns: 1fr;
  }

  .legal-section {
    padding: 1.5rem;
    border-radius: 24px;
  }

  .section-title {
    font-size: 2rem;
  }

  footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* =========================
   Back To Top Button
========================= */

#backToTop {
  position: fixed;
  bottom: 28px;
  right: 28px;

  width: 52px;
  height: 52px;

  border: 1px solid var(--border);
  border-radius: 40%;

  background: rgba(255,255,255,0.06);
  color: var(--text);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1rem;
  cursor: pointer;

  z-index: 999;

  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);

  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease,
    background 0.3s ease;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#backToTop:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(91,75,138,0.35);
}

/* Mobile */
@media (max-width: 768px) {
  #backToTop {
    width: 48px;
    height: 48px;
    bottom: 20px;
    right: 20px;
  }
}