/*
 * PixelSpark web — "Midnight Spark", the Android v2 theme.
 * Tokens are SparkColors.kt (app/src/main/kotlin/com/pixelspark/app/ui/v2/theme);
 * the type is Space Grotesk, the font the app ships. Change them there first.
 */
:root {
  color-scheme: dark;
  --bg: #0A0E14;            /* BgPrimary */
  --bg-elevated: #141B24;   /* BgElevated */
  --bg-container: #1C2530;  /* BgContainer */
  --border: #1E293B;        /* Border / SurfaceToggle */
  --accent: #7C3AED;        /* AccentPrimary */
  --accent-2: #A78BFA;      /* AccentSecondary */
  --glow: #C084FC;          /* AccentGlow */
  --text: #F1F5F9;          /* TextPrimary */
  --text-2: #94A3B8;        /* TextSecondary */
  --text-3: #64748B;        /* TextTertiary */
  --success: #34D399;
  --warning: #FBBF24;
  --grad-start: #7C3AED;    /* GradientStart */
  --grad-end: #EC4899;      /* GradientEnd */
  --cta: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  --radius: 24px;
  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 8px; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-container);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------- shared chrome ---------- */

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 14, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-nav.scrolled { border-bottom-color: var(--border); }
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }

.lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.lockup .mark { width: 30px; height: 30px; }
.lockup .word { height: 26px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.nav-links a { color: var(--text-2); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links .btn-cta, .nav-links .btn-cta:hover { color: #fff; }

.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.btn-cta, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  border: 0;
  background: var(--cta);
  color: #fff;
  font: 600 16px/1 var(--font);
  white-space: nowrap;
  box-shadow: 0 12px 32px -12px rgba(236, 72, 153, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-cta:hover, .btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 16px 40px -12px rgba(236, 72, 153, 0.7); }
.btn-cta svg, .btn svg { flex: none; }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; box-shadow: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 8px;
  color: var(--accent-2);
  font-weight: 500;
}

.site-footer { border-top: 1px solid var(--border); margin-top: 96px; padding: 40px 0 48px; color: var(--text-3); font-size: 14px; }
.site-footer .wrap { display: grid; gap: 28px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px; }
.footer-brand p { margin: 12px 0 0; color: var(--text-2); max-width: 34ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- landing ---------- */

.hero { position: relative; padding: 72px 0 40px; }
.hero::before {
  content: "";
  position: absolute;
  inset: -120px 0 auto;
  height: 720px;
  background: radial-gradient(520px 360px at 72% 40%, rgba(124, 58, 237, 0.20), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 56px; }
.hero h1 { font-size: clamp(42px, 6.2vw, 72px); font-weight: 600; margin: 18px 0 20px; }
.hero h1 .light { font-weight: 300; }
.hero .lede { font-size: clamp(17px, 2vw, 20px); color: var(--text-2); max-width: 46ch; margin: 0 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--text-3); font-size: 14px; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }

.orb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
}
.orb::after {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.35), transparent 68%);
  z-index: -1;
  animation: breathe 4.8s ease-in-out infinite;
}
.orb img { width: 100%; height: 100%; }
@keyframes breathe { 0%, 100% { opacity: 0.55; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }

/* phone + screen tour */
.device { display: grid; justify-items: center; gap: 22px; }
.phone {
  position: relative;
  width: min(320px, 78vw);
  aspect-ratio: 540 / 1212;
  border-radius: 44px;
  padding: 10px;
  background: linear-gradient(160deg, #1C2530, #0F141B 60%);
  border: 1px solid var(--border);
  box-shadow: 0 50px 100px -40px rgba(124, 58, 237, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.phone .screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 34px; background: var(--bg); }
.phone .screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 0.6s ease, transform 0.9s ease;
}
.phone .screen img.on { opacity: 1; transform: none; }

.segmented {
  display: inline-flex;
  position: relative;
  padding: 5px;
  border-radius: 999px;
  background: var(--border);
}
.segmented button {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  color: var(--text-2);
  font: 500 14px/1 var(--font);
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.segmented button[aria-selected="true"] { color: #fff; }
.segmented .thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), width 0.35s cubic-bezier(.2, .8, .2, 1);
}

/* sections */
.section { padding: 88px 0 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); margin: 14px 0 14px; }
.section-head p { color: var(--text-2); font-size: 18px; margin: 0; }

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.mode-picker { padding: 32px; display: grid; align-content: start; gap: 24px; }
.mode-picker .segmented { width: 100%; }
.mode-picker .segmented button { flex: 1; height: 46px; font-size: 15px; }
.mode-detail { padding: 32px; display: grid; align-content: start; gap: 14px; }
.mode-detail .hint { font-size: 14px; color: var(--accent-2); font-weight: 500; }
.mode-detail h3 { font-size: 28px; }
.mode-detail p { margin: 0; color: var(--text-2); }
.mode-detail .swap { display: grid; gap: 14px; transition: opacity 0.25s ease, transform 0.25s ease; }
.mode-detail .swap.out { opacity: 0; transform: translateY(6px); }
.facts { display: grid; gap: 0; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--text-3); font-size: 14px; }
.facts dd { margin: 0; color: var(--text); font-weight: 500; text-align: right; }

