:root {
  color-scheme: dark;
  --bg-0: #040011;
  --bg-1: #170738;
  --bg-2: #0b0226;
  --violet-300: #c4b5fd;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --text-main: rgba(255, 255, 255, 0.88);
  --text-sub: rgba(196, 181, 253, 0.7);
  --text-muted: rgba(196, 181, 253, 0.52);
  --green-400: #34d399;
  --gold-500: #f59e0b;
  --red-500: #ef4444;

  --qb-page-bg: linear-gradient(195deg, #040011 0%, #170738 35%, #0b0226 65%, #040011 100%);
  --qb-heading: #ffffff;
  --qb-text: rgba(196, 181, 253, 0.7);
  --qb-text-secondary: rgba(196, 181, 253, 0.65);
  --qb-text-muted: rgba(196, 181, 253, 0.52);
  --qb-text-bright: rgba(255, 255, 255, 0.86);
  --qb-card-bg-solid: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(139, 92, 246, 0.02) 50%, rgba(255, 255, 255, 0.015));
  --qb-card-border: rgba(167, 139, 250, 0.14);
  --qb-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --qb-glass-bg: rgba(4, 0, 17, 0.9);
  --qb-glass-border: rgba(167, 139, 250, 0.2);
  --qb-footer-text: rgba(196, 181, 253, 0.25);
  --qb-noise-opacity: 0.016;
  --qb-star-opacity: 1;
  --qb-glow-opacity: 1;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-0: #faf8ff;
  --bg-1: #f0ecff;
  --bg-2: #ede8ff;
  --text-main: #1e1040;
  --text-sub: #6b5a8a;
  --text-muted: #9a8cb8;

  --qb-page-bg: linear-gradient(195deg, #faf8ff 0%, #f0ecff 35%, #ede8ff 65%, #faf8ff 100%);
  --qb-heading: #1e1040;
  --qb-text: #6b5a8a;
  --qb-text-secondary: #7c6a9e;
  --qb-text-muted: #9a8cb8;
  --qb-text-bright: #2d1f54;
  --qb-card-bg-solid: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(237, 232, 255, 0.56), rgba(255, 255, 255, 0.72));
  --qb-card-border: rgba(139, 92, 246, 0.12);
  --qb-card-shadow: 0 6px 24px rgba(139, 92, 246, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --qb-glass-bg: rgba(255, 255, 255, 0.92);
  --qb-glass-border: rgba(139, 92, 246, 0.16);
  --qb-footer-text: #9a8cb8;
  --qb-noise-opacity: 0;
  --qb-star-opacity: 0.3;
  --qb-glow-opacity: 0.25;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  color: var(--text-main);
  background: var(--qb-page-bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: #a78bfa;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(167, 139, 250, 0.3);
}

a:hover {
  color: #c4b5fd;
}

.legal-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.starfield,
.floating-orbs,
.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.starfield {
  z-index: -3;
  opacity: var(--qb-star-opacity);
}

.floating-orbs {
  z-index: -2;
  overflow: hidden;
  opacity: var(--qb-glow-opacity);
}

.noise-layer {
  z-index: -1;
  opacity: var(--qb-noise-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(66px);
  animation: orb-float linear infinite;
}

.orb-1 {
  width: 320px;
  height: 320px;
  left: 8%;
  top: 14%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.16), transparent 70%);
  animation-duration: 18s;
}

.orb-2 {
  width: 250px;
  height: 250px;
  left: 74%;
  top: 8%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.13), transparent 70%);
  animation-duration: 22s;
  animation-delay: -2s;
}

.orb-3 {
  width: 210px;
  height: 210px;
  left: 62%;
  top: 62%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent 70%);
  animation-duration: 20s;
  animation-delay: -4s;
}

.orb-4 {
  width: 170px;
  height: 170px;
  left: 20%;
  top: 72%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.08), transparent 70%);
  animation-duration: 24s;
  animation-delay: -1s;
}

.orb-5 {
  width: 140px;
  height: 140px;
  left: 86%;
  top: 42%;
  background: radial-gradient(circle, rgba(196, 181, 253, 0.1), transparent 70%);
  animation-duration: 16s;
  animation-delay: -3s;
}

