/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: transparent;
    position: relative;
    overflow: hidden;
    /* The hover fill (::before, z-index -1) must stay inside the button.
       Without its own stacking context it slid behind dark section
       backgrounds, leaving dark text on a dark button. */
    isolation: isolate;
    z-index: 0;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--accent-primary);
    z-index: -1;
    transition: width var(--transition-medium);
}

.btn:hover {
    color: var(--raw-white);
    border-color: var(--raw-green);
}

.btn:hover::before {
    width: 100%;
    background-color: var(--raw-green);
}

.btn-primary {
    background-color: var(--accent-primary);
    color: var(--raw-black);
    font-weight: 700;
}

.btn-primary::before {
    background-color: var(--raw-green);
}

.btn-primary:hover {
    background-color: var(--raw-green);
    border-color: var(--raw-green);
    color: var(--accent-primary);
}

/* Service Cards */
.service-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    padding: var(--spacing-md);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Snappy/Fast transition */
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Geometric Pattern for Service Cards */
/* Geometric Pattern for Service Cards - Dot Grid */
.service-card::before {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-image: radial-gradient(var(--border-light) 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.3;
    transition: all 0.5s ease;
    z-index: -1;
}

.service-card:hover::before {
    transform: scale(1.5) rotate(45deg);
    background-image: radial-gradient(var(--accent-primary) 1px, transparent 1px);
    opacity: 0.2;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(47, 62, 46, 0.05), rgba(30, 40, 30, 0.05));
    /* Green gradient */
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.service-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--raw-green);
    /* Green border */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(47, 62, 46, 0.15);
    /* Green glow */
}

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

.service-card h3 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.5rem;
    color: var(--text-main);
}

.service-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
    color: var(--accent-primary);
}

/* Featured Project (Full-width hero style) */
.project-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: var(--spacing-lg);
    min-height: 600px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition-medium);
}

.project-featured:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 20px 60px rgba(200, 162, 74, 0.1);
}

.project-featured-image {
    position: relative;
    overflow: hidden;
}

.project-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 4px);
    animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.project-featured-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-surface);
}

.project-featured-content h3 {
    font-size: 2.5rem;
    margin: var(--spacing-sm) 0 var(--spacing-md);
}

.project-featured-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
}

.project-stats {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.project-stats li {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.project-stats strong {
    display: block;
    font-size: 1.8rem;
    color: var(--accent-primary);
    font-family: var(--font-heading);
    margin-bottom: 0.25rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-tags span {
    padding: 0.5rem 1rem;
    background: rgba(47, 62, 46, 0.08);
    /* Green tint */
    border: 1px solid rgba(47, 62, 46, 0.2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--raw-green);
    transition: all 0.3s ease;
}

.project-tags span:hover {
    background: var(--accent-primary);
    color: var(--bg-body);
}

/* Project Grid Cards */
.project-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    transition: all var(--transition-medium);
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.project-card-image {
    height: 300px;
    position: relative;
}

.project-card-content {
    padding: var(--spacing-md);
}

.project-card-content h3 {
    font-size: 1.5rem;
    margin: var(--spacing-sm) 0;
}

.project-card-content p {
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-category {
    color: var(--accent-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-xs);
    display: block;
}

/* Project Links */
.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-gray-dark);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.project-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-3px);
}

.project-link .ph-icon {
    transition: transform 0.3s ease;
}

.project-link:hover .ph-icon {
    transform: scale(1.1);
}

/* Accordion Styles */
.accordion-container {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    border: 1px solid var(--color-gray-dark);
    margin-bottom: 1rem;
    background: var(--bg-body);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.accordion-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.accordion-item:hover::before,
.accordion-item.active::before {
    opacity: 1;
}

.accordion-item:hover {
    border-color: var(--accent-secondary);
}

.accordion-item.active {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(47, 62, 46, 0.05), rgba(200, 162, 74, 0.05));
}

.accordion-header {
    width: 100%;
    padding: 1.5rem 2rem;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    transition: all 0.3s ease;
}

.accordion-header:hover {
    color: var(--accent-primary);
}

.accordion-title {
    display: flex;
    align-items: center;
}

.accordion-icon {
    transition: transform 0.3s ease;
    color: var(--accent-primary);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 2rem;
}

.accordion-item.active .accordion-content {
    max-height: 300px;
    padding: 0 2rem 1.5rem 2rem;
}

.accordion-content p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* Responsive */
@media (max-width: 968px) {
    .project-featured {
        grid-template-columns: 1fr;
    }

    .project-featured-image {
        min-height: 400px;
    }

    .accordion-header {
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
    }

    .accordion-content {
        padding: 0 1.5rem;
    }

    .accordion-item.active .accordion-content {
        padding: 0 1.5rem 1.25rem 1.5rem;
    }
}

/* Project Logo Styling */
.project-logo-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* Removed .project-logo-frame styles as they are no longer needed */

.project-logo-container img {
    max-width: 75%;
    /* Increased size for better visibility */
    max-height: 75%;
    object-fit: contain;
    width: auto;
    height: auto;
    transition: transform 0.6s ease;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
    /* Add shadow to logo itself */
}

/* Product marks shown as an app icon (e.g. MLVisor) */
.project-logo-container img.project-app-icon {
    width: auto;
    height: auto;
    max-width: 52%;
    max-height: 62%;
    aspect-ratio: 1;
    border-radius: 22%;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    filter: none;
}

.project-card:hover .project-logo-container img,
.project-slide:hover .project-logo-container img {
    transform: scale(1.1);
    /* Subtle zoom on hover */
}
