/* ===========================================================
   DESIGN TOKENS — shared across all pages
   =========================================================== */
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #191922;
  --text: #ededf2;
  --text-muted: #8a8a94;
  --accent-violet: #7c5cff;
  --accent-blue: #5c9fff;
  --accent-pink: #ff5ca8;
  --border: rgba(237, 237, 242, 0.1);

  --font-display: 'Caveat', cursive;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius: 16px;
  --radius-lg: 28px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.hidden { display: none !important; }

/* ===========================================================
   SIMPLE TOP NAV — every page except Home
   =========================================================== */
.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.page-nav .brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-blue), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-nav .back-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
}
.page-nav .back-link:hover { color: var(--text); border-color: var(--accent-blue); }

/* ===========================================================
   SHARED SECTION LAYOUT
   =========================================================== */
.section {
  position: relative;
  padding: 3rem 0 6rem;
  overflow: hidden;
  min-height: 70vh;
}

.section canvas.section-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.section-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}

.section-blurb {
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
}

/* ===========================================================
   FOOTER
   =========================================================== */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ===========================================================
   CHATBOT — site-wide, included on every page
   =========================================================== */
#chatbot-root {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
}

#chatbot-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: #12121a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

#chatbot-bubble svg { width: 26px; height: 26px; }

#chatbot-bubble::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, var(--accent-violet), var(--accent-blue), var(--accent-pink), var(--accent-violet));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 4s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#chatbot-window {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: min(340px, 90vw);
  height: 440px;
  background: #101017;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

#chatbot-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.chatbot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-title { font-weight: 600; font-size: 0.9rem; }
.chatbot-subtitle { font-size: 0.7rem; color: var(--text-muted); }

#chatbot-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
}

#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.msg {
  max-width: 85%;
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.msg.user { align-self: flex-end; background: var(--surface-2); }
.msg.bot {
  align-self: flex-start;
  background: linear-gradient(160deg, rgba(124,92,255,0.25), rgba(255,92,168,0.15));
}

#chatbot-form { display: flex; border-top: 1px solid var(--border); }

#chatbot-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.8rem 1rem;
  font-family: inherit;
}

#chatbot-form button { background: none; border: none; color: var(--accent-blue); padding: 0 1rem; }

@media (max-width: 480px) {
  #chatbot-window { height: 70vh; }
}