.orb-6 {
  width: 360px;
  height: 360px;
  left: 40%;
  top: 30%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08), transparent 72%);
  filter: blur(90px);
  animation-duration: 26s;
  animation-delay: -5s;
}

@keyframes orb-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  25% {
    transform: translate3d(28px, -22px, 0) scale(1.06);
  }

  50% {
    transform: translate3d(-20px, 14px, 0) scale(0.95);
  }

  75% {
    transform: translate3d(14px, -10px, 0) scale(1.03);
  }
}

@keyframes star-twinkle {
  0%,
  100% {
    opacity: var(--star-opacity, 0.4);
  }

  50% {
    opacity: calc(var(--star-opacity, 0.4) * 0.3);
  }
}

@keyframes orb-bob {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-8px) scale(1.03);
  }
}

@keyframes ring-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.glass-strong,
.glass-pill {
  position: relative;
  border: 1px solid var(--qb-card-border);
  background: var(--qb-card-bg-solid);
  backdrop-filter: blur(32px) saturate(1.65) brightness(1.05);
  -webkit-backdrop-filter: blur(32px) saturate(1.65) brightness(1.05);
  box-shadow: var(--qb-card-shadow);
}

.glass-strong::before,
.glass-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(196, 181, 253, 0.18), rgba(96, 165, 250, 0.07), rgba(244, 114, 182, 0.08));
  opacity: 0.35;
  padding: 1px;
  mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  -webkit-mask: linear-gradient(#fff, #fff) content-box, linear-gradient(#fff, #fff);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.glass-pill {
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.legal-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 1rem;
}

.legal-nav-inner {
  width: min(920px, calc(100% - 2rem));
  margin-inline: auto;
  border-radius: 22px;
  padding: 0.8rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(60px) saturate(2) brightness(1.08);
  -webkit-backdrop-filter: blur(60px) saturate(2) brightness(1.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--qb-heading);
  font-weight: 700;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: block;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.4);
}

.back-home,
.bottom-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--qb-text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-home:hover,
.bottom-link:hover {
  color: var(--qb-heading);
}

.legal-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--qb-glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(196, 181, 253, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, 0.3);
}

.theme-toggle-icon::before {
  content: "☾";
  font-size: 0.95rem;
  line-height: 1;
}

[data-theme="light"] .theme-toggle {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
}

[data-theme="light"] .theme-toggle-icon::before {
  content: "☀";
}

.legal-main {
  position: relative;
  z-index: 1;
  padding: 7rem 0 4rem;
}

.legal-container {
  width: min(850px, calc(100% - 2rem));
  margin-inline: auto;
}

.legal-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-orb {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  margin: 0 auto 1.1rem;
  animation: orb-bob 2.5s ease-in-out infinite;
  position: relative;
}

.hero-orb::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.32), transparent 70%);
  filter: blur(10px);
}

.hero-orb::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 1.2px dashed rgba(196, 181, 253, 0.36);
  animation: ring-spin 10s linear infinite;
}

