:root {
  --primary-purple: #5900B3;
  --purple-light: #b265ff;
  --purple-border: rgba(178, 101, 255, 0.28);
  --purple-border-hover: rgba(178, 101, 255, 0.65);
  --bg-dark: #07030d;
  --text-main: #ffffff;
  --text-muted: rgba(230, 220, 250, 0.7);
  --text-dim: rgba(200, 190, 225, 0.45);
  --card-bg: rgba(10, 4, 18, 0.78);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, Menlo, monospace;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg-dark);
}

.beams-bg-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

#beams-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.code-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.code-card {
  position: absolute;
  width: max-content;
  min-width: 290px;
  max-width: min(440px, calc(100vw - 32px));
  min-height: 84px;
  padding: 16px 22px;
  background: var(--card-bg);
  border: 1px solid var(--purple-border);
  border-radius: 8px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  text-align: left;
  box-sizing: border-box;
}

.code-card.active {
  opacity: 1;
  transform: translateY(0);
}

#slot-1 {
  top: clamp(20px, 5vh, 60px);
  left: clamp(16px, 4vw, 60px);
}

#slot-2 {
  bottom: clamp(65px, 10vh, 110px);
  right: clamp(16px, 4vw, 60px);
}

#slot-3 {
  top: clamp(20px, 5vh, 60px);
  right: clamp(16px, 4vw, 60px);
}

.card-meta {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.card-lang {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-light);
}

.card-content {
  display: block;
  text-align: left;
  min-height: 48px;
}

.code-print {
  display: inline;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  color: rgba(245, 240, 255, 0.95);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 4;
  margin: 0;
  padding: 0;
  text-align: left;
}

.typing-cursor {
  display: inline-block;
  width: 6px;
  height: 0.95em;
  vertical-align: -0.12em;
  background: var(--purple-light);
  margin-left: 2px;
  animation: blink 0.85s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.tok-kw { color: #c084fc; font-weight: 500; }
.tok-str { color: #f3e8ff; }
.tok-fn { color: #e9d5ff; }
.tok-typ { color: #a78bfa; }
.tok-com { color: #73628a; font-style: italic; }

.hero-stage {
  position: relative;
  z-index: 10;
  margin: auto;
  padding: 32px 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

.brand-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 12px;
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
}

.subtitle-wrapper {
  margin-bottom: 32px;
  min-height: 24px;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.3vw, 1.05rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.brand-subtitle .decrypted-char {
  color: #ffffff;
}

.brand-subtitle .scrambled-char {
  color: var(--purple-light);
  opacity: 0.85;
}

.link-wrapper {
  display: flex;
  justify-content: center;
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(245, 240, 255, 0.92);
  padding: 12px 28px;
  background: rgba(14, 7, 26, 0.82);
  border: 1px solid var(--purple-border);
  border-radius: 9999px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.doc-link:hover {
  border-color: var(--purple-border-hover);
  color: #ffffff;
  transform: translateY(-2px);
  background: rgba(22, 10, 42, 0.92);
}

.link-icon {
  color: var(--purple-light);
  transition: transform 0.25s ease;
}

.doc-link:hover .link-icon {
  transform: translate(2px, -2px);
}

.footer-bar {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 44px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.footer-item {
  transition: color 0.25s ease;
}

.footer-item:hover {
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 1024px) {
  #slot-1 { left: 20px; top: 28px; width: 280px; }
  #slot-2 { right: 20px; bottom: 80px; width: 280px; }
  #slot-3 { display: none !important; }
}

@media (max-width: 768px) {
  #slot-1 {
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: min(320px, calc(100vw - 32px));
    right: auto;
  }

  #slot-1.active {
    transform: translateX(-50%) translateY(0);
  }

  #slot-2 {
    top: auto;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: min(320px, calc(100vw - 32px));
    right: auto;
  }

  #slot-2.active {
    transform: translateX(-50%) translateY(0);
  }

  #slot-3 {
    display: none !important;
  }

  .footer-bar {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 20px 16px;
  }
}
