/* ==========================================================================
   Cap Vision — Base stylesheet
   Phase 2 scaffold: tokens, layout primitives, header/footer, sticky CTA.
   Hero/carousel/service-card visual polish + animations land in Phase 4.
   ========================================================================== */

:root {
    /* Brand palette — maritime, professional, not a generic SaaS gradient */
    --cv-navy-950: #061420;
    --cv-navy-900: #0a1f33;
    --cv-navy-800: #0f2d47;
    --cv-navy-700: #163f60;
    --cv-blue-500: #1a74b0;
    --cv-blue-400: #2a93d8;
    --cv-teal-400: #19b3a6;
    --cv-amber-500: #e8a33d;
    --cv-ink-900: #0c1a24;
    --cv-ink-700: #35505f;
    --cv-mist-100: #f4f8fa;
    --cv-mist-200: #e7eef2;
    --cv-white: #ffffff;

    --cv-font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --cv-font-body: 'Inter', 'Segoe UI', sans-serif;

    --cv-radius-sm: 8px;
    --cv-radius-md: 14px;
    --cv-radius-lg: 24px;

    --cv-shadow-sm: 0 2px 10px rgba(6, 20, 32, 0.08);
    --cv-shadow-md: 0 12px 32px rgba(6, 20, 32, 0.14);

    --cv-transition: 200ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--cv-font-body);
    color: var(--cv-ink-900);
    background-color: var(--cv-white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.cv-font-display {
    font-family: var(--cv-font-display);
    letter-spacing: -0.01em;
}

.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2000;
    padding: 0.75rem 1rem;
    background: var(--cv-navy-900);
    color: var(--cv-white);
}

/* ---------------------------------------------------------------------- */
/* Header / Navigation                                                     */
/* ---------------------------------------------------------------------- */

.cv-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(10, 31, 51, 0.96);
    backdrop-filter: saturate(140%) blur(6px);
}

.cv-navbar {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.cv-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.cv-brand-logo {
    height: 80px;
    width: 80px;
    border-radius: var(--cv-radius-sm);
    object-fit: cover;
}

@media (max-width: 575.98px) {
    .cv-brand-logo {
        height: 64px;
        width: 64px;
    }
}

.cv-brand-text {
    font-family: var(--cv-font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--cv-white);
    line-height: 1.1;
    display: flex;
    flex-direction: column;
}

.cv-brand-since {
    font-family: var(--cv-font-body);
    font-weight: 500;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cv-teal-400);
}

.cv-navbar .nav-link {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: var(--cv-radius-sm);
    transition: color var(--cv-transition), background-color var(--cv-transition);
}

.cv-navbar .nav-link:hover,
.cv-navbar .nav-link.active {
    color: var(--cv-white);
    background-color: rgba(255, 255, 255, 0.08);
}

.btn-cv-primary {
    background-color: var(--cv-teal-400);
    color: var(--cv-navy-950);
    font-weight: 600;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1.3rem;
    transition: transform var(--cv-transition), background-color var(--cv-transition);
}

.btn-cv-primary:hover {
    background-color: var(--cv-amber-500);
    color: var(--cv-navy-950);
    transform: translateY(-1px);
}

.btn-cv-outline {
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    color: var(--cv-white);
    border-radius: 999px;
    font-weight: 600;
    padding: 0.55rem 1.3rem;
    transition: border-color var(--cv-transition), background-color var(--cv-transition);
}

.btn-cv-outline:hover {
    border-color: var(--cv-white);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--cv-white);
}

/* ---------------------------------------------------------------------- */
/* Generic section scaffolding (content detail lands in Phase 3/4)         */
/* ---------------------------------------------------------------------- */

.cv-section {
    padding: clamp(3rem, 6vw, 6rem) 0;
}

.cv-section-alt {
    background-color: var(--cv-mist-100);
}

.cv-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cv-blue-500);
    margin-bottom: 0.75rem;
}

