/* ============================================================
   VIPASSANA — Quiet Luxury Enhancements
   ============================================================ */

/* ─── SCROLL DEPTH INDICATOR ─────────────────────────────── */
#scroll-indicator {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(to right, var(--gold-dim), var(--gold), #E8D08A);
  z-index: 2000;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(198,165,92,0.5);
}

/* ─── DARK MODE TOGGLE BUTTON ────────────────────────────── */
.theme-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--charcoal);
  border: 1px solid rgba(198,165,92,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  transition: all 0.35s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.theme-toggle:hover {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(198,165,92,0.3);
  transform: scale(1.08);
}
.theme-toggle svg {
  width: 20px; height: 20px;
  transition: opacity 0.3s, transform 0.4s;
}
.theme-toggle .icon-moon { color: var(--gold); }
.theme-toggle .icon-sun  { color: var(--gold); position: absolute; opacity: 0; transform: rotate(-90deg); }

[data-theme="dark"] .theme-toggle { background: rgba(247,245,242,0.08); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg); }
[data-theme="dark"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0deg); }

/* ─── SOUNDSCAPE TOGGLE ──────────────────────────────────── */
.soundscape-toggle {
  position: fixed;
  bottom: 32px;
  right: 92px;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--charcoal);
  border: 1px solid rgba(198,165,92,0.25);
  border-radius: 9999px;
  padding: 6px 8px;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.sound-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
  color: rgba(198,165,92,0.45);
  font-size: 10px;
  letter-spacing: 0.04em;
  flex-direction: column;
  gap: 2px;
}
.sound-btn svg { width: 14px; height: 14px; }
.sound-btn.active { background: rgba(198,165,92,0.15); color: var(--gold); }
.sound-btn:hover:not(.active) { color: rgba(198,165,92,0.7); }
.sound-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

[data-theme="dark"] .soundscape-toggle { background: rgba(247,245,242,0.06); }

/* ─── CINEMATIC TRANSITION OVERLAY ──────────────────────── */
#scene-curtain {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1800;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease;
}
#scene-curtain.closing { opacity: 1; transition: opacity 0.35s ease; }
#scene-curtain.opening { opacity: 0; transition: opacity 0.6s ease; }

/* ─── ONBOARDING OVERLAY ─────────────────────────────────── */
#onboarding {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: #050402;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 40px 24px;
  transition: opacity 0.9s ease;
}
#onboarding.hiding { opacity: 0; pointer-events: none; }
#onboarding.hidden { display: none; }

.ob-step { display: none; flex-direction: column; align-items: center; }
.ob-step.active { display: flex; animation: fadeInUp 0.9s ease both; }

.ob-wheel {
  width: 56px; height: 56px;
  margin-bottom: 48px;
  filter: drop-shadow(0 0 20px rgba(198,165,92,0.4));
}

.ob-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(198,165,92,0.6);
  margin-bottom: 24px;
}

.ob-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 5vw, 52px);
  color: rgba(247,245,242,0.92);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 28px;
  max-width: 560px;
}

.ob-body {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 17px;
  color: rgba(247,245,242,0.4);
  max-width: 420px;
  line-height: 1.8;
  margin-bottom: 56px;
}

.ob-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 48px;
}
.ob-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(198,165,92,0.2);
  transition: background 0.3s;
}
.ob-dot.active { background: var(--gold); }

.ob-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  margin-bottom: 56px;
}
.ob-checklist li {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: rgba(247,245,242,0.55);
}
.ob-checklist li span.mark {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(198,165,92,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
  font-size: 12px;
}

.ob-commit-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 22px;
  color: rgba(247,245,242,0.7);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 56px;
}

.ob-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px;
  border-radius: 9999px;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}
.ob-btn:hover {
  background: var(--gold);
  color: #0a0806;
  box-shadow: 0 0 28px rgba(198,165,92,0.35);
}

.ob-skip {
  position: absolute;
  top: 28px;
  right: 28px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,245,242,0.2);
  cursor: pointer;
  transition: color 0.25s;
  font-family: 'Inter', sans-serif;
}
.ob-skip:hover { color: rgba(247,245,242,0.4); }

