/* Shared styles for the legal pages (privacy.html, terms.html).
   The site chrome (tokens, grain, cursor, buttons, nav, footer) is copied from index.html, so keep the two in step. */

:root {
  --bg: #04060c;
  --bg-2: #070b16;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2fb;
  --muted: #8d97ad;
  --blue: #0563f7;
  --blue-2: #2f86ff;
  --cyan: #6fe3ff;
  --light: #eef3fb;
  --ink: #0a0a0a;
  --ink-muted: #4c5466;
  --danger: #ff5a5a;
  --radius: 28px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 3%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 5%); }
  80% { transform: translate(6%, 2%); }
}

/* ---------- Cursor ---------- */
.cursor, .cursor-ring { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor, .cursor-ring {
    display: block; position: fixed; top: 0; left: 0; z-index: 200; pointer-events: none;
    border-radius: 50%; transform: translate3d(-100px, -100px, 0);
  }
  .cursor { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; mix-blend-mode: difference; }
  .cursor-ring {
    width: 36px; height: 36px; margin: -18px 0 0 -18px;
    border: 1px solid rgba(255, 255, 255, .35);
    transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, border-color .35s;
  }
  .cursor-ring.is-hover {
    width: 72px; height: 72px; margin: -36px 0 0 -36px;
    background: rgba(47, 134, 255, .12); border-color: rgba(111, 227, 255, .6);
  }
}

