/* ==========================================================================
   THREE.WS - 3D AI AGENT PROTOCOL FOR ROBINHOOD CHAIN (EXACT REPLICA)
   Design System: Near-black (#0a0a0a), Space Grotesk + Inter + JetBrains Mono,
                  Multi-color Gradient Forge Bar, Infinite Capability Ticker,
                  Tabbed Code Editor Panes, 3 Doors Bento Grid
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg-0: #0a0a0a;
  --surface-0: #0e0e0f;
  --surface-1: #161618;
  --surface-2: #202024;
  --surface-3: #2c2c32;

  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.18);

  --text-1: #f6f6f6;
  --text-2: #a8a8a8;
  --text-3: #8a8a8a;
  --text-4: #6e6e6e;

  --accent-purple: #8b5cf6;
  --accent-pink: #ff6ad5;
  --accent-orange: #ffb454;
  --accent-cyan: #4fc3ff;
  --green: #22c55e;

  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.55;
  background: var(--bg-0);
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* Layout Wrappers */
.wrap-1280 {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.wrap-1440 {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Header Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--stroke);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-1);
}

.brand-logo .dot-ws {
  color: var(--text-3);
  font-weight: 400;
}

.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--green);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-2);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-1);
}

/* Buttons */
.btn-primary {
  background: var(--text-1);
  color: var(--bg-0);
  padding: 10px 20px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  transition: all 0.18s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--text-1);
  padding: 10px 20px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  border: 1px solid var(--stroke-strong);
  transition: all 0.18s ease;
}

.btn-outline:hover {
  border-color: var(--text-1);
  background: rgba(255, 255, 255, 0.05);
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: calc(100vh - 64px);
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--stroke);
}

.hero-text {
  padding: 96px 48px 96px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-3);
  margin-bottom: 28px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-green 2.4s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

h1.hero-h {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 96px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  font-weight: 600;
  margin-bottom: 28px;
  color: var(--text-1);
}

h1.hero-h em {
  font-style: normal;
  color: var(--text-3);
  font-weight: 500;
}

.hero-sub {
  font-size: 1.12rem;
  color: var(--text-2);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.55;
}

/* Hero Multi-Color Gradient Forge Bar */
.hero-forge {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin-bottom: 24px;
  padding: 7px 7px 7px 18px;
  border-radius: 14px;
  background:
    linear-gradient(var(--surface-0), var(--surface-0)) padding-box,
    linear-gradient(120deg, #ffb454, #ff6ad5 38%, #8b5cf6 64%, #4fc3ff) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 8px 30px -18px rgba(139,92,246,.5);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.hero-forge:focus-within {
  box-shadow: 0 0 0 4px rgba(139,92,246,.18), 0 10px 34px -16px rgba(139,92,246,.6);
  transform: translateY(-1px);
}

.hero-forge-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.hero-forge-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 9px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: #0a0a0a;
  border: 0;
  background: linear-gradient(120deg, #ffb454, #ff6ad5 40%, #8b5cf6 66%, #4fc3ff);
  background-size: 160% 160%;
  background-position: 0% 50%;
  transition: all 0.3s ease;
}

.hero-forge-go:hover {
  background-position: 100% 50%;
  box-shadow: 0 0 22px -4px rgba(139,92,246,.55);
}

/* Tries Chips */
.hero-forge-tries {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-try {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-0);
  border: 1px solid var(--stroke);
  color: var(--text-2);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hero-try:hover {
  color: var(--text-1);
  border-color: var(--stroke-strong);
  transform: translateY(-1px);
}

/* Metrics Row */
.metrics {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--stroke);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.metric strong {
  font-family: var(--font-display);
  color: var(--text-1);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-transform: none;
}

/* Hero 3D Stage Canvas */
.hero-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(118% 78% at 50% 20%, rgba(255,255,255,0.075) 0%, rgba(255,255,255,0.022) 36%, transparent 60%),
    var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-3d-model-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-avatar-card {
  background: rgba(14, 14, 15, 0.85);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
}

/* Capability Infinite Ticker */
.capability-strip {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  background: var(--surface-0);
  padding: 14px 0;
  user-select: none;
}

.cap-track {
  display: flex;
  width: max-content;
  animation: cap-scroll 45s linear infinite;
}

.cap-item {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
  white-space: nowrap;
  padding: 0 16px;
}

@keyframes cap-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Section Blocks */
section.block {
  padding: 112px 0;
  border-top: 1px solid var(--stroke);
}

.block-head {
  margin-bottom: 60px;
  max-width: 800px;
}

.block-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

.block-h {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin-bottom: 20px;
}

.block-h em {
  font-style: normal;
  color: var(--text-3);
  font-weight: 500;
}

/* 3 Doors Bento Grid */
.doors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--stroke);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.door {
  background: var(--surface-0);
  padding: 44px 36px 38px;
  display: flex;
  flex-direction: column;
  transition: background 0.18s ease;
}

.door:hover {
  background: var(--surface-1);
}

.door-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--text-3);
  margin-bottom: 28px;
}

