/* ============================================================
   METASTACK — Global Styles
   Design system: clean white, slate accents, blue primary
   Font: Bricolage Grotesque (display) + Instrument Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700;800&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Brand */
  --blue:        #1a56db;
  --blue-hover:  #1648c0;
  --blue-light:  #eff6ff;
  --blue-mid:    #bfdbfe;

  /* Neutrals */
  --white:       #ffffff;
  --slate-50:    #f8fafc;
  --slate-100:   #f1f5f9;
  --slate-200:   #e2e8f0;
  --slate-300:   #cbd5e1;
  --slate-400:   #94a3b8;
  --slate-500:   #64748b;
  --slate-600:   #475569;
  --slate-700:   #334155;
  --slate-800:   #1e293b;
  --slate-900:   #0f172a;

  /* Semantic */
  --green:       #059669;
  --green-light: #ecfdf5;
  --red:         #dc2626;
  --amber:       #d97706;

  /* Type */
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'Instrument Sans', sans-serif;

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-2xl: 32px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.12);

  /* Transitions */
  --ease: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; text-rendering: optimizeLegibility; }
body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--slate-800);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.container     { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.container-sm  { max-width: 780px;  margin: 0 auto; padding: 0 28px; }
.section       { padding: 104px 0; }
.section-lg    { padding: 128px 0; }
.section-sm    { padding: 72px 0; }

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 18px;
}
.eyebrow::before {
  content: '';
  width: 20px; height: 2px;
  background: var(--blue); border-radius: 2px; flex-shrink: 0;
}

.heading-xl {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800; line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--slate-900);
}
.heading-lg {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700; line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--slate-900);
}
.heading-md {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-weight: 700; line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--slate-900);
}
.text-blue { color: var(--blue); }
.text-muted { color: var(--slate-500); }
.body-lg { font-size: 1.0625rem; line-height: 1.75; color: var(--slate-600); }
.body-sm { font-size: 0.875rem; line-height: 1.6; color: var(--slate-500); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-md);
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600;
  transition: all var(--ease); white-space: nowrap; cursor: pointer;
  border: 1.5px solid transparent;
}
.btn-primary {
  background: var(--blue); color: #fff; border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,86,219,0.3); }
.btn-ghost {
  background: transparent; color: var(--slate-700); border-color: var(--slate-200);
}
.btn-ghost:hover { border-color: var(--slate-300); background: var(--slate-50); color: var(--slate-900); }
.btn-white {
  background: #fff; color: var(--slate-900); border-color: transparent;
}
.btn-white:hover { background: var(--slate-100); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--r-md); }
.btn-sm { padding: 8px 16px; font-size: 0.8125rem; border-radius: var(--r-sm); }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--r-xl);
  transition: box-shadow var(--ease), border-color var(--ease), transform var(--ease);
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--slate-300); transform: translateY(-3px); }
.card-surface {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--r-xl);
}

/* ── TAGS ────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 10px; border-radius: 100px;
  background: var(--slate-100); color: var(--slate-600);
  letter-spacing: 0.02em;
}
.tag-blue {
  background: var(--blue-light); color: var(--blue);
}

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--slate-200); }

/* ── SCROLL REVEAL ───────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }
.reveal-d5 { transition-delay: 0.40s; }

/* ── FORM SHARED ─────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 0.8125rem; font-weight: 600;
  color: var(--slate-700); margin-bottom: 7px;
}
.form-control {
  width: 100%; padding: 11px 15px;
  background: var(--white); border: 1.5px solid var(--slate-200);
  border-radius: var(--r-md); font-size: 0.9rem; color: var(--slate-900);
  transition: border-color var(--ease), box-shadow var(--ease);
  outline: none; resize: none;
  -webkit-appearance: none; appearance: none;
}
.form-control::placeholder { color: var(--slate-300); }
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.form-control.invalid { border-color: var(--red); }
.field-error { font-size: 0.75rem; color: var(--red); margin-top: 5px; font-weight: 500; display: none; }
.field-error.show { display: block; }

/* ── NAVBAR ──────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: 68px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease), box-shadow var(--ease);
}
#nav.scrolled { border-bottom-color: var(--slate-200); box-shadow: var(--shadow-sm); }
.nav-wrap {
  height: 68px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 800;
  color: var(--slate-900); letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 7px;
}
.nav-logo-mark {
  width: 28px; height: 28px; background: var(--blue);
  border-radius: 7px; display: flex; align-items: center; justify-content: center;
}
.nav-logo-mark svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.nav-links {
  display: flex; align-items: center; gap: 2px;
}
.nav-links a {
  font-size: 0.875rem; font-weight: 500; color: var(--slate-600);
  padding: 6px 13px; border-radius: var(--r-sm);
  transition: color var(--ease), background var(--ease);
}
.nav-links a:hover { color: var(--slate-900); background: var(--slate-100); }
.nav-links a.active { color: var(--blue); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.hamburger {
  display: none; flex-direction: column; gap: 4.5px;
  padding: 8px; border-radius: var(--r-sm); cursor: pointer;
  transition: background var(--ease);
}
.hamburger:hover { background: var(--slate-100); }
.hamburger span {
  display: block; width: 20px; height: 1.8px;
  background: var(--slate-700); border-radius: 2px; transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

/* Mobile drawer */
.mobile-drawer {
  display: none; position: fixed;
  top: 68px; left: 0; right: 0; bottom: 0;
  background: var(--white); z-index: 850;
  flex-direction: column; padding: 24px 28px 40px;
  overflow-y: auto; border-top: 1px solid var(--slate-200);
}
.mobile-drawer.open { display: flex; }
.mobile-drawer a {
  font-family: var(--font-display);
  font-size: 1.375rem; font-weight: 700; color: var(--slate-800);
  padding: 16px 0; border-bottom: 1px solid var(--slate-100);
  display: flex; align-items: center; justify-content: space-between;
}
.mobile-drawer a::after { content: '→'; color: var(--slate-300); font-size: 1rem; }
.mobile-drawer .btn { margin-top: 24px; width: 100%; justify-content: center; font-size: 1rem; padding: 15px; }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  background: var(--slate-900); color: var(--slate-400);
  padding: 72px 0 36px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 56px;
}
.footer-brand-name {
  font-family: var(--font-display); font-size: 1.25rem;
  font-weight: 800; color: var(--white); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.footer-brand-mark {
  width: 26px; height: 26px; background: var(--blue);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.footer-brand-mark svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; max-width: 260px; color: var(--slate-500); }
.footer-socials { display: flex; gap: 8px; margin-top: 20px; }
.social-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--slate-800); border: 1px solid var(--slate-700);
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-500); font-size: 0.75rem; font-weight: 700;
  transition: all var(--ease); text-decoration: none;
}
.social-btn:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }
.footer-col h5 {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 700;
  color: var(--white); text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 18px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 0.875rem; color: var(--slate-500); transition: color var(--ease); }
