/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
  --primary-color: #6366f1;
  --secondary-color: #a855f7;
  --accent-color: #ec4899;

  --dark-bg: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-glow: 0 0 20px rgba(99, 102, 241, 0.5);

  --bg-main: #020617;
  --bg-soft: #02091f;
  --accent-blue: #38bdf8;
  --accent-gold: #facc6b;

  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

/* ==========================================================================
   Base
   ========================================================================== */

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% -20%, #1d2660 0, transparent 55%),
    radial-gradient(circle at 90% -20%, #0f172a 0, transparent 55%),
    radial-gradient(circle at 50% 120%, #020617 0, #000 70%);
}

a {
  color: #fff;
  text-decoration: none;
}

img,
svg {
  vertical-align: middle;
  height: auto;
}

/* Typography */
h1,
h2,
h3,
h4,
.brand-font {
  font-family: "Space Grotesk", sans-serif;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, #fff 0%, var(--primary-color) 50%, var(--secondary-color) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Background canvas
   ========================================================================== */

#neural-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
}

/* ==========================================================================
   Glassmorphism
   ========================================================================== */

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.glass-nav {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-glow {
  position: relative;
  z-index: 1;
  overflow: hidden;

  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border: none;
  color: #fff;

  padding: 12px 30px;
  border-radius: 999px;
  font-weight: 600;

  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;

  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
  color: #fff;
}

.btn-glow:hover::before {
  opacity: 1;
}

/* Soft ghost button */
.btn-ghost-soft {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
  font-size: 0.82rem;
  padding-inline: 0.9rem;
}

.btn-ghost-soft:hover {
  background: rgba(15, 23, 42, 1);
  color: #f9fafb;
}

/* Primary glow button */
.btn-primary-glow {
  background: linear-gradient(120deg, #facc6b, #f97316);
  border: none;
  color: #111827;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 0.3rem 1.2rem rgba(248, 181, 52, 0.7), 0 0 12px rgba(250, 204, 21, 0.8);
}

.btn-primary-glow:hover {
  background: linear-gradient(120deg, #fde047, #f97316);
  color: #020617;
}

/* ==========================================================================
   Mockup phone chat
   ========================================================================== */

.mockup-phone {
  position: relative;
  overflow: hidden;

  height: 600px;
  background: #0f172a;

  border: 8px solid #334155;
  border-radius: 36px;

  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: perspective(1000px) rotateY(-10deg) rotateX(5deg);
  transition: transform 0.5s ease;
}

.mockup-phone:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 15px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 15px;

  height: 460px;
  padding: 20px;
  overflow-y: auto;
}

/* Chat scrollbar */
.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 3px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;

  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;

  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.message.received {
  align-self: flex-start;
  background: #334155;
  border-bottom-left-radius: 2px;
  color: #e2e8f0;
}

.message.sent {
  align-self: flex-end;
  background: var(--primary-color);
  border-bottom-right-radius: 2px;
  color: #fff;
}

.chat-input-area {
  position: absolute;
  bottom: 0;
  width: 100%;

  display: flex;
  gap: 10px;

  padding: 15px;
  background: #1e293b;
  border-top: 1px solid #334155;
}

/* Typing indicator */
.typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;

  border-radius: 999px;
  background-color: #94a3b8;

  animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ==========================================================================
   Persona cards
   ========================================================================== */

.persona-card {
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.persona-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
  border-color: var(--secondary-color);
}

.persona-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.persona-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.persona-card:hover .persona-img {
  transform: scale(1.1);
}

.persona-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0));
}

/* ==========================================================================
   Persona header + shell
   ========================================================================== */

.persona-header {
  height: 140px;
  background: radial-gradient(circle at top, #0b1120 0, #020617 70%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 0.7rem 2rem rgba(15, 23, 42, 0.9);
}

.persona-header-inner {
  max-width: 1100px;
}

.brand-title {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c7d2fe;
}

.avatar-glow {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 76px;
  height: 76px;
  padding: 3px;

  border-radius: 50%;
  background: conic-gradient(from 180deg, #38bdf8, #facc6b, #f97316, #6366f1, #38bdf8);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.75), 0 0 50px rgba(248, 250, 252, 0.25);
}

.avatar-glow img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;

  background: radial-gradient(circle, #020617 0, #111827 60%);
  border: 2px solid rgba(15, 23, 42, 0.9);
}

.synapse-label {
  font-size: 0.78rem;
  color: #9ca3af;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;

  padding: 0.15rem 0.65rem;
  border-radius: 999px;

  font-size: 0.75rem;
  color: #bbf7d0;

  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(34, 197, 94, 0.65);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8);
}

.status-dot {
  width: 9px;
  height: 9px;

  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3);
}

.persona-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f9fafb;
}

.persona-sub {
  font-size: 0.88rem;
  color: #cbd5f5;
}

.pill-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;

  border-radius: 999px;
  color: #e5e7eb;

  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

/* Content area with iFrame */
.content-shell {
  height: calc(100vh - 140px);
  padding: 1rem;
}

.content-shell-inner {
  height: 100%;
  margin: 0 auto;
  padding: 0.35rem;

  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.9);

  background: radial-gradient(circle at top, #02091f 0, #020617 55%);
  box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.95), 0 0 40px rgba(15, 23, 42, 0.9);
}

.content-shell-inner iframe {
  width: 100%;
  height: 100%;

  border-radius: 20px;
  border: 1px solid rgba(31, 41, 55, 0.9);

  background: radial-gradient(circle at top, #020617 0, #020617 50%);
}

/* ==========================================================================
   Layout helpers (safe-area + bottom scroll region)
   ========================================================================== */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh; /* proper on iPhone */
  height: 100vh; /* fallback */
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.top {
  /* intentionally empty */
}

.bottom {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Misc project-specific rules
   ========================================================================== */

.IconGrid {
  display: flex;
  gap: 20px;
  flex-wrap: nowrap !important;
  filter: invert(1);
}

.g-mb-30 {
  margin-bottom: 0 !important;
}

.Presonas {
  width: 50%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes typing {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0);
  }
}

.floating-icon {
  animation: float 6s ease-in-out infinite;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .mockup-phone {
    height: 500px;
    margin-top: 50px;
    transform: none;
  }

  .mockup-phone:hover {
    transform: none;
  }
}

@media (max-width: 576px) {
  body {
    padding-top: 0;
  }

  main.content-shell,
  .app-header,
  .chat-area,
  .input-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .persona-header {
    height: 150px;
  }

  .content-shell {
    height: calc(100vh - 150px);
    padding-inline: 0.6rem;
  }

  .brand-title {
    font-size: 0.8rem;
  }

  .persona-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .content-shell-inner,
  .chat-area,
  .input-container {
    padding: 0;
  }
}

