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

html, body {
  width: 100%;
  height: 100%;
  background: #160d26;
  overflow: hidden;
  cursor: default;
}

/* Visually-hidden label, still read by screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Animated mesh gradient around #3b2464 (lighter + darker shades).
   Layered radial blobs drift while the whole sheet pans for a soft,
   modern, always-moving backdrop. */
#gradient {
  position: fixed;
  inset: -20%;                 /* oversize so drifting never reveals edges */
  z-index: 0;
  background-color: #050309;
  background-image:
    radial-gradient(38% 48% at 18% 22%, #341f59 0%, transparent 60%),   /* purple highlight */
    radial-gradient(40% 50% at 82% 18%, #161b42 0%, transparent 58%),   /* cool blue hint   */
    radial-gradient(46% 56% at 72% 82%, #3a2351 0%, transparent 58%),   /* purple           */
    radial-gradient(34% 44% at 26% 80%, #2f1a28 0%, transparent 56%),   /* warm hint        */
    radial-gradient(42% 52% at 30% 55%, #1d1133 0%, transparent 60%),   /* purple mid       */
    radial-gradient(44% 52% at 8% 60%,  #040208 0%, transparent 58%),   /* dark pocket L    */
    radial-gradient(48% 56% at 92% 70%, #040207 0%, transparent 60%),   /* dark pocket R    */
    radial-gradient(42% 50% at 60% 12%, #030106 0%, transparent 58%),   /* dark pocket top  */
    radial-gradient(40% 48% at 45% 92%, #040208 0%, transparent 56%),   /* dark pocket bot  */
    radial-gradient(36% 44% at 95% 35%, #030106 0%, transparent 54%),   /* dark pocket R-up */
    radial-gradient(60% 70% at 55% 50%, #140c26 0%, transparent 72%);   /* deep purple wash */
  background-size: 190% 190%;
  animation: drift 38s ease-in-out infinite alternate;
  filter: saturate(0.95) brightness(0.82);
}

@keyframes drift {
  0%   { background-position:   0%   0%; }
  25%  { background-position: 100%  20%; }
  50%  { background-position:  60% 100%; }
  75%  { background-position:  20%  70%; }
  100% { background-position: 100% 100%; }
}

/* Soft glow that sits behind the Clumo video at the bottom-middle,
   gently breathing so the character looks like he's glowing. */
#glow {
  position: fixed;
  left: 50%;
  bottom: -8%;
  transform: translateX(-50%);
  width: 44vw;
  height: 44vw;
  max-width: 640px;
  max-height: 640px;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
    rgba(173, 130, 255, 0.55) 0%,
    rgba(123, 76, 200, 0.35) 35%,
    rgba(59, 36, 100, 0.18) 60%,
    transparent 75%);
  filter: blur(40px);
  mix-blend-mode: screen;
  animation: breathe 4.5s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(0.96); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.06); }
}

#canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
}

.overlay {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 3;
}

#hint { bottom: 24px; }

#loader {
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
}

/* ---- Top-middle UI: title, description, minimal login ---- */
#ui {
  position: fixed;
  top: clamp(104px, 21vh, 236px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(92vw, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: "Jost", system-ui, -apple-system, sans-serif;
  color: #f4f1fb;
}

.brand {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(48px, 9vw, 84px);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-indent: 0.22em;          /* balance the trailing letter-spacing */
  line-height: 1;
  color: #ffffff;
}

.tagline {
  margin-top: 14px;
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: rgba(244, 241, 251, 0.62);
  max-width: 30ch;
}

.login {
  margin-top: 34px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Input + leading icon */
.field-wrap { position: relative; width: 100%; }
.field-wrap .icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(244, 241, 251, 0.45);
  pointer-events: none;
  transition: color 200ms ease;
}
.field-wrap:focus-within .icon { color: rgba(157, 134, 255, 0.95); }

.field {
  width: 100%;
  height: 54px;
  padding: 0 18px 0 50px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 300;
  color: #f4f1fb;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  outline: none;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
.field::placeholder { color: rgba(244, 241, 251, 0.42); }
.field:hover { border-color: rgba(255, 255, 255, 0.22); }
.field:focus {
  border-color: rgba(157, 134, 255, 0.7);
  background: rgba(157, 134, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(157, 134, 255, 0.16);
}

.submit {
  width: 100%;
  height: 54px;
  margin-top: 4px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(100deg, #a78bff 0%, #8b5cf6 100%);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: filter 200ms ease, box-shadow 200ms ease, opacity 200ms ease;
}
.submit:hover { filter: brightness(1.08); box-shadow: 0 8px 28px rgba(139, 92, 246, 0.45); }
.submit:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.submit:disabled { opacity: 0.6; cursor: default; box-shadow: none; filter: none; }

.alt {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: rgba(244, 241, 251, 0.5);
}
.alt a { color: rgba(157, 134, 255, 0.98); text-decoration: none; cursor: pointer; }
.alt a:hover { color: #bba8ff; }

#formMsg {
  min-height: 16px;
  font-size: 12.5px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: rgba(157, 134, 255, 0.98);
}

@media (prefers-reduced-motion: reduce) {
  #gradient, #glow { animation: none !important; }
  * { transition-duration: 1ms !important; }
}

/* ============================================================
   Dashboard (app.html) — post-login page in the Clumo style
   ============================================================ */
body.app { overflow-y: auto; }

.app-shell {
  position: relative;
  z-index: 5;
  width: min(94vw, 1320px);
  margin: 0 auto;
  padding: clamp(22px, 4vh, 44px) 0 80px;
  font-family: "Jost", system-ui, -apple-system, sans-serif;
  color: #f4f1fb;
}

/* Profile sits at the top, centered above the two side columns. */
.app-shell .profile { max-width: 600px; margin: 0 auto; }

/* Two side columns with a clear gap in the middle for the Clumo video.
   Stacks to a single column on narrow screens (Clumo sits behind). */
.app-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 clamp(24px, 5vw, 48px);
  align-items: start;
  margin-top: clamp(24px, 4vh, 40px);
}
@media (min-width: 1000px) {
  .app-columns {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 30vw, 460px) minmax(0, 1fr);
  }
  .col-left  { grid-column: 1; }
  .col-right { grid-column: 3; }
  .col-left .section-title:first-of-type,
  .col-right .section-title:first-of-type { margin-top: 0; }
}

/* Cards stacked vertically inside a column. */
.stack { display: flex; flex-direction: column; gap: 16px; }

/* Top bar */
.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(28px, 5vh, 48px);
}
.app-top .brand { font-size: clamp(26px, 4vw, 34px); }

.ghost-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(244, 241, 251, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 9px 16px;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}
.ghost-btn:hover {
  border-color: rgba(157, 134, 255, 0.6);
  color: #fff;
  background: rgba(157, 134, 255, 0.08);
}

/* Glass card */
.card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: clamp(22px, 3vw, 30px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.section-title {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 241, 251, 0.55);
  margin: clamp(34px, 5vh, 48px) 0 16px;
}
.section-title:first-of-type { margin-top: 0; }

/* Profile card */
.profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}
.avatar {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Outfit", sans-serif;
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #a78bff 0%, #8b5cf6 100%);
}
.profile-info { flex: 1 1 200px; min-width: 0; }
.profile-name { font-size: 20px; font-weight: 500; line-height: 1.2; }
.profile-email {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 300;
  color: rgba(244, 241, 251, 0.55);
  word-break: break-all;
}
.profile-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.stat {
  text-align: center;
  min-width: 96px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(157, 134, 255, 0.07);
  border: 1px solid rgba(157, 134, 255, 0.18);
}
.stat-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 241, 251, 0.5);
}
.stat-value {
  margin-top: 4px;
  font-family: "Outfit", sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
}
.tier-badge { color: #c9b8ff; }

/* Download */
.download-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.download-card p {
  font-size: 13px;
  font-weight: 300;
  color: rgba(244, 241, 251, 0.6);
  margin-top: 4px;
}
.download-card h3 { font-family: "Outfit", sans-serif; font-weight: 500; font-size: 18px; }

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(100deg, #a78bff 0%, #8b5cf6 100%);
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  cursor: pointer;
  transition: filter 200ms ease, box-shadow 200ms ease;
}
.pill-btn:hover { filter: brightness(1.08); box-shadow: 0 8px 28px rgba(139, 92, 246, 0.4); }
.pill-btn .icon { width: 18px; height: 18px; }

/* Card grids */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tier {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.tier.current { border-color: rgba(157, 134, 255, 0.55); background: rgba(157, 134, 255, 0.06); }
.tier-name { font-family: "Outfit", sans-serif; font-size: 18px; font-weight: 600; }
.tier-price { font-size: 13px; font-weight: 300; color: rgba(244, 241, 251, 0.6); }
.tier-price b { font-family: "Outfit", sans-serif; font-size: 26px; font-weight: 600; color: #fff; }
.tier-feats {
  list-style: none;
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.tier-feats li {
  font-size: 13px;
  font-weight: 300;
  color: rgba(244, 241, 251, 0.72);
  padding-left: 22px;
  position: relative;
}
.tier-feats li::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(157, 134, 255, 0.25);
  box-shadow: inset 0 0 0 2px rgba(157, 134, 255, 0.7);
}
.current-tag {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c9b8ff;
  background: rgba(157, 134, 255, 0.14);
  border: 1px solid rgba(157, 134, 255, 0.4);
  border-radius: 999px;
  padding: 4px 10px;
}

.soft-btn {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: rgba(157, 134, 255, 0.16);
  border: 1px solid rgba(157, 134, 255, 0.4);
  border-radius: 12px;
  padding: 11px;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.soft-btn:hover { background: rgba(157, 134, 255, 0.26); }
.soft-btn:disabled { opacity: 0.5; cursor: default; }

.credit-pack { text-align: center; align-items: center; display: flex; flex-direction: column; gap: 6px; }
.credit-amt { font-family: "Outfit", sans-serif; font-size: 30px; font-weight: 600; color: #fff; }
.credit-amt span { font-size: 13px; font-weight: 300; color: rgba(244, 241, 251, 0.55); display: block; }
.credit-price { font-size: 14px; font-weight: 300; color: rgba(244, 241, 251, 0.7); margin-bottom: 6px; }

/* Toast / notice */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  z-index: 50;
  font-family: "Jost", sans-serif;
  font-size: 14px;
  color: #f4f1fb;
  background: rgba(40, 26, 66, 0.92);
  border: 1px solid rgba(157, 134, 255, 0.4);
  border-radius: 14px;
  padding: 13px 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.app-loading {
  text-align: center;
  color: rgba(244, 241, 251, 0.5);
  font-size: 14px;
  padding: 40px 0;
}
