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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent-1: #8B5CF6;
  --accent-2: #3B82F6;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-lg: 20px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
  animation: gradientShift 15s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes gradientShift {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(2%, -2%) scale(1.02);
  }
  50% {
    transform: translate(-1%, 1%) scale(0.98);
  }
  75% {
    transform: translate(1%, 2%) scale(1.01);
  }
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.highlight {
  color: var(--accent-1);
  font-weight: 600;
}

/* ─── NAVBAR ─── */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(139, 92, 246, 0.12), 0 4px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link-accent {
  color: var(--accent-1);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.nav-link-accent:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-1);
}

.nav-ask-btn {
  margin-left: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
  display: none;
}

.nav-ask-btn:hover {
  opacity: 0.85;
}

/* ─── HAMBURGER ─── */

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.25s ease;
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── SPLIT LAYOUT ─── */

.split-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 73px;
  min-height: calc(100vh - 73px);
  position: relative;
  z-index: 1;
}

/* ─── HERO ─── */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.hero-content {
  text-align: center;
  max-width: 480px;
}

.profile-wrapper {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.profile-ring {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.35), 0 0 50px rgba(59, 130, 246, 0.15);
  animation: ringPulse 3s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.35), 0 0 50px rgba(59, 130, 246, 0.15); }
  50%       { box-shadow: 0 0 30px rgba(139, 92, 246, 0.55), 0 0 70px rgba(59, 130, 246, 0.25); }
}


.profile-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
}

.profile-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-title {
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: clamp(0.9375rem, 1.5vw, 1.125rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.break {
  display: block;
}

/* ─── SOCIAL LINKS ─── */

.social-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-link:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

/* ─── HERO CONTACTS ─── */

.hero-contacts {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.hero-contact-btn {
  flex: 1;
  max-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.hero-contact-btn:hover {
  border-color: rgba(139, 92, 246, 0.45);
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.07);
}

.hero-contact-btn--wa {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.hero-contact-btn--wa:hover {
  opacity: 0.88;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-color: transparent;
}

/* ─── CHAT ─── */

.chat-section {
  display: flex;
  align-items: center;
  padding: 2rem 3rem 2rem 0;
  min-height: 0;
}

.chat-container {
  width: 100%;
  max-width: 600px;
  height: 100%;
  max-height: calc(100vh - 140px);
  background: var(--bg-card);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.06), 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.08);
}

.chat-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 1;
}

.chat-box {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-box::-webkit-scrollbar {
  width: 6px;
}

.chat-box::-webkit-scrollbar-track {
  background: transparent;
}

.chat-box::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.chat-message {
  display: flex;
  max-width: 85%;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.msg-content {
  padding: 0.75rem 1.125rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.chat-message.bot .msg-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-message.bot .msg-content p {
  margin: 0 0 0.5em;
}

.chat-message.bot .msg-content p:last-child {
  margin-bottom: 0;
}

.chat-message.bot .msg-content ul,
.chat-message.bot .msg-content ol {
  margin: 0.25em 0;
  padding-left: 1.25em;
}

.chat-message.bot .msg-content li {
  margin-bottom: 0.25em;
}

.chat-message.bot .msg-content code {
  background: rgba(255,255,255,0.08);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}

.chat-message.bot .msg-content pre {
  background: #0d0d0d;
  padding: 0.75em 1em;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.5em 0;
}

.chat-message.bot .msg-content pre code {
  background: none;
  padding: 0;
}

.chat-message.bot .msg-content strong {
  font-weight: 600;
}

.chat-message.user .msg-content {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.chat-input-wrapper input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-wrapper input:focus {
  border-color: var(--accent-1);
}

.chat-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.chat-input-wrapper button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.chat-input-wrapper button:hover {
  opacity: 0.9;
}

.clear-btn {
  width: 40px !important;
  padding: 0 !important;
  font-size: 1rem;
  background: transparent !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  border-radius: var(--radius) !important;
  flex-shrink: 0;
}

.clear-btn:hover {
  color: #ff6b6b !important;
  border-color: #ff6b6b !important;
}

/* ─── FOOTER ─── */

.footer {
  text-align: center;
  padding: 1rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
  position: relative;
  z-index: 1;
}

/* ─── ANIMATIONS ─── */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .particle {
    display: none;
  }

  body::before {
    animation: none;
  }

  .profile-ring {
    animation: none;
  }
}

/* ─── TYPING INDICATOR ─── */

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ─── COPY BUTTON ─── */

.msg-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
}

.msg-wrapper:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.copy-btn.copied {
  border-color: #22c55e;
  color: #22c55e;
}

/* ─── PARTICLES ─── */

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(139, 92, 246, 0.4);
  border-radius: 50%;
  animation: float linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) translateX(var(--drift));
    opacity: 0;
  }
}

