:root {
  --bg: #030303;
  --text: #f6f2ea;
  --muted: rgba(246, 242, 234, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --orb-orange: #ff7a1f;
  --orb-orange-deep: #d24d00;
  --orb-orange-glow: rgba(255, 122, 31, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  background: #000;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Outfit", sans-serif;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.03), transparent 18%),
    radial-gradient(circle at 28% 78%, rgba(255, 255, 255, 0.018), transparent 28%),
    linear-gradient(180deg, #000 0%, #020406 46%, #000 100%);
}

.space-field,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.space-field {
  overflow: hidden;
}

.warp-layer,
.nebula-haze {
  position: absolute;
  inset: -20%;
}

.warp-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  transform-origin: center;
}

.warp-layer-far {
  opacity: 0.12;
  filter: blur(0.45px);
}

.warp-layer-far::before {
  background-image:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 255, 255, 0.2) 49%, transparent 50%),
    linear-gradient(90deg, transparent 0 49%, rgba(255, 255, 255, 0.1) 50%, transparent 51%);
  background-size: 110px 280px, 150px 330px;
  animation: warpSlow 14s linear infinite;
}

.warp-layer-mid {
  opacity: 0.16;
}

.warp-layer-mid::before {
  background-image:
    linear-gradient(90deg, transparent 0 47%, rgba(255, 255, 255, 0.48) 48%, rgba(255, 255, 255, 0.04) 49%, transparent 56%),
    linear-gradient(88deg, transparent 0 46%, rgba(255, 255, 255, 0.24) 47%, transparent 52%);
  background-size: 70px 460px, 100px 520px;
  animation: warpMid 8s linear infinite;
}

.warp-layer-near {
  opacity: 0.18;
  filter: blur(0.7px);
}

.warp-layer-near::before {
  background-image:
    linear-gradient(90deg, transparent 0 46%, rgba(255, 255, 255, 0.66) 47%, rgba(255, 255, 255, 0.1) 49%, transparent 57%),
    linear-gradient(92deg, transparent 0 46%, rgba(255, 255, 255, 0.52) 47%, transparent 54%);
  background-size: 36px 760px, 56px 840px;
  animation: warpFast 4.4s linear infinite;
}

.nebula-haze {
  background:
    radial-gradient(circle at 52% 38%, rgba(255, 255, 255, 0.04), transparent 15%),
    radial-gradient(circle at 62% 62%, rgba(255, 255, 255, 0.018), transparent 20%),
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.012), transparent 17%);
  filter: blur(22px);
}

.grain {
  opacity: 0.04;
  background-image: repeating-radial-gradient(circle at 0 0, transparent 0, #fff 1px, transparent 2px);
}

.cosmos-shell,
.upload-shell {
  position: relative;
  z-index: 2;
  width: min(1180px, 96vw);
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.micro-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}

.mood-dots {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  margin-right: auto;
}

.mood-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.16rem 0.22rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.mood-dot-bullet {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 12px currentColor;
}

.mood-dot-label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
  transition: max-width 180ms ease, opacity 180ms ease;
}

.mood-dot[data-open="true"] .mood-dot-label {
  max-width: 8rem;
  opacity: 1;
}

.mood-dot[data-mood="fear"] { color: rgba(111, 201, 255, 0.92); }
.mood-dot[data-mood="anger"] { color: rgba(255, 107, 107, 0.92); }
.mood-dot[data-mood="grief"] { color: rgba(180, 158, 255, 0.92); }
.mood-dot[data-mood="sadness"] { color: rgba(124, 148, 255, 0.92); }
.mood-dot[data-mood="hope"] { color: rgba(148, 255, 205, 0.92); }
.mood-dot[data-mood="confusion"] { color: rgba(255, 214, 112, 0.92); }
.mood-dot[data-mood="longing"] { color: rgba(255, 170, 214, 0.92); }

.micro-nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.cosmos-stage {
  position: relative;
  min-height: calc(100vh - 3rem);
}

.hero-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(460px, 82vw);
  transform: translate(-50%, -50%);
  text-align: center;
}

