@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --bg:           #07050F;
  --surface:      #0E0B1A;
  --surface2:     #161228;
  --border:       #201A30;
  --border-hi:    rgba(140, 26, 82, 0.5);
  --text:         #EDE8F5;
  --muted:        #8A7FA0;
  --muted2:       #45405A;

  --acai:         #8C1A52;
  --violet:       #6B21A8;
  --rose:         #BE185D;

  --grad:         linear-gradient(135deg, #8C1A52 0%, #6B21A8 52%, #BE185D 100%);
  --grad-soft:    linear-gradient(135deg, #C2457E 0%, #9B5FD8 52%, #E0538C 100%);
  --grad-bg:      linear-gradient(135deg, rgba(140,26,82,0.12) 0%, rgba(107,33,168,0.12) 52%, rgba(190,24,93,0.08) 100%);

  --font:  'Inter', sans-serif;
  --mono:  'JetBrains Mono', monospace;
  --max:   900px;
  --r:     10px;
  --r-sm:  6px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); }

/* ============================================================
   UTILITIES
   ============================================================ */
.grad-text {
  background: var(--grad-soft);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wrapper {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}
.section-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: inline-block;
  background: var(--grad-soft);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 20px;
}
h3 { font-size: 15px; font-weight: 600; }
p { color: var(--muted); line-height: 1.75; }
.divider { border: none; border-top: 1px solid var(--border); margin: 60px 0; }

/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7, 5, 15, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.2px;
}
.nav-logo .initials {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
}
.nav-links a {
  font-size: 13.5px;
  color: var(--muted);
  padding: 6px 13px;
  border-radius: var(--r-sm);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active {
  color: var(--text);
  font-weight: 500;
  background: var(--surface2);
}

/* ============================================================
   PAGE HEADER (shared by about / projects / contact)
   ============================================================ */
.page-top {
  padding-top: 120px;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 64px;
}
.page-top .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-block;
  background: var(--grad-soft);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-top h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
}
.page-top .sub {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
  max-width: 480px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.22s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 22px rgba(107, 33, 168, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 6px 32px rgba(107, 33, 168, 0.6);
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-secondary:hover {
  border-color: var(--border-hi);
  color: var(--text);
  background: rgba(140, 26, 82, 0.1);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================================
   TAGS
   ============================================================ */
.tag {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--muted);
  white-space: nowrap;
}
.tag-hi {
  background: rgba(140, 26, 82, 0.15);
  border-color: rgba(140, 26, 82, 0.35);
  color: #D0607A;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  border-color: rgba(140, 26, 82, 0.45);
  box-shadow: 0 4px 28px rgba(107, 33, 168, 0.13);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 100px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-inner span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted2);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  font-size: 12px;
  color: var(--muted2);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--muted); }

/* ============================================================
   AI CHAT WIDGET
   ============================================================ */
.ai-widget {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 200;
}
.ai-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--grad);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(107, 33, 168, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.ai-btn:hover { transform: scale(1.08); box-shadow: 0 6px 36px rgba(107, 33, 168, 0.7); }
.ai-btn svg { width: 22px; height: 22px; color: #fff; }
.ai-btn .ai-pulse {
  position: absolute;
  top: -2px; right: -2px;
  width: 12px; height: 12px;
  background: var(--grad);
  border-radius: 50%;
  border: 2px solid var(--bg);
}
.ai-tooltip {
  position: absolute;
  bottom: 62px; right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  width: 210px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}
.ai-widget:hover .ai-tooltip {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.ai-tooltip .t-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.ai-tooltip .t-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.ai-tooltip .t-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(140, 26, 82, 0.2);
  border: 1px solid rgba(140, 26, 82, 0.4);
  color: #E0638A;
}

/* ============================================================
   FLOATING CHAT POPUP
   ============================================================ */
.ai-panel {
  position: absolute;
  bottom: 66px; right: 0;
  width: 320px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.ai-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}
.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.ai-panel-info { display: flex; align-items: center; gap: 10px; }
.ai-panel-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.ai-panel-name { font-size: 13px; font-weight: 600; color: var(--text); }
.ai-panel-sub  { font-size: 11px; color: var(--muted2); }
.ai-panel-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted2); font-size: 16px; line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s;
}
.ai-panel-close:hover { color: var(--text); }
.ai-panel-msgs {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 260px;
  overflow-y: auto;
}
.ai-panel-msgs::-webkit-scrollbar { width: 4px; }
.ai-panel-msgs::-webkit-scrollbar-track { background: transparent; }
.ai-panel-msgs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.ai-panel-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.ai-panel-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.15s;
}
.ai-panel-input:focus { border-color: rgba(107,33,168,0.6); }
.ai-panel-input::placeholder { color: var(--muted2); }
.ai-panel-send {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--grad);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.ai-panel-send:hover { opacity: 0.85; }
.ai-panel-send:disabled { opacity: 0.4; cursor: default; }
.ai-panel-send svg { width: 15px; height: 15px; color: #fff; }

/* shared msg styles (used by both inline chat and popup) */
.msg { display: flex; }
.msg-bot  { justify-content: flex-start; }
.msg-user { justify-content: flex-end; }
.msg-bubble {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.msg-bot .msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-bottom-left-radius: 4px;
}
.msg-user .msg-bubble {
  background: linear-gradient(135deg, rgba(140,26,82,0.45), rgba(107,33,168,0.45));
  border: 1px solid rgba(140,26,82,0.3);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.typing-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted2);
  margin: 0 2px;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-5px); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .wrapper { padding: 0 18px; }
  .nav-inner { padding: 0 18px; }
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-inner span:last-child { display: none; }
}
