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

:root {
  --bg: #020617;
  --bg-soft: rgba(15, 23, 42, 0.9);
  --accent: #6366f1;
  --accent-strong: #a855f7;
  --accent-soft: rgba(129, 140, 248, 0.16);
  --accent-soft-alt: rgba(248, 113, 113, 0.2);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: rgba(148, 163, 184, 0.6);
  --radius-xl: 1.6rem;
  --shadow-soft: 0 20px 48px rgba(15, 23, 42, 0.95);
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top, #111827 0, transparent 55%),
    radial-gradient(circle at bottom, #020617 0, #000 60%);
  color: var(--text);
  overflow-x: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.bg-orbit {
  position: fixed;
  inset: auto;
  top: -180px;
  right: -180px;
  width: 340px;
  height: 340px;
  background: conic-gradient(
    from 140deg,
    rgba(56, 189, 248, 0.05),
    rgba(129, 140, 248, 0.45),
    rgba(236, 72, 153, 0.35),
    rgba(56, 189, 248, 0.05)
  );
  filter: blur(40px);
  opacity: 0.9;
  pointer-events: none;
  z-index: -1;
  animation: drift 26s linear infinite;
}

.bg-orbit.orbit-two {
  top: auto;
  bottom: -160px;
  left: -200px;
  right: auto;
  width: 380px;
  height: 380px;
  opacity: 0.8;
  animation-duration: 32s;
  animation-direction: reverse;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(40px, -30px, 0) rotate(180deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(360deg);
  }
}

.shell {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  padding: 1.4rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  animation: fade-in 0.7s ease-out both;
}

@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.35), transparent 65%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-orb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: radial-gradient(circle at 25% 25%, #f9fafb, var(--accent));
  box-shadow:
    0 0 18px rgba(129, 140, 248, 0.9),
    0 0 42px rgba(236, 72, 153, 0.7);
  position: relative;
  overflow: hidden;
  animation: pulse 2s ease-in-out infinite;
}

.brand-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(
    from 210deg,
    transparent 0 55%,
    rgba(248, 250, 252, 0.8) 60%,
    transparent 70% 100%
  );
  mix-blend-mode: screen;
  animation: spin 4s linear infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.brand-title {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chip {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.4rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  transition: 0.18s ease all;
}

.chip-soft {
  border-color: rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #020617);
}

.chip-soft:hover {
  border-color: rgba(148, 163, 184, 0.95);
  background: rgba(15, 23, 42, 0.98);
  transform: translateY(-1px);
}

.chip-primary {
  background: linear-gradient(135deg, #22c55e, var(--accent), var(--accent-strong));
  border-color: transparent;
  box-shadow:
    0 10px 26px rgba(56, 189, 248, 0.6),
    0 0 0 1px rgba(15, 23, 42, 0.95);
}

.chip-primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 14px 36px rgba(79, 70, 229, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.95);
}

.main {
  flex: 1;
  padding: 0.4rem 0 1.7rem;
  display: flex;
  align-items: center;
}

.typing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: stretch;
  width: 100%;
}

.hero-copy {
  padding: 1.8rem 1.35rem 1.7rem;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.22), transparent 60%),
    radial-gradient(circle at bottom right, rgba(190, 24, 93, 0.26), transparent 55%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.97), rgba(15, 23, 42, 0.93));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
  position: relative;
  overflow: hidden;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid transparent;
  background: conic-gradient(
    from 200deg,
    rgba(59, 130, 246, 0.3),
    rgba(236, 72, 153, 0.35),
    rgba(250, 204, 21, 0.25),
    rgba(59, 130, 246, 0.3)
  );
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1px;
  opacity: 0.8;
  pointer-events: none;
}

.hero-title {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 26rem;
  margin-bottom: 1.4rem;
}

.hero-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(209, 213, 219, 0.85);
}

.metric-bar {
  width: 100%;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.6);
  overflow: hidden;
  position: relative;
}

.metric-fill {
  width: 92%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, var(--accent), var(--accent-strong));
  position: relative;
  overflow: hidden;
}

