/* ===========================
   HEDONISM TEAM — Styles
   =========================== */
:root {
  --black: #171717;
  --white: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-400: #a3a3a3;
  --gray-700: #404040;
  --gray-900: #262626;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --font: 'Geist', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

.container { max-width: 1264px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 768px) { .container { padding: 0 16px; } }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex; align-items: center;
  padding: 12px 24px; background: var(--black); color: var(--white);
  border-radius: 8px; font-size: 15px; font-weight: 500;
  border: none; cursor: pointer;
  transition: transform 0.25s var(--spring), opacity 0.2s;
}
.btn-primary:hover { transform: scale(1.04); opacity: 0.88; }

.btn-secondary {
  display: inline-flex; align-items: center;
  padding: 12px 24px; background: transparent; color: var(--black);
  border-radius: 8px; font-size: 15px; font-weight: 500;
  border: 1px solid rgba(0,0,0,0.2); cursor: pointer;
  transition: transform 0.25s var(--spring), background 0.2s;
}
.btn-secondary:hover { background: rgba(0,0,0,0.05); transform: scale(1.03); }

.btn-light {
  display: inline-flex; align-items: center;
  padding: 12px 24px; background: var(--white); color: var(--black);
  border-radius: 8px; font-size: 15px; font-weight: 500;
  transition: transform 0.25s var(--spring), opacity 0.2s;
}
.btn-light:hover { transform: scale(1.03); }

.btn-outline-light {
  display: inline-flex; align-items: center;
  padding: 12px 24px; background: transparent; color: var(--white);
  border-radius: 8px; font-size: 15px; font-weight: 500;
  border: 1px solid rgba(255,255,255,0.3);
  transition: transform 0.25s var(--spring), background 0.2s;
}
.btn-outline-light:hover { background: rgba(255,255,255,0.1); transform: scale(1.03); }

.btn-dark {
  display: inline-flex; align-items: center;
  padding: 10px 20px; background: var(--black); color: var(--white);
  border-radius: 8px; font-size: 14px; font-weight: 500;
  transition: transform 0.25s var(--spring), opacity 0.2s;
}
.btn-dark:hover { transform: scale(1.03); opacity: 0.85; }

.btn-small {
  display: inline-flex; align-items: center;
  padding: 10px 20px; background: var(--white); color: var(--black);
  border-radius: 8px; font-size: 14px; font-weight: 500;
  transition: transform 0.25s var(--spring);
}
.btn-small:hover { transform: scale(1.03); }

.section-tag {
  display: inline-flex; padding: 6px 16px;
  border: 1px solid var(--gray-200); border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--gray-700); margin-bottom: 24px;
}
.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 400;
  line-height: 1.1; letter-spacing: -0.02em; color: var(--black);
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 0;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: rgba(250,250,250,0.85);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.3s, box-shadow 0.3s;
}
.navbar.scrolled {
  background: rgba(250,250,250,0.97);
  box-shadow: 0 1px 20px rgba(0,0,0,0.07);
}
.nav-container {
  max-width: 1264px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 14px; color: var(--gray-700); transition: color 0.2s; }
.nav-links a:hover { color: var(--black); }
.nav-links .btn-primary { color: var(--white); }

.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-burger span { display: block; width: 24px; height: 2px; background: var(--black); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-container { padding: 0 16px; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10,22,40,0.97);
    padding: 80px 32px 40px;
    gap: 0; z-index: 99;
    animation: navDown 0.35s var(--ease-out);
    overflow-y: auto;
  }
  .nav-links.open a {
    color: rgba(255,255,255,0.8) !important;
    font-size: 1.5rem !important;
    font-weight: 500;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: color 0.2s, padding-left 0.25s;
    display: block;
  }
  .nav-links.open a:hover { color: white !important; padding-left: 10px; }
  .nav-links.open .btn-primary {
    margin-top: 28px;
    background: white !important; color: #171717 !important;
    border-radius: 8px; text-align: center;
    font-size: 1rem !important; border-bottom: none !important;
    padding: 14px 24px !important; display: flex; justify-content: center;
  }
}
@keyframes navDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }

