/* ══════════════════════════════════════════════════════════════
   SWIFTCRAM — LEGAL PAGES (Terms of Service · Privacy Policy)
   Mirrors the landing page design system: #13131a canvas, dark
   glass cards on #131322, purple accents, Inter.
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg:            #13131a;
  --card:          #131322;
  --card-hover:    #17172b;
  --purple:        #9d6fff;
  --purple-bright: #b490ff;
  --purple-glow:   rgba(157, 111, 255, 0.12);
  --purple-dim:    rgba(157, 111, 255, 0.22);
  --text:          #f0f0f8;
  --text-muted:    #9a9ab8;
  --text-faint:    #6b6b88;
  --border:        #2c2c3e;
  --border-bright: rgba(157, 111, 255, 0.28);
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

a { color: var(--purple-bright); }

/* ─── NAV ───────────────────────────────────────────────── */
.legal-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 66px;
  padding: 0 40px;
  background: rgba(19, 19, 26, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(44, 44, 62, 0.55);
}
.legal-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
}
.legal-brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
}
.legal-wordmark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.legal-wordmark em { font-style: normal; color: var(--purple); }

.legal-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.legal-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.legal-nav-links a:hover,
.legal-nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--purple-glow);
}
.legal-nav-links a:focus-visible,
.legal-brand:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: 8px;
}

@media (max-width: 620px) {
  .legal-nav { padding: 0 18px; }
  .legal-nav-links a { padding: 6px 9px; font-size: 13px; }
}

/* ─── SHELL ─────────────────────────────────────────────── */
.legal-shell {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 132px 24px 96px;
}
.legal-shell::before {
  content: '';
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 620px; height: 480px;
  background: radial-gradient(ellipse, rgba(157, 111, 255, 0.13) 0%, transparent 68%);
  filter: blur(70px);
  pointer-events: none;
  z-index: -1;
}

/* ─── HEADER ────────────────────────────────────────────── */
.legal-header { margin-bottom: 44px; }
.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-bright);
  background: var(--purple-glow);
  border: 1px solid var(--purple-dim);
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 22px;
}
.legal-title {
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 900;
  letter-spacing: -1.8px;
  line-height: 1.08;
  margin-bottom: 16px;
}
.legal-title em { font-style: normal; color: var(--purple-bright); }
.legal-lede {
  font-size: 16.5px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 620px;
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.legal-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 13px;
}

/* ─── TABLE OF CONTENTS ─────────────────────────────────── */
.legal-toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 40px;
}
.legal-toc h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 14px;
}
.legal-toc ol {
  list-style: none;
  counter-reset: toc;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
}
@media (max-width: 620px) { .legal-toc ol { grid-template-columns: 1fr; } }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 8px;
  margin-left: -8px;
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.legal-toc a::before {
  content: counter(toc) '.';
  color: var(--purple);
  font-weight: 700;
  flex-shrink: 0;
}
.legal-toc a:hover { color: var(--text); background: var(--purple-glow); }
.legal-toc a:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

/* ─── SECTION CARDS ─────────────────────────────────────── */
.legal-section {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 32px 32px;
  margin-bottom: 18px;
  scroll-margin-top: 90px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

/* Scroll-reveal start state. Gated on html.js so the policy text stays
   readable if the reveal script never runs. */
.js .legal-section {
  opacity: 0;
  transform: translateY(28px);
}
.legal-section:hover {
  background: var(--card-hover);
  border-color: var(--border-bright);
}
.js .legal-section.in-view {
  animation: fadeInUp 0.5s ease forwards;
}

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

.legal-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.legal-section-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--purple-glow);
  border: 1px solid var(--purple-dim);
  color: var(--purple-bright);
  font-size: 14px;
  font-weight: 800;
}
.legal-section h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.3;
}

.legal-section p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.78;
  margin-bottom: 14px;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section strong { color: var(--text); font-weight: 600; }

.legal-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 4px 0 14px;
}
.legal-section ul:last-child { margin-bottom: 0; }
.legal-section li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}
.legal-section li::before {
  content: '';
  position: absolute;
  left: 3px; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--purple);
}

/* Highlighted callout inside a section */
.legal-callout {
  display: flex;
  gap: 13px;
  background: rgba(157, 111, 255, 0.07);
  border: 1px solid var(--purple-dim);
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 18px;
}
.legal-callout svg {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 2px;
  color: var(--purple-bright);
}
.legal-callout p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

/* Definition-style rows (data processors, GDPR rights) */
.legal-defs {
  display: grid;
  gap: 10px;
  margin: 4px 0 4px;
}
.legal-def {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 15px 17px;
}
.legal-def dt {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.legal-def dd {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.legal-def-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--purple-bright);
  background: var(--purple-glow);
  border: 1px solid var(--purple-dim);
  border-radius: 5px;
  padding: 2px 7px;
  vertical-align: 1px;
}

/* Contact block */
.legal-contact {
  display: grid;
  gap: 4px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 4px;
  font-size: 14.5px;
  color: var(--text-muted);
}
.legal-contact span { color: var(--text); font-weight: 600; }
.legal-contact a { text-decoration: none; }
.legal-contact a:hover { text-decoration: underline; }

/* ─── FOOTER ────────────────────────────────────────────── */
.legal-footer {
  border-top: 1px solid var(--border);
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 24px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.legal-footer-brand { font-size: 14px; font-weight: 700; }
.legal-footer-brand em { font-style: normal; color: var(--purple); }
.legal-footer-links { display: flex; gap: 20px; }
.legal-footer-links a {
  font-size: 13px;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.legal-footer-links a:hover { color: var(--text-muted); }
.legal-footer-copy { font-size: 13px; color: var(--text-faint); }

@media (max-width: 560px) {
  .legal-shell { padding: 108px 18px 72px; }
  .legal-section { padding: 24px 20px 26px; border-radius: 16px; }
  .legal-footer { flex-direction: column; text-align: center; }
}

/* ─── REDUCED MOTION ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .legal-section,
  .js .legal-section.in-view {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