.metric-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    120deg,
    rgba(248, 250, 252, 0.4),
    transparent 40%,
    transparent 60%,
    rgba(248, 250, 252, 0.5)
  );
  background-size: 180% 100%;
  mix-blend-mode: screen;
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -80% 0;
  }
  100% {
    background-position: 120% 0;
  }
}

.metric-value {
  font-size: 0.8rem;
  color: rgba(249, 250, 251, 0.9);
}

.metric-inline {
  gap: 0.55rem;
}

.metric-inline > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.metric-pill {
  font-size: 0.78rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.9);
  background: radial-gradient(circle at top, rgba(22, 163, 74, 0.65), #052e16);
  color: #bbf7d0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.95);
}

.metric-pill-soft {
  border-color: rgba(129, 140, 248, 0.9);
  background: radial-gradient(circle at top, rgba(129, 140, 248, 0.6), #020617);
  color: #e0e7ff;
}

.panel {
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.97)),
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.75);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.95);
  background: linear-gradient(
    to right,
    rgba(15, 23, 42, 0.98),
    rgba(15, 23, 42, 0.9)
  );
}

.panel-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.dot-red {
  background: #f97373;
}

.dot-amber {
  background: #fbbf24;
}

.dot-green {
  background: #22c55e;
}

.panel-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(156, 163, 175, 0.9);
  margin-left: 0.35rem;
}

.panel-body {
  padding: 1.15rem 1.05rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.26rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), #020617);
  color: rgba(209, 213, 219, 0.95);
}

.pill-soft {
  border-color: rgba(129, 140, 248, 0.9);
  background: radial-gradient(circle at top, rgba(129, 140, 248, 0.25), #020617);
}

.app-slot {
  border-radius: 1.2rem;
  padding: 0.95rem 0.95rem 1rem;
  background:
    radial-gradient(circle at top left, var(--accent-soft), transparent 60%),
    radial-gradient(circle at bottom, var(--accent-soft-alt), transparent 60%),
    rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.95);
}

.typing-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.typing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.1rem;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.typing-timer {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.96);
}

.typing-text {
  border-radius: 0.9rem;
  padding: 0.85rem 0.9rem;
  background:
    radial-gradient(circle at top left, rgba(129, 140, 248, 0.14), transparent 55%),
    rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e5e7eb;
  max-height: 140px;
  overflow-y: auto;
}

.typing-input {
  margin-top: 0.2rem;
  width: 100%;
  min-height: 90px;
  max-height: 140px;
  resize: vertical;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.8);
  padding: 0.75rem 0.9rem;
  background: rgba(15, 23, 42, 0.98);
  color: #e5e7eb;
  font-size: 0.9rem;
  outline: none;
  transition: 0.16s ease border, 0.16s ease box-shadow, 0.16s ease background, 0.16s ease transform;
}

.typing-input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.typing-input:focus {
  border-color: #6366f1;
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.85),
    0 14px 30px rgba(15, 23, 42, 0.98);
  background: #020617;
  transform: translateY(-1px);
}

.typing-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.stat-box {
  border-radius: 0.9rem;
  padding: 0.55rem 0.7rem;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), #020617);
  border: 1px solid rgba(148, 163, 184, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
}

.typing-actions {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.typing-actions .chip {
  font-size: 0.78rem;
  padding-inline: 0.9rem;
}

.btn-main {
  border-radius: 999px;
  border: none;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e, var(--accent), var(--accent-strong));
  color: #f9fafb;
  box-shadow:
    0 15px 36px rgba(56, 189, 248, 0.75),
    0 0 0 1px rgba(15, 23, 42, 0.95);
  transition: 0.16s ease transform, 0.16s ease box-shadow, 0.16s ease filter;
}

.btn-main:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 19px 46px rgba(79, 70, 229, 0.95),
    0 0 0 1px rgba(15, 23, 42, 0.95);
  filter: brightness(1.05);
}

.btn-main:active {
  transform: translateY(0) scale(0.97);
  box-shadow:
    0 11px 26px rgba(30, 64, 175, 0.95),
    0 0 0 1px rgba(15, 23, 42, 0.95);
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.45rem;
}

