/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0f; --bg-card: #12121a; --bg-card-hover: #1a1a28;
  --text: #e8e8f0; --text-dim: #8888a0; --text-muted: #55556a;
  --accent: #6366f1; --accent2: #8b5cf6; --accent3: #a78bfa;
  --green: #22c55e; --blue: #3b82f6; --yellow: #eab308; --purple: #a855f7;
  --red: #ef4444; --cyan: #06b6d4;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent2), var(--cyan));
  --radius: 16px; --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
h1,h2,h3,h4 { font-weight: 700; line-height: 1.2; }
code { font-family: var(--mono); background: rgba(99,102,241,.15); padding: 2px 6px; border-radius: 4px; font-size: .85em; }
strong { color: var(--text); }

/* === HERO === */
.hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,.15) 0%, transparent 60%), radial-gradient(ellipse at 80% 80%, rgba(139,92,246,.1) 0%, transparent 50%); z-index: 0; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23ffffff08' stroke-width='.5'/%3E%3C/svg%3E"); }
.hero-content { position: relative; z-index: 1; }
.hero-badge { display: inline-block; padding: 6px 16px; border-radius: 20px; border: 1px solid rgba(99,102,241,.4); color: var(--accent3); font-size: .8rem; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 24px; backdrop-filter: blur(8px); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 900; margin-bottom: 16px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: clamp(1rem, 2vw, 1.25rem); color: var(--text-dim); max-width: 640px; margin: 0 auto 48px; }
.hero-stats { display: flex; gap: 48px; justify-content: center; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 3rem; font-weight: 900; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.scroll-hint { position: absolute; bottom: 32px; color: var(--text-muted); font-size: 1.2rem; animation: bounce 2s ease infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* === SECTIONS === */
.section { padding: 100px 0; position: relative; }
.section-dark { background: var(--bg-card); }
.section-title { font-size: clamp(1.8rem, 3.5vw, 2.8rem); text-align: center; margin-bottom: 12px; }
.section-desc { text-align: center; color: var(--text-dim); max-width: 700px; margin: 0 auto 56px; font-size: 1.05rem; }

/* === PARADIGM === */
.paradigm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.paradigm-card { background: var(--bg-card); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius); padding: 32px; transition: transform .3s, border-color .3s, box-shadow .3s; }
.paradigm-card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,.3); box-shadow: 0 16px 48px rgba(99,102,241,.1); }
.card-icon { font-size: 2.5rem; margin-bottom: 16px; }
.card-logo { margin-bottom: 16px; display: flex; align-items: center; justify-content: flex-start; min-height: 56px; }
.paradigm-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.paradigm-card p { color: var(--text-dim); font-size: .95rem; }
.paradigm-card em { color: var(--accent3); font-style: normal; font-weight: 500; }

/* === CAPABILITIES === */
.caps-layout { display: flex; flex-direction: column; gap: 40px; }
.cap-group { position: relative; }
.group-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; padding: 6px 14px; border-radius: 20px; display: inline-block; margin-bottom: 16px; }
.group-a { background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.25); }
.group-b { background: rgba(59,130,246,.12); color: var(--blue); border: 1px solid rgba(59,130,246,.25); }
.cap-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cap-card { background: var(--bg); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm); padding: 20px; transition: transform .3s, border-color .3s; }
.cap-card:hover { transform: translateY(-3px); }
.cap-adapter:hover { border-color: rgba(34,197,94,.4); }
.cap-core:hover { border-color: rgba(59,130,246,.4); }
.cap-header { font-family: var(--mono); font-size: .95rem; font-weight: 500; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cap-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-blue { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.dot-purple { background: var(--purple); box-shadow: 0 0 8px var(--purple); }
.cap-body { display: flex; flex-wrap: wrap; gap: 6px; }
.cap-tag { font-size: .72rem; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,.05); color: var(--text-dim); border: 1px solid rgba(255,255,255,.06); }
.cap-db { font-size: .75rem; color: var(--red); margin-top: 4px; width: 100%; }
.db-yes { color: var(--green); }

/* === MESH PLANES === */
.mesh-planes { display: flex; flex-direction: column; gap: 24px; }
.plane { background: var(--bg-card); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius); overflow: hidden; transition: border-color .3s; }
.plane:hover { border-color: rgba(99,102,241,.3); }
.plane-header { display: flex; align-items: center; gap: 16px; padding: 24px 28px 0; }
.plane-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.plane-icon-data { background: rgba(59,130,246,.15); }
.plane-icon-ctrl { background: rgba(34,197,94,.15); }
.plane-icon-async { background: rgba(168,85,247,.15); }
.plane-header h3 { font-size: 1.15rem; flex: 1; }
.plane-pattern { font-family: var(--mono); font-size: .8rem; padding: 4px 10px; border-radius: 6px; background: rgba(99,102,241,.15); color: var(--accent3); }
.plane-body { padding: 16px 28px; }
.plane-body p { color: var(--text-dim); font-size: .92rem; margin-bottom: 12px; }
.plane-detail { display: flex; gap: 16px; flex-wrap: wrap; }
.plane-detail span { font-size: .8rem; color: var(--text-muted); }
.plane-flow { display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: rgba(0,0,0,.3); flex-wrap: wrap; }
.pf-node { font-family: var(--mono); font-size: .78rem; padding: 4px 10px; border-radius: 6px; font-weight: 500; }
.pf-in { background: rgba(34,197,94,.15); color: var(--green); }
.pf-core { background: rgba(59,130,246,.15); color: var(--blue); }
.pf-out { background: rgba(6,182,212,.15); color: var(--cyan); }
.pf-saf { background: rgba(168,85,247,.15); color: var(--purple); }
.pf-all { background: rgba(255,255,255,.08); color: var(--text-dim); }
.pf-arrow { color: var(--text-muted); font-size: .75rem; font-family: var(--mono); }
.pf-status { font-size: .72rem; color: var(--text-muted); margin-left: auto; }
.pf-close { background: rgba(168,85,247,.15); color: var(--purple); }

