:root {
  --bg: #ffffff;
  --bg-alt: #f6f5fc;          /* faint violet-tinted gray */
  --surface: #ffffff;
  --border: #e6e3f3;
  --text: #0f0a24;            /* near-black with violet undertone */
  --text-muted: #5b5677;
  --accent: #7c3aed;          /* violet 600 — readable on white */
  --accent-strong: #6d28d9;   /* violet 700 */
  --accent-2: #0891b2;        /* cyan 600 */
  --accent-3: #db2777;        /* pink 600 */
  --accent-soft: rgba(124, 58, 237, 0.10);
  --gradient: linear-gradient(135deg, #7c3aed 0%, #0891b2 100%);
  --gradient-warm: linear-gradient(135deg, #db2777 0%, #7c3aed 55%, #0891b2 100%);
  --glow: 0 6px 24px rgba(124, 58, 237, 0.18);
  --shadow-sm: 0 1px 2px rgba(15, 10, 36, 0.04), 0 1px 3px rgba(15, 10, 36, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 10, 36, 0.05), 0 10px 30px rgba(124, 58, 237, 0.08);
  --shadow-lg: 0 18px 48px rgba(124, 58, 237, 0.16), 0 6px 16px rgba(15, 10, 36, 0.06);
  --radius: 10px;
  --radius-lg: 16px;
  --max-width: 1100px;
  --header-h: 64px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --header-bg: rgba(255, 255, 255, 0.82);
  --header-bg-scrolled: rgba(255, 255, 255, 0.92);
  --grid-line: rgba(15, 10, 36, 0.05);
  --ok: #047857;
  --ok-bg: rgba(4, 120, 87, 0.10);
  --ok-border: rgba(4, 120, 87, 0.20);
  --code-bg: #faf9ff;
  --code-text: #1f1a3a;
  --tag-talk: #c2410c;
  --tag-talk-bg: rgba(194, 65, 12, 0.10);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

/* Dark theme — applied via data-theme set before first paint (inline script
   in <head>), defaulting to the OS preference and persisted in localStorage. */
:root[data-theme="dark"] {
  --bg: #0d0a1c;
  --bg-alt: #120e26;          /* faint violet-tinted near-black */
  --surface: #171231;
  --border: #2a2344;
  --text: #ece9fa;
  --text-muted: #a7a0c8;
  --accent: #a78bfa;          /* violet 400 — readable on dark */
  --accent-strong: #c4b5fd;   /* violet 300 */
  --accent-2: #22d3ee;        /* cyan 400 */
  --accent-3: #f472b6;        /* pink 400 */
  --accent-soft: rgba(167, 139, 250, 0.14);
  --gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --gradient-warm: linear-gradient(135deg, #ec4899 0%, #8b5cf6 55%, #06b6d4 100%);
  --glow: 0 6px 24px rgba(139, 92, 246, 0.30);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 1px 3px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.32), 0 10px 30px rgba(139, 92, 246, 0.12);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45), 0 6px 16px rgba(139, 92, 246, 0.14);
  --header-bg: rgba(13, 10, 28, 0.80);
  --header-bg-scrolled: rgba(13, 10, 28, 0.92);
  --grid-line: rgba(236, 233, 250, 0.05);
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.12);
  --ok-border: rgba(52, 211, 153, 0.25);
  --code-bg: #14102a;
  --code-text: #d8d3f0;
  --tag-talk: #fb923c;
  --tag-talk-bg: rgba(251, 146, 60, 0.12);
  color-scheme: dark;
}

/* The logo and role icons are deep-violet (#4b0db8) SVGs — brighten them so
   they stay legible on dark backgrounds. */
:root[data-theme="dark"] .brand-logo,
:root[data-theme="dark"] .footer-logo {
  filter: brightness(2.05) saturate(0.85) drop-shadow(0 0 8px rgba(167, 139, 250, 0.35));
}
:root[data-theme="dark"] .card-icon img {
  filter: brightness(2.7) saturate(0.75);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(124, 58, 237, 0.05), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(8, 145, 178, 0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Accessible focus rings — branded */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.nav-cta:focus-visible,
.btn:focus-visible {
  outline-offset: 3px;
}

h1, h2, h3, .section h2, .hero h1 {
  font-family: var(--font-display);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection {
  background: rgba(124, 58, 237, 0.22);
  color: inherit;
}
:root[data-theme="dark"] ::selection {
  background: rgba(167, 139, 250, 0.30);
}

h1, h2, h3, h4 { text-wrap: balance; }

/* Scroll-reveal — elements rise + fade as they enter the viewport.
   Initial hidden state is gated behind .js (set in <head> before paint) so
   no-JS users always see content, and there's no flash-of-hidden-content.
   JS reveals each element by setting inline opacity/transform (which win on
   specificity), using the transition declared here. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
  will-change: opacity, transform;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.site-header.scrolled {
  background: var(--header-bg-scrolled);
  box-shadow: 0 6px 24px rgba(15, 10, 36, 0.06);
  border-bottom-color: transparent;
}

.nav-bar {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: auto;          /* push nav + CTA to the right */
  font-weight: 700;
  text-decoration: none;
  font-size: 1.05rem;
}
.brand-name {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: 260px;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.35));
}

.primary-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.primary-nav a {
  position: relative;
  display: inline-block;
  padding: 0.55rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  text-decoration: none;
  transition: color 150ms ease;
}
.primary-nav a:hover { color: var(--text); }
.primary-nav a.active { color: var(--text); font-weight: 600; }

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.35rem;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: center;
  transition: opacity 180ms ease, transform 180ms ease;
}
.primary-nav a:hover::after,
.primary-nav a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: var(--gradient);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.22);
  transition: filter 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.nav-cta:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.34);
  transform: translateY(-1px);
  text-decoration: none;
}
.nav-cta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
}
/* Light shows the moon (switch to dark); dark shows the sun. */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
/* Without JS the toggle can't work (data-theme is set by script) — hide it. */
html:not([data-theme]) .theme-toggle { display: none; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.nav-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 4px auto;
  border-radius: 1px;
  transition: transform 180ms ease, opacity 180ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hero */
.hero {
  padding: 6rem 0 4.5rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(700px 360px at 0% 20%, rgba(8, 145, 178, 0.14), transparent 60%),
    radial-gradient(600px 300px at 50% 100%, rgba(219, 39, 119, 0.10), transparent 60%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(closest-side at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  align-items: center;
  gap: 3rem;
}
.hero-copy { max-width: 640px; }

/* Hero load-in — staggered rise + fade on first paint */
.hero-copy > *,
.hero-visual {
  animation: hero-in 760ms var(--ease) both;
}
.hero-copy .eyebrow   { animation-delay: 60ms; }
.hero-copy h1         { animation-delay: 140ms; }
.hero-copy .lede      { animation-delay: 240ms; }
.hero-copy .cta-row   { animation-delay: 340ms; }
.hero-visual          { animation-delay: 420ms; }
@keyframes hero-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-visual { animation: none; }
}

/* Floating proof-card mockup */
.hero-visual {
  position: relative;
  perspective: 1200px;
}
.proof-card {
  position: relative;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(8, 145, 178, 0.45)) border-box;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 1.2rem 1.35rem;
  box-shadow:
    0 24px 60px rgba(124, 58, 237, 0.18),
    0 6px 18px rgba(15, 10, 36, 0.06);
  transform: rotate(-1.5deg);
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
  animation: card-float 7s ease-in-out infinite;
}
@keyframes card-float {
  0%, 100% { transform: rotate(-1.5deg) translateY(0); }
  50%      { transform: rotate(-1.5deg) translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .proof-card { animation: none; }
}
.proof-card::before {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: -1;
  border-radius: 28px;
  background: radial-gradient(closest-side, rgba(124, 58, 237, 0.22), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.proof-card:hover { animation-play-state: paused; transform: rotate(0deg) translateY(-3px); }

.proof-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}
.proof-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.proof-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ok);
  padding: 0.22rem 0.55rem;
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: 999px;
}
.proof-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.proof-fields dt {
  color: var(--text-muted);
  font-weight: 500;
}
.proof-fields dd {
  margin: 0;
  color: var(--text);
  text-align: right;
}
.proof-foot {
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.proof-block { color: var(--accent); font-weight: 600; }

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-visual { max-width: 380px; }
  .proof-card { transform: rotate(-1deg); }
}
@media (max-width: 540px) {
  .hero-visual { display: none; }       /* keep mobile hero focused on copy */
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-2);
  margin: 0 0 0.75rem;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 1.1rem;
  letter-spacing: -0.025em;
  font-weight: 700;
  position: relative;
}
.accent {
  background: var(--gradient-warm);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: accent-shift 9s ease-in-out infinite;
}
@keyframes accent-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .accent { animation: none; }
}
.lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  max-width: 60ch;
  text-align: justify;
  hyphens: auto;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 80ms ease, background 120ms ease, border-color 120ms ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--gradient);
  color: #ffffff;
  box-shadow: var(--glow);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 10px 28px rgba(124, 58, 237, 0.32); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow); }