/* ===== HERO ===== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 140px 32px 100px; overflow: hidden;
}

/* Animated orbs */
.hero-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); pointer-events: none;
  animation: orbPulse 12s ease-in-out infinite alternate;
}
.hero-orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(168,204,255,0.55), transparent 65%);
  top: -250px; left: -150px; animation-delay: 0s;
}
.hero-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(210,180,255,0.45), transparent 65%);
  top: -100px; right: -100px; animation-delay: -4s;
}
.hero-orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(180,220,255,0.35), transparent 65%);
  bottom: -100px; left: 50%; transform: translateX(-50%);
  animation-delay: -8s;
}
@keyframes orbPulse {
  0%   { transform: translate(0,0) scale(1); }
  33%  { transform: translate(30px,-20px) scale(1.06); }
  66%  { transform: translate(-20px,15px) scale(0.97); }
  100% { transform: translate(15px,25px) scale(1.03); }
}

.hero-content { position: relative; max-width: 900px; margin: 0 auto; }

.hero-tag {
  display: inline-flex; padding: 6px 16px;
  border: 1px solid var(--gray-200); border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gray-700); margin-bottom: 40px;
  animation: fadeUp 0.7s var(--ease-out) 0.15s both;
}

/* Hero title — JS splits into .ht-word > .ht-char spans */
.hero-title {
  font-size: clamp(3.5rem, 10vw, 7.5rem);
  font-weight: 400; line-height: 1.0;
  letter-spacing: -0.03em; color: var(--black); margin-bottom: 32px;
}
.ht-word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.ht-char {
  display: inline-block;
  animation: charUp 0.6s var(--ease-out) both;
}
.ht-space { display: inline-block; width: 0.25em; }

@keyframes charUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-subtitle {
  font-size: clamp(1rem,2vw,1.2rem); line-height: 1.6;
  color: var(--gray-700); max-width: 600px; margin: 0 auto 48px;
  animation: fadeUp 0.7s var(--ease-out) 0.9s both;
}
.hero-buttons {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap;
  animation: fadeUp 0.7s var(--ease-out) 1.1s both;
}
.hero-scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  font-size: 22px; color: var(--gray-400);
  animation: fadeUp 0.5s ease 1.5s both, scrollBounce 2.5s ease 2s infinite;
}
@keyframes scrollBounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}
@keyframes fadeUp {
  from { opacity:0; transform: translateY(30px); }
  to { opacity:1; transform: translateY(0); }
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(55px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

.reveal-left  { opacity:0; transform: translateX(-55px); transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out); }
.reveal-left.in  { opacity:1; transform: none; }
.reveal-right { opacity:0; transform: translateX(55px);  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out); }
.reveal-right.in { opacity:1; transform: none; }
.reveal-fade  { opacity:0; transition: opacity 0.75s var(--ease-out); }
.reveal-fade.in  { opacity:1; }
.reveal-scale { opacity:0; transform:scale(0.9); transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out); }
.reveal-scale.in { opacity:1; transform:none; }

/* Stagger children */
.stagger > * {
  opacity: 0; transform: translateY(48px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
.stagger.in > *:nth-child(1) { transition-delay: 0s; }
.stagger.in > *:nth-child(2) { transition-delay: 0.09s; }
.stagger.in > *:nth-child(3) { transition-delay: 0.18s; }
.stagger.in > *:nth-child(4) { transition-delay: 0.27s; }
.stagger.in > * { opacity:1; transform:none; }

/* ===== FEATURES ===== */
.features { padding: 140px 0; }
.features-grid {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 20px; margin-top: 60px;
}
@media (max-width: 768px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  border: 1px solid var(--gray-200); border-radius: 20px; padding: 44px;
  background: var(--white); position: relative; overflow: hidden;
  transition: transform 0.4s var(--spring), box-shadow 0.4s, border-color 0.3s;
  cursor: default;
}
.feature-card::after {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(circle 300px at var(--mx,50%) var(--my,50%), rgba(168,204,255,0.18), transparent 70%);
  transition: opacity 0.4s; pointer-events: none;
}
.feature-card:hover::after { opacity: 1; }
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 50px rgba(0,0,0,0.09), 0 0 0 1px rgba(168,204,255,0.35);
  border-color: rgba(168,204,255,0.5);
}
.feature-icon { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--gray-400); margin-bottom: 24px; }
.feature-card h4 { font-size: 1.35rem; font-weight: 500; margin-bottom: 12px; letter-spacing: -0.01em; }
.feature-card p { font-size: 0.95rem; line-height: 1.65; color: var(--gray-700); }