/* Plane uses detail */
.plane-uses { margin: 16px 0 12px; }
.plane-uses h4 { font-size: .85rem; color: var(--text); margin-bottom: 12px; font-weight: 600; }
.use-list { display: flex; flex-direction: column; gap: 10px; }
.use-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; background: rgba(0,0,0,.25); border-radius: var(--radius-sm); border-left: 3px solid rgba(99,102,241,.3); transition: border-color .3s, background .3s; }
.use-item:hover { border-left-color: var(--accent); background: rgba(0,0,0,.35); }
.use-icon { font-size: 1.2rem; min-width: 24px; text-align: center; padding-top: 2px; }
.use-item div { font-size: .82rem; color: var(--text-dim); line-height: 1.5; }
.use-item strong { color: var(--text); font-size: .85rem; }

/* === TRANSACTION FLOW === */
.flow-timeline { display: flex; flex-direction: column; align-items: center; gap: 0; max-width: 600px; margin: 0 auto; }
.flow-step { background: var(--bg); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm); padding: 20px 24px; width: 100%; display: flex; gap: 16px; align-items: flex-start; transition: border-color .3s, transform .3s; }
.flow-step:hover { border-color: rgba(99,102,241,.35); transform: scale(1.01); }
.flow-step-alt { border-color: rgba(234,179,8,.25); }
.flow-step-alt:hover { border-color: rgba(234,179,8,.5); }
.step-num { width: 36px; height: 36px; min-width: 36px; border-radius: 50%; background: var(--gradient); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; color: white; }
.step-alt { background: linear-gradient(135deg, var(--yellow), var(--red)); font-size: .8rem; }
.step-content h4 { font-size: 1rem; margin-bottom: 4px; }
.step-content p { color: var(--text-dim); font-size: .85rem; }
.step-badge { display: inline-block; font-size: .7rem; padding: 3px 8px; border-radius: 4px; background: rgba(99,102,241,.12); color: var(--accent3); margin-top: 6px; }
.badge-async { background: rgba(234,179,8,.12); color: var(--yellow); }
.flow-connector { width: 2px; height: 24px; background: rgba(255,255,255,.1); }
.mesh-line { background: repeating-linear-gradient(to bottom, var(--accent) 0, var(--accent) 4px, transparent 4px, transparent 8px); width: 3px; }
.alt-path { background: repeating-linear-gradient(to bottom, var(--yellow) 0, var(--yellow) 4px, transparent 4px, transparent 8px); width: 3px; }

/* === SECURITY === */
.security-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.sec-card { background: var(--bg-card); border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius-sm); padding: 24px; transition: transform .3s, border-color .3s; }
.sec-card:hover { transform: translateY(-3px); border-color: rgba(99,102,241,.25); }
.sec-icon { font-size: 2rem; margin-bottom: 12px; }
.sec-card h4 { font-size: 1rem; margin-bottom: 6px; }
.sec-card p { color: var(--text-dim); font-size: .88rem; }

/* === BOUNDARY === */
.boundary-layout { display: flex; gap: 0; align-items: stretch; }
.boundary-col { flex: 1; padding: 32px; border-radius: var(--radius-sm); }
.boundary-lua { background: rgba(234,179,8,.06); border: 1px solid rgba(234,179,8,.2); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.boundary-go { background: rgba(59,130,246,.06); border: 1px solid rgba(59,130,246,.2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.boundary-col h3 { font-size: 1.1rem; margin-bottom: 16px; }
.boundary-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.boundary-col li { color: var(--text-dim); font-size: .9rem; padding-left: 16px; position: relative; }
.boundary-col li::before { content: '›'; position: absolute; left: 0; color: var(--accent3); font-weight: 700; }
.boundary-rule { margin-top: 16px; font-size: .75rem; padding: 6px 12px; border-radius: 4px; text-align: center; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.boundary-lua .boundary-rule { background: rgba(234,179,8,.1); color: var(--yellow); }
.boundary-go .boundary-rule { background: rgba(59,130,246,.1); color: var(--blue); }
.boundary-divider { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 4px; }
.divider-line { width: 2px; flex: 1; background: rgba(255,255,255,.1); }
.divider-label { font-size: .65rem; writing-mode: vertical-rl; text-orientation: mixed; color: var(--text-muted); letter-spacing: 3px; padding: 12px 0; font-weight: 600; }

/* === FOOTER === */
.footer { padding: 48px 0; text-align: center; border-top: 1px solid rgba(255,255,255,.06); }
.footer p { color: var(--text-muted); font-size: .85rem; }
.footer-sub { margin-top: 8px; font-size: .75rem; }

/* === ANIMATIONS === */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero-stats { gap: 24px; }
  .stat-num { font-size: 2.2rem; }
  .boundary-layout { flex-direction: column; }
  .boundary-lua { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .boundary-go { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .boundary-divider { flex-direction: row; padding: 4px 0; }
  .divider-line { height: 2px; width: auto; }
  .divider-label { writing-mode: horizontal-tb; }
  .plane-flow { gap: 8px; }
  .security-grid { grid-template-columns: 1fr; }
}
