/* =================================================================
   AI-CV chat, embedded as the homepage's third view (#ai-cv).
   Ported from the former standalone /ai-cv/ page; every rule is scoped
   to .cv so nothing collides with the Webflow stylesheet.
   The input row is placed so its centre sits where the hero's logo
   carousel row sits: 54px above the viewport bottom (>=992px wide),
   49px below that.
================================================================= */

.cv-section {
  height: 100vh;
  height: 100svh;
}

.cv {
  --accent: #a1bde5;
  --surface: rgba(12, 12, 12, .6);
  --line: rgba(255, 255, 255, .12);
  --muted: rgba(255, 255, 255, .62);
  --field-h: 44px;

  position: relative;
  height: 100%;
  display: flex;
  padding: 100px 20px calc(54px - var(--field-h) / 2);
  font-family: Mulish, sans-serif;
  color: #fff;
}

.cv-inner {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}



/* Heading styled like the About section's title + paragraph */
.cv-head { transition: transform .1s ease-out; }
.cv-title {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  font-weight: 700;
  color: #fff;
}
.cv-lead {
  max-width: 640px;
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.cv-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.cv-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.cv-messages::-webkit-scrollbar { width: 6px; }
.cv-messages::-webkit-scrollbar-track { background: rgba(255, 255, 255, .05); border-radius: 3px; }
.cv-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 3px; }

.cv-msg {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: cv-fade-in .3s ease-in;
}
.cv-msg.user { flex-direction: row-reverse; }

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

.cv-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .85rem;
  line-height: 1.45;
  white-space: pre-line;
}
.cv-msg.user .cv-bubble {
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 6px;
}
.cv-msg.assistant .cv-bubble {
  background: rgba(12, 12, 12, .78);
  border: 1px solid rgba(255, 255, 255, .14);
  border-bottom-left-radius: 6px;
}

.cv-typing { display: flex; gap: 4px; padding: 12px 16px; }
.cv-typing span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #888;
  animation: cv-typing 1.4s infinite ease-in-out;
}
.cv-typing span:nth-child(1) { animation-delay: -.32s; }
.cv-typing span:nth-child(2) { animation-delay: -.16s; }

/* Input row */
.cv-input {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  transition: transform .1s ease-out;
}

.cv-field {
  flex: 1;
  min-width: 0;
  height: var(--field-h);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--surface);
  color: #fff;
  font: inherit;
  font-size: .95rem;
  outline: none;
  cursor: text;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: border-color .3s, background .3s, box-shadow .3s;
}
.cv-field::placeholder { color: #888; }
.cv-field:focus {
  border-color: var(--accent);
  background: rgba(161, 189, 229, .1);
  box-shadow: 0 0 0 3px rgba(161, 189, 229, .2);
}

.cv-send {
  width: 42px;
  height: 42px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .25s, opacity .25s;
}
.cv-send:hover { background-color: rgba(255, 255, 255, .5); }
.cv-send:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Data-usage notice shown before the first question is sent */
.cv-banner {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .7);
}
.cv-banner[hidden] { display: none; }
.cv-banner-card {
  max-width: 500px;
  width: 100%;
  padding: 30px;
  border-radius: 20px;
  background: rgba(30, 30, 30, .95);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
  text-align: center;
  animation: cv-fade-in .25s ease-out;
}
.cv-banner-card h3 {
  margin: 0 0 20px;
  font-family: Mulish, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.cv-banner-card p {
  margin: 0 0 15px;
  font-size: .95rem;
  line-height: 1.6;
  color: #e0e0e0;
  text-align: left;
}
.cv-banner-card a { color: var(--accent); text-decoration: none; font-weight: 500; }
.cv-banner-card a:hover { text-decoration: underline; }
.cv-banner-btn {
  margin-top: 10px;
  padding: 12px 30px;
  border: 0;
  border-radius: 30px;
  background: #a1bde5;
  color: #000;
  font: 700 14px/20px Mulish, sans-serif;
  cursor: pointer;
  transition: background-color .25s;
}
.cv-banner-btn:hover { background-color: rgba(255, 255, 255, .5); }

/* Small links in the site footer */
.footer-mini-link { color: rgba(255, 255, 255, .55); text-decoration: none; }
.footer-mini-link:hover { color: #a1bde5; text-decoration: underline; }

@keyframes cv-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cv-typing { 0%, 80%, 100% { transform: scale(.8); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

/* Main page's tablet/phone layout drops the logo row to 49px */
@media (max-width: 991px) {
  .cv { padding-bottom: calc(49px - var(--field-h) / 2); }
}

@media (max-width: 767px) {
  .cv { padding-top: 90px; padding-left: 16px; padding-right: 16px; }
  .cv-inner { gap: 12px; }
  .cv-lead { font-size: 14px; margin-top: 6px; }
  .cv-messages { padding: 14px; }
  .cv-bubble { max-width: 85%; font-size: .8rem; }
  .cv-avatar { width: 22px; height: 22px; }
  .cv-field { font-size: 16px; } /* 16px stops iOS zooming into the field */
  .cv-field::placeholder { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cv *, .cv *::before { animation: none !important; transition: none !important; }
}
