/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a8478;
    border-radius: 999px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #1f6b60;
}

/* ===== Intro Loader Animations ===== */
@keyframes introFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes introScaleIn {
    from {
        opacity: 0;
        transform: scale(0.7);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ringExpand {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    60% {
        opacity: 0.4;
    }

    100% {
        opacity: 0.25;
        transform: scale(1);
    }
}

@keyframes ringExpand2 {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    70% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.2;
        transform: scale(1);
    }
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

.intro-logo svg {
    animation: introScaleIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.intro-ring {
    transform-origin: center;
    animation: ringExpand 1.6s ease-out both;
}

.intro-ring-2 {
    transform-origin: center;
    animation: ringExpand2 1.8s ease-out both;
}

.intro-dot {
    transform-origin: center;
    animation: dotPulse 1.8s ease-in-out infinite 1.2s;
}

.intro-title {
    opacity: 0;
    animation: introFadeUp 0.9s ease-out 0.9s forwards;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.intro-subtitle {
    opacity: 0;
    animation: introFadeUp 0.9s ease-out 1.1s forwards;
}

#intro.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== Hero entrance ===== */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-item {
    opacity: 0;
    animation: heroFadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Hero subtle zoom */
@keyframes heroZoom {
    from {
        transform: scale(1.15);
    }

    to {
        transform: scale(1);
    }
}

.hero-zoom {
    animation: heroZoom 8s ease-out forwards;
}

/* Soft bounce for scroll indicator */
@keyframes bounceSoft {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

.animate-bounce-soft {
    animation: bounceSoft 2s ease-in-out infinite;
}

/* Slow pulse */
@keyframes pulseSlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.08);
    }
}

.animate-pulse-slow {
    animation: pulseSlow 4s ease-in-out infinite;
}

/* ===== Navbar links ===== */
.nav-link {
    position: relative;
    display: inline-block;
    padding: 0.5rem 1rem;
    font-weight: 500;
    color: #1a564d;
    border-radius: 0.75rem;
    transition: color 0.4s ease, background-color 0.4s ease;
}

.dark .nav-link {
    color: #d0ece8;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.35rem;
    right: 50%;
    left: 50%;
    height: 2px;
    border-radius: 999px;
    background: #e36a12;
    transition: right 0.4s ease, left 0.4s ease;
}

.nav-link:hover {
    color: #e36a12;
}

.dark .nav-link:hover {
    color: #f5ab5a;
}

.nav-link:hover::after {
    right: 0.75rem;
    left: 0.75rem;
}

/* Mobile links */
.mobile-link {
    display: block;
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: #1a564d;
    border-radius: 0.75rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dark .mobile-link {
    color: #d0ece8;
}

.mobile-link:hover {
    background-color: #eaf7f5;
    color: #e36a12;
}

.dark .mobile-link:hover {
    background-color: #163f3a;
    color: #f5ab5a;
}

/* ===== Navbar scrolled state ===== */
#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.dark #navbar.scrolled {
    background-color: rgba(8, 24, 22, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===== Reveal on scroll ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

    .reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* Card hover sheen */
.card {
    position: relative;
}

    .card::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 1.5rem;
        padding: 1px;
        background: linear-gradient(135deg, rgba(42, 132, 120, 0.3), transparent 50%);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        opacity: 0;
        transition: opacity 0.5s ease;
        pointer-events: none;
    }

    .card:hover::before {
        opacity: 1;
    }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-item, .intro-title, .intro-subtitle {
        opacity: 1;
    }
}
/* ===== Stat counters ===== */
.stat-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.stat-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Value cards ===== */
.value-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1),
              transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.value-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Team cards ===== */
.team-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1),
              transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.team-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Form steps ===== */
.form-step {
  animation: stepFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.form-step.hidden {
  display: none;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Form input focus glow */
.form-input:focus {
  box-shadow: 0 0 0 4px rgba(42, 132, 120, 0.12);
}

/* Service card checked */
.service-card:has(input:checked) .p-4 {
  border-color: #2a8478;
  background-color: #eaf7f5;
}
.dark .service-card:has(input:checked) .p-4 {
  border-color: #3f9f93;
  background-color: rgba(22, 63, 58, 0.5);
}

/* Success check animation */
@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.success-check {
  animation: successPop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.success-check svg {
  animation: checkDraw 0.4s ease-out 0.3s both;
}
@keyframes checkDraw {
  from { stroke-dashoffset: 30; }
  to { stroke-dashoffset: 0; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-item, .intro-title, .intro-subtitle { opacity: 1; }
}




/* ===== Stat counters ===== */
.stat-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

    .stat-item.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* ===== Value cards ===== */
.value-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
}

    .value-card.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* ===== Team cards ===== */
.team-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
}

    .team-card.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* ===== Form steps ===== */
.form-step {
    animation: stepFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

    .form-step.hidden {
        display: none;
    }

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Form input focus glow */
.form-input:focus {
    box-shadow: 0 0 0 4px rgba(42, 132, 120, 0.12);
}

/* Service card checked */
.service-card:has(input:checked) .p-4 {
    border-color: #2a8478;
    background-color: #eaf7f5;
}

.dark .service-card:has(input:checked) .p-4 {
    border-color: #3f9f93;
    background-color: rgba(22, 63, 58, 0.5);
}

/* Success check animation */
@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

.success-check {
    animation: successPop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

    .success-check svg {
        animation: checkDraw 0.4s ease-out 0.3s both;
    }

@keyframes checkDraw {
    from {
        stroke-dashoffset: 30;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-item, .intro-title, .intro-subtitle {
        opacity: 1;
    }
}

/* ===== Knowledge page: filter buttons ===== */
.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a564d;
    background-color: #eaf7f5;
    border: 2px solid transparent;
    transition: all 0.35s ease;
}

.dark .filter-btn {
    color: #d0ece8;
    background-color: #163f3a;
}

.filter-btn:hover {
    border-color: #3f9f93;
    color: #2a8478;
}

.dark .filter-btn:hover {
    border-color: #6fbfb4;
    color: #a3d9d1;
}

.filter-btn.active {
    background-color: #2a8478;
    color: #fff;
    box-shadow: 0 4px 14px rgba(42, 132, 120, 0.35);
}

.dark .filter-btn.active {
    background-color: #3f9f93;
    color: #081816;
}

/* Article card */
.article-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1);
}

    .article-card.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* Category badge */
.cat-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

/* ===== Modal ===== */
.modal-overlay {
    animation: fadeIn 0.3s ease both;
}

.modal-card {
    animation: modalIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#article-modal.is-closing .modal-overlay {
    animation: fadeOut 0.25s ease both;
}

#article-modal.is-closing .modal-card {
    animation: modalOut 0.25s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
}

/* Modal article body */
.article-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a564d;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.dark .article-body h3 {
    color: #a3d9d1;
}

.article-body ul {
    list-style: disc;
    padding-right: 1.5rem;
    margin: 0.5rem 0;
}

    .article-body ul li {
        margin: 0.35rem 0;
    }

.article-body .note {
    background-color: #eaf7f5;
    border-right: 4px solid #2a8478;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.dark .article-body .note {
    background-color: #163f3a;
    border-right-color: #3f9f93;
}

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-item, .intro-title, .intro-subtitle {
        opacity: 1;
    }
}
