/* ============================================================
   Pine Birch Analytics — Style System
   ============================================================ */

:root {
    /* Brand palette */
    --primary:    #1a3a2a;
    --primary-dark: #0f2b1d;
    --primary-deeper: #0a1f14;
    --green-300:  #86efac;
    --green-400:  #4ade80;
    --green-500:  #22c55e;
    --green-600:  #16a34a;
    --accent:     #4ade80;
    --accent-dim: rgba(74, 222, 128, 0.15);

    /* Neutrals */
    --white:      #ffffff;
    --gray-50:    #f9fafb;
    --gray-100:   #f3f4f6;
    --gray-200:   #e5e7eb;
    --gray-300:   #d1d5db;
    --gray-400:   #9ca3af;
    --gray-500:   #6b7280;
    --gray-600:   #4b5563;
    --gray-700:   #374151;
    --gray-800:   #1f2937;
    --gray-900:   #111827;

    /* Layout */
    --max-width:  1200px;
    --nav-height: 72px;

    /* Typography */
    --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-800);
    background: var(--white);
    overflow-x: hidden;
}

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.hide-mobile { display: inline; }
@media (max-width: 768px) {
    .hide-mobile { display: none; }
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    background: rgba(10, 31, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(74, 222, 128, 0.08);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
    background: rgba(10, 31, 20, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2.5px;
    color: var(--white);
    text-transform: uppercase;
}

.nav-logo-icon { flex-shrink: 0; }

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

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
    letter-spacing: 0.3px;
}

.nav-links a:hover { color: var(--white); }

.nav-cta {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.25);
    padding: 8px 20px;
    border-radius: 6px;
    color: var(--accent) !important;
    transition: all 0.2s ease !important;
}

.nav-cta:hover {
    background: rgba(74, 222, 128, 0.2) !important;
    border-color: rgba(74, 222, 128, 0.4);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 31, 20, 0.97);
        backdrop-filter: blur(20px);
        padding: 32px 24px;
        gap: 24px;
        transform: translateY(-120%);
        opacity: 0;
        transition: all 0.4s var(--ease-out);
        border-bottom: 1px solid rgba(74, 222, 128, 0.1);
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-links a { font-size: 18px; }
}

/* ============================================================
   Hero Carousel
   ============================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 100vh;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--primary-deeper);
    opacity: 0;
    transition: opacity 1.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 31, 20, 0.65) 0%,
        rgba(10, 31, 20, 0.50) 40%,
        rgba(10, 31, 20, 0.75) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 120px 24px 80px;
    max-width: 860px;
}

.hero-badge-sm {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.15);
    padding: 6px 18px;
    border-radius: 100px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--white);
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    line-height: 1.7;
    margin-bottom: 48px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.carousel-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 12px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.carousel-dot:hover {
    border-color: var(--accent);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.25s var(--ease-out);
    cursor: pointer;
    border: none;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: var(--accent);
    color: var(--primary-dark);
}

.btn-primary:hover {
    background: var(--green-300);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(74, 222, 128, 0.25);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 18px 40px;
    font-size: 17px;
    border-radius: 10px;
}

/* ============================================================
   Sections
   ============================================================ */
.section {
    padding: 120px 0;
}

.section-dark {
    background: var(--gray-50);
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--green-600);
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
    max-width: 640px;
    line-height: 1.7;
    margin-bottom: 64px;
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 64px;
    align-items: start;
}

.about-photo-frame {
    width: 280px;
    height: 340px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    position: relative;
}

.about-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-photo-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    border: 1px solid rgba(74, 222, 128, 0.1);
    pointer-events: none;
}

.about-credentials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.credential-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--accent-dim);
    color: var(--green-600);
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.about-text h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.about-lead {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--primary);
    line-height: 1.6;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.about-text p {
    margin-bottom: 16px;
    color: var(--gray-600);
}

.about-text strong {
    color: var(--gray-800);
    font-weight: 600;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-200);
}

.stat { text-align: center; }

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    letter-spacing: 0.3px;
}

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

    .about-photo { text-align: center; }

    .about-photo-frame {
        width: 220px;
        height: 270px;
        margin: 0 auto;
    }

    .about-credentials { justify-content: center; }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   Services
   ============================================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 36px;
    transition: all 0.35s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--green-600));
    opacity: 0;
    transition: opacity 0.35s ease;
}

.service-card:hover {
    border-color: rgba(74, 222, 128, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.service-card:hover::before { opacity: 1; }

.service-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
    line-height: 1.3;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-list li {
    font-size: 14px;
    color: var(--gray-600);
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.service-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
}

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

/* ============================================================
   Case Study
   ============================================================ */
.case-study-content {
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.case-lead {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.case-study-narrative p {
    color: var(--gray-600);
    margin-bottom: 16px;
}

.case-study-narrative strong {
    color: var(--gray-800);
}

.metrics-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 12px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.metric-card {
    background: var(--primary-dark);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(74, 222, 128, 0.1);
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: rgba(74, 222, 128, 0.3);
    transform: translateY(-2px);
}

.metric-disease {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.metric-auc {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.metric-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-600), var(--accent));
    border-radius: 3px;
    transition: width 1.2s var(--ease-out);
}

.case-study-highlights {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.highlight {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.highlight:hover {
    border-color: rgba(74, 222, 128, 0.25);
    background: var(--white);
}

.highlight-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border-radius: 10px;
}

.highlight strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.highlight span {
    font-size: 13px;
    color: var(--gray-500);
}

@media (max-width: 900px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .case-study-highlights {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .case-study-highlights {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Contact
   ============================================================ */
.contact-container {
    text-align: center;
    max-width: 680px;
}

.contact-cta {
    margin-top: 40px;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
    background: var(--primary-deeper);
    padding: 32px 0;
    border-top: 1px solid rgba(74, 222, 128, 0.08);
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
}

.footer-copy {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 580px) {
    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ============================================================
   Animations
   ============================================================ */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-delay-1 { transition-delay: 0.1s; }
.fade-delay-2 { transition-delay: 0.2s; }
.fade-delay-3 { transition-delay: 0.3s; }

/* Hero animations run immediately */
.hero .fade-in {
    animation: heroFadeIn 0.8s var(--ease-out) forwards;
}

.hero .fade-delay-1 { animation-delay: 0.15s; }
.hero .fade-delay-2 { animation-delay: 0.3s; }
.hero .fade-delay-3 { animation-delay: 0.45s; }

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Misc
   ============================================================ */
::selection {
    background: rgba(74, 222, 128, 0.25);
    color: var(--gray-900);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--primary-deeper); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #245236; }