.unsmiley-mark {
  position: relative;
  width: min(320px, 64vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 221, 173, 0.92), transparent 20%),
    radial-gradient(circle at 52% 48%, var(--orb-orange) 0%, rgba(242, 101, 17, 0.94) 36%, rgba(140, 39, 0, 0.94) 72%, rgba(50, 10, 0, 0.98) 100%),
    linear-gradient(180deg, rgba(255, 191, 128, 0.08), rgba(0, 0, 0, 0.1));
  box-shadow:
    inset 16px 18px 40px rgba(255, 236, 196, 0.22),
    inset -26px -30px 54px rgba(40, 6, 0, 0.52),
    0 0 54px var(--orb-orange-glow),
    0 30px 90px rgba(0, 0, 0, 0.6);
}

.unsmiley-mark::before {
  content: "";
  position: absolute;
  inset: -22%;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 231, 176, 0.18) 49%, transparent 50%),
    linear-gradient(90deg, transparent 0 49%, rgba(89, 18, 0, 0.22) 50%, transparent 51%),
    radial-gradient(circle at 38% 36%, rgba(255, 255, 255, 0.18), transparent 18%);
  background-size: 28px 210px, 52px 250px, auto;
  opacity: 0.62;
  mix-blend-mode: screen;
  animation: orbSpin 10s linear infinite;
}

.unsmiley-mark::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.3), transparent 22%),
    radial-gradient(circle at 70% 72%, rgba(0, 0, 0, 0.22), transparent 32%);
  filter: blur(10px);
  opacity: 0.9;
}

.unsmiley-eye,
.unsmiley-mouth {
  position: absolute;
  background: rgba(44, 8, 0, 0.96);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.18);
}

.unsmiley-eye {
  top: 34%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.unsmiley-eye-left {
  left: 31%;
}

.unsmiley-eye-right {
  right: 31%;
}

.unsmiley-mouth {
  left: 50%;
  top: 54%;
  width: 120px;
  height: 54px;
  transform: translateX(-50%);
  transform-origin: center top;
  border-radius: 100px 100px 0 0;
  clip-path: inset(0 0 50% 0);
  transition: transform 80ms linear;
}

.label {
  margin: 0 0 0.45rem;
  color: rgba(255, 255, 255, 0.78);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  font-size: 0.72rem;
}

h1,
h2 {
  font-family: "Special Elite", serif;
}

h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(2.1rem, 6vw, 4.6rem);
  line-height: 0.96;
}

.hotline-number {
  margin: 0 0 0.75rem;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.9);
}

.hero-copy p:last-child {
  margin: 0;
  color: var(--muted);
  max-width: 34ch;
  margin-inline: auto;
}

.orbital-feed {
  position: relative;
  min-height: calc(100vh - 3rem);
  perspective: 1400px;
  transform-style: preserve-3d;
}

.orbit-shell {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  animation: orbitAround var(--orbit-duration, 34s) linear infinite;
  animation-delay: var(--orbit-delay, 0s);
  transform-origin: center;
  transform-style: preserve-3d;
}

.orbit-shell:hover,
.orbit-shell:hover .orbit-card {
  animation-play-state: paused;
}

.orbit-shell.is-paused,
.orbit-shell.is-paused .orbit-card,
.orbit-shell.is-hover-paused,
.orbit-shell.is-hover-paused .orbit-card {
  animation-play-state: paused;
}

.orbit-card {
  width: var(--moon-size, min(240px, 28vw));
  aspect-ratio: 1 / 1;
  padding: 1rem 1rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.36), transparent 18%),
    radial-gradient(circle at 52% 52%, var(--moon-color, rgba(255, 255, 255, 0.22)) 0%, rgba(255, 255, 255, 0.08) 58%, rgba(0, 0, 0, 0.14) 100%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.12), transparent 58%);
  border: 1px solid var(--moon-border, rgba(255, 255, 255, 0.22));
  box-shadow:
    inset 12px 14px 30px rgba(255, 255, 255, 0.12),
    inset -18px -24px 34px rgba(0, 0, 0, 0.2),
    0 0 28px var(--moon-glow, rgba(255, 255, 255, 0.12)),
    0 0 64px color-mix(in srgb, var(--moon-glow, rgba(255, 255, 255, 0.12)) 80%, transparent),
    0 16px 44px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  transform:
    translateX(var(--orbit-radius, 330px))
    translateY(-50%)
    translateZ(var(--orbit-depth, 0px))
    scale(var(--orbit-scale, 1));
  animation:
    orbitCounter var(--orbit-duration, 34s) linear infinite,
    moonFloat var(--float-duration, 6s) ease-in-out infinite,
    moonSpin var(--spin-duration, 18s) linear infinite,
    moonGlowPulse var(--glow-duration, 5.6s) ease-in-out infinite;
  animation-delay: var(--orbit-delay, 0s);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.orbit-card[data-emotion="fear"] { --moon-color: rgba(59, 145, 255, 0.54); --moon-border: rgba(111, 201, 255, 0.84); --moon-glow: rgba(111, 201, 255, 0.4); }