.footer-col a:hover { color: var(--slate-300); }
.footer-bottom {
  border-top: 1px solid var(--slate-800);
  padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p, .footer-bottom a { font-size: 0.8125rem; color: var(--slate-600); }
.footer-bottom a:hover { color: var(--slate-400); }

/* ── CHATBOT ─────────────────────────────────────────────── */
.chat-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 800;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 1.25rem;
  border: none; cursor: pointer;
  box-shadow: 0 4px 24px rgba(26,86,219,0.4);
  transition: all var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.chat-fab:hover { transform: scale(1.07); background: var(--blue-hover); }
.chat-fab .badge-dot {
  position: absolute; top: 1px; right: 1px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff;
}
.chat-window {
  position: fixed; bottom: 94px; right: 28px; z-index: 799;
  width: 356px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transition: all 0.24s cubic-bezier(0.34, 1.4, 0.64, 1);
  max-height: 520px;
}
.chat-window.open { opacity: 1; pointer-events: all; transform: none; }
.chat-win-header {
  background: var(--blue); padding: 16px 18px;
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.chat-win-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.chat-win-info { flex: 1; }
.chat-win-info strong { display: block; color: #fff; font-size: 0.875rem; font-weight: 700; }
.chat-win-info span { color: rgba(255,255,255,0.7); font-size: 0.75rem; }
.chat-win-close { color: rgba(255,255,255,0.7); font-size: 1rem; transition: color var(--ease); }
.chat-win-close:hover { color: #fff; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 2px; }
.chat-msg { display: flex; flex-direction: column; max-width: 84%; }
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }
.chat-bubble {
  padding: 10px 14px; border-radius: 16px;
  font-size: 0.875rem; line-height: 1.55;
}
.chat-msg.bot  .chat-bubble { background: var(--slate-100); color: var(--slate-800); border-bottom-left-radius: 4px; }
.chat-msg.user .chat-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.chat-qr { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chat-qr-btn {
  padding: 6px 12px; border-radius: 100px;
  font-size: 0.775rem; font-weight: 600;
  border: 1.5px solid var(--slate-200); background: var(--white); color: var(--slate-700);
  cursor: pointer; transition: all var(--ease);
}
.chat-qr-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.chat-typing {
  display: flex; gap: 4px; padding: 11px 14px;
  background: var(--slate-100); border-radius: 16px; border-bottom-left-radius: 4px;
  width: fit-content; align-self: flex-start;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--slate-400);
  animation: bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes bounce { 0%,80%,100%{transform:translateY(0);opacity:0.4;} 40%{transform:translateY(-5px);opacity:1;} }
.chat-input-bar {
  padding: 12px 14px; border-top: 1px solid var(--slate-200);
  display: flex; gap: 8px; flex-shrink: 0; background: var(--white);
}
.chat-input-bar input {
  flex: 1; padding: 9px 14px; border: 1.5px solid var(--slate-200);
  border-radius: 100px; font-size: 0.875rem; outline: none;
  transition: border-color var(--ease);
}
.chat-input-bar input:focus { border-color: var(--blue); }
.chat-send {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 0.9rem;
  border: none; cursor: pointer; transition: background var(--ease);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-send:hover { background: var(--blue-hover); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .section { padding: 72px 0; }
  .section-lg { padding: 88px 0; }
  .nav-links { display: none; }
  .nav-right .btn-ghost { display: none; }
  .hamburger { display: flex; }
  .chat-window { width: calc(100vw - 32px); right: 16px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .chat-fab { right: 16px; bottom: 20px; }
}
