/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables */
:root {
  /* Color Palette */
  --bg-main: #FDFBF7;           /* Warm creamy background */
  --bg-card: #FFFFFF;           /* Pure white card backgrounds */
  --bg-accent-soft: #FAF7F2;    /* Soft neutral offset */
  
  --yellow-primary: #F59E0B;    /* Amber 500 - mental clarity & memory */
  --yellow-hover: #D97706;      /* Amber 600 */
  --yellow-light: #FBBF24;      /* Amber 400 */
  --yellow-soft: #FFFBEB;       /* Amber 50 */
  --yellow-border: #FDE68A;     /* Amber 200 */
  
  --blue-primary: #06B6D4;      /* Cyan 500 - calm focus */
  --blue-hover: #0891B2;        /* Cyan 600 */
  --blue-light: #22D3EE;        /* Cyan 400 */
  --blue-soft: #ECFEFF;         /* Cyan 50 */
  --blue-border: #CFFAFE;       /* Cyan 200 */
  
  --text-main: #1E293B;         /* Slate 800 */
  --text-muted: #64748B;        /* Slate 500 */
  --text-light: #94A3B8;        /* Slate 400 */
  --text-inverse: #FFFFFF;
  
  /* Borders and Shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 20px -2px rgba(120, 110, 90, 0.08);
  --shadow-lg: 0 10px 30px -5px rgba(120, 110, 90, 0.12);
  --shadow-focus: 0 0 0 3px rgba(6, 182, 212, 0.25);
  
  /* Typography */
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Base Components & Buttons */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, textarea {
  font-family: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  font-size: 0.95rem;
  gap: 0.5rem;
}

.btn-yellow {
  background-color: var(--yellow-primary);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-yellow:hover {
  background-color: var(--yellow-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.btn-yellow:active {
  transform: translateY(0);
}

.btn-blue {
  background-color: var(--blue-primary);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.btn-blue:hover {
  background-color: var(--blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.35);
}

.btn-blue:active {
  transform: translateY(0);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--blue-primary);
  color: var(--blue-primary);
}

.btn-outline:hover {
  background-color: var(--blue-soft);
  transform: translateY(-2px);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padding {
  padding: 6rem 0;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem auto;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--yellow-primary), var(--blue-primary));
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(253, 251, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-accent-soft);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--yellow-primary), var(--blue-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: var(--blue-primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(6, 182, 212, 0.2));
}

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

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--blue-primary);
  transition: width var(--transition-normal);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-main);
  transition: var(--transition-normal);
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 80% 20%, var(--yellow-soft) 0%, transparent 40%),
              radial-gradient(circle at 10% 80%, var(--blue-soft) 0%, transparent 40%);
  padding: 7rem 0 5rem 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero-title span {
  background: linear-gradient(120deg, var(--yellow-primary), var(--blue-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 550px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-ill-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-ill {
  width: 100%;
  max-width: 420px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(120, 110, 90, 0.15));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Memory Techniques Cards Grid */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 4rem;
}

.tech-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(120, 110, 90, 0.08);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.tech-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: transparent;
  transition: background var(--transition-normal);
}

.tech-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.tech-card.palace::before {
  background: var(--yellow-primary);
}
.tech-card.spaced::before {
  background: var(--blue-primary);
}
.tech-card.mnemonics::before {
  background: linear-gradient(90deg, var(--yellow-primary), var(--blue-primary));
}

.tech-icon-wrapper {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.tech-card.palace .tech-icon-wrapper {
  background-color: var(--yellow-soft);
  color: var(--yellow-primary);
}
.tech-card.spaced .tech-icon-wrapper {
  background-color: var(--blue-soft);
  color: var(--blue-primary);
}
.tech-card.mnemonics .tech-icon-wrapper {
  background-color: #FAF7F2;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--yellow-soft), var(--blue-soft));
}

.tech-icon {
  width: 1.75rem;
  height: 1.75rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.tech-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.tech-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.tech-learn-btn {
  align-self: flex-start;
}

/* Gamified Practice Containers (Dynamic Injectable Sections) */
.practice-container {
  margin-top: 4rem;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(120, 110, 90, 0.08);
  box-shadow: var(--shadow-lg);
  padding: 3rem;
  display: none; /* Controlled by JS active state */
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--bg-accent-soft);
  padding-bottom: 1.5rem;
}

.practice-header-text h3 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.practice-header-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.close-practice {
  background: var(--bg-accent-soft);
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
}

.close-practice:hover {
  background-color: #E2E8F0;
  color: var(--text-main);
}

/* 1. Memory Palace Sandbox Styling */
.palace-sandbox {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
}

.palace-house-map {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  background-color: var(--bg-accent-soft);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--text-light);
}

.palace-room {
  background-color: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-height: 120px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.palace-room:hover {
  border-color: var(--yellow-light);
  transform: scale(1.02);
}

.palace-room.active {
  border-color: var(--yellow-primary);
  background-color: var(--yellow-soft);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.room-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.room-anchor {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-accent-soft);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.palace-room.active .room-anchor {
  background-color: var(--bg-card);
  color: var(--yellow-hover);
  border-color: var(--yellow-border);
}

.palace-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.list-to-remember {
  background-color: var(--bg-accent-soft);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0,0,0,0.05);
}

.list-to-remember h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.list-items-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.list-item-chip {
  background-color: var(--bg-card);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: grab;
  transition: all var(--transition-fast);
}

.list-item-chip:hover {
  background-color: var(--blue-soft);
  border-color: var(--blue-border);
}

.list-item-chip.placed {
  opacity: 0.5;
  text-decoration: line-through;
  cursor: not-allowed;
}

.palace-game-btn {
  margin-top: 1rem;
}

/* 2. Spaced Repetition Practice Tool Styling */
.spaced-sandbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.flashcard-deck-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.flashcard {
  width: 100%;
  height: 250px;
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 2rem;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--blue-border);
}

.flashcard-front {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.flashcard-back {
  background-color: var(--blue-soft);
  color: var(--text-main);
  transform: rotateY(180deg);
}

.flashcard-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue-primary);
  margin-bottom: 1rem;
  font-weight: 700;
}