/* Sections */
.section { padding: 5rem 0; border-top: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }
.section h2 {
  position: relative;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  margin: 0 0 0.6rem;
  letter-spacing: -0.015em;
  font-weight: 700;
  line-height: 1.2;
}
.section h2::before {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  border-radius: 3px;
  background: var(--gradient);
  margin: 0 0 0.85rem;
}
.section-lede {
  color: var(--text-muted);
  margin: 0 0 2rem;
}

/* Justify reading text across the site, including card copy */
.section-lede,
.about-body p,
.arch-detail > p,
.arch-more,
.card p,
.pdf-body p,
.news-list p,
.footer-brand p {
  text-align: justify;
  hyphens: auto;
}

/* About — boxed panels */
.about-stack {
  display: grid;
  gap: 1rem;
}
.about-panel {
  display: block;                  /* tag on top, paragraph below — full panel width */
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
}
.about-panel.about-isnt { border-left-color: var(--accent-3); }
.about-panel.about-why  { border-left-color: var(--accent-2); }

.about-tag {
  display: inline-block;
  margin-bottom: 0.8rem;
  padding: 0.3rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.about-panel.about-isnt .about-tag {
  color: var(--accent-3);
  background: rgba(219, 39, 119, 0.10);
}
.about-panel.about-why .about-tag {
  color: var(--accent-2);
  background: rgba(8, 145, 178, 0.10);
}

.about-body p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}
.about-body strong { color: var(--text); font-weight: 600; }
.about-body em { color: var(--text); font-style: italic; }

