/* telomere.dev — vaporwave genomics SDK */

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

:root {
  --hot-pink: #ff6b9d;
  --lavender: #c084fc;
  --cyan: #67e8f9;
  --mint: #34d399;
  --deep-purple: #1e0a3e;
  --card-white: rgba(255, 255, 255, 0.9);
  --glow-pink: rgba(255, 107, 157, 0.3);
}

html, body {
  background: linear-gradient(135deg, #ff6b9d 0%, #c084fc 50%, #67e8f9 100%);
  background-attachment: fixed;
  color: var(--deep-purple);
  font-family: "Quicksand", system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--mint); color: var(--deep-purple); }

/* ---------- vaporwave grid background ---------- */
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background:
    linear-gradient(180deg,
      #fff7c2 0%, #ffd87a 30%, #ff6b9d 60%, #c084fc 100%);
  filter: blur(0.4px);
  opacity: 0.35;
  mix-blend-mode: screen;
  animation: sun-pulse 9s infinite ease-in-out;
}

.sun::before, .sun::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 6px;
  background: rgba(30, 10, 62, 0.25);
}

.sun::before { top: 60%; }
.sun::after { top: 72%; height: 4px; }

@keyframes sun-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.04); }
}

.floor {
  position: absolute;
  bottom: -50%;
  left: -50%;
  right: -50%;
  height: 100%;
  background:
    repeating-linear-gradient(0deg, transparent 0 60px, rgba(255,255,255,0.4) 60px 62px),
    repeating-linear-gradient(90deg, transparent 0 60px, rgba(255,255,255,0.4) 60px 62px);
  transform: perspective(420px) rotateX(58deg);
  transform-origin: top center;
  opacity: 0.3;
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
}

/* ---------- topbar ---------- */
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 60px);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--deep-purple);
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  font-family: "Bungee", sans-serif;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--deep-purple);
}

.logo-dot { color: var(--hot-pink); }

.topnav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.topnav a {
  font-family: "Quicksand", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--deep-purple);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 200ms ease, color 200ms ease;
}

.topnav a:hover {
  background: var(--mint);
  color: var(--deep-purple);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px clamp(20px, 5vw, 60px) 80px;
}

.hero-frame {
  position: relative;
  background: var(--card-white);
  border: 2.5px solid var(--deep-purple);
  border-radius: 14px;
  padding: 40px clamp(24px, 4vw, 56px);
  max-width: 880px;
  width: 100%;
  box-shadow:
    8px 8px 0 var(--mint),
    16px 16px 0 var(--lavender);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-tag {
  font-family: "Fira Code", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--hot-pink);
  text-transform: uppercase;
}

.hero-title {
  font-family: "Bungee", sans-serif;
  font-size: clamp(48px, 10vw, 120px);
  line-height: 0.95;
  letter-spacing: 0.005em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.05em;
}

.hero-word {
  background: linear-gradient(135deg, var(--hot-pink) 0%, var(--lavender) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px var(--deep-purple);
  display: inline-block;
  animation: title-grad 6s ease-in-out infinite;
  background-size: 200% 200%;
}

.hero-word--alt {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--lavender) 50%, var(--hot-pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  background-size: 200% 200%;
}

@keyframes title-grad {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-sub {
  font-size: clamp(15px, 1.5vw, 18px);
  max-width: 540px;
  color: var(--deep-purple);
}

.hero-sub em {
  font-style: italic;
  color: var(--hot-pink);
  font-weight: 700;
}

.hero-illus {
  margin: 6px 0;
  width: 100%;
}

.chromosome-illus {
  width: 100%;
  height: auto;
  max-width: 600px;
  display: block;
}

.chromosome path { transition: filter 400ms ease; }

.cap {
  transform-origin: center;
  animation: cap-bounce 2.4s infinite ease-in-out;
}

.cap-right { animation-delay: 0.6s; }

@keyframes cap-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn {
  font-family: "Bungee", sans-serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  border: 2.5px solid var(--deep-purple);
  border-radius: 8px;
  padding: 14px 22px;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--deep-purple);
  color: var(--cyan);
  box-shadow: 4px 4px 0 var(--hot-pink);
}

.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--mint);
  background: #2a1158;
}

.btn-ghost {
  background: var(--card-white);
  color: var(--deep-purple);
  box-shadow: 4px 4px 0 var(--cyan);
}

.btn-ghost:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--lavender);
}

/* ---------- shake animation ---------- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake { animation: shake 400ms ease both; }

/* ---------- stream / organic flow ---------- */
.stream {
  position: relative;
  z-index: 1;
  padding: 60px clamp(16px, 4vw, 40px) 120px;
  display: flex;
  flex-direction: column;
  gap: 80px;
  max-width: 1280px;
  margin: 0 auto;
}