.orbit-card[data-emotion="anger"] { --moon-color: rgba(255, 66, 66, 0.5); --moon-border: rgba(255, 107, 107, 0.84); --moon-glow: rgba(255, 94, 94, 0.42); }
.orbit-card[data-emotion="grief"] { --moon-color: rgba(130, 92, 255, 0.48); --moon-border: rgba(180, 158, 255, 0.82); --moon-glow: rgba(170, 154, 255, 0.42); }
.orbit-card[data-emotion="sadness"] { --moon-color: rgba(82, 109, 255, 0.48); --moon-border: rgba(124, 148, 255, 0.82); --moon-glow: rgba(124, 148, 255, 0.38); }
.orbit-card[data-emotion="hope"] { --moon-color: rgba(76, 218, 158, 0.46); --moon-border: rgba(148, 255, 205, 0.82); --moon-glow: rgba(148, 255, 205, 0.4); }
.orbit-card[data-emotion="confusion"] { --moon-color: rgba(255, 177, 30, 0.46); --moon-border: rgba(255, 214, 112, 0.82); --moon-glow: rgba(255, 214, 112, 0.4); }
.orbit-card[data-emotion="longing"] { --moon-color: rgba(255, 105, 180, 0.44); --moon-border: rgba(255, 170, 214, 0.82); --moon-glow: rgba(255, 170, 214, 0.38); }

.orbit-city {
  margin: 0;
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.96);
}

.orbit-meta {
  margin: 0.22rem 0 0;
  font-size: 0.62rem;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.orbit-transcript {
  display: none;
  margin-top: 0.35rem;
  padding-inline: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
  max-width: min(11ch, 72%);
  overflow-wrap: anywhere;
  text-wrap: balance;
  transform: scale(0.82);
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}

.orbit-card audio {
  display: none;
}

.orbit-card[data-active="true"] .orbit-city {
  display: none;
}

.orbit-card[data-active="true"] .orbit-meta {
  display: none;
}

.orbit-card[data-active="true"] .orbit-transcript {
  display: block;
}

.orbit-card[data-popping="true"] .orbit-transcript {
  transform: scale(1);
  opacity: 1;
}

.orbit-shell-1 { --orbit-radius: min(42vw, 430px); --orbit-duration: 38s; --orbit-delay: 0s; --orbit-depth: 80px; --orbit-scale: 1.06; --float-duration: 7s; }
.orbit-shell-2 { --orbit-radius: min(36vw, 370px); --orbit-duration: 32s; --orbit-delay: -6s; --orbit-depth: -60px; --orbit-scale: 0.9; --float-duration: 6s; }
.orbit-shell-3 { --orbit-radius: min(30vw, 300px); --orbit-duration: 28s; --orbit-delay: -11s; --orbit-depth: 120px; --orbit-scale: 1.12; --float-duration: 8s; }
.orbit-shell-4 { --orbit-radius: min(32vw, 340px); --orbit-duration: 35s; --orbit-delay: -17s; --orbit-depth: -90px; --orbit-scale: 0.86; --float-duration: 5.5s; }
.orbit-shell-5 { --orbit-radius: min(40vw, 410px); --orbit-duration: 41s; --orbit-delay: -23s; --orbit-depth: 50px; --orbit-scale: 1; --float-duration: 7.5s; }
.orbit-shell-6 { --orbit-radius: min(34vw, 350px); --orbit-duration: 30s; --orbit-delay: -27s; --orbit-depth: -120px; --orbit-scale: 0.82; --float-duration: 6.4s; }

.orbit-empty {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--muted);
}