.flashcard-word {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.flashcard-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.flashcard-buttons {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all var(--transition-normal);
}

.flashcard.flipped ~ .flashcard-buttons {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.spaced-progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--bg-accent-soft);
  border-radius: 3px;
  margin-top: 1.5rem;
  overflow: hidden;
}

.spaced-progress-fill {
  height: 100%;
  background: var(--blue-primary);
  width: 0%;
  transition: width var(--transition-normal);
}

/* 3. Chunking & Mnemonics Helper Tool Styling */
.chunking-sandbox {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.chunking-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-weight: 700;
  font-size: 0.95rem;
}

.text-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--bg-accent-soft);
  background-color: var(--bg-main);
  transition: all var(--transition-normal);
  font-size: 1rem;
}

.text-input:focus {
  outline: none;
  border-color: var(--blue-primary);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-focus);
}

.chunking-outputs {
  background-color: var(--bg-accent-soft);
  padding: 2rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.05);
}

.chunk-result-box {
  margin-top: 1rem;
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-sm);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chunked-item {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--blue-primary);
}

.mnemonic-result-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mnemonic-word {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mnemonic-letter {
  background: var(--yellow-primary);
  color: var(--text-main);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
}

.mnemonic-text {
  font-size: 1.1rem;
  font-weight: 600;
}

/* AI Health Chat Assistant */
.chat-section {
  background: radial-gradient(circle at 10% 20%, var(--blue-soft) 0%, transparent 35%),
              radial-gradient(circle at 90% 80%, var(--yellow-soft) 0%, transparent 35%);
  border-top: 1px solid rgba(120, 110, 90, 0.05);
}

.chat-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.chat-intro h3 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.chat-intro p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.suggestion-chip {
  background-color: var(--bg-card);
  border: 1px solid rgba(120, 110, 90, 0.1);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.suggestion-chip:hover {
  border-color: var(--blue-primary);
  background-color: var(--blue-soft);
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.suggestion-icon {
  color: var(--blue-primary);
  width: 1.25rem;
  height: 1.25rem;
}

/* Chatbox Component */
.chatbox {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(120, 110, 90, 0.08);
  box-shadow: var(--shadow-lg);
  height: 550px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.chatbox-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--bg-accent-soft);
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--bg-card);
}

.assistant-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--yellow-primary), var(--blue-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-weight: 800;
}

