:root {
  --bg: #0b0b0f;
  --bg-2: #15151d;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #f5f5f7;
  --muted: #a0a0ad;
  --pink: #ff3da6;
  --purple: #8a5cff;
  --blue: #38bdf8;
  --yellow: #ffd23f;
  --green: #4ade80;
  --ring: conic-gradient(
    from 0deg,
    var(--pink),
    var(--yellow),
    var(--green),
    var(--blue),
    var(--purple),
    var(--pink)
  );
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

body {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(138, 92, 255, 0.18), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(255, 61, 166, 0.16), transparent 55%),
    radial-gradient(900px 600px at 50% 120%, rgba(56, 189, 248, 0.12), transparent 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  width: 100%;
  max-width: 760px;
  padding: 32px 20px 80px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 4px;
}

.logo-stack {
  display: inline-grid;
  width: max-content;
  justify-items: center;
}

.brand-video {
  display: block;
  width: 50%;
  border-radius: 10px;
  margin: 0 auto 8px;
  mix-blend-mode: screen;
  opacity: 0.98;
}

.logo-link {
  text-decoration: none;
  display: block;
}

.brand .logo {
  display: block;
  text-align: center;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 2.6rem;
  line-height: 1;
  background: linear-gradient(90deg, #fff, #fff);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.brand .spark {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 14px rgba(255, 210, 63, 0.6));
  align-self: end;
}

.tagline {
  text-align: center;
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

label.field-label {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}

label.field-label .label-note {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
  margin-left: 6px;
  color: color-mix(in srgb, var(--muted) 70%, #000 30%);
}

.field {
  margin-bottom: 20px;
  position: relative;
}

.char-count {
  margin-top: 6px;
  text-align: right;
  font-size: 0.78rem;
  color: var(--muted);
}

.char-count.over {
  color: #cf222e;
  font-weight: 600;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 8px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-row:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(138, 92, 255, 0.25);
}

.input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.05rem;
  font-family: var(--font);
  padding: 8px 0;
}
.input-row textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.05rem;
  font-family: var(--font);
  padding: 8px 0;
  resize: vertical;
  min-height: 44px;
}

/* ---- Avatars ---- */
.avatar-shell {
  display: inline-grid;
  place-items: center;
  line-height: 0;
}
.avatar {
  position: relative;
  border-radius: 50%;
  background: var(--bg-2);
  object-fit: cover;
  flex: none;
  display: inline-block;
}

.avatar-ring {
  position: relative;
  border-radius: 50%;
  padding: 3px;
  background: var(--ring);
  flex: none;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(138, 92, 255, 0.45);
}
.avatar-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg);
}
.avatar-ring img,
.avatar-ring .identicon {
  position: relative;
  z-index: 1;
  border-radius: 50%;
}

.identicon {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border-radius: 50%;
}

.avatar-sm { width: 36px; height: 36px; }
.avatar-sm img { width: 36px; height: 36px; }
.avatar-sm .identicon { width: 36px; height: 36px; font-size: 0.9rem; }
.avatar-md .identicon { width: 56px; height: 56px; font-size: 1.3rem; }
.avatar-md img { width: 56px; height: 56px; }
.avatar-lg .identicon { width: 120px; height: 120px; font-size: 2.6rem; }
.avatar-lg img { width: 120px; height: 120px; }
.avatar-xl .identicon { width: 168px; height: 168px; font-size: 3.6rem; }
.avatar-xl img { width: 168px; height: 168px; }

/* selected chip in input row */
.selected-avatar {
  width: 36px;
  height: 36px;
}
.selected-avatar .identicon {
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
}
.selected-avatar img {
  width: 36px;
  height: 36px;
}

