/* ==========================================================
   DESIGN TOKENS
   Paper: latar netral, bukan putih polos
   Ink: teks utama
   Muted: teks sekunder
   Gold: aksen data KUANTITATIF
   Plum: aksen data KUALITATIF
   ========================================================== */
:root {
  --paper: #FBFBFD;
  --paper-alt: #F3F1FA;
  --ink: #211B37;
  --muted: #665F7D;
  --line: #E4E0F2;

  --gold: #4FAEDE;      /* kuantitatif — biru muda */
  --gold-bg: #E7F4FC;
  --plum: #6C4AB6;      /* kualitatif — ungu */
  --plum-bg: #EFE9FA;
  --mixed: #4B3F8F;     /* mixed methods — ungu tua kebiruan */
  --mixed-bg: #EAE6F7;

  --violet: #6C4AB6;
  --violet-dark: #4B3468;
  --sky: #4FAEDE;
  --sky-light: #A9DCF2;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 14px;
  --max-w: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
ul { padding-left: 1.1em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6em;
}

.lede { color: var(--muted); font-size: 1.05rem; max-width: 46ch; }

section { padding: 5.5rem 1.5rem; }
.section-head { max-width: var(--max-w); margin: 0 auto 2.75rem; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); max-width: 22ch; margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }
.btn-nav { padding: 0.6rem 1.1rem; font-size: 0.85rem; background: var(--violet); color: #fff; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,247,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
}
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.logo span { color: var(--gold); }
.nav-links { display: flex; gap: 1.75rem; font-size: 0.92rem; }
.nav-links a:hover { color: var(--plum); }

/* ---------- Hero ---------- */
.hero { padding-top: 4.5rem; padding-bottom: 3rem; }
.hero-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
}
.hero h1 em { font-style: normal; color: var(--plum); }
.hero-cta { display: flex; gap: 0.9rem; margin-top: 2rem; flex-wrap: wrap; }

/* Signature element: data cards */
.hero-visual { position: relative; min-height: 320px; }
.data-card {
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  position: absolute;
  width: 78%;
  box-shadow: 0 12px 30px -18px rgba(27,27,31,0.25);
}
.quant-card { top: 0; right: 0; }
.qual-card { bottom: 0; left: 0; background: var(--paper); animation: floatIn 900ms ease-out 200ms both; }
.quant-card { animation: floatIn 900ms ease-out 0ms both; }

@keyframes floatIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 0.7rem;
}
.tag-quant { background: var(--gold-bg); color: var(--gold); }
.tag-qual  { background: var(--plum-bg); color: var(--plum); }
.tag-mixed { background: var(--mixed-bg); color: var(--mixed); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 70px; margin: 0.4rem 0; }
.bar {
  width: 14px; height: var(--h); background: var(--gold);
  border-radius: 3px 3px 0 0;
  animation: grow 900ms ease-out both;
}
@keyframes grow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }

.quote { font-size: 0.95rem; font-style: italic; color: var(--ink); margin: 0.3rem 0 0.8rem; }
.stat-line { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin: 0; }

