/* =============================================================
   Lexy v2 — design preview shared stylesheet
   ============================================================= */

:root {
  --lexy-black: #050709;
  --lexy-deep-charcoal: #0B0F12;
  --lexy-charcoal-2: #151B21;
  --lexy-charcoal-3: #1F2730;
  --lexy-white: #FFFFFF;
  --lexy-mist: #F5FAF8;
  --lexy-stone-50: #FAFBFB;
  --lexy-stone-100: #ECEEEF;
  --lexy-stone-200: #DDE1E4;
  --lexy-stone-300: #C9CED2;
  --lexy-stone-400: #98A0A8;
  --lexy-stone-500: #6B7178;
  --lexy-stone-600: #494F55;
  --lexy-stone-700: #2B3138;
  --lexy-orange: #FF7A2F;
  --lexy-orange-light: #FF9A45;
  --lexy-orange-deep: #E1601A;
  --lexy-orange-tint: rgba(255, 122, 47, 0.10);
  --lexy-mint: #35E8A6;
  --lexy-mint-light: #6EF6BF;
  --lexy-mint-tint: rgba(53, 232, 166, 0.14);
  --lexy-gold: #BFD16D;
  --lexy-rose-error: #C9241E;
  --lexy-rose-error-tint: #FFF5F4;
  --lexy-gradient: linear-gradient(135deg, #FF7A2F 0%, #FF9A45 34%, #BFD16D 53%, #6EF6BF 77%, #35E8A6 100%);

  --font-serif: 'Lora', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(5,7,9,.05), 0 1px 1px rgba(5,7,9,.04);
  --shadow-md: 0 8px 24px -8px rgba(5,7,9,.12), 0 2px 6px rgba(5,7,9,.04);
  --shadow-lg: 0 24px 60px -20px rgba(5,7,9,.25), 0 8px 20px -10px rgba(5,7,9,.10);
  --shadow-focus: 0 0 0 4px rgba(5,7,9,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--lexy-deep-charcoal);
  background: var(--lexy-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--lexy-orange); color: var(--lexy-white); }

/* ===== view switcher (banner top) ===== */
.lexy-switcher {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(5,7,9,.92);
  color: #fff;
  border-radius: 999px;
  padding: 5px;
  display: flex;
  gap: 4px;
  box-shadow: 0 10px 30px -8px rgba(5,7,9,.45), 0 0 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-sans);
}
.lexy-switcher a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  transition: color .15s ease, background .15s ease;
}
.lexy-switcher a:hover { color: #fff; }
.lexy-switcher a.active {
  background: var(--lexy-orange);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px -4px rgba(255,122,47,.6);
}
.lexy-switcher a .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lexy-mint);
  box-shadow: 0 0 0 3px rgba(53,232,166,.2);
}

/* ===== buttons ===== */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  padding: 11px 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, color .15s ease, border-color .15s ease;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary {
  background: var(--lexy-orange);
  color: var(--lexy-white);
  box-shadow: 0 6px 18px -8px rgba(255,122,47,.55), inset 0 -1px 0 rgba(0,0,0,.12);
}
.btn-primary:hover { background: var(--lexy-orange-deep); transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(255,122,47,.65); }
.btn-primary:active { transform: translateY(0); background: #C9521A; }
.btn-dark { background: var(--lexy-black); color: var(--lexy-white); }
.btn-dark:hover { background: var(--lexy-deep-charcoal); }
.btn-ghost { background: transparent; color: var(--lexy-deep-charcoal); padding: 11px 16px; }
.btn-ghost:hover { background: var(--lexy-stone-100); }
.btn-outline {
  background: transparent;
  color: var(--lexy-deep-charcoal);
  border: 1px solid var(--lexy-stone-300);
}
.btn-outline:hover { border-color: var(--lexy-black); background: var(--lexy-mist); }
.btn-lg { padding: 15px 26px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ===== badges / pills ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.3;
}
.badge-mint { background: var(--lexy-mint-tint); color: #0e6b4a; }
.badge-mint .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--lexy-mint); animation: pulse 1.6s ease-in-out infinite; }
.badge-orange { background: var(--lexy-orange-tint); color: var(--lexy-orange-deep); }
.badge-dark { background: var(--lexy-black); color: var(--lexy-white); }
.badge-stone { background: var(--lexy-stone-100); color: var(--lexy-stone-700); font-weight: 500; }
.badge-gold { background: rgba(191,209,109,.25); color: #5a6a1f; }

@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

/* citation pill */
.citation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--lexy-stone-100);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--lexy-stone-700);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  font-weight: 500;
}
.citation:hover { border-color: var(--lexy-orange); background: var(--lexy-white); color: var(--lexy-black); }
.citation::before { content: '§'; color: var(--lexy-orange); font-weight: 700; }

/* ===== inputs ===== */
.input-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border: 1.5px solid var(--lexy-stone-100);
  border-radius: 14px;
  background: var(--lexy-white);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-bar:focus-within {
  border-color: var(--lexy-black);
  box-shadow: var(--shadow-focus);
}
.input-bar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  color: var(--lexy-black);
}
.input-bar input::placeholder { color: var(--lexy-stone-500); }
.input-bar .send {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--lexy-black); color: var(--lexy-white);
  display: grid; place-items: center;
  transition: background .15s ease;
}
.input-bar .send:hover { background: var(--lexy-orange); }

.input-plain {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--lexy-stone-200);
  border-radius: 10px;
  background: var(--lexy-white);
  font-size: 14.5px;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-plain:focus { border-color: var(--lexy-black); box-shadow: var(--shadow-focus); }

/* ===== chat messages (shared) ===== */
.msg { display: flex; gap: 12px; margin-bottom: 16px; }
.msg-avatar {
  flex: 0 0 36px; height: 36px; border-radius: 50%;
  background: var(--lexy-black);
  display: grid; place-items: center;
  overflow: hidden;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: contain; }
.msg-body {
  background: var(--lexy-mist);
  padding: 14px 18px;
  border-radius: 4px 18px 18px 18px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.65;
  color: var(--lexy-deep-charcoal);
}
.msg-body strong { font-weight: 700; color: var(--lexy-black); }
.msg-body em { color: var(--lexy-orange-deep); font-style: italic; }
.msg-meta { font-family: var(--font-sans); font-size: 11.5px; color: var(--lexy-stone-500); margin-top: 6px; }
.msg.user { flex-direction: row-reverse; }
.msg.user .msg-body {
  background: var(--lexy-deep-charcoal);
  color: var(--lexy-white);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  border-radius: 18px 4px 18px 18px;
}
.msg.user .msg-avatar {
  background: var(--lexy-orange);
  color: var(--lexy-white);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
}

/* typing indicator */
.typing { display: inline-flex; align-items: center; gap: 4px; padding: 9px 14px; border-radius: 999px; background: var(--lexy-deep-charcoal); }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--lexy-mint); animation: typing 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; background: var(--lexy-gold); }
.typing span:nth-child(3) { animation-delay: .3s; background: var(--lexy-mint-light); }
@keyframes typing { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }

/* ===== utility ===== */
.shell { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .shell { padding: 0 20px; } }

.fade-in { animation: fade .6s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.serif { font-family: var(--font-serif); }
.sans { font-family: var(--font-sans); }
.mono { font-family: var(--font-mono); }
