/* Social Battery — Legal Pages CSS */
/* Fonts: Plus Jakarta Sans (display) + Be Vietnam Pro (body) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@700;900&family=Be+Vietnam+Pro:wght@400;500&display=swap');

/* ─── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Night palette — source: TimeOfDayBackground.tsx night.high */
  --bg-0: #0A0A0C;
  --bg-1: #0E0F16;
  --bg-2: #121420;
  --bg-3: #16192A;
  --bg-4: #1B1F36;

  /* Buddy */
  --buddy-base: #4D9FBF;
  --buddy-highlight: #7ED4E8;
  --buddy-shadow: #1A5C7A;
  --buddy-accent: #4DFFEE;

  /* Glass cards */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 24px;

  /* Text */
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.35);

  /* Link */
  --link: rgba(180, 220, 240, 0.85);
  --link-hover: rgba(77, 208, 225, 1);

  /* Layout */
  --content-max: 680px;
  --radius-card: 16px;
  --radius-sm: 8px;
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--bg-0);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Background Scene ──────────────────────────────────────────────────────── */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* 5-stop gradient — matches night palette exactly */
.bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #0A0A0C 0%,
    #0E0F16 22%,
    #121420 48%,
    #16192A 74%,
    #1B1F36 100%
  );
}

/* Vignette overlays — depth, matches app */
.bg-vignette-v {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.28) 100%);
  pointer-events: none;
}
.bg-vignette-h {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.18) 0%, transparent 50%, rgba(0,0,0,0.18) 100%);
  pointer-events: none;
}

/* Stars container */
.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  animation: twinkle var(--tw-dur, 3.2s) var(--tw-delay, 0s) infinite ease-in-out;
  will-change: opacity;
}

@keyframes twinkle {
  0%, 100% { opacity: var(--tw-max, 0.6); }
  50%       { opacity: calc(var(--tw-max, 0.6) * 0.2); }
}

/* Wave layers — bottom, premium drift, generous height */
.bg-wave {
  position: absolute;
  bottom: -80px;
  left: -10%;
  width: 120%;
  height: 44vh;
  opacity: 0.1;
  animation: wave-drift 4.5s ease-in-out infinite alternate;
  will-change: transform;
}

.bg-wave-2 {
  position: absolute;
  bottom: -100px;
  left: -10%;
  width: 120%;
  height: 52vh;
  opacity: 0.06;
  animation: wave-drift-2 6s ease-in-out infinite alternate;
  will-change: transform;
}

/* Wave layers — TOP, mirrored, asymmetric counter-drift */
.bg-wave-top {
  position: absolute;
  top: -80px;
  left: -10%;
  width: 120%;
  height: 42vh;
  opacity: 0.09;
  transform: scaleY(-1);
  animation: wave-drift-top 5s ease-in-out infinite alternate;
  will-change: transform;
}

.bg-wave-top-2 {
  position: absolute;
  top: -100px;
  left: -10%;
  width: 120%;
  height: 50vh;
  opacity: 0.05;
  transform: scaleY(-1) scaleX(-1);
  animation: wave-drift-top-2 7s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes wave-drift {
  0%   { transform: translateY(0) translateX(0) scaleX(1); }
  100% { transform: translateY(-36px) translateX(-3%) scaleX(1.06); }
}

@keyframes wave-drift-2 {
  0%   { transform: translateY(-12px) translateX(0) scaleX(1.02); }
  100% { transform: translateY(18px) translateX(4%) scaleX(1.08); }
}

@keyframes wave-drift-top {
  0%   { transform: scaleY(-1) translateY(0) translateX(0) scaleX(1); }
  100% { transform: scaleY(-1) translateY(-32px) translateX(3%) scaleX(1.06); }
}

@keyframes wave-drift-top-2 {
  0%   { transform: scaleY(-1) scaleX(-1) translateY(-10px) translateX(0); }
  100% { transform: scaleY(-1) scaleX(-1.08) translateY(16px) translateX(-4%); }
}

/* ─── Bubbles (battery mechanic) ───────────────────────────────────────────── */
.bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bubble {
  position: absolute;
  top: -40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,
    rgba(126, 212, 232, 0.55) 0%,
    rgba(77, 159, 191, 0.35) 45%,
    rgba(26, 92, 122, 0.12) 85%,
    transparent 100%);
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.15),
              0 0 12px rgba(77, 208, 225, 0.18);
  animation: bubble-fall var(--bub-dur, 14s) var(--bub-delay, 0s) infinite linear;
  will-change: transform, opacity;
  opacity: 0;
}

