/* ========== Base ========== */
:root {
  --bg: #0b0f17;
  --bg2: #0f1624;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);
  --faint: rgba(255, 255, 255, 0.55);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 18px;

  --accent: #7c5cff;
  --accent2: #00d4ff;
  --good: #41f1b6;

  --container: 1120px;
  --pad: 18px;

  color-scheme: dark;
}

:root[data-theme="light"]{
  --bg: #ffffff;
  --bg2: #f6f8fc;
  --card: rgba(0, 0, 0, 0.04);
  --card2: rgba(0, 0, 0, 0.06);
  --border: rgba(0, 0, 0, 0.12);
  --text: rgba(10, 15, 25, 0.92);
  --muted: rgba(10, 15, 25, 0.72);
  --faint: rgba(10, 15, 25, 0.55);
  --shadow: 0 10px 30px rgba(0,0,0,0.10);

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(124,92,255,0.18), transparent 60%),
              radial-gradient(900px 600px at 90% 20%, rgba(0,212,255,0.12), transparent 55%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  color: var(--text);
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{
  width: min(var(--container), calc(100% - 2*var(--pad)));
  margin: 0 auto;
}

.sr-only{
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link{
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 9999;
  transition: top 180ms ease;
}
.skip-link:focus{ top: 12px; }

/* ========== Header ========== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 22, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, background 160ms ease;
}
:root[data-theme="light"] .site-header{
  background: rgba(255,255,255,0.70);
}
.site-header.is-elevated{
  border-color: var(--border);
  background: rgba(10,14,22,0.72);
}
:root[data-theme="light"] .site-header.is-elevated{
  background: rgba(255,255,255,0.85);
}

.header-inner{
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, rgba(124,92,255,0.9), rgba(0,212,255,0.9));
  color: #071018;
  box-shadow: var(--shadow);
}
.brand-text{ display: grid; }
.brand-name{ font-weight: 700; }
.brand-tag{ font-size: 12px; color: var(--muted); margin-top: 1px; }

.nav{
  position: relative;
}
.nav-menu{
  display: flex;
  gap: 14px;
  align-items: center;
}
.nav-link{
  font-size: 14px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.nav-link:hover{
  text-decoration: none;
  color: var(--text);
  border-color: var(--border);
  background: var(--card);
}
.nav-link.is-active{
  color: var(--text);
  border-color: rgba(124,92,255,0.35);
  background: linear-gradient(180deg, rgba(124,92,255,0.18), rgba(0,212,255,0.10));
}

.header-actions{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

/* Mobile nav */
.nav-toggle{
  display: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
}
.nav-toggle-lines{
  display: block;
  width: 18px;
  height: 12px;
  position: relative;
}
.nav-toggle-lines::before,
.nav-toggle-lines::after{
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.nav-toggle-lines::before{ top: 1px; }
.nav-toggle-lines::after{ bottom: 1px; }

/* ========== Sections ========== */
.section{
  padding: 70px 0;
}
.section.alt{
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.03) 50%, transparent 100%);
}
:root[data-theme="light"] .section.alt{
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.03) 50%, transparent 100%);
}

.section-head{
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}
.section-head h2{
  margin: 0;
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.02em;
}
.section-head p{
  margin: 0;
  color: var(--muted);
  max-width: 80ch;
}