/* ─── RESPONSIVE ─── */

@media (max-width: 900px) {
  .split-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100svh;
    min-height: 100svh;
    padding-top: 65px;
    padding-bottom: 0.75rem;
    gap: 0.75rem;
    overflow: hidden;
  }

  .hero {
    padding: 1rem 1.5rem 0;
  }

  .profile-wrapper {
    margin-bottom: 0.75rem;
  }

  .profile-ring {
    width: 72px;
    height: 72px;
  }

  .hero-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }

  .hero-subtitle {
    font-size: 0.875rem;
    margin-bottom: 1rem;
  }

  .break {
    display: none;
  }

  .social-links {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .social-link {
    width: 34px;
    height: 34px;
    font-size: 0.8125rem;
  }

  .hero-contacts {
    flex-direction: row;
    gap: 0.625rem;
  }

  .hero-contact-btn {
    max-width: none;
    flex: 1;
    font-size: 0.8125rem;
    padding: 0.55rem 0.75rem;
  }

  .chat-section {
    padding: 0 1rem 0;
    min-height: 0;
    align-items: stretch;
  }

  .chat-container {
    height: 100%;
    max-height: 100%;
  }

  .hamburger {
    display: flex;
  }

  .nav-ask-btn {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
  }

  .nav-link-accent {
    border: none;
  }

  .nav-ask-btn {
    margin: 0.25rem 0 0;
    padding: 0.65rem 1rem;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .navbar {
    padding: 0.65rem 1rem;
  }

  .nav-status {
    font-size: 0.75rem;
  }

  .nav-avatar {
    width: 24px;
    height: 24px;
  }

  .hero {
    padding: 1.5rem 1rem 0.5rem;
  }

  .profile-wrapper {
    margin-bottom: 1rem;
  }

  .profile-ring {
    width: 80px;
    height: 80px;
  }

  .hero-title {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
  }

  .hero-subtitle {
    font-size: 0.8125rem;
    margin-bottom: 1rem;
  }

  .social-links {
    margin-bottom: 1rem;
  }

  .chat-box {
    padding: 1rem;
    gap: 0.75rem;
  }

  .chat-input-wrapper {
    padding: 0.75rem;
    gap: 0.4rem;
  }

  .chat-input-wrapper input {
    font-size: 0.875rem;
    padding: 0.6rem 0.75rem;
  }

  .chat-input-wrapper button {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
  }

  .clear-btn {
    width: 36px !important;
  }

  .chat-section {
    padding: 0 0.75rem 1.5rem;
  }

  .chat-container {
    max-height: 60vh;
  }

  .chat-message {
    max-width: 90%;
  }

  .social-links {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .social-link {
    width: 36px;
    height: 36px;
    font-size: 0.8125rem;
  }

  .break {
    display: none;
  }
}

@media (max-width: 400px) {
  .navbar {
    padding: 0.5rem 0.75rem;
  }

  .nav-logo {
    font-size: 1rem;
  }

  .nav-avatar {
    width: 20px;
    height: 20px;
  }

  .hero {
    padding: 1rem 0.75rem 0.25rem;
  }

  .profile-ring {
    width: 65px;
    height: 65px;
  }

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

  .hero-subtitle {
    font-size: 1rem;
  }

  .chat-input-wrapper {
    padding: 0.5rem;
  }

  .chat-input-wrapper input {
    font-size: 0.8125rem;
    padding: 0.5rem 0.6rem;
  }

  .chat-input-wrapper button {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .clear-btn {
    width: 32px !important;
    font-size: 0.75rem !important;
  }

  .chat-message {
    max-width: 95%;
  }
}