@media (max-width: 720px) {
  .about-panel { padding: 1.2rem 1.1rem; }
}

/* Architecture detail blocks */
.arch-detail h3 {
  margin: 2.5rem 0 0.5rem;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.arch-detail h4 {
  margin: 1.4rem 0 0.4rem;
  font-size: 1rem;
  color: var(--text);
}
.arch-detail > p,
.arch-detail > ul {
  color: var(--text-muted);
  max-width: 75ch;
}
.arch-detail > ul { padding-left: 1.2rem; }
.arch-detail > ul li { margin-bottom: 0.4rem; }
.arch-detail > ul ul {
  padding-left: 1.1rem;
  margin: 0.3rem 0 0.2rem;
  color: var(--text-muted);
}
.arch-detail strong { color: var(--text); }
.arch-detail code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.arch-vs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.arch-vs-side {
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 4px solid var(--text-muted);
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
}
.arch-vs-blockchain { border-top-color: var(--accent-3); }
.arch-vs-ledgera    { border-top-color: var(--accent); }
.arch-vs-side h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}
.arch-vs-side ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.arch-vs-side ul li { margin-bottom: 0.35rem; }

.arch-steps {
  margin: 0.4rem 0 1rem;
  padding-left: 1.3rem;
  color: var(--text-muted);
}
.arch-steps li { margin-bottom: 0.35rem; }

.arch-diagram {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
  overflow-x: auto;
}
.arch-diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 800px;
  margin: 0 auto;
}
.arch-diagram figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.arch-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.92rem;
}
.arch-table th,
.arch-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  color: var(--text-muted);
}
.arch-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  font-weight: 600;
  background: var(--bg-alt);
}
.arch-table tr:last-child td { border-bottom: none; }
.arch-table td:first-child { color: var(--text); font-weight: 600; }

@media (max-width: 720px) {
  .arch-vs { grid-template-columns: 1fr; }
  .arch-table { font-size: 0.85rem; }
  .arch-table th, .arch-table td { padding: 0.5rem 0.55rem; }
}

/* Decentralized application detail blocks */
.dapp-detail { margin-top: 2.5rem; }
.dapp-intro {
  color: var(--text-muted);
  max-width: 75ch;
  margin: 0 0 1.5rem;
}
.dapp-block {
  margin-bottom: 1.25rem;
  padding: 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
}
.dapp-block.dapp-mpc { border-left-color: var(--accent-2); }
.dapp-block.dapp-at  { border-left-color: var(--accent-3); }