/* ─── DARK MODE OVERRIDES ────────────────────────────────── */
[data-theme="dark"] body { background: #0A0907; }

[data-theme="dark"] .section:not(.section-dark):not(.section-sage):not(.section-connect) {
  background: #0A0907;
}
[data-theme="dark"] .section-ivory-2 { background: #111009; }
[data-theme="dark"] .section-ivory-3 { background: #181510; }
[data-theme="dark"] .section-connect { background: #0e1209; }

[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4 { color: #DDD8D0; }

[data-theme="dark"] body,
[data-theme="dark"] p,
[data-theme="dark"] li { color: #9A9590; }

[data-theme="dark"] .text-primary { color: #DDD8D0; }
[data-theme="dark"] .prose { color: #7A756E; }

[data-theme="dark"] .card { background: #181410; border: 1px solid rgba(255,255,255,0.05); }
[data-theme="dark"] .card-matte {
  background: #141108;
  border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .card-matte:hover {
  background: #1c1810;
  border-color: rgba(198,165,92,0.3);
}

[data-theme="dark"] .nav.scrolled {
  background: rgba(10,9,7,0.92);
  border-bottom: 1px solid rgba(198,165,92,0.1);
}
[data-theme="dark"] .nav.scrolled .nav-logo-text { color: #DDD8D0; }
[data-theme="dark"] .nav.scrolled .nav-links a { color: rgba(221,216,208,0.6); }
[data-theme="dark"] .nav.scrolled .nav-links a:hover { color: var(--gold); }
[data-theme="dark"] .nav.scrolled .nav-hamburger span { background: #DDD8D0; }

[data-theme="dark"] .blockquote p { color: #DDD8D0; }
[data-theme="dark"] .precept { border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .precept h4 { color: #DDD8D0; }
[data-theme="dark"] .precept p { color: #7A756E; }
[data-theme="dark"] .timeline-item h4 { color: #DDD8D0; }
[data-theme="dark"] .timeline-item p { color: #7A756E; }
[data-theme="dark"] .stepper-item h4 { color: #DDD8D0; }
[data-theme="dark"] .stepper-item p { color: #7A756E; }

[data-theme="dark"] .stat-label { color: #7A756E; }
[data-theme="dark"] .footer-copy { color: rgba(247,245,242,0.2); }

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  color: #DDD8D0;
  border-bottom-color: rgba(255,255,255,0.12);
  background: transparent;
}
[data-theme="dark"] .form-wrap { background: #141108; border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .form-group label { color: rgba(221,216,208,0.4); }

[data-theme="dark"] .history-entry h4 { color: #DDD8D0; }
[data-theme="dark"] .history-entry p { color: #7A756E; }
[data-theme="dark"] .history-entry::before { background: #0A0907; }

[data-theme="dark"] .prepare-item { border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .prepare-item span { color: #7A756E; }
[data-theme="dark"] .prepare-item strong { color: #DDD8D0; }

[data-theme="dark"] .course-card { background: #141108; border-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .course-card h4 { color: #DDD8D0; }
[data-theme="dark"] .course-card p { color: #7A756E; }
[data-theme="dark"] .course-meta { border-color: rgba(255,255,255,0.06); }

[data-theme="dark"] .guideline-item { background: #141108; border-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .guideline-item h4 { color: #DDD8D0; }
[data-theme="dark"] .guideline-item p { color: #7A756E; }

[data-theme="dark"] .benefit-icon-card { background: #141108; border-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .benefit-icon-card h4 { color: #DDD8D0; }
[data-theme="dark"] .benefit-icon-card p { color: #7A756E; }

[data-theme="dark"] .dana-principle { background: #141108; border-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .dana-principle h4 { color: #DDD8D0; }
[data-theme="dark"] .dana-principle p { color: #7A756E; }

[data-theme="dark"] .ask-item { border-color: rgba(255,255,255,0.06); color: #9A9590; }

[data-theme="dark"] .step-row p { color: #7A756E; }
[data-theme="dark"] .whatsapp-block { background: #0A0907; }
[data-theme="dark"] .whatsapp-block h3 { color: #DDD8D0; }

[data-theme="dark"] .application-tag { border-color: rgba(198,165,92,0.2); }

/* ─── CINEMATIC SECTION REVEAL (GUIDED SCROLL) ───────────── */
.cinema-section {
  position: relative;
}
.cinema-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.0);
  pointer-events: none;
  z-index: 10;
  transition: background 0.8s ease;
}
.cinema-section.entering::before { background: rgba(0,0,0,0.25); }

/* ─── ENHANCED PARTICLE CANVAS ───────────────────────────── */
/* Handled in JS; canvas is already present */

/* ─── CHAT UI ─────────────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  max-width: 700px;
  margin: 0 auto;
  background: var(--charcoal-2);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}

.chat-header {
  padding: 20px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.02);
}
.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(198,165,92,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(198,165,92,0.25);
  flex-shrink: 0;
}
.chat-avatar img { width: 22px; height: 22px; opacity: 0.8; }
.chat-header-info { flex: 1; }
.chat-header-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ivory);
  letter-spacing: 0.02em;
}
.chat-header-status {
  font-size: 11px;
  color: rgba(198,165,92,0.5);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #6BCB77;
  animation: statusPulse 2.5s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(198,165,92,0.2); border-radius: 2px; }

.chat-msg {
  display: flex;
  gap: 10px;
  animation: fadeInUp 0.45s ease both;
}
.chat-msg.user { flex-direction: row-reverse; }

.chat-msg-bubble {
  max-width: 75%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.65;
  position: relative;
}
.chat-msg.dhamma .chat-msg-bubble {
  background: rgba(255,255,255,0.06);
  color: rgba(247,245,242,0.85);
  border-bottom-left-radius: 4px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 15px;
}
.chat-msg.user .chat-msg-bubble {
  background: rgba(198,165,92,0.15);
  color: rgba(247,245,242,0.8);
  border-bottom-right-radius: 4px;
  font-family: 'Inter', sans-serif;
}

.chat-msg-time {
  font-size: 10px;
  color: rgba(247,245,242,0.2);
  margin-top: 5px;
  letter-spacing: 0.04em;
  align-self: flex-end;
  padding: 0 4px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.3s;
}
.typing-indicator.visible { opacity: 1; }
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  background: rgba(255,255,255,0.06);
  padding: 10px 14px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(198,165,92,0.4);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: rgba(255,255,255,0.02);
}
.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: rgba(247,245,242,0.85);
  resize: none;
  outline: none;
  min-height: 46px;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color 0.3s;
}
.chat-input::placeholder { color: rgba(247,245,242,0.25); }
.chat-input:focus { border-color: rgba(198,165,92,0.3); }

.chat-send {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(198,165,92,0.15);
  border: 1px solid rgba(198,165,92,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s ease;
  color: var(--gold);
}
.chat-send:hover { background: rgba(198,165,92,0.25); box-shadow: 0 0 12px rgba(198,165,92,0.2); }
.chat-send svg { width: 16px; height: 16px; }
.chat-send:disabled { opacity: 0.35; cursor: not-allowed; }

/* Prompt pills (quick questions) */
.chat-prompts {
  display: flex;
  gap: 8px;
  padding: 0 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chat-prompts::-webkit-scrollbar { display: none; }
.chat-prompt-pill {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(198,165,92,0.2);
  font-size: 12px;
  color: rgba(198,165,92,0.65);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s;
  font-family: 'Inter', sans-serif;
  background: transparent;
}
.chat-prompt-pill:hover {
  background: rgba(198,165,92,0.1);
  color: var(--gold);
  border-color: rgba(198,165,92,0.4);
}

/* ─── LIGHT RAYS EFFECT (HERO) ───────────────────────────── */
.light-rays {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.light-ray {
  position: absolute;
  bottom: -10%;
  width: 1px;
  background: linear-gradient(to top, rgba(198,165,92,0.0), rgba(198,165,92,0.06) 50%, transparent);
  transform-origin: bottom center;
  animation: rayFlicker var(--ray-dur, 8s) ease-in-out infinite alternate;
}
@keyframes rayFlicker {
  0%   { opacity: 0.3; transform: rotate(var(--ray-rot, 0deg)) scaleX(1); }
  50%  { opacity: 0.6; transform: rotate(var(--ray-rot, 0deg)) scaleX(1.8); }
  100% { opacity: 0.2; transform: rotate(var(--ray-rot, 0deg)) scaleX(0.8); }
}

/* ─── SECTION LABEL (storytelling) ──────────────────────── */
.scene-label {
  position: fixed;
  left: 32px;
  bottom: 32px;
  z-index: 998;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(198,165,92,0.3);
  font-family: 'Inter', sans-serif;
  transition: opacity 0.4s, color 0.4s;
  pointer-events: none;
}
@media (max-width: 768px) { .scene-label { display: none; } }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .theme-toggle { bottom: 20px; right: 20px; width: 42px; height: 42px; }
  .soundscape-toggle { bottom: 20px; right: 72px; }
  .chat-container { height: 520px; border-radius: 16px; }
  .ob-heading { font-size: 28px; }
}