.upload-panel {
  width: min(640px, 92vw);
  margin: 8vh auto 0;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(9, 12, 15, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.stack {
  display: grid;
  gap: 0.72rem;
}

label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

input[type="text"],
input[type="file"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 0.78rem;
  background: rgba(255, 255, 255, 0.05);
}

input::placeholder {
  color: rgba(245, 247, 250, 0.45);
}

button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.78rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #050607;
  background: linear-gradient(180deg, #ffffff 0%, #d7dde5 100%);
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.status {
  min-height: 1.2rem;
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

.status.error {
  color: #ffb1b1;
}

@keyframes warpSlow {
  from { transform: perspective(1000px) translateY(-120px) scaleY(0.8); opacity: 0.03; }
  to { transform: perspective(1000px) translateY(240px) scaleY(1.6); opacity: 0.01; }
}

@keyframes warpMid {
  from { transform: perspective(1000px) translateY(-240px) scaleY(0.2); opacity: 0.02; }
  10% { opacity: 0.28; }
  to { transform: perspective(1000px) translateY(560px) scaleY(4.4); opacity: 0.01; }
}

@keyframes warpFast {
  from { transform: perspective(1000px) translateY(-300px) scaleY(0.08); opacity: 0.01; }
  8% { opacity: 0.38; }
  to { transform: perspective(1000px) translateY(760px) scaleY(7.2); opacity: 0.01; }
}

@keyframes faceWarp {
  from { transform: translateY(-24%) scaleY(0.74); }
  to { transform: translateY(30%) scaleY(1.42); }
}

@keyframes orbSpin {
  from { transform: rotate(0deg) scale(1.02); }
  to { transform: rotate(360deg) scale(1.02); }
}

@keyframes orbitAround {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbitCounter {
  from {
    transform:
      translateX(var(--orbit-radius, 330px))
      translateY(-50%)
      translateZ(var(--orbit-depth, 0px))
      scale(var(--orbit-scale, 1))
      rotate(0deg);
  }
  to {
    transform:
      translateX(var(--orbit-radius, 330px))
      translateY(-50%)
      translateZ(var(--orbit-depth, 0px))
      scale(var(--orbit-scale, 1))
      rotate(-360deg);
  }
}

@keyframes moonFloat {
  0%, 100% {
    margin-top: -10px;
  }
  50% {
    margin-top: 10px;
  }
}

@keyframes moonSpin {
  from { filter: hue-rotate(0deg) saturate(1); }
  50% { filter: hue-rotate(-8deg) saturate(1.08); }
  to { filter: hue-rotate(0deg) saturate(1); }
}

@keyframes moonGlowPulse {
  0%, 100% {
    box-shadow:
      inset 12px 14px 30px rgba(255, 255, 255, 0.12),
      inset -18px -24px 34px rgba(0, 0, 0, 0.2),
      0 0 28px var(--moon-glow, rgba(255, 255, 255, 0.12)),
      0 0 52px color-mix(in srgb, var(--moon-glow, rgba(255, 255, 255, 0.12)) 72%, transparent),
      0 16px 44px rgba(0, 0, 0, 0.38);
  }
  50% {
    box-shadow:
      inset 12px 14px 30px rgba(255, 255, 255, 0.16),
      inset -18px -24px 34px rgba(0, 0, 0, 0.22),
      0 0 34px var(--moon-glow, rgba(255, 255, 255, 0.12)),
      0 0 78px color-mix(in srgb, var(--moon-glow, rgba(255, 255, 255, 0.12)) 88%, transparent),
      0 16px 44px rgba(0, 0, 0, 0.42);
  }
}

@media (max-width: 900px) {
  .micro-nav {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .mood-dots {
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
  }

  .cosmos-stage,
  .orbital-feed {
    min-height: auto;
  }

  .hero-core {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    margin: 2rem auto 1.2rem;
  }

  .orbital-feed {
    display: grid;
    gap: 1rem;
    padding-bottom: 2rem;
  }

  .orbit-shell,
  .orbit-card,
  .orbit-empty {
    position: relative;
    inset: auto;
    width: 100%;
    transform: none;
    animation: none;
  }

  .orbit-card {
    width: 100%;
    aspect-ratio: auto;
    border-radius: 18px;
    align-items: flex-start;
    text-align: left;
  }

  .orbit-empty {
    left: auto;
    bottom: auto;
  }
}

.unsmiley-mark.is-speaking .unsmiley-mouth {
  transform: translateX(-50%) scaleY(var(--mouth-open, 1.15));
}
