/* ============================================
   CBA LLC — Design System
   Theme: "The Ledger" — Dark, premium, fintech
   ============================================ */

/* --- Reset & Variables --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Core palette */
  --bg:       #06080f;
  --bg2:      #0a0d18;
  --surface:  #0f1220;
  --card:     #131729;
  --card2:    #181d35;
  --border:   rgba(255,255,255,0.06);
  --border2:  rgba(255,255,255,0.10);

  /* Accent colors */
  --cyan:     #00d4ff;
  --blue:     #4f6ef7;
  --purple:   #8b5cf6;
  --green:    #00cc88;
  --amber:    #f5a623;
  --red:      #f43f5e;

  /* Gradients */
  --grad-hero:  linear-gradient(135deg, #00d4ff 0%, #4f6ef7 40%, #8b5cf6 100%);
  --grad-card:  linear-gradient(145deg, rgba(79,110,247,0.08), rgba(0,212,255,0.04));
  --grad-glow:  radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(0,212,255,0.06), transparent 60%);

  /* Text */
  --white:    #ffffff;
  --off:      rgba(255,255,255,0.65);
  --dim:      rgba(255,255,255,0.35);
  --muted:    rgba(255,255,255,0.18);

  /* Type */
  --sans:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:     'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --section-pad: clamp(80px, 12vh, 140px);
  --container:   1200px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--off);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Canvas Background --- */
#network-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Utility --- */
.mono { font-family: var(--mono); }
.center { text-align: center; }
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

/* --- Navigation --- */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 clamp(20px, 4vw, 48px);
  transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}
#nav.scrolled {
  background: rgba(6,8,15,0.85);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo-hash {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-dim { color: var(--dim); font-weight: 400; }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.25s;
  letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--white); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--off);
  border-radius: 2px;
  transition: 0.3s;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: rgba(6,8,15,0.95);
  backdrop-filter: blur(20px);
  z-index: 99;
  flex-direction: column;
  padding: 16px 24px 24px;
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 12px 0;
  font-size: 1rem;
  color: var(--off);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: none; }

/* --- Sections --- */
.section {
  position: relative;
  z-index: 1;
  padding: var(--section-pad) 0;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.label-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--cyan);
}
.section-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.section-subtitle {
  font-size: 1.1rem;
  color: var(--off);
  max-width: 640px;
  margin-bottom: 48px;
  line-height: 1.7;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 72px;
}
.hero-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid rgba(0,212,255,0.2);
  background: rgba(0,212,255,0.05);
  margin-bottom: 40px;
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,212,255,0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(0,212,255,0); }
}
.badge-text {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--cyan);
}
.hero-name {
  margin-bottom: 28px;
}
.hero-line {
  display: block;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.hero-line-1 {
  color: var(--white);
}
.hero-line-2 {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--off);
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.7;
}
.hero-tagline em {
  font-style: normal;
  color: var(--white);
  font-weight: 600;
}
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 clamp(16px, 3vw, 40px);
}
.stat-value {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--dim);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border2);
}
.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--grad-hero);
  color: var(--bg);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,212,255,0.25);
}
.btn-ghost {
  background: transparent;
  color: var(--off);
  border: 1px solid var(--border2);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--white);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--dim);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: 1; height: 40px; }
  50% { opacity: 0.3; height: 24px; }
}

/* --- About --- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.about-lead {
  font-size: 1.15rem;
  color: var(--off);
  line-height: 1.75;
  margin-bottom: 20px;
}
.about-lead strong { color: var(--white); font-weight: 600; }
.about-text p { margin-bottom: 20px; line-height: 1.75; }
.about-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--off);
  transition: border-color 0.25s, color 0.25s;
}
.role-chip:hover { border-color: var(--cyan); color: var(--white); }
.role-chip i { color: var(--cyan); font-size: 0.8rem; }

/* Profile photo */
.profile-frame {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 32px;
}
.profile-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0,212,255,0.3);
  filter: grayscale(20%) contrast(1.05);
  transition: filter 0.4s, border-color 0.4s;
}
.profile-frame:hover .profile-img {
  filter: grayscale(0%) contrast(1.1);
  border-color: rgba(0,212,255,0.6);
}
.profile-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(0,212,255,0.15);
  animation: ring-spin 12s linear infinite;
  z-index: 1;
}
.profile-ring::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}
.ring-2 {
  inset: -20px;
  border-color: rgba(79,110,247,0.1);
  animation-duration: 18s;
  animation-direction: reverse;
}
.ring-2::before {
  background: var(--purple);
  box-shadow: 0 0 12px var(--purple);
  width: 4px;
  height: 4px;
}
@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.profile-glow {
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.08) 0%, transparent 70%);
  z-index: 0;
  animation: glow-pulse 4s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.08); }
}
.profile-tag {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid rgba(0,212,255,0.2);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Terminal card */
.terminal-window {
  border-radius: 16px;
  border: 1px solid var(--border2);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.terminal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.terminal-dots { display: flex; gap: 7px; }
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-title {
  font-size: 0.75rem;
  color: var(--dim);
}
.terminal-body {
  padding: 20px;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--off);
  overflow-x: auto;
}
.terminal-body pre {
  font-family: var(--mono);
  white-space: pre;
}
.json-key { color: var(--cyan); }
.json-str { color: var(--green); }
.json-num { color: var(--amber); }

/* --- Pillars --- */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.pillar-card {
  position: relative;
  padding: 36px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--grad-card);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-hero);
  opacity: 0;
  transition: opacity 0.3s;
}
.pillar-card:hover {
  border-color: rgba(0,212,255,0.2);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.pillar-card:hover::before { opacity: 1; }

.pillar-icon {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 1.25rem;
  color: var(--cyan);
}
.pillar-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 1px solid rgba(0,212,255,0.2);
  background: rgba(0,212,255,0.06);
}
.pillar-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}
.pillar-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--off);
  margin-bottom: 20px;
}
.pillar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pillar-tags span {
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.12);
  font-size: 0.7rem;
  color: var(--cyan);
  letter-spacing: 0.03em;
}

