@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500&display=swap");

:root{
  --wheel: conic-gradient(from -90deg, #ef4444, #f97316, #facc15, #22c55e, #14b8a6, #3b82f6, #8b5cf6, #ef4444);
  --red:#ef4444; --orange:#f97316; --yellow:#eab308; --green:#22c55e; --teal:#0d9488; --blue:#3b82f6; --purple:#8b5cf6;

  --bg: #faf9f6;
  --bg-soft: #f2f0ea;
  --surface: #ffffff;
  --text: #17181c;
  --text-dim: #55575f;
  --border: #e7e4db;
  --shadow: 0 1px 2px rgba(20,20,30,.04), 0 10px 30px -12px rgba(20,20,30,.10);
  --shadow-hover: 0 4px 10px rgba(20,20,30,.06), 0 24px 48px -16px rgba(20,20,30,.18);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --maxw: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #101116;
    --bg-soft: #16171e;
    --surface: #1a1b23;
    --text: #f2f2f5;
    --text-dim: #a4a6b3;
    --border: #2a2c37;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.5);
    --shadow-hover: 0 4px 10px rgba(0,0,0,.35), 0 24px 48px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
html, body{ padding:0; margin:0; }
body{
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img{ max-width:100%; display:block; }
a{ color: inherit; }
::selection{ background: var(--purple); color:#fff; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- scroll progress ---------- */
#progress{
  position: fixed; top:0; left:0; height:3px; width:0%;
  background: var(--wheel);
  z-index: 1000;
  transition: width .08s linear;
}

/* ---------- header ---------- */
header.site{
  position: sticky; top:0; z-index: 900;
  backdrop-filter: blur(10px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner{
  max-width: var(--maxw); margin:0 auto; padding: 14px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:-.02em; font-size:1.05rem; text-decoration:none; }
.brand img{ width:32px; height:32px; border-radius: 9px; box-shadow: var(--shadow); }
nav.links{ display:flex; gap:4px; align-items:center; }
nav.links a{
  text-decoration:none; color: var(--text-dim); font-weight:600; font-size:.88rem;
  padding: 8px 12px; border-radius: 999px; transition: color .15s ease, background .15s ease;
}
nav.links a:hover{ color: var(--text); background: var(--bg-soft); }
nav.links a.active{ color: var(--text); background: var(--bg-soft); }
.nav-cta{
  background: var(--text); color: var(--bg) !important; padding: 9px 16px !important;
}
.nav-cta:hover{ background: var(--text) !important; opacity:.85; }
.menu-btn{ display:none; background:none; border:none; padding:8px; cursor:pointer; }
.menu-btn span, .menu-btn::before, .menu-btn::after{ content:''; display:block; width:20px; height:2px; background:var(--text); margin:4px 0; border-radius:2px; }

/* ---------- layout shell ---------- */
.wrap{ max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- hero ---------- */
.hero{
  position: relative; padding: 96px 24px 64px; overflow:hidden;
  text-align:center;
}
.blob{ position:absolute; border-radius:50%; filter: blur(60px); opacity:.35; z-index:0; }
.blob.b1{ width:340px; height:340px; background:var(--purple); top:-120px; left:-80px; }
.blob.b2{ width:380px; height:380px; background:var(--teal); bottom:-160px; right:-100px; }
.blob.b3{ width:260px; height:260px; background:var(--orange); top:40%; left:50%; transform:translate(-50%,-50%); opacity:.15; }

.eyebrow{
  position:relative; z-index:1;
  display:inline-flex; align-items:center; gap:8px;
  background: var(--surface); border:1px solid var(--border); box-shadow: var(--shadow);
  padding: 7px 16px 7px 8px; border-radius:999px; font-size:.8rem; font-weight:700;
  margin-bottom: 28px; color: var(--text-dim);
}
.eyebrow .dot{ width:8px; height:8px; border-radius:50%; background: var(--wheel); flex:none; }
.eyebrow-text{ min-width:0; }

.wheel-mark{
  position:relative; z-index:1; width:128px; height:128px; margin: 0 auto 32px;
  border-radius: 32px; box-shadow: var(--shadow-hover);
  animation: spin 28s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.wheel-mark img{ width:100%; height:100%; border-radius:32px; }

h1.hero-title{
  position:relative; z-index:1;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight:900; letter-spacing:-.03em;
  margin: 0 auto 20px; max-width: 780px; line-height:1.08;
}
h1.hero-title .rainbow{
  background: var(--wheel); -webkit-background-clip:text; background-clip:text; color:transparent;
}
.hero-sub{
  position:relative; z-index:1;
  font-size: 1.15rem; color: var(--text-dim); max-width: 620px; margin: 0 auto 36px;
}
.hero-actions{ position:relative; z-index:1; display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }

.btn{
  display:inline-flex; align-items:center; gap:8px; text-decoration:none;
  font-weight:700; font-size:.92rem; padding: 13px 22px; border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  border: 1px solid transparent;
}
.btn:active{ transform: scale(.97); }
.btn-primary{ background: var(--text); color: var(--bg); box-shadow: var(--shadow); }
.btn-primary:hover{ box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.btn-ghost{ background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover{ border-color: var(--text-dim); transform: translateY(-2px); }

.meta-row{
  position:relative; z-index:1;
  display:flex; gap:22px; justify-content:center; flex-wrap:wrap;
  margin-top: 44px; font-size:.82rem; color: var(--text-dim); font-weight:600;
}
.meta-row span{ display:inline-flex; align-items:center; gap:7px; }
.meta-row svg{ width:15px; height:15px; }

/* ---------- content shell with side TOC ---------- */
.content-shell{
  max-width: var(--maxw); margin: 0 auto; padding: 20px 24px 40px;
  display:grid; grid-template-columns: 200px minmax(0,1fr); gap: 48px;
}
.toc{ position: sticky; top: 90px; align-self:start; }
.toc-label{ font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--text-dim); font-weight:700; margin-bottom:10px; }
.toc ol{ list-style:none; margin:0; padding:0; border-left: 2px solid var(--border); }
.toc li{ margin:0; }
.toc a{
  display:block; text-decoration:none; font-size:.84rem; font-weight:600; color: var(--text-dim);
  padding: 7px 0 7px 16px; margin-left:-2px; border-left: 2px solid transparent; transition: all .15s ease;
}
.toc a:hover{ color: var(--text); }
.toc a.active{ color: var(--text); border-left-color: currentColor; }
@media (max-width: 900px){ .toc{ display:none; } .content-shell{ grid-template-columns: 1fr; } }

main{ min-width:0; }

/* ---------- section cards ---------- */
section.card{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 36px 40px; margin-bottom: 20px; box-shadow: var(--shadow);
  scroll-margin-top: 90px;
  opacity: 0; transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
section.card.in-view{ opacity:1; transform: translateY(0); }

.card-head{ display:flex; align-items:center; gap:14px; margin-bottom: 16px; }
.icon-chip{
  width:44px; height:44px; border-radius: 14px; flex:none;
  display:flex; align-items:center; justify-content:center;
  color:#fff; box-shadow: var(--shadow);
}
.icon-chip svg{ width:22px; height:22px; }
section.card h2{ font-size:1.35rem; font-weight:800; letter-spacing:-.01em; margin:0; }
section.card p{ color: var(--text-dim); font-size:.98rem; margin: 0 0 14px; }
section.card p:last-child{ margin-bottom:0; }
section.card strong{ color: var(--text); }

.tag-updated{
  display:inline-block; font-size:.72rem; font-weight:700; color: var(--text-dim);
  background: var(--bg-soft); border-radius:999px; padding:4px 10px; margin-bottom:14px;
}

/* ---------- data grid ---------- */
.data-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap:10px; margin-top: 6px; }
.data-pill{
  display:flex; align-items:center; gap:10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border:1px solid var(--border); font-size:.85rem; font-weight:600;
}
.data-pill .check{
  width:20px; height:20px; border-radius:50%; background: var(--green); color:#fff; flex:none;
  display:flex; align-items:center; justify-content:center;
}
.data-pill .check svg{ width:12px; height:12px; }
.data-pill .label{ color:var(--text); }
.data-pill .status{ margin-left:auto; color: var(--green); font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }

/* ---------- permission cards ---------- */
.perm{
  border:1px solid var(--border); border-radius: var(--radius-md); padding: 20px;
  background: var(--bg-soft); margin-bottom: 14px;
}
.perm:last-child{ margin-bottom:0; }
.perm-title{ display:flex; align-items:center; gap:10px; font-weight:800; margin-bottom:8px; font-size:.98rem; }
.perm-title .swatch{ width:10px; height:10px; border-radius:3px; flex:none; }
.perm p{ margin:0; font-size:.9rem; }

/* ---------- how it works steps ---------- */
.steps{ counter-reset: step; display:grid; gap:14px; margin-top:10px; }
.step{ display:flex; gap:16px; }
.step::before{
  counter-increment: step; content: counter(step);
  width:30px; height:30px; border-radius:50%; flex:none;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:.85rem; color:#fff; background: var(--wheel);
}
.step p{ margin:0; }

/* ---------- footer ---------- */
footer{ padding: 60px 24px 40px; text-align:center; border-top: 1px solid var(--border); margin-top:20px; }
footer .brand{ justify-content:center; margin-bottom:14px; }
footer p{ color: var(--text-dim); font-size:.85rem; margin: 0 0 18px; }
footer .foot-links{ display:flex; gap:18px; justify-content:center; flex-wrap:wrap; font-size:.85rem; font-weight:600; margin-bottom:22px; }
footer .foot-links a{ text-decoration:none; color: var(--text-dim); }
footer .foot-links a:hover{ color: var(--text); }
.copyright{ font-size:.75rem; color: var(--text-dim); opacity:.8; }

/* ---------- back to top ---------- */
#toTop{
  position: fixed; right: 22px; bottom: 22px; width:44px; height:44px; border-radius:50%;
  background: var(--surface); border:1px solid var(--border); box-shadow: var(--shadow-hover);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  opacity:0; pointer-events:none; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease; z-index: 500;
}
#toTop.show{ opacity:1; pointer-events:auto; transform:translateY(0); }
#toTop svg{ width:18px; height:18px; }

/* ---------- mobile nav ---------- */
@media (max-width: 720px){
  nav.links{
    position: fixed; inset: 60px 12px auto 12px; background: var(--surface); border:1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-hover); flex-direction:column; align-items:stretch;
    padding: 10px; gap:2px; display:none;
  }
  nav.links.open{ display:flex; }
  nav.links a{ text-align:center; }
  .menu-btn{ display:block; }
  .hero{ padding: 64px 20px 48px; }
  section.card{ padding: 26px 22px; }
}
