:root {
  color-scheme: dark;
  --bg: #061018;
  --bg-soft: #0b1722;
  --panel: rgba(11, 23, 34, 0.88);
  --panel-strong: rgba(9, 17, 27, 0.96);
  --border: rgba(34, 211, 238, 0.2);
  --text: #f7fbff;
  --text-soft: #b5c4d8;
  --accent-cyan: #22d3ee;
  --accent-green: #5ff3a0;
  --shadow: 0 24px 60px rgba(2, 8, 18, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(95, 243, 160, 0.1), transparent 24%),
    linear-gradient(180deg, #04070d 0%, #07121c 52%, #061018 100%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
}

.legal-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.legal-topbar,
.legal-panel,
.legal-footer {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(17, 23, 32, 0.92), rgba(8, 14, 22, 0.96));
  box-shadow: var(--shadow);
}

.legal-topbar::before,
.legal-panel::before,
.legal-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 42%),
    url("./assets/playcortex-wavefield-cyan.svg");
  background-repeat: no-repeat;
  background-position: top left, right -140px bottom -34px;
  background-size: 100% 100%, min(54%, 520px) auto;
  opacity: 0.22;
}

.legal-topbar > *,
.legal-panel > *,
.legal-footer > * {
  position: relative;
  z-index: 1;
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.legal-brand img {
  width: 40px;
  height: 40px;
}

.legal-brand-copy {
  display: grid;
  gap: 3px;
}

.legal-brand-copy strong {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.legal-brand-copy span {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.legal-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-link {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 600;
  transition:
    color 160ms ease,
    text-shadow 160ms ease,
    border-color 160ms ease;
}

.legal-link:hover,
.legal-link:focus-visible {
  color: var(--accent-cyan);
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.22);
}

.legal-link--pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 18px;
  background: rgba(11, 23, 34, 0.76);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.08),
    0 0 22px rgba(34, 211, 238, 0.12);
}

.legal-panel {
  padding: 30px;
}

.legal-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.65fr);
  gap: 24px;
  align-items: start;
}

.legal-eyebrow {
  margin: 0 0 12px;
  color: var(--accent-cyan);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-title {
  margin: 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.98;
}

.legal-intro,
.legal-meta,
.legal-note {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.72;
}

.legal-copy {
  display: grid;
  gap: 14px;
}

.legal-actions {
  display: grid;
  gap: 14px;
  align-content: start;
}

.legal-card {
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 22px;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, rgba(10, 18, 28, 0.96), rgba(8, 13, 22, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    0 18px 38px rgba(2, 8, 18, 0.28);
}

.legal-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.legal-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.68;
}

.legal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 18px;
  text-decoration: none;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.legal-button:hover,
.legal-button:focus-visible {
  transform: translateY(-1px);
}

.legal-button--primary {
  color: #041018;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.96), rgba(95, 243, 160, 0.94));
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.22),
    0 0 26px rgba(34, 211, 238, 0.22);
}

.legal-button--secondary {
  color: var(--text);
  border: 1px solid rgba(34, 211, 238, 0.24);
  background: rgba(11, 23, 34, 0.72);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.08),
    0 0 20px rgba(34, 211, 238, 0.12);
}

.legal-viewer {
  margin-top: 26px;
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 24px;
  overflow: hidden;
  background: var(--panel-strong);
}

.legal-viewer iframe {
  display: block;
  width: 100%;
  height: min(78vh, 1080px);
  border: 0;
  background: #0a1119;
}

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  margin-top: 18px;
}

.legal-footer p {
  margin: 0;
  color: var(--text-soft);
}

@media (max-width: 960px) {
  .legal-shell {
    width: min(100vw - 24px, 1180px);
    padding-top: 16px;
  }

  .legal-topbar,
  .legal-panel,
  .legal-footer {
    border-radius: 24px;
  }

  .legal-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .legal-topbar,
  .legal-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .legal-panel {
    padding: 22px;
  }

  .legal-actions-row,
  .legal-nav {
    width: 100%;
  }

  .legal-button,
  .legal-link--pill {
    width: 100%;
  }

  .legal-viewer iframe {
    height: 72vh;
  }
}