.door h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.1;
  font-weight: 600;
  margin-bottom: 14px;
}

.door p {
  color: var(--text-2);
  margin-bottom: 28px;
  font-size: 0.95rem;
  line-height: 1.55;
  flex: 1;
}

/* Tabbed Code Embed Pane */
.embed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--stroke);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pane {
  background: var(--surface-0);
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--stroke);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
}

.code-pane pre {
  margin: 0;
  padding: 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text-1);
  overflow-x: auto;
  background: var(--surface-0);
}

/* Footer */
footer {
  border-top: 1px solid var(--stroke);
  padding: 80px 0 60px;
  background: var(--bg-0);
}

/* Modals & Toasts */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-three {
  background: var(--surface-0);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

.toast-three {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1000;
  background: var(--surface-1);
  border: 1px solid var(--stroke-strong);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

/* 8-Card Bento Grid Showcase */
.agent-bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.agent-bento-card {
  background: var(--surface-0);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.agent-bento-card:hover {
  border-color: var(--stroke-strong);
  transform: translateY(-2px);
  background: var(--surface-1);
}

.card-tag-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card-body-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.loading-ring {
  width: 28px;
  height: 28px;
  border: 2px solid var(--stroke);
  border-top-color: var(--text-3);
  border-radius: 50%;
  animation: ring-spin 1.2s linear infinite;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

.card-footer-info h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-1);
  margin-bottom: 4px;
}

.card-footer-info p {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-4);
  letter-spacing: 0.08em;
}

.agent-bento-card.action-card {
  cursor: pointer;
  background: rgba(22, 22, 24, 0.6);
  border: 1px stroke var(--stroke);
}

.action-card-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

/* Floating 3D Robot Agent Widget (Bottom Right) */
.floating-agent-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.floating-tooltip {
  background: #161618;
  border: 1px solid var(--stroke-strong);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.82rem;
  color: var(--text-2);
  max-width: 280px;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  position: relative;
  animation: floatPulse 3s ease-in-out infinite;
}

.tooltip-arrow {
  position: absolute;
  bottom: -6px;
  right: 32px;
  width: 10px;
  height: 10px;
  background: #161618;
  border-right: 1px solid var(--stroke-strong);
  border-bottom: 1px solid var(--stroke-strong);
  transform: rotate(45deg);
}

@keyframes floatPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.agent-widget-box {
  background: rgba(14, 14, 15, 0.95);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-pill);
  padding: 8px 18px 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  transition: transform 0.2s ease;
}

.agent-widget-box:hover {
  transform: scale(1.05);
}

.agent-widget-badge {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-1);
}

.claim-tag {
  font-size: 0.7rem;
  color: var(--accent-purple);
  font-weight: 600;
}

@media (max-width: 1024px) {
  .agent-bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

