/* ============================================================
   folio — Angus Merry
   Global styles + design system
   ============================================================ */

/* --- CSS Variables ----------------------------------------- */
:root {
  --color-purple-50:  #EEEDFE;
  --color-purple-100: #CECBF6;
  --color-purple-200: #AFA9EC;
  --color-purple-400: #7F77DD;
  --color-purple-600: #534AB7;
  --color-purple-800: #3C3489;
  --color-purple-900: #26215C;

  --color-teal-50:  #E1F5EE;
  --color-teal-400: #1D9E75;

  --color-coral-50:  #FAECE7;
  --color-coral-400: #D85A30;

  --color-pink-50:  #FBEAF0;
  --color-pink-400: #D4537E;

  --color-gray-50:  #FDFCFA;
  --color-gray-400: #888780;
  --color-gray-600: #5F5E5A;

  --border: 0.5px solid rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-card: 12px;
  --radius-profile: 20px;
  --radius-pill: 30px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: #1a1a1a;
  background: var(--color-gray-50);
}

/* --- Page fade-in ------------------------------------------ */
body {
  animation: fadeIn 750ms ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Typography -------------------------------------------- */
h1 { font-size: 28px; font-weight: 500; line-height: 1.25; }
h2 { font-size: 22px; font-weight: 500; line-height: 1.3; }
h3 { font-size: 17px; font-weight: 500; line-height: 1.3; }

p  { font-size: 15px; line-height: 1.7; }

.eyebrow {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--color-gray-400);
  text-transform: none;
}

/* --- Logo -------------------------------------------------- */
.logo {
  font-size: 17px;
  font-weight: 500;
  color: var(--color-purple-600);
  text-decoration: none;
  letter-spacing: -0.3px;
}

/* --- Tags / pills ------------------------------------------ */
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 0.5px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  background: rgba(0, 0, 0, 0.50);
  line-height: 1.6;
}

/* --- Buttons ----------------------------------------------- */
.btn-primary {
  display: inline-block;
  background: var(--color-purple-600);
  color: var(--color-purple-50);
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease;
  line-height: 1;
}

.btn-primary:hover {
  background: var(--color-purple-800);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--color-purple-600);
  border: 1.5px solid var(--color-purple-600);
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease;
  line-height: 1;
}

.btn-secondary:hover {
  background: rgba(83,74,183,0.08);
}

/* --- Nav --------------------------------------------------- */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-gray-600);
  text-decoration: none;
  transition: color 150ms ease;
}

.nav-links a:hover {
  color: #1a1a1a;
}

.matched-pill {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-purple-600);
  background: var(--color-purple-50);
  border: 0.5px solid var(--color-purple-200);
  border-radius: 20px;
  padding: 3px 10px;
}


/* ---- Popup --------------------------------------------- */
.popup-overlay {
  display: flex;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  transition: opacity 200ms ease;
}

.popup-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.popup-card {
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  overflow: hidden;
  max-width: 360px;
  width: calc(100% - 48px);
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

/* ---- Chat header --------------------------------------- */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.10);
  position: relative;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-purple-100);
  overflow: hidden;
  flex-shrink: 0;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.chat-matched {
  font-size: 11px;
  color: var(--color-purple-600);
}

.popup-close {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--color-gray-400);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 150ms ease;
}

.popup-close:hover {
  color: #1a1a1a;
}

/* ---- Chat messages ------------------------------------- */
.chat-messages {
  padding: 20px 16px;
  background: rgba(206, 203, 246, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: var(--color-gray-50);
  border: 0.5px solid rgba(0, 0, 0, 0.10);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  opacity: 0;
  transition: opacity 200ms ease;
}

.typing-indicator.is-visible {
  opacity: 1;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--color-gray-400);
  border-radius: 50%;
  animation: typing-bounce 1.1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: #1a1a1a;
  background: var(--color-gray-50);
  border: 0.5px solid rgba(0, 0, 0, 0.10);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.chat-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-bubble a {
  color: var(--color-purple-600);
  text-decoration: none;
  border-bottom: 0.5px solid var(--color-purple-600);
  padding-bottom: 1px;
  transition: opacity 150ms ease;
}

.chat-bubble a:hover {
  opacity: 0.7;
}