.mood-curious {
  background: radial-gradient(circle at 38% 38%, #bfdbfe, #60a5fa, #7c3aed);
  box-shadow: 0 0 22px rgba(96, 165, 250, 0.42), 0 0 42px rgba(124, 58, 237, 0.26);
}

.mood-shield {
  background: radial-gradient(circle at 38% 38%, #bbf7d0, #34d399, #6d28d9);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.42), 0 0 42px rgba(109, 40, 217, 0.26);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  margin-bottom: 1rem;
  color: #a78bfa;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.legal-hero h1 {
  margin: 0;
  color: var(--qb-heading);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-family: "Space Grotesk", Inter, sans-serif;
}

.legal-hero p {
  margin: 0.7rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.legal-card {
  border-radius: 18px;
  border: 1px solid var(--qb-card-border);
  background: var(--qb-card-bg-solid);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: var(--qb-card-shadow);
  padding: 1.35rem;
  margin-bottom: 0.85rem;
}

.legal-card h2 {
  margin: 0 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #c4b5fd;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-family: "Space Grotesk", Inter, sans-serif;
  letter-spacing: -0.01em;
}

.section-body {
  color: var(--text-sub);
  font-size: 0.95rem;
  line-height: 1.75;
}

.section-body p {
  margin: 0 0 0.75rem;
}

.section-body p:last-child {
  margin-bottom: 0;
}

.section-body strong {
  color: var(--qb-text-bright);
}

.list-title {
  margin-top: 0.2rem;
  color: var(--qb-text-secondary);
  font-weight: 600;
}

.section-body ul {
  margin: 0.3rem 0 0;
  padding-left: 0;
  list-style: none;
}

.section-body li {
  position: relative;
  margin: 0.45rem 0;
  padding-left: 1.3rem;
}

.section-body li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: rgba(196, 181, 253, 0.75);
}

.callout {
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 0.8rem 0;
}

.callout small {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.callout p {
  margin: 0.45rem 0 0;
  color: var(--qb-text-bright);
}

.callout.info {
  border-left: 3px solid var(--violet-600);
  background: rgba(124, 58, 237, 0.06);
}

.callout.info small {
  color: var(--violet-400);
}

.callout.important {
  border-left: 3px solid var(--gold-500);
  background: rgba(245, 158, 11, 0.06);
}

.callout.important small {
  color: var(--gold-500);
}

.callout.warning {
  border-left: 3px solid var(--red-500);
  background: rgba(239, 68, 68, 0.06);
}

.callout.warning small {
  color: var(--red-500);
}

.callout.tip {
  border-left: 3px solid var(--green-400);
  background: rgba(52, 211, 153, 0.06);
}

.callout.tip small {
  color: var(--green-400);
}

.service-list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.service-row {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem;
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 0.65rem;
}

.service-row strong {
  color: var(--qb-text-bright);
  font-size: 0.86rem;
}

.service-row span {
  color: var(--qb-text-muted);
  font-size: 0.8rem;
}

.service-row a {
  white-space: nowrap;
  font-size: 0.84rem;
}

.legal-bottom-nav {
  margin-top: 1.45rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.legal-footer {
  padding: 1.5rem 1rem 1.9rem;
  text-align: center;
}

.legal-footer p {
  margin: 0;
  color: var(--qb-footer-text);
  font-size: 0.82rem;
}

.reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
}

.reveal.is-visible {
  animation: reveal-up 0.55s cubic-bezier(0.22, 0.68, 0.35, 1) forwards;
}

[data-theme="light"] a {
  color: #7c3aed;
  text-decoration-color: rgba(124, 58, 237, 0.3);
}

[data-theme="light"] a:hover {
  color: #5b21b6;
}

[data-theme="light"] .glass-strong,
[data-theme="light"] .glass-pill,
[data-theme="light"] .legal-card {
  border-color: var(--qb-card-border);
  background: var(--qb-card-bg-solid);
  box-shadow: var(--qb-card-shadow);
}

[data-theme="light"] .hero-tag,
[data-theme="light"] .legal-card h2 {
  color: #7c3aed;
}

[data-theme="light"] .section-body li::before {
  color: rgba(124, 58, 237, 0.7);
}

[data-theme="light"] .service-row {
  background: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .back-home,
[data-theme="light"] .bottom-link {
  color: var(--qb-text-secondary);
}

[data-theme="light"] .back-home:hover,
[data-theme="light"] .bottom-link:hover {
  color: var(--qb-heading);
}

[data-theme="light"] *:focus-visible {
  outline-color: rgba(124, 58, 237, 0.55);
}

@media (max-width: 900px) {
  .legal-main {
    padding-top: 6.5rem;
  }

  .legal-nav-inner {
    width: calc(100% - 1.2rem);
    padding: 0.65rem 0.8rem;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
  }

  .back-home {
    font-size: 0.8rem;
  }

  .legal-nav-actions {
    gap: 0.45rem;
  }

  .service-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .service-row a {
    margin-top: 0.2rem;
  }
}

@media (max-width: 700px) {
  .theme-toggle {
    width: 34px;
    height: 34px;
  }

  .back-home {
    font-size: 0;
    gap: 0;
  }

  .back-home svg {
    width: 18px;
    height: 18px;
  }

  .legal-card {
    padding: 1rem;
  }

  .legal-bottom-nav {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

*:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.7);
  outline-offset: 2px;
}
