:root {
  --bg: #e8e8e8;
  --muted: #d4d4d4;
  --primary: #3b9eff;
  --accent: #0a7aff;
  --ink: #1c1c1e;
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#content {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Heading: static, no shimmer, never changes between states ── */
#heading {
  font-size: clamp(64px, 13vw, 108px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 26px;
  padding-bottom: 0.12em;
  background: linear-gradient(90deg, #0a7aff 0%, #3b9eff 42%, #7cc3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
}

/* ── Stage (holds graph / chips / detail above the pill) ── */
#stage {
  position: relative;
  width: min(460px, 94vw);
  height: 0;
  transition: height 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}
#content.exploring #stage,
#content.detailing #stage {
  height: 300px;
  margin-bottom: 18px;
}

/* graph edges */
#graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.4s ease 0.12s;
  pointer-events: none;
}
#content.exploring #graph {
  opacity: 1;
}
#graph line {
  stroke: rgba(59, 158, 255, 0.45);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
#content.exploring #graph line {
  stroke-dashoffset: 0;
}
#graph circle {
  fill: rgba(59, 158, 255, 0.5);
}

/* chips as graph nodes (positions set by JS) */
#chips {
  position: absolute;
  inset: 0;
}
.chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  background: var(--ink);
  border-radius: 999px;
  padding: 11px 16px;
  border: none;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 70px)) scale(0.55);
  transition:
    transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.35s ease,
    background 0.16s ease;
}
#content.exploring .chip {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
#content.exploring .chip:nth-child(1) { transition-delay: 0.03s; }
#content.exploring .chip:nth-child(2) { transition-delay: 0.09s; }
#content.exploring .chip:nth-child(3) { transition-delay: 0.15s; }
#content.exploring .chip:nth-child(4) { transition-delay: 0.21s; }
.chip:hover { background: #262629; }
.chip:active { transform: translate(-50%, -50%) scale(0.96); }
.chip svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--primary); }

/* detail card */
#detail {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
#content.detailing #detail {
  opacity: 1;
  pointer-events: auto;
}
.dcard {
  width: min(380px, 94vw);
  background: var(--ink);
  border-radius: 30px;
  padding: 26px 26px 24px;
  text-align: left;
  color: #fff;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(26px) scale(0.92);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.5, 0.64, 1), opacity 0.3s ease;
}
#content.detailing .dcard {
  transform: none;
  opacity: 1;
}
.dcard .dicon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(59, 158, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.dcard .dicon svg { width: 24px; height: 24px; color: var(--primary); }
.dcard h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 9px; }
.dcard p { font-size: 14px; line-height: 1.62; color: rgba(255, 255, 255, 0.62); max-width: 42ch; }

/* ── Pill ── */
#pill {
  position: relative;
  background: var(--ink);
  border-radius: 999px;
  overflow: hidden;
  box-shadow:
    0 6px 28px rgba(0, 0, 0, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  will-change: width, height;
}
.panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.panel.on {
  opacity: 1;
  pointer-events: auto;
}
#p-tb { justify-content: center; gap: 1px; padding: 0 7px; }
.tb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  min-width: 34px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: inherit;
  transition: background 0.16s ease;
  white-space: nowrap;
}
.tb-btn:hover { background: rgba(59, 158, 255, 0.14); }
.tb-btn:active { background: rgba(59, 158, 255, 0.08); }
.tb-btn svg { flex-shrink: 0; width: 17px; height: 17px; }

.lbl {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.42s cubic-bezier(0.34, 1.5, 0.64, 1), opacity 0.28s ease;
}
.lbl.on { max-width: 72px; opacity: 1; }

#p-waitlist { justify-content: center; gap: 6px; padding: 0 7px; }
.wl-input {
  flex: 1;
  height: 32px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-family: inherit;
  padding: 0 13px;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.wl-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.wl-input:focus { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.26); }
.wl-input.err { border-color: rgba(255, 99, 99, 0.8); }
.wl-submit {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: rgba(59, 158, 255, 0.18);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.16s ease;
}
.wl-submit:hover { background: rgba(59, 158, 255, 0.28); }

#p-wldone { justify-content: center; padding: 0 14px; }
.wl-done {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wl-done svg { width: 16px; height: 16px; }

/* ── Corner privacy link + hint ── */
#privacy-link {
  position: fixed;
  bottom: 22px;
  left: 24px;
  z-index: 20;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.4);
  text-decoration: none;
  letter-spacing: 0.01em;
}
#privacy-link:hover { color: var(--accent); }

#hint {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(0, 0, 0, 0.3);
  letter-spacing: 0.01em;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

/* ── Mobile ── */
@media (max-width: 767px) {
  .chip { font-size: 12px; padding: 9px 13px; gap: 7px; }
  .chip svg { width: 15px; height: 15px; }
  #content.exploring #stage,
  #content.detailing #stage { height: 330px; }
  #hint { display: none; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  #stage,
  #graph,
  #graph line,
  .chip,
  .dcard,
  .lbl,
  .panel { transition-duration: 0.01ms !important; }
  #graph line { stroke-dashoffset: 0 !important; }
}