.cv-hero {
    position: relative;
    color: var(--cv-white);
    background: linear-gradient(180deg, var(--cv-navy-950) 0%, var(--cv-navy-800) 100%);
    overflow: hidden;
}

/* Full-width page banner (all pages except home). Photo has no people. */
.cv-page-hero {
    position: relative;
    color: var(--cv-white);
    background-color: var(--cv-navy-950);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 52vh;
    overflow: hidden;
}

.cv-page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(6, 20, 32, 0.88) 0%, rgba(6, 20, 32, 0.62) 48%, rgba(6, 20, 32, 0.38) 100%);
}

.cv-page-hero .cv-hero-content,
.cv-page-hero .container {
    position: relative;
    z-index: 1;
}

.cv-hero-carousel {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.cv-hero-carousel .carousel-item {
    height: 100%;
}

.cv-hero-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.55) saturate(1.05);
}

.cv-hero-content {
    position: relative;
    z-index: 2;
    padding: clamp(5rem, 14vw, 9rem) 0 clamp(3.5rem, 8vw, 6rem);
}

.cv-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(25, 179, 166, 0.16);
    border: 1px solid rgba(25, 179, 166, 0.45);
    color: var(--cv-teal-400);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

/* ---------------------------------------------------------------------- */
/* Service cards (placeholder styling — richer motion in Phase 4)          */
/* ---------------------------------------------------------------------- */

.cv-card {
    background: var(--cv-white);
    border-radius: var(--cv-radius-md);
    box-shadow: var(--cv-shadow-sm);
    padding: 1.75rem;
    height: 100%;
    transition: transform var(--cv-transition), box-shadow var(--cv-transition);
}

.cv-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--cv-shadow-md);
}

.cv-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--cv-radius-sm);
    background: var(--cv-mist-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cv-blue-500);
    margin-bottom: 1rem;
}

.cv-service-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--cv-radius-md);
}

/* ---------------------------------------------------------------------- */
/* Trust / stats strip                                                     */
/* ---------------------------------------------------------------------- */

.cv-stat {
    text-align: center;
}

.cv-stat-number {
    font-family: var(--cv-font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 2.75rem);
    color: var(--cv-navy-900);
}

.cv-stat-label {
    color: var(--cv-ink-700);
    font-size: 0.9rem;
}

/* Card icon hover lift (used with .cv-card-icon in "Why Cap Vision" blocks) */
.cv-card:hover .cv-card-icon {
    background: var(--cv-teal-400);
    color: var(--cv-white);
    transform: translateY(-2px) rotate(-4deg);
}

.cv-card-icon {
    font-size: 1.4rem;
    transition: transform var(--cv-transition), background-color var(--cv-transition), color var(--cv-transition);
}

/* ---------------------------------------------------------------------- */
/* Sticky WhatsApp CTA                                                     */
/* ---------------------------------------------------------------------- */

.cv-sticky-whatsapp {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #25D366;
    color: var(--cv-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--cv-shadow-md);
    transition: transform var(--cv-transition);
}

