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

:root {
  --bg: #0D1B2A;
  --bg-card: rgba(13, 27, 42, 0.45);
  --bg-overlay: rgba(13, 27, 42, 0.7);
  --accent: #4ECDC4;
  --accent-rgb: 78, 205, 196;
  --accent-secondary: #3BA8A0;
  --text: #FFFFFF;
  --text-secondary: #8899AA;
  --nav-active-bg: rgba(78, 205, 196, 0.12);
  --nav-active-border: rgba(78, 205, 196, 0.4);
  --nav-hover-bg: rgba(78, 205, 196, 0.08);
  --text-dim: #8899AA;
  --border: rgba(78, 205, 196, 0.2);
}

[data-theme="tech"] {
  --bg: #0a0a0f;
  --bg-card: rgba(10, 10, 15, 0.45);
  --bg-overlay: rgba(10, 10, 15, 0.7);
  --accent: #7c6ff7;
  --accent-rgb: 124, 111, 247;
  --accent-secondary: #3b82f6;
  --text: #FFFFFF;
  --text-dim: #8888a0;
  --border: rgba(124, 111, 247, 0.2);
}

[data-theme="cases"] {
  --bg: #0a0f0d;
  --bg-card: rgba(10, 15, 13, 0.45);
  --bg-overlay: rgba(10, 15, 13, 0.7);
  --accent: #10b981;
  --accent-rgb: 16, 185, 129;
  --accent-secondary: #059669;
  --text: #FFFFFF;
  --text-dim: #88a09a;
  --border: rgba(16, 185, 129, 0.2);
}

[data-theme="career"] {
  --bg: #0f0a00;
  --bg-card: rgba(15, 10, 0, 0.45);
  --bg-overlay: rgba(15, 10, 0, 0.7);
  --accent: #f59e0b;
  --accent-rgb: 245, 158, 11;
  --accent-secondary: #d97706;
  --text: #FFFFFF;
  --text-dim: #a09070;
  --border: rgba(245, 158, 11, 0.2);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 0.6s ease;
}

/* ── Particle Background (full page) ── */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-particles canvas {
  width: 100%;
  height: 100%;
}

/* ── Scanlines ── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ── Chat Container ── */
.chat-container {
  position: relative;
  z-index: 2;
  width: 520px;
  max-width: 95vw;
  height: 700px;
  max-height: calc(100dvh - 90px);
  max-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 20px;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .chat-container {
    max-height: calc(100dvh - 90px);
  }
}

/* ── GIF Background inside chat ── */
.chat-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: 20px;
}

.chat-bg .bg-gif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2s ease;
}

.chat-bg .bg-gif.active {
  opacity: 1;
}

.chat-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bg-overlay);
  pointer-events: none;
}

/* ── Header (hidden) ── */
.chat-header {
  display: none;
}

.agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3);
}

.agent-avatar svg {
  width: 22px;
  height: 22px;
  fill: white;
}

.agent-info h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.agent-info .status {
  font-size: 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--accent); }
  50% { opacity: 0.5; box-shadow: 0 0 12px var(--accent); }
}

/* ── Theme Switcher ── */
.theme-switcher {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.theme-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.5;
}

.theme-btn:hover { opacity: 0.8; transform: scale(1.1); }
.theme-btn.active { opacity: 1; border-color: white; }

.theme-btn[data-t="default"] { background: linear-gradient(135deg, #4ECDC4, #2BA8A0); }
.theme-btn[data-t="tech"] { background: linear-gradient(135deg, #7c6ff7, #3b82f6); }
.theme-btn[data-t="cases"] { background: linear-gradient(135deg, #10b981, #059669); }
.theme-btn[data-t="career"] { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* ── Aurora Voice Area ── */
.aurora-voice-area {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 2rem 1.5rem 1rem;
  overflow: hidden;
}

/* Start overlay */
.aurora-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10;
}
.aurora-start p {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-align: center;
  max-width: 280px;
  line-height: 1.6;
}
.aurora-start-btn {
  padding: 0.85rem 2.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary, var(--accent)));
  border: none;
  border-radius: 99px;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.4);
  transition: all 0.2s ease;
}
.aurora-start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(var(--accent-rgb), 0.5); }
.aurora-start-btn--no {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.2), rgba(var(--accent-rgb),0.1));
  border: 1px solid rgba(var(--accent-rgb),0.4);
  box-shadow: none;
}
.aurora-start-btn--no:hover { box-shadow: 0 6px 28px rgba(var(--accent-rgb), 0.3); }
.lang-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

