/* hifi-tokens.css — Andaa brand book v0.1 tokens */

:root {
  /* Primary palette */
  --cream: #FAF7F0;
  --ink: #1A1A1F;
  --purple: #5B4FD9;
  --purple-50: #efedfb;
  --purple-100: #ddd9f6;
  --purple-700: #4338b5;
  --purple-900: #2b2378;

  /* Accents */
  --sun: #FFD23F;
  --sun-soft: #fff0a8;
  --coral: #FF6B5B;
  --coral-soft: #ffd6d0;
  --sage: #7BC4A8;
  --sage-soft: #d2ecdf;

  /* Functional */
  --slate: #6B6B7A;
  --slate-soft: #a1a1ac;
  --mist: #EAE6DC;
  --mist-soft: #f3efe5;
  --red: #E63946;

  /* Type */
  --font-display: 'DM Sans', 'Geist', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Shadows (subtle) */
  --shadow-sm: 0 1px 2px rgba(26, 26, 31, 0.06);
  --shadow-md: 0 4px 14px rgba(26, 26, 31, 0.08);
  --shadow-lg: 0 18px 40px rgba(26, 26, 31, 0.12);
  --shadow-pop: 0 12px 28px rgba(91, 79, 217, 0.16);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
.hifi { font-family: var(--font-body); color: var(--ink); -webkit-font-smoothing: antialiased; }
.hifi h1, .hifi h2, .hifi h3, .hifi h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.hifi p { margin: 0; line-height: 1.6; }

/* Typography utilities (sizes calibrated for 1440 desktop frame) */
.hifi .h-hero { font-size: 68px; line-height: 1.02; letter-spacing: -0.028em; font-weight: 600; }
.hifi .h-hero-sm { font-size: 44px; line-height: 1.04; letter-spacing: -0.025em; font-weight: 600; }
.hifi .h-section { font-size: 40px; line-height: 1.06; letter-spacing: -0.022em; font-weight: 600; }
.hifi .h-card { font-size: 22px; line-height: 1.1; letter-spacing: -0.012em; font-weight: 600; }
.hifi .h-sub { font-size: 18px; line-height: 1.5; color: var(--slate); }
.hifi .body { font-size: 16px; line-height: 1.6; color: var(--ink); }
.hifi .body-sm { font-size: 14px; line-height: 1.55; color: var(--slate); }
.hifi .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  font-weight: 500;
}

/* Mobile sizes — when applied inside a .mobile container, scale down */
.hifi .mobile .h-hero { font-size: 38px; }
.hifi .mobile .h-section { font-size: 26px; }
.hifi .mobile .body { font-size: 15px; }

/* Button */
.hifi .btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  text-decoration: none;
  white-space: nowrap;
}
.hifi .btn-primary { background: var(--purple); color: #fff; box-shadow: var(--shadow-pop); }
.hifi .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 36px rgba(91, 79, 217, 0.22); }
.hifi .btn-ink { background: var(--ink); color: var(--cream); }
.hifi .btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.hifi .btn-soft { background: rgba(26,26,31,0.06); color: var(--ink); }
.hifi .btn-sm { padding: 8px 14px; font-size: 13px; }

/* Card */
.hifi .card {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: var(--r-lg);
  padding: 28px;
}
.hifi .card-flat { background: transparent; border: 1px solid var(--mist); border-radius: var(--r-lg); padding: 28px; }

/* Pill badge */
.hifi .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  background: var(--mist);
  color: var(--ink);
}
.hifi .pill-purple { background: var(--purple-50); color: var(--purple-700); }
.hifi .pill-sun    { background: var(--sun-soft); color: #6a4f00; }
.hifi .pill-coral  { background: var(--coral-soft); color: #8a2a1f; }
.hifi .pill-sage   { background: var(--sage-soft); color: #1f5b40; }

/* Chat bubble (Messenger-like, brand-tinted) */
.hifi .bubble {
  display: inline-block;
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.35;
  word-wrap: break-word;
}
.hifi .bubble-andaa { background: #fff; color: var(--ink); border: 1px solid var(--mist); border-bottom-left-radius: 6px; }
.hifi .bubble-user  { background: var(--purple); color: #fff; border-bottom-right-radius: 6px; }
.hifi .bubble-system { background: transparent; color: var(--slate); font-size: 12px; text-align: center; max-width: 100%; }

/* Section dividers */
.hifi .divider { height: 1px; background: var(--mist); width: 100%; }

/* Subtle dot grid (used sparingly for cover pattern) */
.hifi .dots {
  background-image: radial-gradient(rgba(26,26,31,0.10) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Subtle warm gradient (cream → mist) */
.hifi .warm-grad {
  background: linear-gradient(180deg, var(--cream) 0%, var(--mist-soft) 100%);
}

/* Tight (dense) modifier */
.hifi.density-tight .h-hero { font-size: 60px; }
.hifi.density-tight .h-section { font-size: 34px; }
.hifi.density-tight section { padding-top: 60px !important; padding-bottom: 60px !important; }
.hifi.density-tight .card { padding: 22px; }

/* Loose modifier */
.hifi.density-loose .h-hero { font-size: 76px; }
.hifi.density-loose section { padding-top: 120px !important; padding-bottom: 120px !important; }

/* ─── Motion ─────────────────────────────────────────────────── */
@keyframes andaa-bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes andaa-bubble-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-6px) scale(0.98); }
}
@keyframes andaa-typing {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-3px); }
}
@keyframes andaa-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(-1.5deg); }
}
@keyframes andaa-pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(91,79,217,0.45); }
  100% { box-shadow: 0 0 0 18px rgba(91,79,217,0); }
}
@keyframes andaa-sticker-pop {
  0%   { opacity: 0; transform: scale(0.6) rotate(-12deg); }
  60%  { opacity: 1; transform: scale(1.08) rotate(6deg); }
  100% { opacity: 1; transform: scale(1)   rotate(4deg); }
}
@keyframes andaa-shimmer {
  0% { background-position: -240px 0; }
  100% { background-position: 240px 0; }
}

.bubble-in   { animation: andaa-bubble-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.bubble-out  { animation: andaa-bubble-out 0.3s ease-in both; }
.float-anim  { animation: andaa-float 5.5s ease-in-out infinite; transform-origin: center; }
.pulse-ring  { animation: andaa-pulse-ring 2.4s ease-out infinite; }
.sticker-pop { animation: andaa-sticker-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both; }

.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--slate);
  animation: andaa-typing 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .bubble-in, .float-anim, .pulse-ring, .sticker-pop { animation: none !important; }
  .typing-dot { animation: none !important; opacity: 0.5; }
}
