:root {
    --primary-color: #6b5b5f; /* muted mauve/burgundy */
    --secondary-color: #8b7d82; /* lighter mauve */
    --accent-color: #7a9fb5; /* soft blue-grey accent */
    --text-color: #f3f4f6; /* off-white text */
    --text-light: #d1d5db;
    --background-color: #3d3338; /* dark warm brown */
    --bg-light: #4a4045;
    --card-background: #4a4045;
    --border-color: #5f5559;
    --transition-speed: 0.3s;
    --box-shadow: 0 4px 32px 0 rgba(107,91,95,0.15), 0 1.5px 4px 0 rgba(0,0,0,0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    line-height: 1.7;
    background-color: var(--background-color);
    color: var(--text-color);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: #3d3338;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.logo img {
    height: 70px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

/* Brand link wrapper for logo + wordmark */
.logo .brand-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

/* smaller symbol used in navbar */
.nav-logo {
    height: 56px;
    display: block;
    transition: transform 0.25s ease;
}

/* wordmark image next to the symbol */
.brand-wordmark {
    height: 28px;
    display: block;
}

/* hide the wordmark on smaller screens to save space */
@media (max-width: 768px) {
    .brand-wordmark {
        display: none;
    }
    .nav-logo {
        height: 48px;
    }
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-links li a {
    padding: 0.7rem 1.2rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    border-radius: 8px;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
}

.nav-links li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

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

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

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger span {
    width: 100%;
    height: 2.5px;
    background: var(--text-color);
    transition: var(--transition-speed) ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

header {
    text-align: center;
    padding: 6rem 2rem 4rem 2rem;
    background: linear-gradient(135deg, #6b5b5f 0%, #7a9fb5 50%, #5f8fa8 100%);
    color: #fff;
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(107,91,95,0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(183,28,28,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

header h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

header p {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    color: var(--text-light);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

/* Override header styles for slideshow content */
.hero-slideshow h1 {
    font-size: 3rem !important;
    margin-bottom: 0.4rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    text-align: left !important;
    line-height: 1.1 !important;
}

.hero-slideshow p {
    font-size: 1.05rem !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    text-align: left !important;
    color: #e8ecf1 !important;
    line-height: 1.6 !important;
}

/* Full-line hero slideshow: each slide contains a heading + paragraph */
:root {
    --hero-slide-height: 140px; /* default slide height; overridden on small screens */
}

.hero-slideshow {
    overflow: hidden;
    height: var(--hero-slide-height);
}

.hero-slideshow .slides-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: heroSlide 18s infinite cubic-bezier(0.4, 0.0, 0.2, 1);
}

.hero-slideshow .slide {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    flex: 0 0 100%; /* each slide equals the slideshow container height */
    box-sizing: border-box;
    padding-right: 0.25rem;
}

.hero-slideshow .slide h1 {
    color: #ffffff;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
    margin: 0 0 0.4rem 0;
}

.hero-slideshow .slide p {
    color: #e8ecf1;
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.6;
    max-width: 600px;
}

.hero-slideshow:hover .slides-wrapper {
    animation-play-state: paused;
}

@keyframes heroSlide {
    0%     { transform: translateY(0%); }
    22%    { transform: translateY(0%); }
    28%    { transform: translateY(-100%); }
    50%    { transform: translateY(-100%); }
    56%    { transform: translateY(-200%); }
    78%    { transform: translateY(-200%); }
    84%    { transform: translateY(-300%); }
    100%   { transform: translateY(-300%); }
}

/* Responsive: reduce slide height and font sizes on smaller screens */
@media (max-width: 768px) {
    :root { --hero-slide-height: 120px; }
    .hero-slideshow .slide h1 { font-size: 2.2rem; }
    .hero-slideshow .slide p { font-size: 1rem; }
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    padding: 4rem 5%;
    background: var(--background-color);
}

.services-grid h2 {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.service-card {
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(183,28,28,0.12), 0 2px 8px 0 rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--card-background);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(183,28,28,0.05) 0%, transparent 70%);
    transition: all 0.6s ease;
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 16px 64px 0 rgba(183,28,28,0.25), 0 4px 12px 0 rgba(0,0,0,0.3);
    border-color: var(--primary-color);
}

.service-card:hover::before {
    top: 0;
    left: 0;
}

.service-card h3 {
    font-size: 1.4rem;
    margin: 1rem 0;
    position: relative;
    z-index: 1;
}

.service-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.service-card i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.service-card:hover i {
    transform: scale(1.2) rotate(10deg);
}

.video-section {
    padding: 5rem 2rem;
    /* Match the header gradient for a cohesive look */
    background: linear-gradient(135deg, #6b5b5f 0%, #7a9fb5 50%, #5f8fa8 100%);
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    box-shadow: inset 0 4px 32px 0 rgba(0,0,0,0.2);
}

.video-section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.video-container {
    max-width: 900px;
    margin: 2rem auto;
    box-shadow: 0 16px 48px 0 rgba(183,28,28,0.2), 0 4px 12px 0 rgba(0,0,0,0.3);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-container:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 60px 0 rgba(183,28,28,0.3), 0 6px 16px 0 rgba(0,0,0,0.4);
}

.video-container video {
    width: 100%;
    display: block;
}

footer {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--bg-light);
    color: var(--text-light);
    border-top: 2px solid var(--border-color);
    box-shadow: 0 -4px 16px 0 rgba(0,0,0,0.3);
}

footer p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    header {
        padding: 3rem 1.5rem 2rem 1.5rem;
    }

    header h1 {
        font-size: 2.2rem;
    }

    header p {
        font-size: 1rem;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(61, 51, 56, 0.98);
        flex-direction: column;
        align-items: center;
        padding-top: 2rem;
        transition: right var(--transition-speed) ease;
        border-left: 2px solid var(--primary-color);
        z-index: 999;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        margin: 1.5rem 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger span {
        background: var(--text-color);
    }

    .services-grid {
        grid-template-columns: 1fr;
        padding: 2rem 5%;
    }

    .service-card {
        padding: 2rem 1.5rem;
    }

    .video-section {
        padding: 3rem 1rem;
    }
}

/* Mobile improvements and layout tweaks */
@media (max-width: 900px) {
    /* Reduce header padding for small screens */
    header[ id="home"], header {
        padding: 3.5rem 1.25rem !important;
        min-height: 280px !important;
    }

    .hero-slideshow .slide h1 { font-size: 1.9rem !important; }
    .hero-slideshow .slide p { font-size: 0.98rem !important; }

    /* Ensure the CTA under the slideshow has more breathing room */
    .hero-slideshow + a, .hero-slideshow + .cta {
        margin-top: 1.6rem !important;
        display: inline-block;
    }

    /* Make nav links easier to tap */
    .nav-links li { margin: 1rem 0; }

    /* Make service cards stack cleanly */
    .services-grid { grid-template-columns: 1fr !important; padding: 2rem 3% !important; }

    /* Adjust video section padding */
    .video-section { padding: 2.5rem 1rem !important; }
}

/* Small devices tweaks */
@media (max-width: 480px) {
    .hero-slideshow .slide h1 { font-size: 1.6rem !important; }
    .hero-slideshow .slide p { font-size: 0.95rem !important; }
    .nav-logo { height: 40px; }
}

/* Accessibility: increase tappable area for buttons on mobile */
@media (max-width: 768px) {
    .hamburger { width: 56px; height: 56px; }
    .nav-links a { padding: 12px 8px; display:block; }
}

/* Add consistent spacing between hero slideshow and CTA */
.hero-slideshow + a, .hero-slideshow + .cta { margin-top: 2rem; }

/* Make images responsive by default */
img { max-width: 100%; height: auto; display: block; }

/* Avatar helper: fallback-friendly circular image using background-image */
.avatar { width: 100%; height: 100%; background-size: cover; background-position: center center; display: block; }

/* Slight vertical shift for Albert's avatar so face is centered better in the circle */
.avatar-albert { background-position: center 18% !important; }

/* Constrain common containers for small screens */
.container { padding: 0 1rem; box-sizing: border-box; }

/* Contact page grid: two columns on desktop, stacked on small screens */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }

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

/* Make service cards linkable without default anchor styles */
.service-link { text-decoration: none; color: inherit; display: block; }

/* Contact column niceties */
.contact-info { background: transparent; }
.contact-form-card { background: #fff; }

/* Add breathing room on mobile when stacked */
@media (max-width: 768px) {
    .contact-grid { gap: 1.5rem; }
    .contact-form-card { padding: 1.5rem !important; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
    .contact-info { padding: 0 0.25rem; }
}

/* Larger touch targets for the form button on mobile */
@media (max-width: 480px) {
    .contact-form-card button#contact-submit { padding: 1rem 1.2rem; font-size: 1rem; }
}
