/* ============================================
   Mercatr — V4: Design-First
   Split-screen hero, editorial layout
   Fonts: Sora (headlines) + Open Sans (body)
   ============================================ */

:root {
    /* Brand palette */
    --green-bright: #23D962;
    --green-mid: #2ABF5E;
    --green-dark: #278C41;
    --green-forest: #14401F;
    --brand-black: #0D0D0D;

    /* Functional tokens */
    --bg: #ffffff;
    --bg-alt: #f5f5f3;
    --bg-dark: #0D0D0D;
    --text: #0D0D0D;
    --text-secondary: #525252;
    --text-muted: #8a8a8a;
    --text-on-dark: #f5f5f3;
    --border: rgba(13, 13, 13, 0.08);
    --border-hover: rgba(13, 13, 13, 0.18);

    --accent: #23D962;
    --accent-mid: #2ABF5E;
    --accent-dim: rgba(35, 217, 98, 0.1);

    /* Typography */
    --font-heading: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --max-width: 1200px;
    --nav-height: 72px;
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ---- Container ---- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 48px;
}

@media (max-width: 768px) {
    .container { padding: 0 24px; }
}

/* ---- Typography ---- */
.section-label {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--green-dark);
    margin-bottom: 24px;
}

.text-accent {
    color: var(--green-mid);
}

.section-heading {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
    color: var(--text);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--green-mid);
    color: #fff;
}
.btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
}

.btn-full { width: 100%; }

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 48px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .nav-inner { padding: 0 24px; }
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 80px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links a {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.nav-links a:hover {
    color: var(--text);
}

.nav-cta {
    padding: 8px 22px !important;
    border: 1px solid var(--green-mid) !important;
    border-radius: 4px !important;
    color: var(--green-dark) !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
}
.nav-cta:hover {
    background: var(--green-mid) !important;
    color: #fff !important;
}

/* Mobile toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 99;
    flex-direction: column;
    padding: 24px 48px;
    gap: 20px;
}
.mobile-menu a {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}
.mobile-menu.open {
    display: flex;
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .mobile-menu { padding: 24px; }
}

/* ============================================
   Hero — Split Screen
   ============================================ */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

.hero-visual {
    position: relative;
    background: var(--bg-dark);
    overflow: hidden;
}

.hero-art {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-svg {
    width: 100%;
    height: 100%;
    opacity: 1;
}

.hero-art-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 30% 50%,
        transparent 0%,
        rgba(13, 13, 13, 0.4) 100%
    );
}

.hero-content {
    display: flex;
    align-items: center;
    padding: 80px 64px;
}

.hero-content-inner {
    max-width: 640px;
}

.hero-label {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.6rem, 4.5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 24px;
}

.hero-sub {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 460px;
}

/* ---- Testimonials ---- */
.testimonials {
    border-top: 1px solid var(--border);
    padding-top: 32px;
    max-width: 460px;
}

.testimonial-track {
    position: relative;
    min-height: 120px;
}

.testimonial {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    border: none;
    padding: 0;
    margin: 0;
}

.testimonial.active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
}

.testimonial-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.7;
    font-style: normal;
    margin-bottom: 16px;
}

.testimonial-cite {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    font-style: normal;
    letter-spacing: 0.02em;
}

.testimonial-nav {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

.testimonial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid var(--border-hover);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
}

.testimonial-dot.active {
    background: var(--green-mid);
    border-color: var(--green-mid);
}

.testimonial-dot:hover {
    border-color: var(--text-secondary);
}

/* Hero responsive */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-visual {
        height: 50vh;
        min-height: 320px;
    }

    .hero-content {
        padding: 48px 24px 64px;
    }

    .hero-content-inner {
        max-width: 100%;
    }
}

/* ============================================
   Services
   ============================================ */
.services {
    padding: 140px 0 120px;
    background: var(--bg-alt);
}

.services-header {
    margin-bottom: 72px;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.service-card {
    background: var(--bg);
    padding: 56px 48px;
    transition: background 0.3s;
}

.service-card:hover {
    background: var(--bg-alt);
}

.service-num {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--green-mid);
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 24px;
}

.service-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.service-body {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.service-details li {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 10px 0;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-details li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--green-mid);
    flex-shrink: 0;
}

@media (max-width: 960px) {
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 40px 28px;
    }
}


/* ============================================
   About
   ============================================ */
.about {
    padding: 140px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-right p {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 400;
    line-height: 1.85;
    margin-bottom: 20px;
}

/* Highlighted numbers in about text */
.text-highlight {
    color: var(--green-dark);
    font-weight: 600;
}

/* Personal aside card */
.about-personal {
    background: var(--bg-alt);
    border-left: 3px solid var(--green-mid);
    border-radius: 0 6px 6px 0;
    padding: 20px 24px;
    margin-top: 24px;
}

.about-personal p {
    margin-bottom: 0 !important;
    font-size: 0.95rem !important;
    color: var(--text-secondary) !important;
}

/* Inline logos in about text */
.inline-logo {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.inline-logo--stage2 {
    height: 1.8em;
}

.inline-logo--openview {
    height: 1.8em;
}

/* Highlighted name link */
.highlight-link {
    background: var(--accent-dim);
    color: var(--green-dark);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    transition: background 0.2s;
}

.highlight-link:hover {
    background: rgba(35, 217, 98, 0.22);
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}


/* ============================================
   Contact
   ============================================ */
.contact {
    padding: 120px 0;
    background: var(--bg-dark);
}

.contact-inner {
    max-width: 520px;
}

.contact-inner .section-label {
    color: var(--green-bright);
}

.contact-inner .section-heading {
    color: var(--text-on-dark);
    margin-bottom: 20px;
}

.contact-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.7;
    margin-bottom: 32px;
}

.contact-email {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--green-bright);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.contact-email:hover {
    border-bottom-color: var(--green-bright);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: 40px 0;
    background: var(--green-forest);
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
}

.footer-logo-img {
    height: 80px;
    width: auto;
}

.footer-copy {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 600px) {
    .footer-row {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ============================================
   Animations
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }

/* Hero-specific entrance */
.hero-content-inner > * {
    opacity: 0;
    transform: translateY(20px);
    animation: heroIn 0.7s ease forwards;
}

.hero-content-inner > *:nth-child(1) { animation-delay: 0.2s; }
.hero-content-inner > *:nth-child(2) { animation-delay: 0.4s; }
.hero-content-inner > *:nth-child(3) { animation-delay: 0.6s; }
.hero-content-inner > *:nth-child(4) { animation-delay: 0.85s; }

@keyframes heroIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SVG arc animation */
.hero-svg path {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: drawArc 2.5s ease forwards;
}

.hero-svg path:nth-child(2) { animation-delay: 0.2s; }
.hero-svg path:nth-child(3) { animation-delay: 0.4s; }
.hero-svg path:nth-child(4) { animation-delay: 0.6s; }
.hero-svg path:nth-child(5) { animation-delay: 0.8s; }

@keyframes drawArc {
    to {
        stroke-dashoffset: 0;
    }
}