.connector { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.connector path { fill: none; stroke: var(--line); stroke-width: 2; }

/* ---------- Trust bar ---------- */
.trust { padding: 2.5rem 1.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-label { text-align: center; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); margin-bottom: 1.1rem; text-transform: uppercase; letter-spacing: .06em;}
.trust-items { display: flex; justify-content: center; gap: 2.2rem; flex-wrap: wrap; font-weight: 600; color: var(--muted); font-size: 0.9rem; }

/* ---------- Services ---------- */
.service-grid {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.service-card {
  background: var(--paper-alt); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.75rem;
}
.service-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.service-card p { color: var(--muted); font-size: 0.93rem; }
.service-card ul { font-size: 0.88rem; color: var(--ink); margin-top: 0.9rem; }
.service-card li { margin-bottom: 0.3rem; }

/* ---------- Process ---------- */
.process-list {
  max-width: var(--max-w); margin: 0 auto;
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}
.process-list li { border-top: 2px solid var(--ink); padding-top: 1rem; }
.step-num { font-family: var(--font-mono); color: var(--gold); font-size: 0.85rem; }
.process-list h3 { font-size: 1.02rem; margin: 0.4rem 0 0.4rem; }
.process-list p { color: var(--muted); font-size: 0.88rem; }

/* ---------- Testimonials ---------- */
.testi-grid {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.testi-grid blockquote { margin: 0; background: var(--paper-alt); border-radius: var(--radius); padding: 1.6rem; border: 1px solid var(--line); }
.testi-grid p { font-size: 0.95rem; }
.testi-grid cite { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); font-style: normal; display: block; margin-top: 0.8rem; }

/* ---------- Contact ---------- */
.contact { background: linear-gradient(155deg, var(--violet-dark), #2E2350); color: var(--paper); }
.contact .eyebrow, .contact .lede { color: #C8BFE4; }
.contact-inner { max-width: 640px; margin: 0 auto; }
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1.5rem; }
.form-row { display: flex; flex-direction: column; gap: 0.4rem; }
.form-row label { font-size: 0.85rem; color: #C8BFE4; }
.form-row input, .form-row select, .form-row textarea {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); color: var(--paper);
  border-radius: 8px; padding: 0.7rem 0.9rem; font-family: var(--font-body); font-size: 0.95rem;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid var(--sky); outline-offset: 1px;
}
.contact .btn-primary { background: var(--sky); color: var(--violet-dark); align-self: flex-start; }
.contact .btn-primary:hover { background: var(--sky-light); }
.form-status { font-size: 0.85rem; min-height: 1.2em; }
.form-status.success { color: #7CD98A; }
.form-status.error { color: #E88A8A; }

/* ---------- Footer ---------- */
.footer { padding: 2.5rem 1.5rem; border-top: 1px solid var(--line); }
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: 0.85rem; color: var(--muted);
}
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a:hover { color: var(--plum); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { min-height: 280px; margin-top: 1rem; }
  .service-grid, .testi-grid { grid-template-columns: 1fr; }
  .process-list { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 480px) {
  .process-list { grid-template-columns: 1fr; }
}

/* ---------- Scroll reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Portfolio ---------- */
.portfolio-grid {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.portfolio-card {
  margin: 0; background: var(--paper-alt); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.portfolio-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.portfolio-card figcaption { padding: 1.4rem; }
.portfolio-card h3 { font-size: 1.05rem; margin: 0.6rem 0 0.4rem; }
.portfolio-card p { font-size: 0.9rem; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.9rem; }
.faq-item {
  background: var(--paper-alt); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.4rem;
}
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 0.98rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 1.3rem; color: var(--violet); margin-left: 1rem; transition: transform 200ms ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--muted); font-size: 0.92rem; margin: 0.8rem 0 0.2rem; }

/* ---------- WhatsApp floating button ---------- */
.whatsapp-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; box-shadow: 0 10px 24px -8px rgba(37,211,102,0.6);
  transition: transform 150ms ease;
}
.whatsapp-float:hover { transform: scale(1.08); }

/* ---------- Chatbot widget ---------- */
#chatbot-widget { position: fixed; left: 22px; bottom: 22px; z-index: 60; font-family: var(--font-body); }
#chatbot-toggle {
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--violet); color: #fff; font-size: 1.4rem;
  box-shadow: 0 10px 24px -8px rgba(108,74,182,0.6);
  transition: transform 150ms ease;
}
#chatbot-toggle:hover { transform: scale(1.08); }

#chatbot-window {
  position: fixed; left: 22px; bottom: 92px; z-index: 60;
  width: 320px; max-width: calc(100vw - 44px); height: 420px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 48px -16px rgba(33,27,55,0.35);
  display: flex; flex-direction: column; overflow: hidden;
}
#chatbot-window.hidden { display: none; }

.chatbot-header {
  background: var(--violet); color: #fff; padding: 0.9rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 0.95rem;
}
.chatbot-header button {
  background: transparent; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; line-height: 1;
}

.chatbot-messages {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--paper-alt);
}
.chat-msg { max-width: 85%; padding: 0.55rem 0.8rem; border-radius: 12px; font-size: 0.87rem; line-height: 1.4; }
.chat-msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 2px; }
.chat-msg.user { background: var(--violet); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }

.chatbot-quick-replies { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1rem 0.6rem; background: var(--paper-alt); }
.chatbot-quick-replies button {
  font-size: 0.76rem; padding: 0.35rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--violet); background: #fff; color: var(--violet); cursor: pointer;
}
.chatbot-quick-replies button:hover { background: var(--plum-bg); }

.chatbot-input-form { display: flex; border-top: 1px solid var(--line); }
.chatbot-input-form input {
  flex: 1; border: none; padding: 0.8rem 1rem; font-size: 0.87rem; font-family: var(--font-body);
}
.chatbot-input-form input:focus { outline: none; }
.chatbot-input-form button {
  width: 48px; border: none; background: var(--violet); color: #fff; cursor: pointer; font-size: 1rem;
}

@media (max-width: 480px) {
  .whatsapp-float { right: 14px; bottom: 14px; width: 50px; height: 50px; font-size: 1.4rem; }
  #chatbot-widget { left: 14px; bottom: 14px; }
  #chatbot-window { left: 14px; bottom: 78px; width: calc(100vw - 28px); }
  .portfolio-grid { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
