/* ==========================================================================
   Meridian — Custom CSS Stylesheet
   ========================================================================== */

/* Brand theme overrides (daisyUI light theme) */
:root,
[data-theme="light"] {
    --color-primary: #2563eb;
    --color-primary-content: #ffffff;
    --color-secondary: #1d4ed8;
    --color-secondary-content: #ffffff;
    --color-accent: #06b6d4;
    --color-accent-content: #ffffff;
    --color-base-100: #ffffff;
    --color-base-200: #f8fafc;
    --color-base-300: #e2e8f0;
    --color-base-content: #0f172a;
    --color-success: #10b981;
    --radius-box: 1.5rem;
    --radius-field: 0.75rem;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
}

body {
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

::selection {
    background-color: #2563eb;
    color: #ffffff;
}

:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
    padding: 0.5rem 1rem;
    background: #2563eb;
    color: #ffffff;
    border-radius: 0.5rem;
    font-weight: 600;
}

/* Shared section typography */
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #2563eb;
}
.section-eyebrow::before {
    content: "";
    width: 2rem;
    height: 1px;
    background: rgba(37, 99, 235, 0.5);
}
.section-eyebrow--dark { color: #bfdbfe; }
.section-eyebrow--dark::before { background: rgba(191, 219, 254, 0.6); }

.section-title {
    margin-top: 1rem;
    font-size: 1.875rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0f172a;
    text-wrap: balance;
}
@media (min-width: 768px) { .section-title { font-size: 2.25rem; } }
@media (min-width: 1024px) { .section-title { font-size: 3rem; } }
.section-title--dark { color: #ffffff; }

.section-description {
    margin-top: 1rem;
    font-size: 1.125rem;
    line-height: 1.75;
    color: #64748b;
}
.section-description--dark { color: #dbeafe; }

/* Navbar */
#site-navbar {
    background: transparent;
    box-shadow: none;
    transition: background-color 0.3s ease-out, box-shadow 0.3s ease-out;
}
#site-navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.06), 0 1px 3px 0 rgb(15 23 42 / 0.05);
}

.nav-link {
    position: relative;
    color: #475569;
    transition: color 0.3s ease-out;
}
.nav-link:hover { color: #0f172a; }
.nav-link.nav-active { color: #2563eb; }
.nav-link::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.125rem;
    height: 2px;
    border-radius: 9999px;
    background: #2563eb;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-out;
}
.nav-link.nav-active::after { transform: scaleX(1); }

/* Mobile menu slide-down */
#mobile-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}
#mobile-menu.open { max-height: 580px; opacity: 1; }

/* Scroll-reveal system (IntersectionObserver adds .reveal-visible) */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Entrance & ambient animations */
@keyframes rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-from-right {
    from { opacity: 0; transform: translateX(48px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-rise { animation: rise 0.7s ease-out both; }
.animate-slide-from-right { animation: slide-from-right 0.8s ease-out both; }
.animate-float { animation: float 5s ease-in-out infinite; }
.animate-fade-in { animation: fade-in 0.45s ease-out both; }

/* Process timeline progressive line */
.process-fill-h {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s ease-out;
}
.process-fill-v {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1s ease-out;
}
#process-timeline.is-active .process-fill-h { transform: scaleX(1); }
#process-timeline.is-active .process-fill-v { transform: scaleY(1); }

/* Solutions dashboard chart morph */
.chart-bar { transition: height 0.7s ease-out; }

/* Testimonial slider */
.testimonial-track { transition: transform 0.5s ease-out; }

/* FAQ accordion (grid-rows trick for smooth height) */
.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-out;
}
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-answer-inner { overflow: hidden; }
.faq-icon {
    transition: transform 0.3s ease-out, background-color 0.3s ease-out, color 0.3s ease-out;
}
.faq-item.open .faq-icon {
    transform: rotate(180deg);
    background-color: #2563eb;
    color: #ffffff;
}
.faq-item.open { border-color: rgba(37, 99, 235, 0.3); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}
