:root {
  --color-dark: #13102D;
  --color-paper: #D6D4ED;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  --color-text-on-dark: #D6D4ED;
  --color-muted: rgba(23, 21, 35, 0.55);
  --color-muted-dark: rgba(214, 212, 237, 0.55);

  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid rgba(23, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --nav-height: 64px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", sans-serif;
  --lh-body: 1.75;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

/* Layout Shell */
.site-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) {
  .site-layout { grid-template-columns: 1fr; }
  .sidebar-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-paper);
    border-bottom: var(--card-border);
    padding: 0 24px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar-nav ul { display: flex; gap: 24px; list-style: none; }
  .sidebar-nav .cta-wrap { display: none; }
  .main-scroll { padding-top: var(--nav-height); }
}

/* Sidebar / Header */
.sidebar-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--color-paper);
  border-right: var(--card-border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text);
}
.brand-row img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  background: rgba(39, 20, 235, 0.08);
  color: var(--color-brand);
}
.cta-wrap { margin-top: auto; }

/* Main Area */
.main-scroll { overflow: hidden; }
.section {
  padding: var(--section-y) 0;
  position: relative;
}
.section.bg-dark { background: var(--color-dark); color: var(--color-text-on-dark); }
.section.bg-paper { background: var(--color-paper); color: var(--color-text); }
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 12px;
}
.section.bg-dark .eyebrow { color: var(--color-accent); }
h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}
h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
p { margin-bottom: 16px; max-width: 38em; }
.hl { color: var(--color-brand); }
.section.bg-dark .hl { color: var(--color-accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s, box-shadow 0.2s;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(137, 237, 110, 0.35); }
.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--color-text);
  color: var(--color-text);
}
.section.bg-dark .btn-secondary {
  border-color: var(--color-text-on-dark);
  color: var(--color-text-on-dark);
}
.btn-secondary:hover { background: rgba(23, 21, 35, 0.06); }
.section.bg-dark .btn-secondary:hover { background: rgba(214, 212, 237, 0.1); }
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* Capsules & Cards */
.capsule-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(23, 21, 35, 0.05);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}
.section.bg-dark .capsule { background: rgba(214, 212, 237, 0.1); }
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-bottom: var(--gap);
}
.section.bg-dark .card {
  background: rgba(214, 212, 237, 0.08);
  border-color: rgba(214, 212, 237, 0.15);
  color: var(--color-text-on-dark);
}

/* FAQ / Details */
.faq-list { display: flex; flex-direction: column; gap: 16px; }
details {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  transition: background 0.2s;
}
.section.bg-dark details {
  background: rgba(214, 212, 237, 0.06);
  border-color: rgba(214, 212, 237, 0.12);
  color: var(--color-text-on-dark);
}
summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(39, 20, 235, 0.1);
  color: var(--color-brand);
  font-size: 14px;
  flex-shrink: 0;
}
.section.bg-dark summary::before {
  background: rgba(137, 237, 110, 0.15);
  color: var(--color-accent);
}
details[open] summary::before { content: "−"; }
details p { margin-top: 12px; margin-bottom: 0; font-size: 0.95rem; line-height: 1.7; }

/* Feature Tabs (Pure CSS) */
.feature-tabs input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tab-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tab-label {
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  border: var(--card-border);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tab-panel { display: none; }
input:checked + .tab-label { background: var(--color-brand); color: #fff; border-color: var(--color-brand); }
.section.bg-dark input:checked + .tab-label { background: var(--color-accent); color: var(--color-dark); border-color: var(--color-accent); }
#feat1:checked ~ .tab-panel1,
#feat2:checked ~ .tab-panel2,
#feat3:checked ~ .tab-panel3,
#feat4:checked ~ .tab-panel4 { display: block; }

/* Table */
.table-wrap { overflow-x: auto; margin: 24px 0; border-radius: var(--radius-card); border: var(--card-border); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 16px 20px; text-align: left; border-bottom: var(--card-border); }
th { background: rgba(39, 20, 235, 0.06); font-weight: 700; }
.section.bg-dark th { background: rgba(214, 212, 237, 0.08); }
td:first-child { font-weight: 600; width: 35%; }

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}
.article-card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section.bg-dark .article-card {
  background: rgba(214, 212, 237, 0.06);
  border-color: rgba(214, 212, 237, 0.12);
  color: var(--color-text-on-dark);
}
.article-card time { font-size: 0.8rem; font-weight: 600; opacity: 0.8; }

/* Footer */
.footer {
  background: var(--color-dark);
  color: var(--color-text-on-dark);
  padding: 48px 0;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}
.footer h4 { color: var(--color-accent); margin-bottom: 16px; font-size: 0.95rem; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: var(--color-text-on-dark); text-decoration: none; opacity: 0.85; transition: opacity 0.2s; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(214, 212, 237, 0.15); text-align: center; opacity: 0.7; }

/* SVG Animation Classes */
.svg-grid-node {
  fill: var(--color-brand);
  opacity: 0.25;
  transform-origin: center;
  transform-box: fill-box;
}
.section.bg-dark .svg-grid-node { fill: var(--color-accent); }
.node-1 { animation: grid-pulse 4s ease-in-out infinite alternate; animation-delay: 0.2s; }
.node-2 { animation: grid-pulse 4s ease-in-out infinite alternate; animation-delay: 0.6s; }
.node-3 { animation: grid-pulse 4s ease-in-out infinite alternate; animation-delay: 1.0s; }
.node-4 { animation: grid-pulse 4s ease-in-out infinite alternate; animation-delay: 1.4s; }
.node-5 { animation: grid-pulse 4s ease-in-out infinite alternate; animation-delay: 1.8s; }
.node-6 { animation: grid-pulse 4s ease-in-out infinite alternate; animation-delay: 2.2s; }

@keyframes grid-pulse {
  0% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.4; transform: scale(0.95); }
}

.draw-line {
  stroke: var(--color-brand);
  stroke-width: 2;
  fill: none;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  opacity: 0.6;
}
.section.bg-dark .draw-line { stroke: var(--color-accent); }
.line-anim { animation: dash-draw 6s linear infinite; }
@keyframes dash-draw {
  0% { stroke-dashoffset: 1; opacity: 0.3; }
  20% { stroke-dashoffset: 0; opacity: 0.8; }
  80% { stroke-dashoffset: 0; opacity: 0.8; }
  100% { stroke-dashoffset: 1; opacity: 0.3; }
}

.bubble-float {
  animation: float-bob 5s ease-in-out infinite alternate;
}
@keyframes float-bob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