.cv-sticky-whatsapp:hover {
    transform: scale(1.08);
    color: var(--cv-white);
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */

.cv-footer {
    background-color: var(--cv-navy-950);
    color: rgba(255, 255, 255, 0.78);
    padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
}

.cv-footer-brand {
    margin-bottom: 0.75rem;
}

.cv-footer-tagline {
    color: rgba(255, 255, 255, 0.65);
    max-width: 32ch;
}

.cv-footer-since {
    color: var(--cv-teal-400);
    font-size: 0.85rem;
    font-weight: 600;
}

.cv-footer-heading {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1rem;
}

.cv-footer-links li {
    margin-bottom: 0.55rem;
}

.cv-footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.cv-footer-links a:hover {
    color: var(--cv-teal-400);
}

.cv-footer-divider {
    border-color: rgba(255, 255, 255, 0.12);
    margin: 2rem 0 1.5rem;
}

.cv-footer-bottom {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ---------------------------------------------------------------------- */
/* Scroll reveal utility (JS toggles .is-visible — Phase 4 refines easing) */
/* ---------------------------------------------------------------------- */

.cv-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.cv-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Directional reveal variants — add alongside .cv-reveal */
.cv-reveal-left {
    transform: translateX(-28px);
}
.cv-reveal-left.is-visible {
    transform: translateX(0);
}

.cv-reveal-right {
    transform: translateX(28px);
}
.cv-reveal-right.is-visible {
    transform: translateX(0);
}

.cv-reveal-scale {
    transform: scale(0.92);
}
.cv-reveal-scale.is-visible {
    transform: scale(1);
}

/* Stagger helper: apply alongside .cv-reveal on sibling groups for a
   cascading entrance (JS adds .is-visible; this just offsets the delay). */
.cv-stagger-1.is-visible { transition-delay: 80ms; }
.cv-stagger-2.is-visible { transition-delay: 160ms; }
.cv-stagger-3.is-visible { transition-delay: 240ms; }
.cv-stagger-4.is-visible { transition-delay: 320ms; }

/* ---------------------------------------------------------------------- */
/* Hero carousel motion polish                                             */
/* ---------------------------------------------------------------------- */

.cv-hero-carousel .carousel-item img {
    transform: scale(1.04);
    transition: transform 6500ms ease-out;
}

.cv-hero-carousel .carousel-item.active img {
    transform: scale(1);
}

.cv-hero-badge {
    animation: cv-badge-pulse 2.6s ease-in-out infinite;
}

@keyframes cv-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(25, 179, 166, 0.28); }
    50% { box-shadow: 0 0 0 8px rgba(25, 179, 166, 0); }
}

/* Header gains a stronger shadow once the page is scrolled (toggled by JS) */
.cv-header.is-scrolled {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Service image hover zoom */
.cv-service-image {
    overflow: hidden;
    transition: transform var(--cv-transition);
}

a:hover > .cv-service-image,
.cv-card:hover .cv-service-image {
    transform: scale(1.02);
}

/* Accordion (FAQ) — align with brand styling */
.accordion-button:not(.collapsed) {
    color: var(--cv-navy-900);
    background-color: var(--cv-mist-200);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(26, 116, 176, 0.25);
}

@media (prefers-reduced-motion: reduce) {
    .cv-reveal,
    .cv-reveal-left,
    .cv-reveal-right,
    .cv-reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .cv-hero-carousel .carousel-item img,
    .cv-hero-carousel .carousel-item.active img {
        transform: none;
        transition: none;
    }
    .cv-hero-badge {
        animation: none;
    }
    .cv-card:hover .cv-card-icon {
        transform: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ---------------------------------------------------------------------- */
/* Scroll progress bar (fixed to top, filled by JS on scroll)              */
/* ---------------------------------------------------------------------- */

.cv-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--cv-teal-400), var(--cv-blue-400));
    z-index: 1050;
    transition: width 100ms ease-out;
}

/* ---------------------------------------------------------------------- */
/* Animated counters (JS counts up the number when scrolled into view)     */
/* ---------------------------------------------------------------------- */

.cv-counter {
    display: inline-block;
}

/* ---------------------------------------------------------------------- */
/* Google Maps embed (Contact page)                                        */
/* ---------------------------------------------------------------------- */

.cv-map-section {
    padding-bottom: 0;
}

.cv-map-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--cv-mist-200);
}

.cv-map-wrap--full {
    width: 100vw;
    max-width: 100%;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
    box-shadow: none;
    height: clamp(420px, 52vh, 620px);
    min-height: 420px;
}

.cv-map-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 575.98px) {
    .cv-map-wrap--full {
        height: 360px;
        min-height: 360px;
    }
}