/* --- Patents --- */
.patents-showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 64px;
}
.patent-card {
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.3s, transform 0.3s;
}
.patent-card:hover {
  border-color: rgba(139,92,246,0.3);
  transform: translateY(-3px);
}
.patent-number {
  font-size: 0.75rem;
  color: var(--purple);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.patent-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 16px;
}
.patent-meta {
  display: flex;
  gap: 16px;
  font-size: 0.7rem;
  color: var(--dim);
}
.patent-meta i { margin-right: 4px; }

/* Patent domains */
.patents-domains {
  padding: 40px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.patents-domains h3 {
  font-size: 0.8rem;
  color: var(--dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.domain-bars { display: flex; flex-direction: column; gap: 20px; }
.domain-bar {
  display: grid;
  grid-template-columns: 180px 1fr 48px;
  align-items: center;
  gap: 16px;
}
.domain-name {
  font-size: 0.9rem;
  color: var(--off);
  font-weight: 500;
}
.bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--card);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--grad-hero);
  transition: width 1s ease-out;
}
.domain-count {
  font-size: 0.8rem;
  color: var(--cyan);
  font-weight: 600;
  text-align: right;
}

/* --- Ventures --- */
.ventures-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 32px;
}
.venture-card {
  padding: 36px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.3s;
}
.venture-card:hover { border-color: var(--border2); }
.venture-featured {
  background: var(--grad-card);
  border-color: rgba(0,212,255,0.15);
}
.venture-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 16px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.acquired { background: var(--amber); }
.status-dot.active { background: var(--green); animation: pulse-dot 2s ease-in-out infinite; }
.venture-card h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.venture-role {
  font-size: 0.8rem;
  color: var(--cyan);
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.venture-card > p:not(.venture-role) {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--off);
  margin-bottom: 24px;
  max-width: 720px;
}
.venture-metrics {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.vm { display: flex; flex-direction: column; gap: 4px; }
.vm-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
}
.vm-label {
  font-size: 0.7rem;
  color: var(--dim);
  font-weight: 500;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  margin-top: 48px;
  padding-left: 48px;
}
.timeline-line {
  position: absolute;
  left: 14px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--cyan), var(--purple), var(--border));
}
.timeline-item {
  position: relative;
  padding-bottom: 48px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -42px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(0,212,255,0.1);
  z-index: 1;
}
.timeline-content {
  padding: 24px 28px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.3s, transform 0.3s;
}
.timeline-content:hover {
  border-color: var(--border2);
  transform: translateX(4px);
}
.timeline-year {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  display: block;
}
.timeline-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.timeline-content p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--off);
}

/* --- Contact --- */
.contact-block {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.contact-desc {
  font-size: 1.05rem;
  color: var(--off);
  line-height: 1.75;
  margin-bottom: 40px;
}
.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--off);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.25s;
}
.contact-link:hover {
  border-color: var(--cyan);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.contact-link i { color: var(--cyan); }

/* --- Footer --- */
footer {
  position: relative;
  z-index: 1;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--dim);
}
.footer-sep { color: var(--muted); }
.footer-dim { color: var(--dim); }

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .pillars-grid { grid-template-columns: repeat(2, 1fr); }
  .patents-showcase { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .hero-stats {
    gap: 16px;
  }
  .hero-stat-divider { display: none; }
  .hero-stat {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .pillars-grid {
    grid-template-columns: 1fr;
  }

  .patents-showcase {
    grid-template-columns: 1fr;
  }

  .domain-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .domain-bar .bar-track { display: block; }
  .domain-count { text-align: left; }

  .venture-metrics { gap: 20px; }

  .timeline { padding-left: 36px; }
  .timeline-dot { left: -30px; }
}

@media (max-width: 480px) {
  .hero-line {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
  }
  .section-title {
    font-size: clamp(1.6rem, 6vw, 2.5rem);
  }
  .pillar-card, .patent-card, .venture-card, .timeline-content {
    padding: 24px;
  }
  .patents-domains { padding: 24px; }
}