/* ===== MANIFEST ===== */
.manifest {
  position: relative; background: var(--gray-900);
  padding: 140px 0; overflow: hidden;
}
.manifest-orb {
  position: absolute; border-radius: 50%; filter: blur(100px); pointer-events: none;
}
.manifest-orb-1 {
  width: 700px; height: 700px; bottom: -300px; right: -150px;
  background: radial-gradient(circle, rgba(100,50,200,0.4), transparent 65%);
  animation: orbPulse 20s ease-in-out infinite alternate;
}
.manifest-orb-2 {
  width: 400px; height: 400px; top: -100px; left: -80px;
  background: radial-gradient(circle, rgba(50,100,220,0.3), transparent 65%);
  animation: orbPulse 15s ease-in-out infinite alternate-reverse;
}
.manifest-inner {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: center;
}
@media (max-width: 900px) { .manifest-inner { grid-template-columns: 1fr; gap: 40px; } }

.manifest-tag {
  display: inline-flex; padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 24px;
}

/* Manifest big text — chars animate via JS */
.manifest-text {
  font-size: clamp(3.5rem, 8vw, 6rem); font-weight: 400;
  line-height: 1.05; letter-spacing: -0.02em; color: rgba(255,255,255,0.14);
}
.mt-char {
  display: inline-block;
  opacity: 0; transform: translateY(80%) rotateX(-25deg);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.mt-space { display: inline-block; width: 0.3em; }
.manifest-text.in .mt-char { opacity: 1; transform: none; }

.manifest-body p { font-size: 1.05rem; line-height: 1.7; color: rgba(255,255,255,0.6); margin-bottom: 40px; }
.manifest-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ===== PROJECTS / CAROUSEL ===== */
.projects { padding: 140px 0; }
.carousel-wrapper { margin-top: 60px; overflow: hidden; }
.carousel {
  display: flex; gap: 20px;
  will-change: transform; cursor: grab; user-select: none;
  transition: transform 0.55s cubic-bezier(0.25,1,0.35,1);
}
.carousel.dragging { transition: none; cursor: grabbing; }

.carousel-item {
  flex: 0 0 65%; max-width: 862px; min-height: 480px;
  border-radius: 20px; overflow: hidden;
  position: relative; background: var(--gray-900);
  transition: opacity 0.5s, transform 0.5s var(--spring), box-shadow 0.4s;
  opacity: 0.7; transform: scale(0.96);
}
.carousel-item.active { opacity: 1; transform: scale(1); }
.carousel-item:hover { box-shadow: 0 24px 60px rgba(0,0,0,0.25); }

@media (max-width: 768px) { .carousel-item { flex: 0 0 90%; min-height: 340px; } }

.carousel-bg {
  position: absolute; inset: 0;
  transition: transform 8s ease;
}
.carousel-item.active .carousel-bg { transform: scale(1.04); }

.carousel-content {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.5) 55%, transparent 100%);
}
.carousel-content h5 { font-size: 1.2rem; font-weight: 700; color: var(--white); margin-bottom: 8px; letter-spacing: -0.01em; }
.carousel-content p { font-size: 0.9rem; color: rgba(255,255,255,0.65); line-height: 1.5; margin-bottom: 24px; }