/* ========== Hero ========== */
.hero{
  position: relative;
  padding: 84px 0 40px;
  overflow: hidden;
}
.hero-grid{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: start;
}
.eyebrow{
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.hero h1{
  margin: 0 0 10px;
  font-size: clamp(34px, 4.0vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.gradient{
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede{
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
  max-width: 70ch;
}

.hero-ctas{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-badges{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-bg{
  position: absolute;
  inset: -200px -200px auto -200px;
  height: 600px;
  background:
    radial-gradient(400px 400px at 20% 30%, rgba(124,92,255,0.26), transparent 60%),
    radial-gradient(380px 380px at 70% 20%, rgba(0,212,255,0.18), transparent 60%);
  filter: blur(30px);
  opacity: 0.75;
  pointer-events: none;
}

/* ========== Components ========== */
.card{
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.badge{
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  padding: 7px 10px;
  border-radius: 999px;
}

.primary-btn, .secondary-btn, .ghost-btn, .mini-btn{
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
}

.primary-btn{
  background: linear-gradient(135deg, rgba(124,92,255,0.95), rgba(0,212,255,0.95));
  color: #071018;
  box-shadow: 0 10px 24px rgba(124,92,255,0.22);
}
.primary-btn:hover{ filter: brightness(1.03); text-decoration: none; }

.secondary-btn{
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
.secondary-btn:hover{ background: rgba(255,255,255,0.08); text-decoration: none; }

.ghost-btn{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.ghost-btn:hover{ background: var(--card); }

.mini-btn{
  padding: 8px 10px;
  font-size: 12px;
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
.mini-btn:hover{ background: rgba(255,255,255,0.08); }

.block{ width: 100%; }

.link-btn{
  background: transparent;
  border: none;
  padding: 0;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.link-btn:hover{ color: var(--text); text-decoration: underline; }

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

.feature h3{
  margin: 0 0 10px;
}
.feature p{
  margin: 0 0 12px;
  color: var(--muted);
}

.checklist, .bullets{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.checklist li{ margin: 8px 0; }
.checklist li::marker{ color: var(--good); }

.bullets li{ margin: 8px 0; }

.muted{ color: var(--muted); }
.small{ font-size: 12px; color: var(--muted); }

/* Hero card */
.hero-card .card-top{ margin-bottom: 14px; }
.card-title{ margin: 0; font-size: 18px; }
.card-sub{ margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.stat-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
.stat{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 10px;
}
.stat-k{ font-size: 12px; color: var(--muted); }
.stat-v{ font-weight: 700; margin-top: 2px; }
.stat-d{ font-size: 12px; color: var(--faint); margin-top: 2px; }

.callout{
  border: 1px solid rgba(124,92,255,0.25);
  background: linear-gradient(180deg, rgba(124,92,255,0.12), rgba(0,212,255,0.06));
  border-radius: 14px;
  padding: 12px;
}
.callout-title{ font-weight: 700; }
.callout-body{ color: var(--muted); margin-top: 4px; }

.card-actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}
.copy-toast{
  color: var(--muted);
  font-size: 12px;
}

/* Architecture layout */
.arch{
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
}
.arch-col{
  display: grid;
  gap: 16px;
}
.arch-diagram{
  display: grid;
  gap: 16px;
}
.diagram{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 8px;
}
.node{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 12px;
  font-weight: 700;
}
.arrow{
  height: 10px;
  position: relative;
}
.arrow::before{
  content: "";
  position: absolute;
  left: 12px; right: 12px; top: 4px;
  height: 2px;
  background: linear-gradient(90deg, rgba(124,92,255,0.6), rgba(0,212,255,0.6));
  border-radius: 2px;
}
.arrow::after{
  content: "";
  position: absolute;
  right: 12px; top: 0px;
  width: 0; height: 0;
  border-left: 10px solid rgba(0,212,255,0.6);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.codebox{
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  border-radius: 16px;
  overflow: hidden;
}
:root[data-theme="light"] .codebox{
  background: rgba(0,0,0,0.04);
}
.codebox-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
pre{
  margin: 0;
  padding: 12px;
  overflow: auto;
}
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: var(--text);
}

/* Token roles */
.role{
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.role:last-child{ border-bottom: none; }
.role-title{ font-weight: 700; }
.role-body{ color: var(--muted); margin-top: 4px; }

.notice{
  margin-top: 16px;
  border-color: rgba(0,212,255,0.25);
  background: linear-gradient(180deg, rgba(0,212,255,0.10), rgba(124,92,255,0.06));
}
.notice-title{ font-weight: 800; }
.notice-body{ color: var(--muted); margin-top: 6px; }

/* Timeline */
.timeline{
  padding: 8px 18px;
  margin-bottom: 16px;
}
.timeline-row{
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-row:last-child{ border-bottom: none; }
.t-dot{
  width: 12px;
  height: 12px;
  border-radius: 99px;
  margin-top: 6px;
  background: linear-gradient(135deg, rgba(124,92,255,0.9), rgba(0,212,255,0.9));
}
.t-content h3{ margin: 0 0 6px; }
.t-content p{ margin: 0; color: var(--muted); }

/* Newsletter */
.newsletter{
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  align-items: center;
}
.newsletter-form{
  display: grid;
  gap: 10px;
}
.newsletter-form input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
}
.newsletter-form input:focus{
  border-color: rgba(124,92,255,0.5);
  box-shadow: 0 0 0 4px rgba(124,92,255,0.12);
}
.form-note{ margin: 0; font-size: 12px; color: var(--muted); }

/* FAQ */
.faq{
  display: grid;
  gap: 12px;
}
details summary{
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
details summary::-webkit-details-marker{ display: none; }
details summary::after{
  content: "+";
  float: right;
  color: var(--muted);
}
details[open] summary::after{ content: "–"; }
.faq-body{
  margin-top: 10px;
  color: var(--muted);
}

/* Footer */
.footer{
  padding: 34px 0;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.10);
}
:root[data-theme="light"] .footer{
  background: rgba(0,0,0,0.02);
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.2fr 0.6fr 1fr;
  gap: 16px;
  align-items: center;
}
.footer-brand{ font-weight: 800; margin-bottom: 6px; }
.footer-links{
  display: grid;
  gap: 8px;
  justify-items: start;
}
.footer-meta{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.dot{ color: var(--muted); }

/* ========== Responsive ========== */
@media (max-width: 980px){
  .header-inner{
    grid-template-columns: 1fr auto auto;
  }
  .hero-grid{
    grid-template-columns: 1fr;
  }
  .arch{
    grid-template-columns: 1fr;
  }
  .grid-3{
    grid-template-columns: 1fr;
  }
  .grid-2{
    grid-template-columns: 1fr;
  }
  .newsletter{
    grid-template-columns: 1fr;
  }
  .footer-grid{
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .footer-meta{
    justify-content: flex-start;
  }

  .nav-toggle{ display: inline-flex; }
  .nav-menu{
    position: absolute;
    right: 0;
    top: 52px;
    min-width: 260px;
    display: grid;
    gap: 6px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(10,14,22,0.92);
    box-shadow: var(--shadow);
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
  }
  :root[data-theme="light"] .nav-menu{
    background: rgba(255,255,255,0.95);
  }
  .nav-menu.is-open{
    opacity: 1;
    transform: translateY(0px);
    pointer-events: auto;
  }
  .nav-link{
    padding: 10px 12px;
  }
}