.dapp-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.dapp-header h3 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.dapp-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.dapp-mpc .dapp-tag { color: var(--accent-2); background: rgba(8, 145, 178, 0.10); }
.dapp-at  .dapp-tag { color: var(--accent-3); background: rgba(219, 39, 119, 0.10); }

.dapp-summary {
  color: var(--text-muted);
  margin: 0.25rem 0 1rem;
  max-width: 75ch;
}

.dapp-section {
  margin: 0.9rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}
.dapp-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.dapp-mpc .dapp-section h4 { color: var(--accent-2); }
.dapp-at  .dapp-section h4 { color: var(--accent-3); }

.dapp-section > p,
.dapp-flow,
.dapp-why {
  color: var(--text-muted);
  max-width: 75ch;
  margin: 0;
}
.dapp-flow { padding-left: 1.3rem; }
.dapp-flow li { margin-bottom: 0.4rem; }
.dapp-why  { padding-left: 1.2rem; }
.dapp-why  li { margin-bottom: 0.4rem; }
.dapp-section strong { color: var(--text); }
.dapp-section em { color: var(--text); font-style: italic; }
.dapp-section code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

@media (max-width: 720px) {
  .dapp-block { padding: 1.2rem 1.1rem; }
  .dapp-header h3 { font-size: 1.15rem; }
}

/* Getting Started — tutorial */
#getting-started h3 {
  margin: 2.2rem 0 0.4rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
#getting-started > .container > p {
  color: var(--text-muted);
  max-width: 75ch;
}

.tutorial-prereq,
.tutorial-recap {
  margin: 1.5rem 0;
  padding: 1.1rem 1.3rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius);
}
.tutorial-recap { border-left-color: var(--accent); }
.tutorial-prereq h3,
.tutorial-recap h3 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-2);
}
.tutorial-recap h3 { color: var(--accent); }
.tutorial-prereq ul,
.tutorial-recap  ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}
.tutorial-prereq ul li,
.tutorial-recap  ul li { margin-bottom: 0.35rem; }
.tutorial-recap p {
  margin: 0.8rem 0 0;
  color: var(--text-muted);
}

.tutorial {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.25rem;
  display: grid;
  gap: 1rem;
}
.tutorial-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
}
.tutorial-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.20);
}
.tutorial-body h4 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  color: var(--text);
}
.tutorial-body p {
  margin: 0 0 0.6rem;
  color: var(--text-muted);
  max-width: 70ch;
}
.tutorial-body p:last-child { margin-bottom: 0; }
.tutorial-body pre.codeblock {
  margin: 0.4rem 0 0.4rem;
}
.tutorial-body pre.codeblock + p { margin-top: 0.6rem; }
.tutorial-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}
.tutorial-body pre.codeblock code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

@media (max-width: 640px) {
  .tutorial-step { grid-template-columns: 1fr; padding: 1rem 1.05rem; }
  .tutorial-num { margin-top: 0; }
}

