/* CleanSpace website — tokens mirror the Figma "Color" collection (app/src/main/res/values/colors.xml and values-night/colors.xml) */
:root {
  --primary: #5B4AD6;
  --on-primary: #FFFFFF;
  --primary-container: #E5DEFF;
  --on-primary-container: #170065;
  --secondary-container: #E4DFF9;
  --on-secondary-container: #1B192C;
  --tertiary: #006B5B;
  --tertiary-container: #9EF2DD;
  --on-tertiary-container: #00201A;
  --warning-container: #FFDCBE;
  --on-warning-container: #2C1600;
  --error: #BA1A1A;
  --surface: #FCF8FF;
  --surface-lowest: #FFFFFF;
  --surface-low: #F6F2FC;
  --surface-container: #F0ECF6;
  --surface-high: #EAE6F1;
  --surface-highest: #E5E1EB;
  --on-surface: #1C1B21;
  --on-surface-variant: #47464F;
  --outline: #78767F;
  --outline-variant: #C8C5D0;

  --data-photos: #3D7BF7;
  --data-videos: #D9488B;
  --data-apps: #5B4AD6;
  --data-documents: #E08A00;
  --data-audio: #0E9AA7;

  --radius-s: 12px;
  --radius-m: 20px;
  --radius-l: 28px;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #C8BFFF;
    --on-primary: #2B1A9E;
    --primary-container: #4231BD;
    --on-primary-container: #E5DEFF;
    --secondary-container: #474558;
    --on-secondary-container: #E4DFF9;
    --tertiary: #5FDBC0;
    --tertiary-container: #005144;
    --on-tertiary-container: #9EF2DD;
    --warning-container: #693C00;
    --on-warning-container: #FFDCBE;
    --error: #FFB4AB;
    --surface: #131318;
    --surface-lowest: #0E0E13;
    --surface-low: #1C1B21;
    --surface-container: #201F25;
    --surface-high: #2A2930;
    --surface-highest: #35343B;
    --on-surface: #E5E1EB;
    --on-surface-variant: #C8C5D0;
    --outline: #928F99;
    --outline-variant: #47464F;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--primary); text-underline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--primary); color: var(--on-primary);
  padding: 8px 16px; border-radius: 999px; z-index: 10;
}
.skip:focus { left: 16px; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline-variant);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; color: var(--on-surface); text-decoration: none;
}
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--on-surface-variant); text-decoration: none; font-weight: 500;
  font-size: 15px; padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--surface-high); color: var(--on-surface); }
.nav a[aria-current="page"] { background: var(--secondary-container); color: var(--on-secondary-container); }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: 999px;
  font: inherit; font-weight: 500; font-size: 16px; text-decoration: none;
  border: 0; cursor: pointer;
}
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-filled:hover { filter: brightness(1.08); }
.btn-tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn-tonal:hover { filter: brightness(0.97); }
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn[aria-disabled="true"] { cursor: default; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-lowest); color: var(--on-surface);
  border-radius: 999px; padding: 6px 14px 6px 10px;
  font-size: 14px; font-weight: 500;
}
.chip svg { width: 18px; height: 18px; fill: var(--primary); }

.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); margin: 0 0 8px;
}

/* ---------- Hero ---------- */
.hero { padding: 40px 0 24px; }
.hero-card {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  border-radius: 32px;
  padding: 56px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 72px); line-height: 1.05; letter-spacing: -.02em;
  margin: 24px 0 20px; font-weight: 500; color: var(--on-primary-container);
}
@media (prefers-color-scheme: dark) { .hero h1 { color: var(--on-secondary-container); } }
.hero .lede { font-size: 20px; line-height: 1.5; margin: 0 0 32px; max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { font-size: 14px; color: var(--on-surface-variant); margin: 16px 0 0; }

/* Phone mock: storage ring, drawn in CSS so it matches the real Home screen */
.phone {
  justify-self: center;
  width: 300px; max-width: 100%;
  background: var(--surface); color: var(--on-surface);
  border-radius: 40px; padding: 14px;
  border: 8px solid var(--on-surface);
  box-shadow: 0 30px 60px -20px rgb(23 0 101 / .35);
}
.phone-screen { border-radius: 26px; background: var(--surface); padding: 18px 16px 20px; }
.phone-status { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--on-surface-variant); margin-bottom: 14px; }
.phone-title { font-size: 13px; color: var(--on-surface-variant); margin: 0; }
.phone-device { font-size: 20px; font-weight: 500; margin: 0 0 14px; }
.ring-card { background: var(--surface-low); border-radius: 22px; padding: 18px; text-align: center; }
.ring { position: relative; width: 168px; height: 168px; margin: 4px auto 12px; display: grid; place-content: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4.2; }
.ring circle.track { stroke: var(--surface-highest); }
.ring b { display: block; font-size: 21px; font-weight: 500; line-height: 1.1; }
.ring span { font-size: 11px; color: var(--on-surface-variant); }
.ring-free { color: var(--tertiary); font-weight: 500; font-size: 14px; margin: 0 0 14px; }
.phone .btn { width: 100%; justify-content: center; height: 44px; font-size: 15px; }
.mini-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mini-tile { background: var(--surface-low); border-radius: 16px; padding: 12px; font-size: 13px; font-weight: 500; text-align: left; }
.mini-tile i { display: block; width: 28px; height: 28px; border-radius: 9px; background: var(--primary-container); margin-bottom: 8px; position: relative; }
.mini-tile i::after { content: ""; position: absolute; inset: 8px; border-radius: 3px; background: var(--primary); }
@media (prefers-color-scheme: dark) { .mini-tile i::after { background: var(--on-primary-container); } }
.mini-tile small { display: block; color: var(--on-surface-variant); font-weight: 400; font-size: 11px; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.15; margin: 0 0 12px; font-weight: 500; letter-spacing: -.01em; }
.section-head p { margin: 0; font-size: 18px; color: var(--on-surface-variant); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface-low);
  border-radius: var(--radius-m);
  padding: 28px;
}
.card h3 { font-size: 20px; line-height: 1.3; margin: 16px 0 8px; font-weight: 500; }
.card p { margin: 0; color: var(--on-surface-variant); font-size: 15px; }

