:root {
  --green-900: #063b35;
  --green-700: #0b6b5d;
  --green-500: #12a28a;
  --mint: #e7f5f1;
  --blue: #1f6fb2;
  --blue-soft: #dcebf7;
  --ink: #0d1f1c;
  --muted: #55696a;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* Figma "smart animate" feel */
}

html { scroll-behavior: smooth; }
body { font-family: "DM Sans", sans-serif; color: var(--ink); background: #fff; overflow-x: hidden; }
h1, h2, h3, h4, .brand { font-family: "Archivo", sans-serif; letter-spacing: -0.02em; }
a { transition: color 0.3s var(--ease); }

/* Nav */
.navbar { transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), padding 0.4s var(--ease); padding: 1.1rem 0; }
.navbar.scrolled { background: rgba(255, 255, 255, 0.96); box-shadow: 0 1px 0 rgba(6, 59, 53, 0.08); padding: 0.55rem 0; }
.navbar .brand { font-weight: 800; font-size: 1.35rem; color: #fff; }
.navbar.scrolled .brand, .navbar.scrolled .nav-link { color: var(--green-900); }
.navbar .nav-link { color: rgba(255, 255, 255, 0.85); font-weight: 500; position: relative; }
.navbar .nav-link::after { content: ""; position: absolute; left: 1rem; right: 1rem; bottom: 4px; height: 2px; background: var(--green-500); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease); }
.navbar .nav-link:hover::after { transform: scaleX(1); }
.navbar-toggler { border-color: rgba(255, 255, 255, 0.5); }
.navbar-toggler-icon { filter: invert(1); }
.navbar.scrolled .navbar-toggler { border-color: rgba(6, 59, 53, 0.4); }
.navbar.scrolled .navbar-toggler-icon { filter: none; }
@media (max-width: 991px) { .navbar-collapse { background: var(--green-900); border-radius: 12px; padding: 1rem; margin-top: 0.6rem; } .navbar .nav-link, .navbar.scrolled .nav-link { color: #fff; } }

/* Buttons */
.btn-sea, .btn-ghost { border-radius: 999px; font-weight: 700; padding: 0.85rem 1.8rem; position: relative; overflow: hidden; transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), background 0.3s; }
.btn-sea { background: var(--green-500); color: #fff; border: 0; box-shadow: 0 8px 20px -8px rgba(18, 162, 138, 0.8); }
.btn-sea:hover { background: #0f8f7a; color: #fff; transform: translateY(-3px); box-shadow: 0 14px 26px -10px rgba(18, 162, 138, 0.9); }
.btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, 0.7); }
.btn-ghost:hover { background: #fff; color: var(--green-900); transform: translateY(-3px); }
.btn-sea:active, .btn-ghost:active { transform: scale(0.97); }

/* Hero */
.hero { position: relative; min-height: 100vh; background: linear-gradient(180deg, #052e2a 0%, var(--green-700) 55%, #2a8fc0 100%); color: #fff; display: flex; align-items: center; overflow: hidden; padding: 7rem 0 14rem; }
.hero h1 { font-weight: 800; font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.02; }
.hero h1 em { font-style: normal; color: #8ee6d4; }
.hero .lead { max-width: 34rem; color: rgba(255, 255, 255, 0.82); }
.eyebrow { display: inline-block; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: #8ee6d4; margin-bottom: 1rem; }
.sun { position: absolute; width: 360px; height: 360px; border-radius: 50%; right: 12%; bottom: 22%; background: radial-gradient(circle, rgba(255, 255, 255, 0.5), rgba(142, 230, 212, 0.15) 60%, transparent 70%); animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.8; } }

.skyline { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: auto; display: block; }
.layer-far { fill: #0a5a4f; opacity: 0.55; }
.layer-mid { fill: #07453d; }
.layer-near { fill: #031f1b; }
.window { animation: twinkle 4s ease-in-out infinite; }
.window:nth-child(2n) { animation-delay: 1.2s; }
.window:nth-child(3n) { animation-delay: 2.4s; }
@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.95; } }
.crane-jib { transform-box: view-box; transform-origin: 1010px 232px; animation: sway 9s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(-4deg); } }
.hook { animation: lift 6s ease-in-out infinite; }
@keyframes lift { 50% { transform: translateY(-22px); } }
.cloud { fill: #fff; opacity: 0.12; animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-60px); } to { transform: translateX(160px); } }

/* Page-load sequence */
.stagger > * { opacity: 0; transform: translateY(28px); animation: rise 0.9s var(--ease) forwards; }
.stagger > *:nth-child(1) { animation-delay: 0.15s; }
.stagger > *:nth-child(2) { animation-delay: 0.3s; }
.stagger > *:nth-child(3) { animation-delay: 0.45s; }
.stagger > *:nth-child(4) { animation-delay: 0.6s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* Sections */
section { padding: 6rem 0; }
.section-title { font-weight: 800; font-size: clamp(2rem, 4vw, 3rem); }
.section-sub { color: var(--muted); max-width: 36rem; }
.bg-mint { background: var(--mint); }

.card-app { background: #fff; border: 1px solid rgba(6, 59, 53, 0.1); border-radius: 18px; padding: 2rem; height: 100%; transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease), border-color 0.4s; }
.card-app:hover { transform: translateY(-10px); box-shadow: 0 30px 50px -28px rgba(6, 59, 53, 0.45); border-color: var(--green-500); }
.card-app .tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--blue-soft); color: var(--blue); }
.card-app .tag.live { background: #d3f3ea; color: var(--green-700); }
.card-app h3 { font-size: 1.45rem; margin: 1.2rem 0 0.6rem; }
.card-app p { color: var(--muted); }
.card-app .arrow { font-weight: 700; color: var(--green-700); text-decoration: none; display: inline-flex; gap: 0.4rem; }
.card-app .arrow span { transition: transform 0.4s var(--ease); }
.card-app:hover .arrow span { transform: translateX(6px); }

.step { position: relative; padding-left: 4.2rem; margin-bottom: 2.2rem; }
.step .num { position: absolute; left: 0; top: 0; width: 3rem; height: 3rem; border-radius: 50%; background: var(--green-700); color: #fff; font-family: "Archivo", sans-serif; font-weight: 800; display: grid; place-items: center; transition: transform 0.6s var(--ease), background 0.4s; }
.step:hover .num { transform: scale(1.15) rotate(-8deg); background: var(--blue); }
.step h4 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.step p { color: var(--muted); margin: 0; }

.comp-item { display: flex; gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid rgba(6, 59, 53, 0.12); transition: padding-left 0.5s var(--ease); }
.comp-item:hover { padding-left: 0.8rem; }
.comp-item .lvl { flex: none; width: 5.5rem; font-weight: 800; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); padding-top: 0.2rem; }
.comp-item h4 { font-size: 1.1rem; margin: 0 0 0.2rem; }
.comp-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.notice { font-size: 0.85rem; color: var(--muted); border-left: 3px solid var(--blue); padding-left: 1rem; margin-top: 1.5rem; }

.stat { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 3rem; color: var(--green-700); line-height: 1; }

.cta { background: linear-gradient(120deg, var(--green-900), var(--green-700) 60%, var(--blue)); color: #fff; }
.form-control { border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.08); color: #fff; padding: 0.85rem 1rem; height: auto; transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease); }
.form-control::placeholder { color: rgba(255, 255, 255, 0.65); }
.form-control:focus { background: rgba(255, 255, 255, 0.16); border-color: #8ee6d4; color: #fff; box-shadow: none; transform: translateY(-2px); }

footer { background: #031f1b; color: rgba(255, 255, 255, 0.7); padding: 2.5rem 0; font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .stagger > * { opacity: 1; transform: none; }
}
@media (max-width: 767px) { .sun { display: none; } .hero { padding-bottom: 9rem; } }

/* Blog */
.blog-wrap { padding: 8rem 0 4rem; min-height: 70vh; }
.post-card { display: block; padding: 1.6rem 0; border-bottom: 1px solid rgba(6, 59, 53, 0.12); color: var(--ink); text-decoration: none; transition: padding-left 0.5s var(--ease); }
.post-card:hover { padding-left: 0.8rem; color: var(--ink); text-decoration: none; }
.post-card h2 { font-size: 1.5rem; margin: 0.3rem 0; }
.post-card p { color: var(--muted); margin: 0; }
.post { max-width: 46rem; }
.post-body { font-size: 1.08rem; line-height: 1.75; }
.post-body h2 { font-size: 1.6rem; margin: 2.2rem 0 0.8rem; }
.post-body a { color: var(--blue); }

/* Chat widget */
.bv-chat { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1050; font-family: "DM Sans", sans-serif; }
.bv-chat-fab { background: var(--green-500); color: #fff; border: 0; border-radius: 999px; padding: 0.95rem 1.5rem; font-weight: 700; box-shadow: 0 14px 30px -10px rgba(6, 59, 53, 0.6); transition: transform 0.45s var(--ease); }
.bv-chat-fab:hover { transform: translateY(-3px); }
.bv-chat-panel { width: min(380px, calc(100vw - 2.5rem)); height: min(520px, 75vh); background: #fff; border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(6, 59, 53, 0.55); display: flex; flex-direction: column; overflow: hidden; animation: rise 0.6s var(--ease); }
.bv-chat-panel[hidden] { display: none; }
.bv-chat-head { background: var(--green-700); color: #fff; padding: 0.9rem 1.1rem; display: flex; justify-content: space-between; align-items: center; }
.bv-chat-close { background: none; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; }
.bv-chat-tabs { display: flex; gap: 0.35rem; padding: 0.5rem 0.6rem; overflow-x: auto; background: #fff; border-bottom: 1px solid rgba(6, 59, 53, 0.1); }
.bv-tab { flex: 0 0 auto; border: 1px solid rgba(6, 59, 53, 0.2); background: transparent; color: var(--green-700); border-radius: 999px; padding: 0.25rem 0.8rem; font-size: 0.82rem; font-weight: 600; transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.bv-tab:hover { background: var(--mint); }
.bv-tab.is-active { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.bv-chat-log { flex: 1; overflow-y: auto; padding: 1rem; background: var(--mint); }
.bv-msg { max-width: 85%; padding: 0.6rem 0.9rem; border-radius: 14px; margin-bottom: 0.6rem; white-space: pre-wrap; font-size: 0.95rem; animation: rise 0.4s var(--ease); }
.bv-assistant { background: #fff; color: var(--ink); border-bottom-left-radius: 4px; }
.bv-user { background: var(--green-700); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bv-chat-form { display: flex; gap: 0.5rem; padding: 0.7rem; border-top: 1px solid rgba(6, 59, 53, 0.1); }
.bv-chat-form input { flex: 1; border: 1px solid rgba(6, 59, 53, 0.25); border-radius: 999px; padding: 0.55rem 1rem; }
.bv-chat-form button { background: var(--green-500); color: #fff; border: 0; border-radius: 999px; padding: 0 1.1rem; font-weight: 700; }

/* Admin */
.admin-body { background: var(--mint); min-height: 100vh; }
.admin-card { background: #fff; border-radius: 18px; padding: 1.5rem; box-shadow: 0 20px 40px -28px rgba(6, 59, 53, 0.5); }
.admin-log { height: 360px; overflow-y: auto; background: var(--mint); border-radius: 12px; padding: 1rem; }
.lead-row { padding: 0.8rem 0; border-bottom: 1px solid rgba(6, 59, 53, 0.1); font-size: 0.92rem; }