/* Grid + cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.grid-team { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-3     { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 780px) {
  .grid-3   { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .grid-3   { grid-template-columns: 1fr; }
}
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  margin-bottom: 0.85rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(124, 58, 237, 0.18);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1),
              background 220ms ease,
              color 220ms ease;
}
.card-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-icon img {
  height: 30px;
  width: auto;
  max-width: 28px;
  object-fit: contain;
}
.card:hover .card-icon {
  transform: scale(1.06);
  background: var(--gradient);
  color: #ffffff;
  border-color: transparent;
}

.card {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(8, 145, 178, 0.35)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 240ms ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
}
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* Lists */
.release-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.07), rgba(8, 145, 178, 0.06)),
    var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.release-banner::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient);
}
.release-banner-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--gradient);
  box-shadow: var(--glow);
}
.release-banner-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.release-banner-text {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.release-banner-text time {
  white-space: nowrap;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.link-list, .release-list, .news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
.link-list li { color: var(--text-muted); }
.release-list li {
  display: grid;
  grid-template-columns: 4.5rem 7rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
}
.release-tag {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}
.release-tag-future { color: var(--text-muted); }
.release-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.release-desc { color: var(--text-muted); }

@media (max-width: 640px) {
  .release-list li {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "tag  date"
      "desc desc";
    gap: 0.3rem 0.8rem;
  }
  .release-tag  { grid-area: tag; }
  .release-date { grid-area: date; justify-self: start; }
  .release-desc { grid-area: desc; }
}

.news-list li {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
}
.news-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.4rem;
  flex-wrap: wrap;
}
.news-date {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0;
  font-weight: 600;
}
.news-tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.news-tag-demo  { color: var(--accent-2); background: rgba(8, 145, 178, 0.10); }
.news-tag-event { color: var(--accent-3); background: rgba(219, 39, 119, 0.10); }
.news-tag-talk  { color: var(--tag-talk);  background: var(--tag-talk-bg); }
/* news-tag-paper inherits the default violet */

.news-list h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.news-list p { margin: 0; color: var(--text-muted); }
.news-list p a { color: var(--accent); }

/* PDF resource cards */
.pdf-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.pdf-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(8, 145, 178, 0.35)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
  transition: transform 120ms ease, box-shadow 160ms ease;
}
.pdf-card:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.pdf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #ffffff;
  background: var(--gradient);
  flex-shrink: 0;
}
.pdf-body h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.pdf-body p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.pdf-meta {
  margin-top: 0.25rem !important;
  font-family: var(--font-mono);
  font-size: 0.8rem !important;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.pdf-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
  white-space: nowrap;
}
.pdf-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}
.pdf-cta-alt {
  background: transparent;
  color: var(--accent-2);
  box-shadow: none;
  border: 1px solid var(--border);
}
.pdf-cta-alt:hover {
  border-color: var(--accent-2);
  background: rgba(124, 58, 237, 0.06);
}
.pdf-icon-cite { background: linear-gradient(135deg, #0891b2 0%, #7c3aed 100%); }
.pdf-card-cite { box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04); }
.pdf-card-cite .pdf-body em { color: var(--text); font-style: italic; }

/* Section sub-headings */
.papers-h {
  margin: 1.75rem 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 600;
}
.papers-h:first-of-type { margin-top: 0.5rem; }

/* Foundations citation list */
.cite-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.cite-list li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 10, 36, 0.04);
}
.cite-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  padding: 0.2rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  margin-top: 0.1rem;
}
.cite-list li > div { min-width: 0; }
.cite-title {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}
.cite-meta {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.cite-meta a { color: var(--accent); }
.cite-note {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .pdf-card {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "icon body"
      "cta  cta";
  }
  .pdf-icon { grid-area: icon; }
  .pdf-body { grid-area: body; }
  .pdf-cta  { grid-area: cta; justify-self: stretch; text-align: center; }
  .pdf-actions { grid-area: cta; }
  .pdf-actions .pdf-cta { flex: 1; }
  .cite-list li {
    grid-template-columns: auto 1fr;
    gap: 0.5rem 0.8rem;
  }
}

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.timeline li {
  display: block;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.t-body { color: var(--text-muted); }
.t-body strong { color: var(--accent); font-weight: 600; }

/* Code */
.codeblock {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--code-text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-alt);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem 2rem;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}
.footer-brand-link { display: inline-block; line-height: 0; }
.footer-logo {
  height: 30px;
  width: auto;
  display: block;
  margin-bottom: 0.85rem;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.25));
}
.footer-brand p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 30ch;
  line-height: 1.55;
}
.footer-col h4 {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.footer-col a {
  color: var(--text-muted);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 150ms ease;
}
.footer-col a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}
.footer-bottom > .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.footer-bottom p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.footer-bottom a { color: var(--accent); text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }
.footer-top {
  font-size: 0.85rem;
  font-weight: 500;
}

@media (max-width: 780px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1.5rem;
  }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 1000px) {
  .nav-toggle { display: inline-block; }
  .primary-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--header-bg-scrolled);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 240ms ease;
  }
  .primary-nav.open {
    max-height: 600px;
    box-shadow: 0 8px 24px rgba(15, 10, 36, 0.06);
  }
  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem 1rem 1rem;
    gap: 0.1rem;
  }
  .primary-nav a {
    display: block;
    padding: 0.7rem 0.85rem;
    border-radius: 6px;
    font-size: 0.95rem;
  }
  .primary-nav a:hover { background: var(--accent-soft); }
  .primary-nav a.active { color: var(--accent); background: var(--accent-soft); }
  .primary-nav a::after { display: none; }

  .nav-cta {
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
  }
  .nav-cta svg { width: 12px; height: 12px; }
}

@media (max-width: 460px) {
  .nav-cta span { display: none; }   /* icon-only CTA on very small screens */
  .nav-cta { padding: 0.45rem 0.55rem; }
  .nav-cta svg { width: 14px; height: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