.footer {
  padding: 0.7rem 0.3rem 1.1rem;
  display: flex;
  justify-content: center;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-text strong {
  color: var(--text);
}

@media (max-width: 900px) {
  .typing-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    order: 1;
  }

  .panel {
    order: 2;
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 1rem 0.8rem 0.9rem;
  }

  .topbar {
    padding-inline: 0.9rem;
    padding-block: 0.75rem;
    border-radius: 1.4rem;
  }

  .brand-sub {
    display: none;
  }

  .hero-copy {
    padding: 1.45rem 1.05rem 1.4rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-sub {
    font-size: 0.86rem;
  }

  .panel-body {
    padding-inline: 0.9rem;
  }
}

@media (max-width: 480px) {
  .topbar {
    gap: 0.4rem;
  }

  .top-actions {
    gap: 0.25rem;
  }

  .chip {
    padding-inline: 0.65rem;
  }

  .typing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-slot {
    padding: 0.85rem 0.8rem 0.9rem;
  }
}
.footer{
  margin-top: 1.4rem;
  padding-bottom: 1rem;
  display: flex;
  justify-content: center;
  pointer-events: auto;
  animation: footerFadeIn 0.8s ease-out 0.2s both;
}

.footer-inner{
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at top left, rgba(129,140,248,0.2), transparent 55%),
    rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.6);
  box-shadow:
    0 0 0 1px rgba(15,23,42,1),
    0 0 28px rgba(79,70,229,0.55);
  backdrop-filter: blur(14px);
  font-size: 0.84rem;
  color: #9ca3af;
  animation: footerGlow 6s ease-in-out infinite;
}

.footer-label{
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: #64748b;
}

.footer .dot{
  color: #4b5563;
  font-size: 0.9rem;
}

.creator-link{
  position: relative;
  font-weight: 600;
  color: #a5b4fc;
  text-decoration: none;
  transition: transform 0.22s ease, color 0.22s ease;
  padding-inline: 2px;
}

/* underline + glow on hover */
.creator-link::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #22d3ee, #6366f1, #a855f7);
  transition: width 0.25s ease;
}

.creator-link:hover{
  color: #e5e7eb;
  transform: translateY(-1px);
  text-shadow:
    0 0 8px rgba(129,140,248,0.9),
    0 0 14px rgba(168,85,247,0.9);
}

.creator-link:hover::after{
  width: 100%;
}

/* subtle entrance + breathing glow */
@keyframes footerFadeIn{
  from{
    opacity: 0;
    transform: translateY(8px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes footerGlow{
  0%,100%{
    box-shadow:
      0 0 0 1px rgba(15,23,42,1),
      0 0 20px rgba(79,70,229,0.4);
  }
  50%{
    box-shadow:
      0 0 0 1px rgba(129,140,248,0.6),
      0 0 32px rgba(129,140,248,0.9);
  }
}

/* Mobile keyboard fixes */
@media (max-width: 768px) {
  /* Let the page start from the top instead of being centered */
  body {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .shell {
    min-height: 100dvh; /* dynamic viewport height, respects keyboard */
  }

  .main {
    align-items: flex-start;
  }

  /* Make sure we have some space at the bottom so input is not hidden */
  .panel-body {
    padding-bottom: 5rem;
  }
}
/* ================= MOBILE RESPONSIVE FIX ================= */

@media (max-width: 768px) {
    .topbar {
        flex-wrap: wrap;
        gap: .6rem;
        padding: .8rem 1rem;
    }

    .top-actions {
        display: flex;
        gap: .5rem;
        overflow-x: auto;        /* allow smooth scrolling */
        white-space: nowrap;
        padding-bottom: .3rem;
        scrollbar-width: none;  /* hide scrollbar (Firefox) */
    }

    .top-actions::-webkit-scrollbar {
        display: none;           /* hide scrollbar (Chrome) */
    }

    .user-profile {
        margin-left: auto;        /* stick to right side */
    }
}

/* Smaller screens (phones) */
@media (max-width: 480px) {
    .user-profile {
        padding: .35rem .8rem;
        font-size: .8rem;
    }

    .user-avatar {
        width: 26px;
        height: 26px;
    }

    .user-name {
        font-size: .8rem;
    }

    .pill, .chip {
        font-size: .75rem;
        padding: .3rem .65rem;
    }

    .hero-copy, .panel {
        margin-top: .5rem;
    }
}