.assistant-status-info h4 {
  font-size: 1rem;
  font-weight: 700;
}

.assistant-status-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #10B981; /* Green active */
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.chat-messages {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background-color: var(--bg-accent-soft);
}

/* Chat Message Styling */
.message {
  max-width: 80%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: messageSlide 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(12px);
}

@keyframes messageSlide {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message-bubble {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  position: relative;
  word-break: break-word;
}

.message.user .message-bubble {
  background-color: var(--blue-primary);
  color: var(--text-inverse);
  border-top-right-radius: 0px;
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.15);
}

.message.assistant .message-bubble {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-top-left-radius: 0px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.05);
}

/* Markdown tags in response bubble */
.message-bubble p {
  margin-bottom: 0.5rem;
}
.message-bubble p:last-child {
  margin-bottom: 0;
}
.message-bubble ul, .message-bubble ol {
  margin-left: 1.25rem;
  margin-bottom: 0.5rem;
}
.message-bubble li {
  margin-bottom: 0.25rem;
}
.message-bubble strong {
  font-weight: 700;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  align-self: flex-end;
  padding: 0 4px;
}

.message.user .message-time {
  align-self: flex-end;
}

.message.assistant .message-time {
  align-self: flex-start;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.5rem 1rem;
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border-top-left-radius: 0px;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100%, 80% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* Chat Input Footer */
.chat-input-area {
  padding: 1.25rem 1.5rem;
  background-color: var(--bg-card);
  border-top: 1px solid var(--bg-accent-soft);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-input {
  flex-grow: 1;
  border: 2px solid var(--bg-accent-soft);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  outline: none;
  background-color: var(--bg-accent-soft);
  transition: all var(--transition-normal);
  resize: none;
  height: 48px;
  max-height: 120px;
  overflow-y: auto;
}

.chat-input:focus {
  border-color: var(--blue-primary);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-focus);
}

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--blue-primary);
  color: var(--text-inverse);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.send-btn:hover {
  background-color: var(--blue-hover);
  transform: translateY(-2px);
}

.send-btn:active {
  transform: translateY(0);
}

.send-btn-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(45deg);
  margin-left: -2px;
  margin-top: 2px;
}

/* Footer styling */
.footer {
  background-color: var(--text-main);
  color: #94A3B8;
  padding: 4rem 0 2rem 0;
  font-size: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-brand h4 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--bg-main);
  margin-bottom: 1rem;
}

.footer-brand p {
  line-height: 1.6;
}

.footer-links h5, .footer-contact h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bg-main);
  margin-bottom: 1.25rem;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a:hover {
  color: var(--bg-main);
}

.footer-contact p {
  margin-bottom: 0.75rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

/* Mobile responsive menu & design tweaks */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .tech-grid {
    grid-template-columns: 1fr;
  }
  .chat-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .palace-sandbox {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .chunking-sandbox {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .section-padding {
    padding: 4rem 0;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .hamburger {
    display: flex;
  }
  .nav-links {
    display: none; /* Controlled by mobile active class */
    position: absolute;
    top: 4.5rem;
    left: 0;
    width: 100%;
    background-color: var(--bg-main);
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--bg-accent-soft);
    gap: 1.5rem;
  }
  .nav-links.mobile-active {
    display: flex;
  }
}

/* API Warning Message */
.api-warning-banner {
  background-color: var(--yellow-soft);
  border: 1px solid var(--yellow-border);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
