/* ============================================================
   DESIGN SYSTEM — matches michaelshutt.xyz
   ============================================================ */
:root {
  --bg: #020617;
  --surface: rgba(30, 41, 59, 0.7);
  --border: rgba(148, 163, 184, 0.1);
  --ink: #f8fafc;
  --muted: #94a3b8;
  --brand: #22d3ee;
  --brand-glow: rgba(34, 211, 238, 0.5);
  --brand-deep: #0891b2;
  --accent: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.5);
  --radius: 12px;
  --font-head: "Outfit", sans-serif;
  --font-body: "DM Sans", sans-serif;
  color-scheme: dark;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: var(--brand-deep);
  text-shadow: 0 0 8px var(--brand-glow);
}

button { cursor: pointer; }

.container { width: min(1200px, 92vw); margin: 0 auto; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  color: white;
}
h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h3 { font-size: 1.35rem; }

p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--brand);
  color: #0f172a;
  font-weight: 700;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ============================================================
   NAV
   ============================================================ */
.topbar {
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.2rem;
  color: white;
  letter-spacing: -0.02em;
}
.menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.menu a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.menu a:hover {
  color: white;
  text-shadow: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.6rem;
  border-radius: 9999px;
  font-weight: 600;
  font-family: var(--font-head);
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
}
.btn-primary {
  background: var(--brand);
  color: #0f172a;
  box-shadow: 0 0 20px -5px var(--brand-glow);
}
.btn-primary:hover, .btn-primary:focus {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 0 30px -5px var(--brand-glow);
  color: #0f172a;
  text-shadow: none;
}
.btn-secondary {
  background: transparent;
  color: white;
  border: 1px solid var(--border);
}
.btn-secondary:hover, .btn-secondary:focus {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 15px -5px var(--brand-glow);
  text-shadow: none;
}

/* ============================================================
   LAYOUT
   ============================================================ */
section { padding: 6rem 0; }

.hero {
  padding: 7rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.12) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}
.hero p { max-width: 580px; font-size: 1.2rem; line-height: 1.65; }

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.highlight-section {
  background: rgba(30, 41, 59, 0.4);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.highlight-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top, rgba(34, 211, 238, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}
.highlight-section .container { position: relative; z-index: 2; }

/* ============================================================
   CARDS
   ============================================================ */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  margin-top: 2.5rem;
}
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 0 30px -10px var(--brand-glow);
}
.card-icon { font-size: 2rem; margin-bottom: 1rem; display: block; }
.card h3 { color: var(--brand); margin-bottom: 0.5rem; }
.price-tag {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
  margin: 0;
}

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  transition: all 0.3s ease;
}
.stat-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 20px -8px var(--brand-glow);
}
.stat-number {
  font-family: var(--font-head);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-label { color: var(--muted); font-size: 0.9rem; font-weight: 500; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  background: rgba(2, 6, 23, 0.5);
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}
.footer-brand {
  font-family: var(--font-head);
  color: white;
}
.footer-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.footer-copy {
  margin-top: 2rem;
  font-size: 0.8rem;
  opacity: 0.5;
}
.footer-credit {
  margin-left: 1rem;
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .card, .btn, a { transition: none; }
}

/* ============================================================
   CHAT WIDGET — FAB
   ============================================================ */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--brand);
  color: #0f172a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px -4px var(--brand-glow), 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-fab:hover {
  background: white;
  transform: scale(1.08);
  box-shadow: 0 6px 30px -4px var(--brand-glow);
}
.chat-fab.open {
  background: rgba(30, 41, 59, 0.9);
  color: var(--muted);
  border: 1px solid var(--border);
}
.fab-icon { display: flex; align-items: center; justify-content: center; }
.fab-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--bg);
  display: none;
}
.fab-badge.visible { display: block; }

/* ============================================================
   CHAT WIDGET — PANEL
   ============================================================ */
.chat-panel {
  position: fixed;
  bottom: 102px;
  right: 28px;
  width: 380px;
  height: 520px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(10, 17, 40, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 999;
  box-shadow:
    0 20px 60px -10px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(34, 211, 238, 0.06);
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  overflow: hidden;
}
.chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   CHAT HEADER
   ============================================================ */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, rgba(34, 211, 238, 0.07), rgba(167, 139, 250, 0.04));
  flex-shrink: 0;
}
.chat-header-info { display: flex; align-items: center; gap: 0.75rem; }
.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #0f172a;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.chat-header-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  color: white;
}
.chat-header-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 2px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.chat-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}
.chat-close-btn:hover { background: rgba(148, 163, 184, 0.1); color: white; }

/* ============================================================
   MESSAGES
   ============================================================ */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.2); border-radius: 2px; }

.message {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  animation: msg-appear 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes msg-appear {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.message.user    { align-self: flex-end;  align-items: flex-end; }
.message.assistant { align-self: flex-start; align-items: flex-start; }

.message-bubble {
  padding: 0.6rem 0.95rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  word-break: break-word;
}
.message.user .message-bubble {
  background: var(--brand);
  color: #0f172a;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.message.assistant .message-bubble {
  background: rgba(30, 41, 59, 0.8);
  color: var(--ink);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.message.assistant .message-bubble strong { color: var(--brand); }

.message-time {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 3px;
  opacity: 0.65;
  padding: 0 3px;
}

/* ============================================================
   TYPING INDICATOR
   ============================================================ */
.typing-indicator {
  display: none;
  padding: 0.25rem 1.1rem 0.5rem;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.typing-indicator.visible { display: flex; }
.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1.3s infinite ease-in-out;
}
.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/* ============================================================
   INPUT AREA
   ============================================================ */
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.5);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.55rem 0.8rem;
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 100px;
  overflow-y: auto;
  transition: border-color 0.2s ease;
}
.chat-input::placeholder { color: var(--muted); opacity: 0.7; }
.chat-input:focus {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.08);
}
.chat-input:disabled { opacity: 0.5; }

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--brand);
  color: #0f172a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.chat-send-btn:hover { background: white; transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 90px;
    height: 480px;
  }
  .chat-fab { bottom: 18px; right: 18px; }
}

@media (max-width: 768px) {
  .menu { gap: 1rem; font-size: 0.85rem; }
  .hero { padding: 5rem 0 3rem; }
  section { padding: 4rem 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .menu a { display: none; }
}
