/* ============================================
   MedicAlgo - Style Sheet
   Color palette derived from logo:
   - Primary:    #2a6b7c (teal/petrol blue)
   - Dark:       #1a3a4a (deep navy)
   - Accent:     #3d8a9c (lighter teal)
   - Cream:      #f0e6d3 (parchment)
   - Light:      #f7f2eb (light cream)
   - Text:       #2c2c2c (charcoal)
   ============================================ */

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

:root {
    --primary: #2a6b7c;
    --primary-dark: #1a3a4a;
    --primary-light: #3d8a9c;
    --cream: #f0e6d3;
    --light: #f7f2eb;
    --text: #2c2c2c;
    --text-light: #5a5a5a;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Lora', Georgia, serif;
    line-height: 1.3;
    color: var(--primary-dark);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 16px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 48px;
}

/* --- Button --- */
.btn {
    display: inline-block;
    padding: 14px 36px;
    border-radius: 4px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
    background: var(--white);
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo img {
    height: 44px;
    width: auto;
    border-radius: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.navbar.scrolled .nav-logo img {
    opacity: 1;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 36px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--white);
    transition: color var(--transition);
    position: relative;
}

.navbar.scrolled .nav-links a {
    color: var(--text);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

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

.nav-toggle span {
    width: 26px;
    height: 2px;
    background: var(--white);
    transition: all var(--transition);
}

.navbar.scrolled .nav-toggle span {
    background: var(--text);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.35) saturate(0.7);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    padding: 24px;
}

.hero-logo {
    width: 160px;
    height: auto;
    margin: 0 auto 24px;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--white);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.hero-tagline {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 36px;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* --- About --- */
.about {
    background: var(--light);
}

.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    align-items: center;
}

.about-image img {
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-width: 300px;
}

.about-text h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.about-text h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary);
    margin-top: 12px;
    border-radius: 2px;
}

.about-text p {
    margin-bottom: 16px;
    font-size: 1.05rem;
    color: var(--text-light);
}

.about-text strong {
    color: var(--primary-dark);
}

/* --- Services --- */
.services {
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-top: 48px;
}

.service-card {
    background: var(--light);
    border-radius: 8px;
    padding: 40px 32px;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--cream);
}

.service-icon {
    width: 56px;
    height: 56px;
    color: var(--primary);
    margin-bottom: 20px;
}

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

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--primary-dark);
}

.service-card p {
    color: var(--text-light);
    font-size: 0.98rem;
    line-height: 1.7;
}

/* --- Portfolio / Carousel --- */
.portfolio {
    background: var(--primary-dark);
    color: var(--white);
}

.portfolio .section-title {
    color: var(--white);
}

.portfolio .section-title::after {
    background: var(--cream);
}

.portfolio .section-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

.carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 8px;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: var(--white);
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    border-radius: 0 0 8px 8px;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.carousel-btn-prev {
    left: 16px;
}

.carousel-btn-next {
    right: 16px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: background var(--transition);
}

.carousel-dot.active {
    background: var(--cream);
}

/* --- Contact --- */
.contact {
    background: var(--light);
}

.contact-content {
    max-width: 500px;
    margin: 0 auto;
}

.contact-cta {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.btn-large {
    padding: 18px 48px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.btn-large:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-icon {
    width: 22px;
    height: 22px;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    color: var(--text);
}

.contact-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--primary);
}

.contact-item svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: var(--primary);
}

.contact-item span {
    font-size: 1.05rem;
    font-weight: 500;
}

/* --- Footer --- */
.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 40px 0;
}

.footer-logo {
    height: 48px;
    width: auto;
    margin: 0 auto 16px;
    border-radius: 4px;
    opacity: 0.7;
}

.footer p {
    font-size: 0.9rem;
}

/* --- Fade-in Animation --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        box-shadow: var(--shadow);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        color: var(--text) !important;
    }

    .nav-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }

    .hero-logo {
        width: 120px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .about-image img {
        margin: 0 auto;
        max-width: 240px;
    }

    .about-text h2::after {
        margin-left: auto;
        margin-right: auto;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .carousel-slide img {
        height: 260px;
    }

    .section {
        padding: 64px 0;
    }

    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-logo {
        width: 100px;
    }

    .carousel-slide img {
        height: 200px;
    }

    .btn {
        padding: 12px 28px;
        font-size: 0.9rem;
    }
}
