/* Design tokens */
:root {
  /* Colors */
  --background: #FAFAF8;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.06);
  
  /* Rainbow Gradient */
  --gradient-rainbow: linear-gradient(
    135deg,
    #FFE80F 0%,
    #CDED1E 16.67%,
    #87E22C 33.33%,
    #3DD658 50%,
    #04C49E 66.67%,
    #019FBF 83.33%,
    #0153B9 100%
  );
  
  /* Soft gradient overlay for backgrounds */
  --gradient-soft: linear-gradient(
    135deg,
    rgba(255, 232, 15, 0.08) 0%,
    rgba(205, 237, 30, 0.08) 16.67%,
    rgba(135, 226, 44, 0.08) 33.33%,
    rgba(61, 214, 88, 0.08) 50%,
    rgba(4, 196, 158, 0.08) 66.67%,
    rgba(1, 159, 191, 0.08) 83.33%,
    rgba(1, 83, 185, 0.08) 100%
  );
  
  /* Individual gradient colors for accents */
  --gradient-yellow: #FFE80F;
  --gradient-lime: #CDED1E;
  --gradient-green: #87E22C;
  --gradient-emerald: #3DD658;
  --gradient-teal: #04C49E;
  --gradient-cyan: #019FBF;
  --gradient-blue: #0153B9;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Spacing */
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Border radius */
  --radius-sm: 0.5rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --radius-full: 9999px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { 
  max-width: 75rem; 
  margin: 0 auto; 
  padding: 0 var(--space-4); 
}

.space-y-8 > * + * { margin-top: var(--space-8); }
.muted { color: var(--text-secondary); }
.lead { 
  font-size: 1.125rem; 
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: var(--space-4) 0;
  max-width: 75rem;
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.brand-img { 
  display: inline-flex; 
  align-items: center; 
  text-decoration: none;
}

.brand-img img { 
  height: 2.5rem;
  display: block;
}

.brand-title { 
  display: none; /* Hide on header, show in hero */
}

.brand .logo { 
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.main-nav { 
  display: flex; 
  gap: var(--space-6);
  align-items: center;
}

.nav-link { 
  color: var(--text-primary);
  text-decoration: none; 
  padding: 0.5rem 0;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-link:hover { 
  color: var(--gradient-cyan);
}

.nav-link.active {
  color: var(--gradient-emerald);
  font-weight: 600;
}

/* Gradient button in header */
.nav-link.btn-gradient {
  background: var(--gradient-rainbow);
  color: white;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-link.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  color: white;
}

/* Content */
.content { 
  padding: var(--space-16) 0;
  min-height: calc(100vh - 200px);
}

.welcome { 
  text-align: center; 
  padding: var(--space-12) 0 var(--space-16);
  background: transparent;
  max-width: 50rem;
  margin: 0 auto;
}

.welcome .chat-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  background: var(--gradient-rainbow);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.welcome .chat-icon svg {
  width: 40px;
  height: 40px;
  stroke: white;
  stroke-width: 2.5;
  fill: none;
}

.welcome h1 {
  font-size: 4rem;
  font-weight: 800;
  margin: 0 0 var(--space-3);
  line-height: 1.1;
  background: var(--gradient-rainbow);
  background-size: 40% 100%;
  background-position: 50% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.welcome h2 { 
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 var(--space-6);
  color: var(--text-secondary);
}

.welcome .greeting {
  font-size: 1.25rem;
  margin: var(--space-8) 0 var(--space-4);
  line-height: 1.6;
}

.welcome .greeting .highlight {
  color: var(--gradient-cyan);
  font-weight: 600;
}

.welcome .prompt-text {
  font-size: 1rem;
  color: var(--text-muted);
  margin: var(--space-8) 0 var(--space-6);
}

.welcome .lead { 
  font-size: 1rem;
  max-width: 50rem; 
  margin: 0 auto;
  color: var(--text-secondary);
}

.card { 
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: 0 4px 16px var(--card-shadow);
}

.section-head { 
  display: flex; 
  align-items: baseline; 
  justify-content: space-between; 
  margin-bottom: var(--space-4);
}

/* Carousel */
.carousel { 
  display: flex; 
  overflow-x: auto; 
  scroll-snap-type: x mandatory; 
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6) var(--space-8);
  justify-content: center;
  -webkit-overflow-scrolling: touch; 
  scrollbar-width: none;
  margin: 0 -1rem;
}

.carousel::-webkit-scrollbar { 
  display: none;
}
.card-item { 
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  cursor: pointer; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 0 0 auto;
  width: 100%;
  max-width: 350px;
  scroll-snap-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
}

.card-item:hover { 
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.card-item .title { 
  margin: 0 0 var(--space-2);
  font-weight: 700;
  text-align: left;
  width: 100%;
  display: block;
  font-size: 1.15rem;
  line-height: 1.4;
  color: white;
}

.card-item .subtitle { 
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  text-align: left;
  width: 100%;
  line-height: 1.5;
}

.card-item .arrow {
  position: absolute;
  right: var(--space-6);
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  opacity: 0.9;
  display: none; /* hide arrow icons on cards */
}

/* Landing Questions Cards */
.question-card { 
  display: flex; 
  flex-direction: column; 
  justify-content: center;
  padding: var(--space-8);
  background: var(--gradient-rainbow);
  min-height: 140px;
  text-align: center;
}

.question-card .title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  line-height: 1.4;
  text-align: center;
}

/* Waitlist card */
.waitlist-card {
  text-align: center;
  background: var(--gradient-soft);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: var(--space-12) var(--space-8);
  position: relative;
  overflow: hidden;
}

.waitlist-card h3 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 var(--space-6);
  line-height: 1.2;
  color: var(--text-primary);
}

.waitlist-card h3 .gradient-text {
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.waitlist-card p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 42rem;
  margin: 0 auto var(--space-4);
}

.waitlist-form {
  display: none;
}

.waitlist-card .btn {
  margin: var(--space-6) 0 var(--space-4);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius-full);
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn.primary { 
  background: var(--gradient-rainbow);
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.btn.primary:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.waitlist-subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: var(--space-4);
}

/* Family intro block (Parents page) */
.family-intro {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.family-intro-image,
.family-intro-text {
  flex: 1;
}

@media (min-width: 768px) {
  .family-intro {
    flex-direction: row;
    align-items: center;
  }
}

/* Badge */
.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

/*Buttons: KEEP*/
.icon-btn { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 1rem; } /*Close chat "✕" button*/

/* Lists */
.list { margin: .5rem 0 0; padding-left: 1.25rem; }
.list li { margin: .25rem 0; }

/* Modal */
.modal { position: fixed; inset: 0; display: none; z-index: 100; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-panel { 
  position: relative; 
  z-index: 10; 
  display: flex; 
  justify-content: center; 
  align-items: flex-start; 
  height: 100%; 
  padding: var(--space-4); 
  overflow-y: auto;
  /*padding-top: 5vh;*/
}

/* ===== CHAT MODAL STYLES ===== */

/* Chat Container */
.chat { 
  background: #fff; 
  width: 100%; 
  max-width: 51.25rem; 
  height: 80vh; 
  max-height: 90vh; 
  border-radius: 1rem; 
  display: flex; 
  flex-direction: column; 
  box-shadow: 0 1.25rem 3rem rgba(0,0,0,.25);
  margin: 2vh auto;
}

/* Chat Header */
.chat-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 1rem; 
  border-bottom: 0.0625rem solid #eee; 
}

.header-title { 
  display: flex; 
  align-items: baseline; 
  gap: 0.75rem; 
}

.chat-header .prompt-counter { 
  font-size: 0.85rem; 
  color: var(--text-secondary); 
  font-weight: normal; 
}

.prompt-counter { 
  color: #64748b; 
  font-weight: 600; 
}

/* Chat Messages Area */
.chat-messages { 
  flex: 1; 
  overflow: auto; 
  padding: 1rem; 
  background: #fafafa; 
}

/* Message Bubbles */
.msg { 
  display: flex;
  margin-bottom: 1rem; 
}

.msg .bubble { 
  display: inline-block; 
  padding: 1rem; 
  border-radius: 0.75rem; 
  max-width: 85%; 
  white-space: normal; 
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 0.0625rem solid #e5e7eb;
}

.msg.user { 
  justify-content: flex-end; 
}

.msg.user .bubble { 
  background: #e8f1ff; 
  border-color: #cfe0ff;
  border-bottom-right-radius: 0; 
}

.msg.ai { 
  justify-content: flex-start; 
}

.msg.ai .bubble { 
  background: #f8fafc; 
  border-color: #e5e7eb;
  border-bottom-left-radius: 0; 
}

.msg .meta { 
  font-size: .75rem; 
  color: var(--text-secondary); 
  margin-top: .15rem; 
}

/* Message Content Formatting */
.message-content {
  line-height: 1.3;
  font-size: 1rem;
  
  color: var(--text-primary);
}

.message-content p { 
  margin: 0 0 .5rem;
  line-height: 1.3; 
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content p + p {
  margin-top: .5rem;
}

.message-content ul, 
.message-content ol { 
  margin: 0 0 .75rem 1.25rem;
  padding-left: 1.5rem;
}

.message-content li {
  margin: 0 0 .25rem;
}

.message-content li:last-child { 
  margin-bottom: 0; 
}

.message-content h1, 
.message-content h2, 
.message-content h3 { 
  margin: .75rem 0 .5rem; 
}

.message-content em { 
  font-style: italic; 
  color: #4b5563; 
  font-weight: 500; 
}

.message-content strong { 
  font-weight: 600; 
  color: #111827; 
}

.message-content a { 
  color: #3b82f6; 
  text-decoration: none; 
  border-bottom: 1px dotted #3b82f6;
}

.message-content a:hover { 
  color: #2563eb; 
  /*border-bottom: 1px solid #2563eb; */
}

.message-content blockquote { 
  border-left: 3px solid #e5e7eb; 
  padding-left: 1rem; 
  margin-left: 0; 
  color: #4b5563; 
  font-style: italic; 
}

/* Chat Input */
.chat-input { 
  display: flex; 
  gap: .5rem; 
  padding: var(--space-4) var(--space-6); 
  border-top: 0.0625rem solid #eee; 
}

.chat-input input { 
  flex: 1; 
  padding: .65rem .8rem; 
  border: 0.0625rem solid #e5e7eb; 
  border-radius: 0.625rem; 
}

/* Feedback Section */
.feedback {
  padding: var(--space-4) var(--space-6);
  border-top: 0.0625rem solid #eee;
  text-align: center;
}

.ratings { 
  display: flex; 
  gap: 1rem; 
  justify-content: center;
  margin-top: 1rem;
}

.ratings .rate { 
  width: 2.25rem; 
  height: 2.25rem; 
  border-radius: 50%; 
  border: 0.0625rem solid #e5e7eb; 
  background: #fff; 
  cursor: pointer; 
}

.ratings .emoji-rate {
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.ratings .emoji-rate .emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.ratings .emoji-rate .label {
  font-size: 0.75rem;
  font-weight: 500;
}

.ratings .rate:hover { 
  background: #f1f5f9; 
}
.feedback.hidden { display: none; }

/* Utilities */
.spacer { flex: 1; }

/* Small screens */
@media (max-width: 48rem) {
  .chat { height: calc(100vh - 2.5rem); border-radius: 0.75rem; }
}