/* CSS Variables */
:root {
  --bg1: #032d4f;
  --bg2: #082137;
  --accent: #0d2075;
  --text: #eaf6ff;
  --muted: #b9d7ee;
  --border: rgba(255,255,255,.14);
  --bg-light: #112b44;
  --bg-lighter: #183a5a;
}

/* Reset & Base Styles */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  padding: 0;
  font-family: Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif;
  color: var(--text);
  background: linear-gradient(-45deg, var(--bg1), #09487f, var(--accent), var(--bg2));
  background-size: 400% 400%;
  animation: gradientShift 18s ease infinite;
  min-height: 100vh;
  position: relative;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  position: relative;
  z-index: 2;
}

/* Floating Orbs */
.floating-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(105, 210, 231, 0.3), rgba(42, 169, 199, 0.1));
  backdrop-filter: blur(2px);
  animation: floatOrb 15s infinite ease-in-out;
}

.orb:nth-child(1) {
  width: 120px;
  height: 120px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.orb:nth-child(2) {
  width: 80px;
  height: 80px;
  top: 60%;
  left: 80%;
  animation-delay: -5s;
}

.orb:nth-child(3) {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 20%;
  animation-delay: -10s;
}

.orb:nth-child(4) {
  width: 100px;
  height: 100px;
  top: 20%;
  left: 70%;
  animation-delay: -2s;
}

.orb:nth-child(5) {
  width: 40px;
  height: 40px;
  top: 50%;
  left: 50%;
  animation-delay: -8s;
}

@keyframes floatOrb {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  25% {
    transform: translate(-30px, -50px) scale(1.1);
    opacity: 0.8;
  }
  50% {
    transform: translate(40px, -30px) scale(0.9);
    opacity: 0.4;
  }
  75% {
    transform: translate(-20px, 40px) scale(1.05);
    opacity: 0.7;
  }
}

/* Floating Particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(168, 230, 255, 0.6);
  border-radius: 50%;
  animation: floatParticle 20s infinite linear;
}

.particle:nth-child(1) {
  top: 20%;
  left: 25%;
  animation-delay: 0s;
  animation-duration: 18s;
}

.particle:nth-child(2) {
  top: 50%;
  left: 75%;
  animation-delay: -3s;
  animation-duration: 22s;
}

.particle:nth-child(3) {
  top: 70%;
  left: 15%;
  animation-delay: -6s;
  animation-duration: 16s;
}

.particle:nth-child(4) {
  top: 30%;
  left: 60%;
  animation-delay: -9s;
  animation-duration: 24s;
}

.particle:nth-child(5) {
  top: 80%;
  left: 40%;
  animation-delay: -12s;
  animation-duration: 20s;
}

.particle:nth-child(6) {
  top: 10%;
  left: 80%;
  animation-delay: -15s;
  animation-duration: 19s;
}

.particle:nth-child(7) {
  top: 60%;
  left: 30%;
  animation-delay: -18s;
  animation-duration: 21s;
}

.particle:nth-child(8) {
  top: 90%;
  left: 70%;
  animation-delay: -21s;
  animation-duration: 17s;
}

@keyframes floatParticle {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate(0, -100vh);
    opacity: 0;
  }
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
}

.pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  backdrop-filter: blur(4px);
  font-weight: 600;
  font-size: 14px;
}

h1 {
  margin: 18px 0 12px;
  font-size: clamp(32px, 6.4vw, 64px);
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 800;
}

h1 .ada {
  background: linear-gradient(90deg, #a8e6ff 0%, #69d2e7 60%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

p.sub {
  color: var(--muted);
  font-size: clamp(16px,1.8vw,18px);
  max-width: 680px;
  line-height: 1.6;
  margin: 16px 0;
}

/* Buttons */
.btns {
  display: flex;
  gap: 16px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  transition: .3s all ease;
  font-size: 16px;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, #2aa9c7, #69d2e7);
  border-color: #2aa9c7;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.22);
}

/* Phone Demo */
.phone {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  background: radial-gradient(180px 140px at 65% 25%, rgba(105,210,231,.18), transparent 60%),
             radial-gradient(160px 120px at 20% 80%, rgba(105,210,231,.16), transparent 60%),
             linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.05);
  height: min(62vh, 520px);
  min-height: 400px;
}

.stage {
  position: absolute;
  inset: 0;
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}

.stage.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.stage.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

#cardanoLogoCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* Bot Demo Interface */
.demo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.demo-head {
  padding: 12px 16px;
  border-bottom: 1px solid #0f3554;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #081c2f, #0a1f35);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.d1 { background: #ff5f57; }
.dot.d2 { background: #febc2e; }
.dot.d3 { background: #28c840; }

.demo-body {
  padding: 16px;
  flex: 1;
  overflow: auto;
  background: linear-gradient(180deg, #071f33, #061a2e);
  border-bottom: 1px solid #0f3554;
  font-family: ui-monospace, Menlo, Consolas, "SF Mono", monospace;
}

.bubble {
  max-width: 85%;
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.bubble.me {
  margin-left: auto;
  background: linear-gradient(135deg, #0f3554, #1a4a70);
  color: #e1f3ff;
  border: 1px solid rgba(105,210,231,.2);
}

.bubble.bot {
  background: linear-gradient(135deg, #0a2a46, #0d3050);
  color: #e1f3ff;
  border: 1px solid rgba(255,255,255,.1);
}

.demo-foot {
  padding: 12px 16px;
  background: linear-gradient(135deg, #071f33, #061a2e);
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-row input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  background: #0b2b4a;
  border: 1px solid #134b76;
  color: #cfe9ff;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.input-row input:focus {
  border-color: #69d2e7;
  box-shadow: 0 0 0 2px rgba(105,210,231,.2);
}

.input-row button {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #176ea6, #2aa9c7);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.input-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

/* Sections */
section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 28px;
  margin: 0 0 16px;
  font-weight: 700;
}

.twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.card {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.card ul {
  margin: 16px 0;
  padding-left: 20px;
}

.card li {
  margin: 8px 0;
  line-height: 1.6;
}

/* Code Display */
.codewrap {
  position: relative;
  background: #061626;
  border: 1px solid #0f2842;
  border-radius: 16px;
  overflow: hidden;
}

.codehdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.code-buttons {
  display: flex;
  gap: 8px;
}

.code-buttons .btn {
  padding: 6px 12px;
  font-size: 14px;
  background: var(--bg-light);
}

.code-buttons .btn:hover {
  background: var(--bg-lighter);
}

.copybtn {
  padding: 8px 16px;
  border: 1px solid #1c4164;
  border-radius: 8px;
  background: #0d2a44;
  color: #d5eeff;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s ease;
}

.copybtn:hover {
  background: #154a75;
  transform: translateY(-1px);
}

pre {
  margin: 0;
  padding: 20px;
  overflow: auto;
  max-height: 500px;
}

code {
  display: block;
  font-family: ui-monospace, Menlo, Consolas, "SF Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e6f3ff;
  white-space: pre-wrap;
}

/* Caret animation for typing effect */
.caret {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  vertical-align: bottom;
  background: #69d2e7;
  margin-left: 2px;
  animation: blink 1s steps(2,start) infinite;
  box-shadow: 0 0 8px rgba(105,210,231,.6);
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Footer */
.footer {
  margin-top: 80px;
  padding: 60px 0 20px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text);
}

.footer-col p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin: 12px 0;
}

.footer-col ul a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col ul a:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.social-link:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-bottom p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

#particles-bg {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Dropdown */
.dropdown {
  margin-top: 16px;
}

.dropdown-btn {
  background: linear-gradient(135deg, #176ea6, #2aa9c7);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s ease;
  width: 100%;
  text-align: left;
}

.dropdown-btn:hover {
  background: linear-gradient(135deg, #2aa9c7, #69d2e7);
}

.dropdown-content {
  display: none;
  margin-top: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.dropdown-content ul {
  padding-left: 20px;
}

.dropdown-content li {
  margin: 8px 0;
  line-height: 1.6;
}

/* Code Syntax Highlight */
.keyword { color: #c678dd; }
.string { color: #98c379; }
.number { color: #d19a66; }
.function { color: #61afef; }
.comment { color: #5c6370; font-style: italic; }
.variable { color: #e06c75; }
.operator { color: #56b6c2; }

/* Responsive */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .twocol {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 20px 16px;
  }
  
  .hero {
    gap: 24px;
  }
  
  .phone {
    height: 400px;
  }
  
  h1 {
    font-size: clamp(28px, 8vw, 48px);
  }
  
  .section-title {
    font-size: 24px;
  }
  
  section {
    padding: 48px 0;
  }
  
  .footer {
    margin-top: 60px;
    padding: 40px 0 20px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .footer-col {
    text-align: center;
  }
  
  .social-links {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
  }
}