/* ============================================
   PUNK ELVES — Design System
   Lavender / bone / ink, chunky cartoon style
   ============================================ */

:root {
  --lavender: #c9aee4;
  --lavender-soft: #d9c6ee;
  --lavender-deep: #a98cd1;
  --bone: #f2ead3;
  --bone-dark: #e4d8b8;
  --ink: #17141c;
  --bubblegum: #f2a7c3;
  --bubblegum-soft: #f7c4d6;
  --white: #fdfbf5;
  --shadow-hard: 6px 6px 0 var(--ink);
  --shadow-soft: 4px 4px 0 var(--ink);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: 'Luckiest Guy', cursive;
  --font-body: 'Fredoka', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--lavender);
  color: var(--ink);
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--ink); color: var(--bone); }

/* ---------- Cartoon text outline helper ---------- */
.bone-text {
  font-family: var(--font-display);
  color: var(--bone);
  letter-spacing: 2px;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(201, 174, 228, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--ink);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--bone);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform .2s ease;
}
.nav-logo:hover { transform: rotate(-2deg) scale(1.04); }
.nav-logo svg { width: 34px; height: 34px; }
.nav-logo img {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  object-fit: cover;
  box-shadow: 2px 2px 0 var(--ink);
  background: var(--lavender-soft);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  transition: color .2s;
}
.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 3px;
  background: var(--ink);
  border-radius: 2px;
  transition: width .25s ease;
}
.nav-links a:not(.btn):hover::after { width: 100%; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 1px;
  color: var(--ink);
  background: var(--bone);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 12px 26px 8px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease, box-shadow .15s ease, background .2s;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--white);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}
.btn-pink { background: var(--bubblegum); }
.btn-pink:hover { background: var(--bubblegum-soft); }
.btn-lg { font-size: 1.35rem; padding: 16px 36px 12px; }

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bone);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: .95rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 28px;
  animation: float-slow 4s ease-in-out infinite;
}
.hero-badge .dot {
  width: 10px; height: 10px;
  background: #4cd964;
  border: 2px solid var(--ink);
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 7.5rem);
  line-height: 1;
  color: var(--bone);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 7px 7px 0 var(--ink);
  margin-bottom: 24px;
  animation: title-pop .8s cubic-bezier(.2, 1.6, .4, 1) both;
}
.hero h1 .tilt-l { display: inline-block; transform: rotate(-4deg); }
.hero h1 .tilt-r { display: inline-block; transform: rotate(3deg); }

.hero-sub {
  max-width: 560px;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 40px;
  animation: fade-up .8s .25s ease both;
}

.hero-ctas {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fade-up .8s .4s ease both;
}

.hero-stats {
  display: flex;
  gap: 20px;
  margin-top: 56px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fade-up .8s .55s ease both;
}
.stat-chip {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 14px 26px;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease;
}
.stat-chip:hover { transform: translateY(-4px) rotate(-1.5deg); }
.stat-chip .num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  display: block;
  color: var(--lavender-deep);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
}
.stat-chip .label { font-size: .9rem; font-weight: 600; opacity: .75; }

/* ---------- Floating decorations ---------- */
.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floater {
  position: absolute;
  opacity: .85;
  filter: drop-shadow(3px 3px 0 rgba(23, 20, 28, .35));
  animation: float-drift 7s ease-in-out infinite;
}
.floater svg { width: 100%; height: 100%; }
.floater:nth-child(2n) { animation-duration: 9s; animation-delay: -2s; }
.floater:nth-child(3n) { animation-duration: 11s; animation-delay: -4s; }
.floater:nth-child(4n) { animation-direction: reverse; }

/* ============================================
   MARQUEE
   ============================================ */
.marquee {
  background: var(--ink);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
  padding: 14px 0;
  transform: rotate(-1deg) scale(1.02);
}
.marquee-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: marquee 22s linear infinite;
  width: max-content;
}
.marquee-track span {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: var(--bone);
}
.marquee-track span:nth-child(2n) { color: var(--bubblegum); }

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: 110px 24px;
  max-width: 1120px;
  margin: 0 auto;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  text-align: center;
  color: var(--bone);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink);
  margin-bottom: 16px;
}
.section-sub {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 500;
  max-width: 620px;
  margin: 0 auto 60px;
  opacity: .85;
}

/* ---------- About cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.card {
  background: var(--bone);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-hard);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover {
  transform: translate(-3px, -5px) rotate(-.5deg);
  box-shadow: 9px 10px 0 var(--ink);
}
.card-icon {
  width: 68px; height: 68px;
  background: var(--lavender-soft);
  border: 3px solid var(--ink);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  box-shadow: 3px 3px 0 var(--ink);
}
.card-icon svg { width: 38px; height: 38px; }
.card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.card p { font-size: 1.02rem; line-height: 1.6; opacity: .85; }

/* ---------- WL steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
  counter-reset: step;
}
.step {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 34px 24px 28px;
  position: relative;
  box-shadow: var(--shadow-soft);
  transition: transform .25s ease;
}
.step:hover { transform: translateY(-6px); }
.step-num {
  position: absolute;
  top: -22px; left: 22px;
  width: 46px; height: 46px;
  background: var(--bubblegum);
  border: 3px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  padding-top: 4px;
  box-shadow: 3px 3px 0 var(--ink);
}
.step h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: .5px;
  margin: 8px 0 10px;
}
.step p { font-size: .98rem; line-height: 1.55; opacity: .8; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink);
  border-radius: var(--radius-lg);
  border: 3px solid var(--ink);
  padding: 70px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--bone);
  -webkit-text-stroke: 0;
  text-shadow: 4px 4px 0 var(--lavender-deep);
  margin-bottom: 18px;
}
.cta-band p {
  color: var(--lavender-soft);
  font-size: 1.15rem;
  margin-bottom: 34px;
}
.cta-band .floater { opacity: .25; }

/* ---------- Footer ---------- */
.footer {
  border-top: 3px solid var(--ink);
  padding: 36px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--lavender-deep);
}
.footer .nav-logo { font-size: 1.2rem; }
.footer p { font-weight: 500; opacity: .8; }
.footer a { color: var(--ink); font-weight: 700; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ============================================
   CHAT APPLICATION PAGE
   ============================================ */
.chat-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 110px 20px 40px;
}