.block {
  position: relative;
  background: var(--card-white);
  border: 2.5px solid var(--deep-purple);
  border-radius: 14px;
  padding: 36px clamp(22px, 4vw, 48px);
  box-shadow: 6px 6px 0 var(--lavender);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.block.is-revealed { opacity: 1; transform: translateY(0); }

.block[data-flow="left"] {
  margin-left: 4%;
  margin-right: 14%;
  max-width: 720px;
}

.block[data-flow="right"] {
  margin-left: 28%;
  margin-right: 2%;
  max-width: 760px;
}

.block[data-flow="center"] {
  margin-left: auto;
  margin-right: auto;
  max-width: 600px;
}

.block-tag {
  font-family: "Fira Code", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--hot-pink);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.block-tag span {
  background: var(--deep-purple);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "Bungee", sans-serif;
  font-size: 11px;
}

.block-title {
  font-family: "Bungee", sans-serif;
  font-size: clamp(28px, 4.5vw, 48px);
  line-height: 1.05;
  margin-bottom: 18px;
  color: var(--deep-purple);
}

.block-title em {
  font-style: italic;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  background: linear-gradient(90deg, var(--hot-pink), var(--lavender));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.block-text {
  max-width: 56ch;
  margin-bottom: 18px;
  color: var(--deep-purple);
}

/* ---------- code blocks ---------- */
.codeblock {
  background: var(--deep-purple);
  color: var(--cyan);
  padding: 18px 22px;
  border-radius: 10px;
  font-family: "Fira Code", monospace;
  font-size: 14px;
  line-height: 1.7;
  border: 2px solid var(--hot-pink);
  box-shadow: 4px 4px 0 var(--mint);
  overflow-x: auto;
}

.codeblock .prompt { color: var(--mint); }
.codeblock .cmd { color: var(--hot-pink); }

/* ---------- floating CD shape ---------- */
.block-shape {
  position: absolute;
  width: 140px;
  height: 140px;
  pointer-events: none;
}

.shape-cd {
  top: -50px;
  right: -60px;
  animation: cd-spin 14s linear infinite;
}

@keyframes cd-spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

.shape-cd svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 0 rgba(30,10,62,0.4)); }

/* ---------- API list ---------- */
.api-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.api-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 16px;
  align-items: baseline;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.65);
  border: 2px solid var(--deep-purple);
  border-radius: 8px;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.api-row[data-color="pink"] { box-shadow: -4px 4px 0 var(--hot-pink); }
.api-row[data-color="purple"] { box-shadow: -4px 4px 0 var(--lavender); }
.api-row[data-color="cyan"] { box-shadow: -4px 4px 0 var(--cyan); }
.api-row[data-color="mint"] { box-shadow: -4px 4px 0 var(--mint); }

.api-row:hover {
  transform: translate(2px, -2px);
  background: #fff;
}

.api-sig {
  font-family: "Fira Code", monospace;
  font-size: 14px;
  color: var(--deep-purple);
}

.api-sig b { color: var(--hot-pink); font-weight: 600; }

.api-desc {
  font-size: 13px;
  color: rgba(30, 10, 62, 0.8);
}

.api-desc em {
  font-style: italic;
  color: var(--lavender);
  font-weight: 600;
}

/* ---------- playground ---------- */
.playground {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.play-label {
  font-family: "Fira Code", monospace;
  font-size: 12px;
  color: var(--lavender);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.play-input {
  background: rgba(30, 10, 62, 0.04);
  border: 2px dashed var(--deep-purple);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: "Fira Code", monospace;
  font-size: 14px;
  color: var(--deep-purple);
  resize: vertical;
  min-height: 80px;
  transition: border-color 200ms ease, background 200ms ease;
}

.play-input:focus {
  outline: none;
  border-color: var(--hot-pink);
  background: #fff;
}

.play-input.is-error {
  border-color: var(--hot-pink);
  border-style: solid;
  background: rgba(255, 107, 157, 0.1);
}

.play-buttons {
  display: flex;
  gap: 12px;
}

.play-output {
  margin-top: 4px;
  background: var(--deep-purple);
  color: var(--cyan);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.65;
  min-height: 50px;
  border: 2px solid var(--mint);
}

.output-prompt { color: var(--mint); margin-right: 8px; }
.output-text { color: var(--cyan); }
.output-text.is-success { color: var(--mint); }
.output-text.is-error { color: var(--hot-pink); }

/* ---------- shape gallery ---------- */
.shape-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}

.shape-card {
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid var(--deep-purple);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  transition: transform 280ms ease, box-shadow 280ms ease;
  box-shadow: 4px 4px 0 var(--cyan);
}

.shape-card:nth-child(2) { box-shadow: 4px 4px 0 var(--lavender); }
.shape-card:nth-child(3) { box-shadow: 4px 4px 0 var(--hot-pink); }
.shape-card:nth-child(4) { box-shadow: 4px 4px 0 var(--mint); }

.shape-card:hover {
  transform: translate(-2px, -4px);
}

.shape-card svg { width: 100%; height: auto; max-width: 140px; }

.shape-card figcaption {
  font-family: "Bungee", sans-serif;
  font-size: 13px;
  color: var(--deep-purple);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* ---------- footer card ---------- */
.footer-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-line {
  font-family: "Bungee", sans-serif;
  font-size: clamp(14px, 1.6vw, 18px);
  color: var(--deep-purple);
  letter-spacing: 0.03em;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-family: "Fira Code", monospace;
  font-size: 12px;
  color: rgba(30, 10, 62, 0.7);
}

.footer-meta .dot { color: var(--hot-pink); }

/* ---------- responsive ---------- */
@media (max-width: 800px) {
  .block[data-flow="left"], .block[data-flow="right"] {
    margin-left: 0;
    margin-right: 0;
  }
  .api-row { grid-template-columns: 1fr; }
  .shape-cd { display: none; }
  .topnav { gap: 10px; }
  .topnav a { font-size: 11px; padding: 4px 6px; }
}