.carousel-dots { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 28px; }
.carousel-dot {
  height: 5px; border-radius: 3px; background: var(--gray-200);
  cursor: pointer; border: none; width: 36px; outline: none;
  transition: width 0.4s cubic-bezier(0.76,0,0.24,1), background 0.4s;
}
.carousel-dot.active { background: var(--black); width: 86px; }

/* ===== BLOG ===== */
.blog { padding: 140px 0; background: var(--gray-100); }
.blog-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 40px 0 48px; flex-wrap: wrap; gap: 16px;
  border-bottom: 1px solid var(--gray-200); padding-bottom: 16px;
}
.blog-tabs { display: flex; }
.blog-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 16px; font-size: 14px; color: var(--gray-400);
  cursor: pointer; transition: color 0.2s, border-color 0.2s; font-family: var(--font);
}
.blog-tab.active { color: var(--black); border-bottom-color: var(--black); }
.blog-tab:hover { color: var(--black); }
.blog-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  background: var(--white); border-radius: 12px; overflow: hidden;
  display: block; transition: transform 0.4s var(--spring), box-shadow 0.4s;
}
.blog-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,0.1); }
.blog-card-img { width: 100%; aspect-ratio: 16/10; transition: transform 7s ease; }
.blog-card:hover .blog-card-img { transform: scale(1.04); }
.blog-card-info { padding: 20px; }
.blog-card-info h3 { font-size: 1rem; font-weight: 500; line-height: 1.4; color: var(--black); margin-bottom: 8px; }
.blog-date { font-size: 0.8rem; color: var(--gray-400); }

/* ===== FAQ ===== */
.faq { padding: 140px 0; }
.faq-inner { max-width: 860px; margin: 0 auto; }
.faq-list { margin-top: 60px; }
.faq-item { border-bottom: 1px solid var(--gray-200); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 24px 0; background: none; border: none; cursor: pointer;
  font-family: var(--font); text-align: left; gap: 16px;
}
.faq-question span { font-size: 1rem; font-weight: 500; color: var(--black); line-height: 1.4; }
.faq-icon {
  width: 32px; height: 32px; border-radius: 50%; background: var(--black); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 300; flex-shrink: 0;
  transition: transform 0.35s var(--spring);
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease-out); }
.faq-answer p { font-size: 0.95rem; line-height: 1.7; color: var(--gray-700); padding-bottom: 24px; }