.icon-box {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--primary-container); color: var(--on-primary-container);
}
.icon-box svg { width: 24px; height: 24px; fill: currentColor; }
.icon-box.mint { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.icon-box.amber { background: var(--warning-container); color: var(--on-warning-container); }

.group-label {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--on-surface-variant); margin: 40px 0 16px;
}
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--outline-variant); }
.group-label:first-of-type { margin-top: 0; }

/* Principles */
.principles .card { background: var(--surface-container); }
.principles h3 { margin-top: 0; font-size: 22px; }

/* Promise band */
.promise {
  background: var(--primary); color: var(--on-primary);
  border-radius: 32px; padding: 48px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
}
.promise b { display: block; font-size: 36px; font-weight: 500; line-height: 1.1; margin-bottom: 6px; }
.promise span { font-size: 15px; opacity: .9; }

/* Screenshots */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.shots figure { margin: 0; }
.shots img { border-radius: var(--radius-m); width: 100%; height: auto; background: var(--surface-high); }
.shots figcaption { font-size: 14px; color: var(--on-surface-variant); margin-top: 10px; }

/* Permissions */
.perm { display: flex; gap: 20px; align-items: flex-start; }
.perm h3 { margin-top: 0; }

/* FAQ */
.faq { max-width: 800px; }
.faq details {
  background: var(--surface-low); border-radius: var(--radius-m);
  padding: 4px 24px; margin-bottom: 12px;
}
.faq summary {
  cursor: pointer; list-style: none; font-weight: 500; font-size: 17px;
  padding: 18px 0; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; line-height: 1; color: var(--primary); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 20px; color: var(--on-surface-variant); }

/* CTA */
.cta {
  background: var(--tertiary-container); color: var(--on-tertiary-container);
  border-radius: 32px; padding: 56px; text-align: center;
}
.cta h2 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; font-weight: 500; }
.cta p { margin: 0 auto 28px; max-width: 52ch; font-size: 18px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--outline-variant); padding: 40px 0 56px; margin-top: 40px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
.site-footer p { margin: 0; color: var(--on-surface-variant); font-size: 14px; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer nav a { color: var(--on-surface-variant); font-size: 14px; }

/* ---------- Legal / privacy page ---------- */
.legal { padding: 48px 0 24px; }
.legal-grid { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; }
.legal-grid > * { min-width: 0; }
.toc { position: sticky; top: 88px; font-size: 14px; }
.toc p { font-weight: 700; margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--outline-variant); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--on-surface-variant); text-decoration: none; }
.toc a:hover { color: var(--primary); border-left-color: var(--primary); }

.legal-head h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.1; margin: 0 0 12px; font-weight: 500; }
.legal-head .meta { color: var(--on-surface-variant); margin: 0 0 28px; }

.summary-card {
  background: var(--secondary-container); color: var(--on-secondary-container);
  border-radius: var(--radius-l); padding: 28px 32px; margin-bottom: 40px;
}
.summary-card h2 { font-size: 20px; margin: 0 0 14px; font-weight: 500; }
.summary-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.summary-card li { display: flex; gap: 12px; align-items: flex-start; }
.summary-card li svg { width: 20px; height: 20px; flex: none; margin-top: 3px; fill: var(--tertiary); }

.prose { max-width: 72ch; }
.prose h2 { font-size: 26px; font-weight: 500; margin: 48px 0 12px; scroll-margin-top: 88px; }
.prose h3 { font-size: 18px; font-weight: 500; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--on-surface); }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }

.table-wrap { overflow-x: auto; margin: 16px 0; border-radius: var(--radius-s); border: 1px solid var(--outline-variant); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 560px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--outline-variant); }
.prose th { background: var(--surface-container); font-weight: 500; }
.prose tr:last-child td { border-bottom: 0; }

.todo {
  background: var(--warning-container); color: var(--on-warning-container);
  padding: 1px 6px; border-radius: 6px; font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-card { grid-template-columns: 1fr; padding: 40px 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .promise { grid-template-columns: repeat(2, 1fr); }
  .legal-grid { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav a.hide-sm { display: none; }
  .hero { padding-top: 16px; }
  .hero-card { padding: 32px 20px; border-radius: 24px; }
  .hero .lede { font-size: 18px; }
  section { padding: 48px 0; }
  .grid-4, .grid-3, .shots { grid-template-columns: 1fr; }
  .promise { grid-template-columns: 1fr 1fr; padding: 32px 24px; gap: 24px; border-radius: 24px; }
  .promise b { font-size: 28px; }
  .cta { padding: 40px 20px; border-radius: 24px; }
  .card { padding: 24px; }
  .summary-card { padding: 24px 20px; }
}