.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.type { padding: 28px; transition: border-color 0.25s ease, transform 0.25s ease; }
.type:hover { border-color: rgba(167, 139, 250, 0.35); transform: translateY(-2px); }
.type .icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.14);
  color: var(--accent-2);
  margin-bottom: 20px;
}
.type h3 { font-size: 22px; margin-bottom: 8px; }
.type p { margin: 0; color: var(--text-2); }
.type .tag { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--text-3); }

.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.trust .panel { padding: 28px; }
.trust h3 { font-size: 19px; margin-bottom: 8px; }
.trust p { margin: 0; color: var(--text-2); font-size: 15px; }

.closing { padding: 112px 0 0; text-align: center; }
.closing .orb { width: 88px; height: 88px; margin: 0 auto 28px; }
.closing h2 { font-size: clamp(34px, 5vw, 52px); }
.closing p { color: var(--text-2); font-size: 18px; margin: 12px 0 32px; }

/* reveal on scroll (only when JS has run, so the page never hides without it) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .orb::after { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .phone .screen img, .segmented .thumb, .mode-detail .swap { transition: none; }
}

/* ---------- policy pages (privacy, terms, delete-*) ---------- */

.shell { width: min(1120px, 100% - 40px); margin-inline: auto; }

.hero.page { padding: 64px 0 36px; }
.hero.page::before { inset: -160px 0 auto; height: 520px; background: radial-gradient(480px 300px at 50% 30%, rgba(124, 58, 237, 0.16), transparent 70%); }
.hero.page h1 { font-size: clamp(36px, 5vw, 56px); margin: 16px 0 14px; }
.hero.page .lede { margin: 0 0 10px; }
.updated { margin: 0; font-size: 14px; color: var(--text-3); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.gradient-text { background: linear-gradient(90deg, var(--accent-2), var(--grad-end)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.layout-container { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.sidebar { position: sticky; top: 92px; }
.sidebar-title { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.toc-list { display: grid; gap: 2px; border-left: 1px solid var(--border); }
.toc-link { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--text-2); font-size: 14px; }
.toc-link:hover { color: var(--text); border-left-color: var(--accent-2); }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 36px);
}
.grid { display: grid; gap: 20px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.card h2 { font-size: 24px; }
.card h3 { font-size: 18px; margin: 24px 0 8px; }
.card p, .card li { color: var(--text-2); }
.card strong { color: var(--text); font-weight: 600; }
.card ul, .card ol { padding-left: 20px; }
.card li { margin: 8px 0; }

.policy h2 { margin: 40px 0 12px; padding-top: 8px; scroll-margin-top: 96px; }
.policy h2:first-child { margin-top: 0; }

.card-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.card-head h2 { margin: 0; }
.card-sub { margin: 6px 0 0; font-size: 15px; color: var(--text-3) !important; }

.icon-wrap {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.14);
  color: var(--accent-2);
}
.icon-wrap.pink { background: rgba(236, 72, 153, 0.12); color: #F472B6; }
.icon-wrap.green { background: rgba(52, 211, 153, 0.12); color: var(--success); }
.icon-wrap.amber { background: rgba(251, 191, 36, 0.12); color: var(--warning); }

.steps { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 4px; }
.step { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); margin: 0 !important; }
.step:first-child { border-top: 0; }
.step p { margin: 4px 0 0; }
.step-num {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.list { list-style: none; padding: 0 !important; margin: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; }
.list-icon { flex: none; margin-top: 3px; color: var(--accent-2); }

.help-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.help-card h2 { font-size: 22px !important; }
.help-card p { margin: 8px 0 0; max-width: 56ch; }

.callout, .note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--bg-container);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.callout p { margin: 0; }
.callout-icon { flex: none; margin-top: 2px; color: var(--accent-2); }
.note { display: block; }

.ambient-glow-1, .ambient-glow-2 { display: none; }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero:not(.page) { padding-top: 48px; text-align: center; }
  .hero:not(.page) .lede { margin-inline: auto; }
  .hero-actions, .hero-facts { justify-content: center; }
  .hero:not(.page) .orb { margin-inline: auto; }
  .modes, .types, .trust, .split { grid-template-columns: minmax(0, 1fr); }
  .layout-container { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .toc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; }
  .toc-link { padding-left: 0; border-left: 0; }
}

@media (max-width: 600px) {
  .nav-links .hide-sm { display: none; }
  .lockup .word { height: 22px; }
  .mode-picker, .mode-detail { padding: 24px; }
  .mode-picker .segmented button { padding: 0 8px; }
  #tour-tabs { max-width: 100%; }
  #tour-tabs button { padding: 0 11px; font-size: 13px; }
  .footer-top { flex-direction: column; }
  .section { padding-top: 72px; }
}