@keyframes bubble-fall {
  0%   { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
  8%   { opacity: var(--bub-op, 0.7); }
  50%  { transform: translate3d(var(--bub-sway, 12px), 55vh, 0) scale(1); }
  92%  { opacity: calc(var(--bub-op, 0.7) * 0.5); }
  100% { transform: translate3d(0, 112vh, 0) scale(0.9); opacity: 0; }
}

/* ─── Page Wrapper ──────────────────────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ─── Header (index = hero centered) ───────────────────────────────────────── */
.site-header {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0 32px;
  text-align: center;
}

.buddy-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

/* ─── Buddy SVG animations ──────────────────────────────────────────────────── */
.buddy-bounce {
  animation: buddy-float 2.8s ease-in-out infinite;
  will-change: transform;
  transform-origin: center bottom;
}

@keyframes buddy-float {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(-8px) scale(1.01); }
}

.buddy-eyes {
  animation: buddy-blink 4s 1.5s infinite;
  will-change: transform;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes buddy-blink {
  0%, 94%, 100% { transform: scaleY(1); }
  96%            { transform: scaleY(0.08); }
  98%            { transform: scaleY(1); }
}

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero { text-align: center; }

.hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 900;
  font-size: clamp(40px, 8vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.hero-tagline {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 400;
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* ─── Nav Cards (index links) ───────────────────────────────────────────────── */
.nav-cards {
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
}

.nav-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.18s ease;
}

.nav-card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%,
    rgba(126, 212, 232, 0.22) 0%,
    rgba(77, 159, 191, 0.12) 55%,
    rgba(26, 92, 122, 0.08) 100%);
  border: 1px solid rgba(126, 212, 232, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--buddy-highlight);
  box-shadow: inset 0 0 12px rgba(126, 212, 232, 0.08),
              0 0 16px rgba(77, 208, 225, 0.15);
}

.nav-card-icon svg { display: block; }

.nav-card-body {
  flex: 1;
  min-width: 0;
}

.nav-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  text-decoration: none;
}

.nav-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 18px;
}

.nav-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.nav-card-arrow {
  color: var(--text-muted);
  font-size: 20px;
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.18s ease, color 0.18s ease;
}

.nav-card:hover .nav-card-arrow {
  transform: translateX(4px);
  color: var(--link-hover);
}

/* ─── Back Link ─────────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.18s ease;
}

.back-link:hover { color: var(--link-hover); text-decoration: none; }

/* ─── Legal Header (inner pages) ───────────────────────────────────────────── */
.legal-header {
  padding: 48px 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.legal-header-mini-buddy {
  flex-shrink: 0;
}

.legal-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.legal-updated {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Legal Content ─────────────────────────────────────────────────────────── */
.legal-content {
  padding-bottom: 64px;
  flex: 1;
}

.legal-content h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 3.5vw, 24px);
  line-height: 1.3;
  color: var(--text-primary);
  margin-top: 40px;
  margin-bottom: 12px;
}

.legal-content p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 400;
}

.legal-content ul, .legal-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 16px;
}

.legal-content li { margin-bottom: 6px; }

.legal-content strong {
  color: var(--text-primary);
  font-weight: 500;
}

.legal-content a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(180, 220, 240, 0.3);
  text-underline-offset: 2px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.legal-content a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

/* Glass section cards */
.glass-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 24px 28px;
  margin-bottom: 16px;
}

.glass-section h2 { margin-top: 0; }
.glass-section > *:last-child { margin-bottom: 0; }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 32px 0 40px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.site-footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}

.site-footer a:hover { color: var(--link-hover); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .glass-section { padding: 20px; }
  .nav-card { padding: 20px; }
  .legal-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-header { padding: 36px 0 24px; }
  .hero-title { letter-spacing: -0.015em; }
}