/* Orb */
.aurora-orb {
  position: relative;
  width: 80px;
  height: 80px;
  cursor: pointer;
  flex-shrink: 0;
}
.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), 0.2);
  animation: orbRing 3s linear infinite;
}
.orb-ring-2 { inset: -8px; border-color: rgba(var(--accent-rgb), 0.1); animation-duration: 5s; animation-direction: reverse; }
.orb-ring-3 { inset: -16px; border-color: rgba(var(--accent-rgb), 0.05); animation-duration: 7s; }
@keyframes orbRing { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.orb-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent), rgba(var(--accent-rgb), 0.7) 60%);
  box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.4), 0 0 80px rgba(var(--accent-rgb), 0.15);
  transition: background 2s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orb-icon { width: 28px; height: 28px; }

.aurora-orb.listening .orb-core {
  animation: orbPulse 1s ease-in-out infinite;
  box-shadow: 0 0 60px rgba(var(--accent-rgb), 0.7), 0 0 120px rgba(var(--accent-rgb), 0.3);
}
.aurora-orb.speaking .orb-core {
  animation: orbSpeak 0.4s ease-in-out infinite alternate;
  box-shadow: 0 0 50px rgba(var(--accent-rgb), 0.5), 0 0 100px rgba(var(--accent-rgb), 0.2);
}
@keyframes orbPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes orbSpeak { from { transform: scale(1); } to { transform: scale(1.05); } }

/* Orb label */
.orb-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-align: center;
  min-height: 1.2em;
  transition: color 0.3s ease;
}
.orb-label.active { color: var(--accent); }

/* Transcript */
.aurora-transcript {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.5rem 1rem;
  flex: 1;
  min-height: 60px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* Close button in controls */
.close-btn {
  font-size: 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  transition: color 0.2s ease;
  position: absolute;
  right: 1rem;
}
.close-btn:hover { color: var(--text); }
.transcript-placeholder {
  font-size: 0.8rem;
  text-align: center;
  padding-top: 0.5rem;
  color: var(--text-dim);
}
.transcript-msg {
  margin-bottom: 0.75rem;
  padding: 0;
}
.transcript-msg.user {
  color: rgba(255,255,255,0.5);
  text-align: right;
}
.transcript-msg.agent { color: rgba(255,255,255,0.85); }
.transcript-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Controls */
.aurora-controls {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: none;
  background: transparent;
  flex-shrink: 0;
}
.ctrl-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.ctrl-btn:hover { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }
.ctrl-btn.active { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #ef4444; }
.ctrl-btn svg { width: 20px; height: 20px; }
.end-btn {
  width: 50px; height: 50px;
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}
.end-btn:hover { background: rgba(239,68,68,0.25); }

/* ── Navigation (matching main site) ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.8rem 2rem;
  background: rgba(13, 27, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-logo-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.nav-logo-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.nav-logo-left img,
.nav-logo-right img {
  height: 44px;
  width: auto;
  max-width: 160px;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.nav-logo-left img:hover,
.nav-logo-right img:hover {
  opacity: 1;
}

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

.nav-item {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: none;
  border: 1px solid transparent;
  border-radius: 50px;
  padding: 0.55rem 1.5rem;
  cursor: pointer;
  transition: all 0.4s ease;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text);
  background: var(--nav-hover-bg);
}

.nav-item.active {
  color: var(--accent);
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 0.5rem;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.nav-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

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

.nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 20, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.nav-drawer .nav-item {
  font-size: 1.3rem;
  padding: 1rem 2rem;
  letter-spacing: 0.12em;
}

@media (max-width: 768px) {
  .nav-logo-left img, .nav-logo-right img { height: 36px; max-width: 120px; }
  .nav { padding: 0.6rem 1.2rem; display: flex; justify-content: space-between; }
  .nav-items { display: none; }
  .nav-hamburger { display: flex; }
  .nav-item { font-size: 0.7rem; padding: 0.45rem 1rem; letter-spacing: 0.08em; }
}

/* Push body content below fixed nav */
body {
  padding-top: 70px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Extra safety for iOS Chrome which doesn't handle dvh well */
@media (max-width: 768px) {
  .chat-container {
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
  }
}