/* ===== FOOTER ===== */
.footer { background: var(--gray-900); padding: 80px 0 40px; }
.footer-inner { max-width: 1264px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 768px) { .footer-inner { padding: 0 16px; } }
.footer-top {
  display: grid; grid-template-columns: 1fr 2fr; gap: 80px;
  padding-bottom: 60px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
@media (max-width: 900px) { .footer-top { grid-template-columns: 1fr; gap: 40px; } }
.footer-logo { font-size: 20px; font-weight: 700; color: var(--white); margin-bottom: 32px; letter-spacing: -0.02em; }
.footer-subscribe { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-subscribe input {
  flex: 1; min-width: 180px; padding: 12px 16px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; font-size: 14px; color: var(--white);
  font-family: var(--font); outline: none; transition: border-color 0.2s;
}
.footer-subscribe input::placeholder { color: rgba(255,255,255,0.28); }
.footer-subscribe input:focus { border-color: rgba(255,255,255,0.28); }
.footer-subscribe button {
  padding: 12px 20px; background: var(--white); color: var(--black);
  border: none; border-radius: 8px; font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: var(--font);
  transition: transform 0.25s var(--spring), opacity 0.2s;
}
.footer-subscribe button:hover { transform: scale(1.03); opacity: 0.9; }
.footer-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; }
@media (max-width: 600px) { .footer-links { grid-template-columns: 1fr 1fr; } }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col-title { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.footer-col a { font-size: 14px; color: rgba(255,255,255,0.4); transition: color 0.2s; }
.footer-col a:hover { color: rgba(255,255,255,0.9); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 32px; flex-wrap: wrap; gap: 16px;
}
.footer-policies { display: flex; gap: 24px; }
.footer-policies a { font-size: 13px; color: rgba(255,255,255,0.28); transition: color 0.2s; }
.footer-policies a:hover { color: rgba(255,255,255,0.7); }
.footer-copy { font-size: 13px; color: rgba(255,255,255,0.22); }

/* ===== SUPPORT BUTTON ===== */
.support-btn {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 64px; height: 64px;
  border-radius: 50%;
  cursor: pointer; z-index: 999;
  overflow: visible;
  animation: supportAppear 0.6s cubic-bezier(0.34,1.56,0.64,1) 1.5s both;
}
@keyframes supportAppear {
  from { opacity:0; transform: scale(0) translateY(20px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
.support-btn img {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover; object-position: center top;
  display: block;
  border: 3px solid rgba(255,255,255,0.9);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s;
}
.support-btn:hover img {
  transform: scale(1.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 4px rgba(255,180,80,0.5);
}
.support-pulse {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255,180,80,0.6);
  animation: supportPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes supportPulse {
  0%   { transform: scale(1);    opacity: 0.7; }
  70%  { transform: scale(1.38); opacity: 0; }
  100% { transform: scale(1.38); opacity: 0; }
}
/* tooltip removed */
@media (max-width: 768px) {
  .support-btn { bottom: 20px; right: 20px; width: 56px; height: 56px; }
  .support-btn img { width: 56px; height: 56px; }
}

/* ===== HERO TITLE SMALL ===== */
.hero-title-sm {
  font-size: clamp(1.5rem, 4.5vw, 3.5rem) !important;
}

/* ===== CHAT POPUP ===== */
.chat-popup {
  position: fixed;
  bottom: 108px; right: 32px;
  width: 360px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 998;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  transition: transform 0.35s cubic-bezier(0.34,1.4,0.64,1), opacity 0.3s;
  font-family: var(--font);
}
.chat-popup.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #6020c0, #a040ff);
  color: white;
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,255,255,0.6);
}
.chat-name { font-size: 15px; font-weight: 600; }
.chat-status { font-size: 12px; opacity: 0.85; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.chat-online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; display: inline-block;
  box-shadow: 0 0 6px rgba(74,222,128,0.8);
}
.chat-close {
  background: rgba(255,255,255,0.2); border: none; color: white;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.chat-close:hover { background: rgba(255,255,255,0.35); }

.chat-messages {
  flex: 1; padding: 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 320px; min-height: 200px;
  background: #f8f7fc;
}
.chat-msg { display: flex; align-items: flex-end; gap: 8px; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.chat-bubble {
  max-width: 80%; padding: 10px 14px;
  border-radius: 16px; font-size: 14px; line-height: 1.5;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  color: #222;
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, #7030d0, #a040ff);
  color: white; border-radius: 16px 16px 4px 16px;
}
.chat-msg.bot .chat-bubble { border-radius: 16px 16px 16px 4px; }

/* Typing indicator */
.chat-typing .chat-bubble {
  display: flex; gap: 4px; align-items: center; padding: 12px 16px;
}
.chat-typing .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #a040ff; opacity: 0.5;
  animation: typingDot 1.2s ease-in-out infinite;
}
.chat-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

.chat-input-area {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-top: 1px solid #eee; background: white;
}
.chat-input {
  flex: 1; border: 1px solid #e0e0e0; border-radius: 20px;
  padding: 10px 16px; font-size: 14px; font-family: var(--font);
  outline: none; transition: border-color 0.2s;
  color: #222;
}
.chat-input:focus { border-color: #a040ff; }
.chat-send {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #7030d0, #a040ff);
  border: none; cursor: pointer; color: white;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
}
.chat-send:hover { transform: scale(1.1); opacity: 0.9; }

@media (max-width: 480px) {
  .chat-popup { width: calc(100vw - 48px); right: 16px; bottom: 90px; }
}