/* ---- Autocomplete ---- */
.autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #14141c;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  overflow: hidden;
  z-index: 30;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: none;
}
.autocomplete.open {
  display: block;
}
.ac-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.ac-item:hover,
.ac-item.active {
  background: rgba(138, 92, 255, 0.18);
}
.ac-item .ac-name {
  font-weight: 600;
}
.ac-item .ac-handle {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- Button ---- */
.btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  box-shadow: 0 10px 30px rgba(255, 61, 166, 0.35);
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(138, 92, 255, 0.45);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---- Preview ---- */
.preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 6px 0 24px;
  min-height: 64px;
  color: var(--muted);
}
.preview[hidden] {
  display: none;
}
.preview .who {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.preview .who .handle {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  max-width: 140px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.preview .arrow {
  font-size: 1.6rem;
  color: var(--yellow);
  filter: drop-shadow(0 0 10px rgba(255, 210, 63, 0.6));
}

.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.footer {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer.credit {
  margin-top: 8px;
}
.footer.credit a {
  color: var(--text);
  font-weight: 600;
}
.form-error {
  color: #cf222e;
  font-size: 0.875rem;
  margin: 0 0 12px;
}

/* ---- Clippy assistant ---- */
.clippy {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: 280px;
  pointer-events: none;
}
.clippy.clippy--show { display: flex; }
.clippy.clippy--in { animation: clippy-in 0.55s cubic-bezier(0.18, 1.4, 0.4, 1) both; }
.clippy.clippy--out { animation: clippy-out 0.3s ease forwards; }

.clippy-bubble {
  position: relative;
  pointer-events: auto;
  background: linear-gradient(160deg, rgba(33, 33, 48, 0.96), rgba(20, 20, 30, 0.96));
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(138, 92, 255, 0.25),
    0 0 32px rgba(138, 92, 255, 0.25);
  backdrop-filter: blur(8px);
}
.clippy-bubble::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -9px;
  width: 16px;
  height: 16px;
  background: rgba(20, 20, 30, 0.96);
  border-right: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  transform: rotate(45deg);
}
.clippy-text {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.clippy-close {
  pointer-events: auto;
  align-self: flex-end;
  margin: 0 4px -2px 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.clippy-close:hover { background: var(--pink); color: #fff; }

.clippy-pal {
  position: relative;
  margin-right: 18px;
  filter: drop-shadow(0 6px 14px rgba(56, 189, 248, 0.35));
  animation: clippy-bob 2.6s ease-in-out infinite;
}
.clippy-eyes { animation: clippy-blink 4s infinite; transform-origin: center; }
.clippy-pupil { animation: clippy-look 4s ease-in-out infinite; }

.clippy-sparkle {
  position: absolute;
  font-size: 14px;
  opacity: 0;
}
.clippy-sparkle.s1 { top: -6px; left: -6px; animation: clippy-twinkle 2.2s ease-in-out infinite; }
.clippy-sparkle.s2 { top: 12px; right: -10px; animation: clippy-twinkle 2.2s ease-in-out 0.7s infinite; }
.clippy-sparkle.s3 { bottom: 4px; left: -12px; animation: clippy-twinkle 2.2s ease-in-out 1.3s infinite; }

@keyframes clippy-in {
  0% { transform: translateY(40px) scale(0.7); opacity: 0; }
  60% { transform: translateY(-6px) scale(1.04); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes clippy-out {
  to { transform: translateY(30px) scale(0.85); opacity: 0; }
}
@keyframes clippy-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}
@keyframes clippy-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
@keyframes clippy-look {
  0%, 40% { transform: translateX(0); }
  55%, 80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}
@keyframes clippy-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(20deg); }
}
@media (prefers-reduced-motion: reduce) {
  .clippy.clippy--in,
  .clippy-pal,
  .clippy-eyes,
  .clippy-pupil,
  .clippy-sparkle { animation: none; }
  .clippy-sparkle { opacity: 0.9; }
}

/* ---- Hubot assistant (pops up over a text field) ---- */
.hubot {
  position: absolute;
  bottom: calc(100% - 12px);
  right: 0;
  z-index: 60;
  display: none;
  flex-direction: row;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}
.hubot.hubot--show { display: flex; }
.hubot.hubot--in { animation: hubot-in 0.55s cubic-bezier(0.18, 1.4, 0.4, 1) both; }
.hubot.hubot--out { animation: hubot-out 0.3s ease forwards; }

.hubot-bubble {
  position: relative;
  pointer-events: auto;
  align-self: center;
  max-width: 230px;
  background: linear-gradient(160deg, rgba(33, 33, 48, 0.96), rgba(20, 20, 30, 0.96));
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(246, 166, 35, 0.25),
    0 0 32px rgba(246, 166, 35, 0.25);
  backdrop-filter: blur(8px);
}
.hubot-bubble::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 16px;
  width: 16px;
  height: 16px;
  background: rgba(20, 20, 30, 0.96);
  border-right: 1px solid var(--panel-border);
  border-top: 1px solid var(--panel-border);
  transform: rotate(45deg);
}
.hubot-text {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.hubot-close {
  pointer-events: auto;
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 1;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.hubot-close:hover { background: #f6a623; color: #fff; }

.hubot-pal {
  position: relative;
  flex: none;
  filter: drop-shadow(0 6px 14px rgba(246, 166, 35, 0.4));
  animation: hubot-bob 2.6s ease-in-out infinite;
}
.hubot-wave {
  animation: hubot-pulse 1.4s ease-in-out infinite;
  transform-origin: center;
}

.hubot-sparkle {
  position: absolute;
  font-size: 14px;
  opacity: 0;
}
.hubot-sparkle.s1 { top: -6px; right: -4px; animation: clippy-twinkle 2.2s ease-in-out infinite; }
.hubot-sparkle.s2 { top: 18px; left: -10px; animation: clippy-twinkle 2.2s ease-in-out 0.7s infinite; }
.hubot-sparkle.s3 { bottom: 6px; right: -10px; animation: clippy-twinkle 2.2s ease-in-out 1.3s infinite; }

@keyframes hubot-in {
  0% { transform: translateY(30px) scale(0.7); opacity: 0; }
  60% { transform: translateY(-6px) scale(1.04); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes hubot-out {
  to { transform: translateY(24px) scale(0.85); opacity: 0; }
}
@keyframes hubot-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
@keyframes hubot-pulse {
  0%, 100% { transform: scaleY(0.6); opacity: 0.7; }
  50% { transform: scaleY(1.1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hubot.hubot--in,
  .hubot-pal,
  .hubot-wave,
  .hubot-sparkle { animation: none; }
  .hubot-sparkle { opacity: 0.9; }
}

/* ---------------------------------------------------------------------------
   Responsive: keep the submit form on a single screen (iPad + iPhone).
   The brand video + generous spacing can push the button below the fold,
   so we trim vertical rhythm on shorter / smaller viewports.
--------------------------------------------------------------------------- */

/* Trim the oversized bottom padding everywhere so the footer hugs content. */
.wrap {
  padding-bottom: 40px;
}

/* Phones (portrait) — tighten the stack so the CTA stays visible. */
@media (max-width: 560px) {
  .wrap {
    padding: 20px 16px 28px;
  }
  .brand-video {
    width: 40%;
    margin-bottom: 4px;
  }
  .brand .logo {
    font-size: 2.1rem;
  }
  .tagline {
    margin-bottom: 16px;
  }
  .card {
    padding: 18px;
  }
  .field {
    margin-bottom: 14px;
  }
  .footer {
    margin-top: 16px;
  }
}

/* Short viewports (e.g. iPad/phone landscape) — compress vertical rhythm so
   every element fits without scrolling. Height-based so it also helps any
   short window regardless of width. */
@media (max-height: 820px) {
  .wrap {
    padding-top: 16px;
    padding-bottom: 24px;
  }
  .brand {
    margin: 2px 0;
  }
  .brand-video {
    width: 28%;
    margin-bottom: 2px;
  }
  .brand .logo {
    font-size: 2rem;
  }
  .tagline {
    margin: 0 0 12px;
    font-size: 0.95rem;
  }
  .card {
    padding: 16px 20px;
  }
  .field {
    margin-bottom: 12px;
  }
  label.field-label {
    margin-bottom: 4px;
  }
  .input-row {
    padding: 4px 12px;
  }
  .input-row textarea {
    min-height: 40px;
  }
  .footer {
    margin-top: 14px;
  }
  .footer.credit {
    margin-top: 4px;
  }
}