.chat-shell {
  width: 100%;
  max-width: 660px;
  background: var(--bone);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0 var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: title-pop .7s cubic-bezier(.2, 1.4, .4, 1) both;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  background: var(--lavender-deep);
  border-bottom: 3px solid var(--ink);
}
.chat-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--lavender-soft);
  overflow: hidden;
  flex-shrink: 0;
}
.chat-avatar svg { width: 100%; height: 100%; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-header-info h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 1px;
  color: var(--bone);
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 var(--ink);
}
.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
}
.chat-status .dot {
  width: 9px; height: 9px;
  background: #4cd964;
  border: 2px solid var(--ink);
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}

/* progress bar */
.chat-progress {
  height: 12px;
  background: var(--bone-dark);
  border-bottom: 3px solid var(--ink);
  position: relative;
}
.chat-progress-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    -45deg,
    var(--bubblegum),
    var(--bubblegum) 12px,
    var(--bubblegum-soft) 12px,
    var(--bubblegum-soft) 24px
  );
  border-right: 3px solid var(--ink);
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.chat-window {
  flex: 1;
  min-height: 420px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--lavender-deep) transparent;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: msg-in .4s cubic-bezier(.2, 1.2, .4, 1) both;
}
.msg-bot { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--lavender-soft);
  flex-shrink: 0;
  overflow: hidden;
  align-self: flex-end;
}
.msg-avatar svg { width: 100%; height: 100%; }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-user .msg-avatar { background: var(--bubblegum-soft); }

.msg-bubble {
  padding: 14px 18px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 500;
  word-break: break-word;
}
.msg-bot .msg-bubble {
  background: var(--white);
  border-bottom-left-radius: 4px;
  box-shadow: 3px 3px 0 var(--ink);
}
.msg-user .msg-bubble {
  background: var(--bubblegum);
  border-bottom-right-radius: 4px;
  box-shadow: -3px 3px 0 var(--ink);
}
.msg-bubble a {
  color: var(--lavender-deep);
  font-weight: 700;
  word-break: break-all;
}
.msg-bubble .mini-note {
  display: block;
  margin-top: 6px;
  font-size: .85rem;
  opacity: .65;
}

/* typing indicator */
.typing .msg-bubble {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 16px 20px;
}
.typing-dot {
  width: 9px; height: 9px;
  background: var(--ink);
  border-radius: 50%;
  animation: typing-bounce 1s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }

/* quick action buttons inside chat */
.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-left: 48px;
  animation: msg-in .4s .1s cubic-bezier(.2, 1.2, .4, 1) both;
}
.chat-action-btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .95rem;
  background: var(--white);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s, box-shadow .15s, background .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chat-action-btn:hover {
  transform: translate(-1px, -2px);
  box-shadow: 4px 5px 0 var(--ink);
  background: var(--bubblegum-soft);
}
.chat-action-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chat-action-btn.primary { background: var(--bubblegum); }

/* input bar */
.chat-input-bar {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-top: 3px solid var(--ink);
  background: var(--white);
}
.chat-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  padding: 13px 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--bone);
  outline: none;
  transition: box-shadow .2s, background .2s;
}
.chat-input:focus {
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
}
.chat-input:disabled { opacity: .5; cursor: not-allowed; }
.chat-input.shake { animation: shake .4s ease; border-color: #d33; }

.chat-send {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--bubblegum);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
}
.chat-send:hover { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--ink); }
.chat-send:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.chat-send:disabled { opacity: .5; cursor: not-allowed; }
.chat-send svg { width: 22px; height: 22px; }

.chat-footnote {
  margin-top: 22px;
  font-size: .9rem;
  font-weight: 500;
  opacity: .7;
  text-align: center;
}

/* success confetti bits */
.confetti {
  position: fixed;
  top: -20px;
  z-index: 999;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes float-drift {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-22px) rotate(8deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .7; }
}
@keyframes title-pop {
  0% { opacity: 0; transform: scale(.7) translateY(30px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fade-up {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: none; }
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes msg-in {
  0% { opacity: 0; transform: translateY(14px) scale(.96); }
  100% { opacity: 1; transform: none; }
}
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: .8; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .nav { padding: 12px 18px; }
  .nav-links { gap: 14px; }
  .nav-links a:not(.btn) { display: none; }
  .hero { padding-top: 100px; }
  .section { padding: 80px 18px; }
  .chat-window { max-height: 50vh; min-height: 340px; }
  .msg { max-width: 95%; }
  .chat-actions { padding-left: 0; }
}