/* ---------- Buttons ---------- */
.btn {
  --bx: 0px; --by: 0px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 28px; border-radius: 999px;
  font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .01em;
  color: #fff; background: var(--blue);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 10px 40px -10px rgba(5, 99, 247, .8);
  overflow: hidden; isolation: isolate; white-space: nowrap;
  transform: translate3d(var(--bx), var(--by), 0);
  transition: transform .5s var(--ease), box-shadow .4s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(120% 120% at 50% 120%, var(--cyan), var(--blue-2) 45%, var(--blue) 75%);
  transform: translateY(101%); transition: transform .6s var(--ease);
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 16px 60px -10px rgba(47, 134, 255, .95); }
.btn__roll { position: relative; display: block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.btn__roll > span { display: block; transition: transform .6s var(--ease); }
.btn:hover .btn__roll > span { transform: translateY(-100%); }
.btn__arrow { width: 18px; height: 18px; transition: transform .6s var(--ease); }
.btn:hover .btn__arrow { transform: rotate(-45deg); }
.btn--ghost { background: transparent; box-shadow: 0 0 0 1px var(--line-strong) inset; }
.btn--ghost::before { background: rgba(255, 255, 255, .08); }
.btn--light { background: #fff; color: var(--ink); box-shadow: none; }
.btn--light::before { background: var(--cyan); }
.btn--sm { height: 44px; padding: 0 20px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]::before { display: none; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 100;
  transition: transform .6s var(--ease);
}
.nav.is-hidden { transform: translateY(-140%); }
.nav__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1100px; margin: 0 auto; padding: 8px 8px 8px 22px;
  width: calc(100% - 2 * var(--gutter));
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(6, 9, 18, .55);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  position: relative; overflow: hidden;
}
.nav__progress { position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; background: linear-gradient(90deg, transparent, var(--cyan), var(--blue)); transform: scaleX(0); transform-origin: left; }
.nav .logo { height: 24px; width: auto; }
.nav .logo-mobile { display: none; height: 30px; width: 30px; }
@media (max-width: 560px) {
  .nav .logo-desktop { display: none; }
  .nav .logo-mobile { display: block; }
  .nav__inner { padding-left: 12px; }
}

/* ---------- Section shared ---------- */
.section { position: relative; padding: clamp(96px, 14vw, 180px) 0; }
.eyebrow-line { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.eyebrow-line i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.eyebrow-line b { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); transform-origin: left; }
.section-heading {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(40px, 6.4vw, 92px); line-height: .98; letter-spacing: -.04em;
  max-width: 14ch;
}
.section-heading.dark { color: var(--ink); }
.main-paragraph { color: var(--muted); font-size: 18px; }
.main-paragraph.dark { color: var(--ink); }
.default-text { color: var(--muted); }
.default-text.dark { color: var(--muted); }

/* split words */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.wi { display: inline-block; will-change: transform; }

/* ---------- Footer ---------- */
.footer-background { position: relative; padding: clamp(80px, 12vw, 160px) 0 0; overflow: hidden; }
.footer-background::before {
  content: ""; position: absolute; left: 50%; bottom: -30%; width: 1200px; height: 800px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(5, 99, 247, .35), transparent);
  filter: blur(30px); pointer-events: none;
}
.footer-container { position: relative; }
.footer-top-div { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.footer-top-logo-div img { height: 32px; width: auto; }
.footer-top-logo-div .default-text { margin-top: 18px; font-family: var(--display); font-size: clamp(22px, 2.6vw, 34px); color: var(--text); letter-spacing: -.02em; line-height: 1.15; max-width: 16ch; }
.footer-top-buttons-div { display: flex; align-items: center; gap: 12px; }
.x-link { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); transition: background .4s, border-color .4s, transform .5s var(--ease); }
.x-link:hover { background: #fff; border-color: #fff; }
.x-link:hover .x { filter: invert(1); }
.x { width: 24px; height: 24px; }
.divider-div { height: 1px; background: var(--line); margin: 48px 0 24px; transform-origin: left; }
.footer-bottom-div { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.footer-link-block { display: flex; gap: 24px; }
.footer-link { position: relative; }
.footer-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
.footer-link:hover { color: var(--text); }
.footer-link:hover::after { transform: scaleX(1); transform-origin: left; }
.footer-giant { position: relative; margin-top: clamp(40px, 6vw, 80px); padding: 0 var(--gutter); }
.footer-giant img {
  width: 100%; max-width: 1600px; margin: 0 auto; height: auto; opacity: .9;
  mask-image: linear-gradient(180deg, #000 30%, transparent 105%);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 105%);
  transform: translateY(18%);
}

/* ---------- Legal pages ---------- */
.legal-hero { position: relative; padding: clamp(150px, 18vw, 220px) 0 clamp(56px, 7vw, 96px); overflow: hidden; }
.legal-hero__glow {
  position: absolute; left: 50%; top: -340px; width: 1300px; height: 820px; transform: translateX(-50%); pointer-events: none;
  background:
    radial-gradient(40% 38% at 50% 45%, rgba(5, 99, 247, .42), transparent 70%),
    radial-gradient(22% 24% at 30% 58%, rgba(111, 227, 255, .14), transparent 70%),
    radial-gradient(24% 26% at 72% 52%, rgba(47, 134, 255, .22), transparent 70%);
  filter: blur(40px);
  animation: legalGlow 14s ease-in-out infinite alternate;
}
@keyframes legalGlow { to { transform: translateX(-52%) scale(1.1) rotate(5deg); } }
/* Faint concentric rings echo the home page's hero orbits */
.legal-hero__rings {
  position: absolute; left: 50%; top: -900px; width: 1800px; aspect-ratio: 1; transform: translateX(-50%); pointer-events: none;
  background: repeating-radial-gradient(circle at 50% 50%, transparent 0 89px, rgba(120, 170, 255, .1) 89px 90px);
  mask-image: radial-gradient(closest-side, #000 35%, transparent 100%); -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
}
.legal-hero .container { position: relative; }
.breadcrumb-div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.breadcrumb-div a { transition: color .3s; }
.breadcrumb-div a:hover { color: var(--text); }
.breadcrumb-div .divider { opacity: .5; }
.breadcrumb-div [aria-current] { color: var(--text); }
.legal-title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(48px, 9vw, 128px); line-height: .95; letter-spacing: -.045em;
}
.legal-updated {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 32px; padding: 8px 16px 8px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; color: var(--muted);
}
.legal-updated i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }

/* Contents on the left (sticky), the document on the right */
.legal-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.legal-toc { position: sticky; top: 120px; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.legal-toc a {
  display: block; padding: 7px 0 7px 18px; margin-left: -1px;
  font-size: 14px; line-height: 1.45; color: var(--muted); border-left: 1px solid transparent;
  transition: color .3s, border-color .3s, transform .5s var(--ease);
}
.legal-toc a:hover { color: var(--text); transform: translateX(4px); }
.legal-toc a.is-active { color: var(--text); border-left-color: var(--cyan); }

.legal-body { max-width: 760px; }
.legal-intro p { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; color: var(--text); }
.legal-intro p + p { margin-top: 16px; }
.legal-sec { padding-top: 48px; margin-top: 48px; border-top: 1px solid var(--line); scroll-margin-top: 110px; }
.legal-sec h2 { font-family: var(--display); font-weight: 500; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.12; letter-spacing: -.03em; margin-bottom: 20px; }
.legal-sec h3 { font-family: var(--display); font-weight: 500; font-size: 19px; letter-spacing: -.01em; color: var(--text); margin: 28px 0 10px; }
.legal-sec h2 + h3 { margin-top: 0; }
.legal-sec p, .legal-sec li { color: var(--muted); font-size: 17px; line-height: 1.75; }
.legal-sec p + p, .legal-sec ul + p, .legal-sec p + ul { margin-top: 14px; }
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legal-body li { position: relative; padding-left: 26px; }
.legal-body li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--blue-2); box-shadow: 0 0 10px rgba(47, 134, 255, .8); }
.legal-body a { color: var(--cyan); background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); }
.legal-body a:hover { background-size: 100% 1px; }

@media (max-width: 960px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { display: none; }
}
@media (max-width: 560px) {
  .legal-sec { padding-top: 36px; margin-top: 36px; }
  .legal-sec p, .legal-sec li { font-size: 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
